07-21-2014 12:17 PM
Hi,
I run the attached code with the CRIO 9074. The code make that CRIO is sending Hello World 10 times with the serial write over NI 9871 serial module. This code takes 8 mili seconds.
I think this time is too long. What can i do with the code to make it faster? (Actually i will send much more data and this time is critical for me.)
Thanks.
Serdar
07-21-2014
12:24 PM
- last edited on
03-25-2025
10:58 AM
by
Content Cleaner
Don't take a picture of your monitor. Use the Code Capture Tool, or the snippet tool, or attach a VI file, or use the Print Screen button.
As for your code it looks pretty simple. You have 12 bytes of payload data (or around there it is hard to tell without the source), then you have a start, stop, parity, and termination character data so lets round to say 15 bytes of data 10 times is 150 bytes on a 115200 baud is 1.3ms, then there is likely other compiler overhead that someone else might be able to explain. Not saying 8ms is normal just that it doesn't surprise me hopefully someone else can explain more.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
07-21-2014 03:31 PM
How long does it take to configure the serial port? If the config VI returns before the port has completed the setup process, some additional time might lag before the first write. What happens if you add a frame at the left of the sequence structure and put a 100 ms wait in it?
Lynn
07-22-2014
10:07 AM
- last edited on
03-25-2025
10:58 AM
by
Content Cleaner
Hey Soz,
The maximum baud rate supported by the module is 3.6864 Mbps which is regardless of cable length. So if the cable is 1 M or 100 Meters the Max that you can set the baud rate is 3.6864 and this should remain valid up to 4000 feet. This is based off what the module itself can handle. You could probably send data at a higher baud rate but the module would not interpret the data correctly.
"NI 9871"
https://www.ni.com/docs/en-US/bundle/ni-9871-getting-started/page/overview.html
Regards,
Daniel C.