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: 

Acquire data from two sensors simultaneously with VISA

Hey Everyone,

 

My VI has a producer-cconsumer loop with which I acquire data from a sensor to save and display it. VISA is used to read data from the sensor.

Now I would like to acquire data from a second sensor simultaneously. If I use another VISA serial port to read data, How would I know, which COM port had been assigned to the second sensor

 

Cheers

Gokul

0 Kudos
Message 1 of 3
(2,850 Views)
When you add a second port, that will appear in MAX. This new port is the one you connect to the sensor. Take note of the new port number. What is confusing?
0 Kudos
Message 2 of 3
(2,841 Views)

I don't know if this is not clear to you, but you will use the Open on two separate ports.  Each open will get it's own VISA resource, and then when you read from one you use one resource, and read from the other port with the other resource.  But it sounds like this might be relatively simple.  If you have a producer loop collecting data, and a consumer for getting and displaying/logging data, you can probably just copy your producer loop and have two of them, pushing to the same consumer.  Each loop can then talk to each VISA resource independently and both push data to the same place.  Of course when you push data to the consumer you'll want to send some meta data along with it, stating where the data came from so the consumer knows "Oh this is a reading of 5V and it came from sensor 1" so it can display or log it appropriately.

0 Kudos
Message 3 of 3
(2,784 Views)