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: 

Controlling Valves with a Producer/Consumer structure

Hi all,

 I 've been working in a research where temperature and pressure can cause serious material failure. I've made a sequence in a text file of 0's and 1's with a time column in it. I've been using a program where labview reads this text file and starts controlling the valves by itself. The problem now is to add a maximum temperature or pressure value for the labview program to run an "emergency sequence" if the measurement exceeds this limit. I've been trying to use this program with a DAQ Assistant in a while loop but I've been having problems with it.

 

Someone suggested me that I should use a Producer/Consumer architecture to do this, but the problem is that I've been working with LabVIEW for 2 months, so I am not an expert. I wanted to see if anyone could help me build this program with such architecture.

 

 

0 Kudos
Message 1 of 4
(2,304 Views)

Hi gmartinez,

Here is a great example of using a producer consumer architecture while acquiring data.

 

https://decibel.ni.com/content/docs/DOC-2431

 

You will want to model your VI after this except instead of writing the data to a file in the consumer loop, you will want to check if the data is out of range and then execute your 'emergency' code sequence. A case structure inside the consumer loop would be a great way of achieving this. If you want to see the design pattern you can also go to

 File->New....->VI->From Template->Framework->Design Patterns->Producer/Consumer Design Pattern(Data) 

in LabVIEW.

 

Regards,

DylanC

Applications Engineer

National Instruments

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

Hi Dylan,

 

I was trying to open the vi in my LabVIEW 2009 and it said that the file is not a resource file and that it couldn't be loaded. Any suggestions? 

 

Gus

0 Kudos
Message 3 of 4
(2,260 Views)

Hi Dylan, 

 

I got the program running but had some trouble with it, so I modified my other program but now the problem is that the DAQ Assistant reads just one sample and stops reading them continuously. I wanted the DAQ Assistant to continue reading but I am not sure how to do that. Any suggestions?

 

Attached is my program.

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