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.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Comm Functions

I have been using the Serial Compatible functions for an application which is embedded on a FP-2015 Real Time module. Should I be using the VISA functions instead? Also, is there a way in which I should clear the buffer if the serial port is not connected? I do not see a function for this, so I am guessing I would need to do this a soem lower level.

TommyH
0 Kudos
Message 1 of 3
(3,019 Views)
Hi Tommy H,
Sorry for the delay in answering your post. This post did not get assigned correctly. You do not have to use VISA commands instead of the serial commands. However, VISA commands give you the option to switch between different communication methods without a lot of modification to your code. See the following link for more general information on VISA:

http://sine.ni.com/apps/we/nioc.vp?cid=10046〈=US


If you want to flush the serial buffer I would suggest using the "VISA Flush I/O Buffer." There is no serial command to do this so you will have to use the VISA VI.

Hope this helps!
Brooks W.
National Instruments
Message 2 of 3
(3,009 Views)
I changed all the serial comm functions to VISA and moved them into a independent thread under lower priority. Everything is good now.

Thank you for the help.

TommyH
0 Kudos
Message 3 of 3
(2,996 Views)