LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting data from more than one instrument via same labVIEW program

Solved!
Go to solution

Hi,

 

I have a program through which I collect data from a scale and save the data in to textfile. Now I need to collect data from three identical scales and save the data. I'm wondering if it is possible to do that in one same program? I mean how to handle three ports and saving three different text files?

 

I attach the current program. The communication with the scale is serial and I use VISA's VI:s. Thanks in advance for the help 😃

 

 scale.JPG

0 Kudos
Message 1 of 4
(2,293 Views)
Solution
Accepted by topic author sifeet

This is easily possible with a single program, and there are several ways to do it.  I would recommend the following:

 

  1. Take data from each device in a separate loop (this could be in a separate subVI, as well).  These loops should be state machines so you can start and stop the acquisitions in a clean manner.  This assumes the instruments are on separate ports.  If they are on the same port, you will probably want to use the same loop.
  2. Write to the file in a single loop.  This, also, should be a state machine.
  3. Use queues to send data from the acquisition loops to the file I/O loop.
  4. Use yet another loop for your user interface.  It should contain an event structure.

To do this, you will need to learn about state machines and producer/consumer architectures.  Start with the LabVIEW help, then search these forums.  There are a plethora of implementations of state machines and producer/consumer architectures.  If you have the time, I would highly recommend you learn and use LabVIEW classes (requires LabVIEW 8.2 or higher).  It will make your job easier in the long run.

 

Let us know if you run into issues...

Message 2 of 4
(2,281 Views)

Thank you both for your answers! I havent had the chance to complete the program yet, but it shouldn't be hard to do it now with the clue I got from you.

 

 

0 Kudos
Message 4 of 4
(2,246 Views)