Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering Separate Events Using Continuously Acquired Data

Hello everyone,

 

I am putting together a program automating the operation and data logging of a wind tunnel based on pressure transducer measurements. I have already created tasks and successfully read in the pressure transducer using a while loop and a DAQmx single sample read operation. Now, I would like to create an analog output task to turn on a relay when the storage pressure reaches a certain value, opening the tunnel valve. Then the relay needs to stay on (while the storage pressure decreases below the turn-on level) for either a period of a few seconds or until a pressure transducer in the test section reads constant values for a short time. During this time when the tunnel is on, I'd like to write the pressure values reported by the initial while loop to a file.

 

I'm not too sure of the best way to accomplish this, I've had difficulty wiring simple case structures within the overall while loop. I've been reading about master-slave architectures, but am not too familiar with their operation or if they would be useful in the situation. Would event or timed structures be useful in this case?

 

Thanks in advance for all the help. If it helps, I can post my current VI on my website to give a decent idea of my program.

0 Kudos
Message 1 of 3
(3,002 Views)

Klynch,

 It would be very helpful if you would post your vi which you can do by using the 'Add Attachments' button on the post editor. It would also be helpful to include what DAQ card(s) you are using and what version of LabVIEW you are working with. Which architecture you will use depends on your needs. It is a really good idea to seperate your acquisition from your file handling by using a producer consumer using queues type structure. If you look in LabVIEW there is a template you can work off of. If you are having problems with using DAQmx there is a good tutorial. ftp://ftp.ni.com/pub/devzone/pdf/tut_2835.pdf

 

Hope this helps

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 2 of 3
(2,989 Views)

Hello klynch,

 

The best way to do this would be to do software comparisons.  You can count time using the tick count VIs with shift registers to count the amount of time that has passed.  For your case, it sounds like a state machine would be the best architecture.  Here's a good tutorial on how to create state machines and here's a better overview on how to create and implement state machines.

 

Broad strokes here, I would recommend using Threshold Check, AO Start, AO Stop, and time check as some of your states.  A simple case selector won't really work for your application, but a state machine will allow you to do different tasks depending on the external factors you have outlined.  Hope this helps!

ColeR
Field Engineer
0 Kudos
Message 3 of 3
(2,985 Views)