05-12-2017 12:57 PM
Hi All,
I have some concerns with the way of RS485 data transmitted through NI USB to RS485 cable. Following are the list of specifications for communication,
1. 9-bit mode of operation (1st byte of 9th bit is 1 and 2-8 byte of 9th bit is 0).
2. Baud Rate - 230400
3. Parity - None
4. Flow Control - None
5. Stop Bit - 1
6. Data Bits - 8
I used the parity bit Mark (1) and space (0) for the 9th bit. I used for loop with Mark for 1st byte and space for remaining bytes as shown below,
The scope waveform is as shown below ~10ms to transmit the data,
I'm not sure why there's a delay between 1st byte and the other bytes? Is it because of the parity change?
I also need to send all the data within ~1ms as the waveform shown below.
Kindly comment your queries so that I can add more information.
Thanks in advance.
Solved! Go to Solution.
05-15-2017 03:28 AM
Hi,
I am using a interface to our product for some time now with similar specification. 9 bits and 250.000 baud over RS-485.
You probably will get a parity error from the read if the other side is also using the 9th bit.
Flow-Control is set to none, but how is the TX enable of your RS-485 transceiver managed ?
Kees
05-15-2017 07:28 AM - edited 05-15-2017 07:32 AM
Hi Kees,
The TX enable shown in the image is from the DUT. I'm not sure how can I access the TX enable in PXI system?
Are you referring to the DUT enable line?
Thanks
05-16-2017 03:17 AM
I see it in the picture now. The 2 - wire auto setting will manage the TX enable.
Not sure what problem you have at this moment.
05-16-2017 07:13 AM
Hi Kees,
The time for the entire frame 8 bytes to be transmitted. The system expects the data in ~1ms where as the USB RS485 takes ~10ms.
How can I improve this?
Thanks.
05-17-2017 04:38 AM
Hi,
With my test a 8 byte data transmission takes 2.5 - 5 msec. The time between the first and the remaining bytes is almost 2 msec.
It is not much faster as you solution. It takes some time to switch the parity of the UART.
If it needs to be much faster I think the only way to solve it is a hardware solution.
Kees
05-17-2017 07:07 AM
Hi Kees,
Yeah you are correct. I also had the same thought.
Thanks for your time.
I'm going to leave this open for sometime maybe someone might have their view. If not I'll accept as solution later.
05-18-2017 09:18 AM
Hi Kees,
Could you say how to improve the frame rate to ~5ms?
Because I would like to improve.
Thanks.
05-19-2017 01:42 AM
Hi,
The attached VI is the basic write and read I use. There is some code included to handle the leading zero's in the data. Some of my USB converters and/or drivers produce these zero's.
The first for-loop is the actual write data. Try to move your arrays with constants to the outside of the the for-loop. I also included a defined replacement character in case of a parity error. As you can see I only switch parity twice.
Kees
05-22-2017 07:23 AM
Hi Kees,
Is it possible to downgrade the file to 2012. Because I use LV 2012 SP1.
Thanks