Basic Call Function Sequence for VISA Library in LabWindows™/CVI™

Updated Nov 30, 2018

Reported In

Software

  • LabWindows/CVI

Driver

  • NI-VISA

Issue Details

  • I am unfamiliar with the VISA library in LabWindows/CVI. What is the basic function call sequence?
  • How do I configure my COM port using the VISA library functions?
  • Using the RS-232 library, I use the 'OpenComConfig' function to set the baud rate. How do I set the baud rate using equivalent VISA library functions?

Solution

The basic call function sequence using VISA library functions is as follows:

viOpenDefaultRM()
viOpen() // For the serial port
viSetAttribute() // For each attribute you need such as baud rate, etc.
viWrite()
viRead()
viClose()

The viSetAttribute function is used to configure the COM port. For details on all Attributes able to be controlled programmatically, check out Chapter 3 of the NI-VISA Programmer Reference Manual .

WAS THIS ARTICLE HELPFUL?

Not Helpful