Example Code

Performing Concurrent Serial VISA Read and Write in Parallel Loops

Code and Documents

Attachment

Functional Description

This example illustrates how to write to and read from a serial device concurrently in parallel loops. This uses a single VISA Configure Serial Port VI and then branches into two parallel loops that write and read.

Caveats and Additional Notes

Make sure to adjust the serial port configuration settings accordingly and to use the correct termination character for your device. If you would like an example of how to do this with using two VISA Open VIs to create two duplicate VISA sessions, see the attached example Two_VISA_Open_LV86.vi.

One_VISA_Config_LV86.png

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
alarikh
Member
Member
on

It not works.

Snowboarder
Member
Member
on

Excellent example of Serial Port Read and Write.

GretchenSkellyZimmer
Member
Member
on

I tried out the Two VISA Open VI - it's great!  I went a step further and separated the two functions (Read & Write) into two separate VIs, and Hooray!  its works!  Thanks for the idea.

yukeyang
Member
Member
on

thx a lot.That's exactly what i'm searching for.I want to write a software based on producer/consumer frame which can control my board according to my command on the front panel,while receiving data from my board.

Contributors