Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS485 Timing Control

Solved!
Go to solution

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,

 

123.png

 

The scope waveform is as shown below ~10ms to transmit the data,

 

tek00017.png

 

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.

 

12.png

 

Kindly comment your queries so that I can add more information.

 

Thanks in advance.

0 Kudos
Message 1 of 12
(5,019 Views)

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

0 Kudos
Message 2 of 12
(4,960 Views)

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

0 Kudos
Message 3 of 12
(4,962 Views)

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. 

0 Kudos
Message 4 of 12
(4,954 Views)

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.

0 Kudos
Message 5 of 12
(4,949 Views)
Solution
Accepted by topic author mini09

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

Message 6 of 12
(4,937 Views)

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.

 

 

0 Kudos
Message 7 of 12
(4,935 Views)

Hi Kees,

 

Could you say how to improve the frame rate to ~5ms?

 

Because I would like to improve.

 

Thanks.

0 Kudos
Message 8 of 12
(4,908 Views)

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

0 Kudos
Message 9 of 12
(4,896 Views)

Hi Kees,

 

Is it possible to downgrade the file to 2012. Because I use LV 2012 SP1.

 

Thanks

0 Kudos
Message 10 of 12
(4,870 Views)