LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measurement issues with parallel loops

Issue is that the instrument readings from RoomMonitor.vi are all 0 until the measurements from DrawtestStateMachine.vi are complete.  Both are accessing the NI9211 in the CompacDAQ system.  RoomMonitor.vi also accesses the NI9225 and the NI9205.  Each VI works correctly when executed alone.

 

Room Monitor.vi - takes readings from thermocouples and voltage inputs once every minute to monitor room conditions. Data displayed on waveform chart and stored into an Excel spreadsheet.

DrawtestStateMachine.vi - Based on user input, turns on a relay for X secs, turns off the relay, takes a temperature measurement, then waits X secs before going to next relay.  Data displayed on waveform chart and stored in Excel spreadsheet.  Temperature measurement compared to temperature limit if Control is true and will flash failure indicator and stop test once over temperature drink limit reached.  

 

Originally code was flat but I realized that I only wanted Room Monitor to run in parallel with the valve control portion of DrawtestStateMachine.vi, I put the code in a stacked sequence.  Sequence 3 is where the parallel loops are located - it is a while loop in parallel with a state machine.

0 Kudos
Message 1 of 3
(2,582 Views)

Hi Carol:

 

When you say that it doesn't update until the measurements from DrawtestStateMachine.vi are complete, are you talking about the temperature measurement taken in ValveCtrl.vi?

 

In general, you should avoid a program that reads values from the same device simultaneously and I'm a little surprised you didn't receive an error along those lines.  Is there a way you can modify your program to read from the 9211 in just one place and pass the value as needed?

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,546 Views)
I had a feeling that was the issue....I had tried a simple vi with 2 loops reading from the 9211 in parallel and I did get the instrument error on that vi.  I will try to move all the reads into one vi as you suggested.  My concern is that I need to keep the timing of the valve control precise.
0 Kudos
Message 3 of 3
(2,529 Views)