From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI9871, relation between baudrate - idle length

hi,

 

i m trying to catch datas by NI9871 using RS485 protocol with different baudrates. My data is
arriving to 9871 module as "idle + start + data (8 bit)"

 

i don't undestand how important the 'idle' length of time between 'data words'.

For an instance, i m sending 0,1,2,...,254,255 datas as binary from my device.. When i set the 'idle' lenght as equal to
data bit length, module (NI9871) couldn't catch all datas.. When i begin to set idle length longer,
module beginning to catch more datas than before and after some threshold value (idle length), it s catching all datas... It
looks there is a idle length threshold for each baudrate.. Why the idle length such an important
for catching datas ...

 

In addition to that, when i set a FIFO as 'host-to-target' (FIFO size 32700, uint8) and try to send 
0,1,...,254,255 datas by NI9871 module, it s sending all datas for 14.4kbps or upper
baudrates, unfortunately, at lower boudrates, it is not sending all.. for example, when i set
the baudrate as 75bps, it s sending just 70-80 datas and first 63 datas is in order, other 5-6
data looks selected between [63,255]. Is it normal or i m missing somethings..

 

Lastly, how i can learn , how the NI9871 module reading received data.. catching just one value from received bit

 or catching several points for each bit and deciding the value according to dominant one..

 

Best Regards..

 

0 Kudos
Message 1 of 8
(2,735 Views)

davut,

 

Have you taken a look at any of the 9871 specific LabVIEW examples? These show the proper way to configure reads/writes for the 9871 as well as how to set up the DMA transfer. You shouldn't have to be dialing in the idle length everytime you change the baudrate. Take a look at the example entitled 987x Serial Loopback that can be found in example finder. Also, you may find the two links below to be helpful.

 

http://zone.ni.com/reference/en-XX/help/370984T-01/lvaddon11/crio-9871/

http://zone.ni.com/reference/en-XX/help/370984T-01/lvaddon11/987x_programming_overview/

 

Best of luck! If you have any additional questions, post back and I'll help you find a solution.

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 2 of 8
(2,716 Views)

  

thanks for the links, Nick-C.. they are really helpful. i understand it better.

 

there is something i wonder..

i set the baudrate of 9871 module as 3.6864Mbps and tried to sent data through RS485 module.
The stop bit length configured as 1. i m writing the bytes to FIFO (host-to-target) and sending Bytes from FIFO.. when i observed the signal on oscilloscope screen,
distance between 2 bytes is more than a bit length (more than STOP bit length) . i mean, for 3.6864Mbps, one bit length is
about 270 ns but distances between bytes is almost 7-8 mikro second. 

 

How should i configure the algorithm to decrease time length between written Bytes ?

 

i added my project file..

 

Thank you again.. Best regards..

 

0 Kudos
Message 3 of 8
(2,694 Views)

davut,

 

By distances between bytes, you mean the time between the start of one byte and the start of the next is 7uS? Or do you mean the time between the end of one byte and the start of the next is 7uS?

 

Regards,

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 4 of 8
(2,668 Views)

Hi,

 

i mean, the time between the end of one byte and the start of the next byte..

 

Regards, Davut

0 Kudos
Message 5 of 8
(2,659 Views)

Davut,

 

In the code you posted previously, you are not ever setting the baud rate. There is an enum control that lets you select the baudrate which is simply sitting in the True case of the read loop, but it's not actually controlling anything. 
In order to set the baud rate you need to use an FPGA I/O property node and select the baud rate property, then you can create a control off of this. Ideally you should also be only setting the baud rate once at the very start of the program execution. Make sure this matches the baud rate of whatever device is sending the data.

 

Also, if you know you are receiving only one byte of data at time from the other device, your setup at the moment should be okay. However, if you may be receiving multiple bytes and you want to read them all you can find out how many bytes are available at the port using I/O Property nodes as well and then read however many times is necessary.

 

Regards,

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 6 of 8
(2,654 Views)

Hi again,

 

You are right, the enum type Baudrate controller is useless. It is because firtsly,
i was controlling the baudrate for 75-921600bps.. Then i wanted to communicate
for higher baudrates more than 921 kbps, i mean 1843200bps and 3686400bps. So, i made
the baudrate enum useless (because it s not giving an option for 1843200bps and 3686400bps)
and i set the configuration from project window.

 

9871WriteHighBaudRate.lvproj > 9871 module > properties > port2 > baudrate = 1843200bps or (3686400bps)
parity bit = none
stop bit = 1

-------

the button ( FIFOWriteAddElement ) on front panel of controller.vi, fills the FIFO ( 256 number ).. '9871write' button sends the datas by 9871 module ..

when i run the code, the distance between bytes more than 1 bit length but i set, stop bit = 1

 

 

0 Kudos
Message 7 of 8
(2,646 Views)

Davut,

 

Does the problem persist when you are using baud rates that are selectable using the property node and enum? This module's specifications are up to 3.684 Mbaud, however it's strange that you wouldn't be able to set this programmatically. I'm checking on why this is the case. I'm guessing that this problem only exists at higher baudrates, am I correct?

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 8 of 8
(2,630 Views)