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: 

Implement RS485 interface with 2.5Mbaud - cRio & NI9401

Hello everyone,

 

I have a little problem. Since some days i try to implement the RS485 interface into my cRio fpga system. My idea was, to take the RS232 example:

 

http://forums.ni.com/t5/LabVIEW-Robotics-Documents/RS-232-Interface-Reference-Example-for-LabVIEW-FP...

 

and build a TTL -> RS485 converter. For this converter i need an R/W port, to switch between read and write. But I think it's very awkward and this example is to slow. If i set the baudrate to 2.5Mbaud, i only get ca. 2Mbaud. Does anybody implement the RS485 interface into the FPGA? I know, that i always need a level converter - but thats the easiest part 😉

 

Our first idea was to use the NI9871 module (RS485 cRio modul). But this module is not able to communicate with 2.5Mbaut.

 

Thank you very mich for your help and sorry for my english 🙂

 

Greetings

Flo

0 Kudos
Message 1 of 7
(4,322 Views)

Hi Flo,

 

the NI 9871 Module should be able to communicate with more than 2,5Mbaut as you can see here:

NI 9871 (FPGA Interface) - NI-RIO Software Help 4.0

 

Maybe this example might help you:

NI cRIO-9871.zip

 

Best wishes

Dennis

 

--------------------------------------------------------------------------------------------------------
Work with NI Hard- and Software for about 15 years now.

Certified LabVIEW Developer & TestStand Developer/Architect

--------------------------------------------------------------------------------------------------------

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 2 of 7
(4,254 Views)

Hi Dennis,

 

according to the linked help entry the baudrate is set by

BaudRate = 3.6864 Mbps / (Prescaler * Divider) with prescaler=1 or 4 and Divider=1…65535

How will Nullstrom ever achieve 2.5MBaud?

If the help is correct he can reach only 3.6864MBaud or 1.8432MBaud…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(4,248 Views)

Hi,

 

my bad, I thought you meant that it is not possible to set a baudrate higher than 2.5Mbaut.

You are right, it is not possible to set the bautrate to exactly 2.5Mbaut.

 

If you need exactly the 2.5Mbaut you will have to implement the RS485 Interface on your own into the FPGA.

There is no example Code available for that, I'm sorry.

--------------------------------------------------------------------------------------------------------
Work with NI Hard- and Software for about 15 years now.

Certified LabVIEW Developer & TestStand Developer/Architect

--------------------------------------------------------------------------------------------------------

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 4 of 7
(4,240 Views)

Good Morning Dennis,

 

Thank you very much for your answer, but Gerd is right. With my 9871 module, I'm not able the reach 2.5Mbaud. And i need exactly 2.5Mbaud for this sensor.

 

For your information:

The main theme is, i should trigger the data communication with an external trigger signal and it's very important that the jitter between my rising edge from my external trigger and my first start bit is very small. I try to implement this on my realtime PXI System (incl. NI PXI-8433/2 Card - the card is able to communicate with 2.5Mbaud). Now I'm able to trigger the data communication but, the jitter between my rising edge from my triggersignal to the first start bit is to big (12µs).

 

Now i think i take the RS232 sample:

http://forums.ni.com/t5/LabVIEW-Robotics-Documents/RS-232-Interface-Reference-Example-for-LabVIEW-FP...

 

And try to change it for my application. If anybody have a little RS485 example - it would be great 🙂

 

Thank you vor your help...

0 Kudos
Message 5 of 7
(4,214 Views)

Hello, I am  also trying to implement RS485 interface with cRio & NI9401. I would like to know about your experience and the challenges you face.

As I understand, though NI9871 can do 3.8M Baud rate, throughput is limited to 1.5M. Did you see similar limitation with NI9401.

0 Kudos
Message 6 of 7
(2,810 Views)

Have you had any success in converting the rs232 example and implementing it as 485 on FPGA?

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂


0 Kudos
Message 7 of 7
(2,726 Views)