LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer Consumer Start Trigger

Solved!
Go to solution

Short Explanation: I'm using a 3rd party device to send a TTL signal to use as my start trigger in my VI. My cDAQ and modules appear to have the ability to send a start trigger independantly but I have been unable to hunt down how to do this in a producer/consumer system.  I do have an idea at the bottom of the long explanation.

 

Long Explanation:

 

I'm running a test system that monitors the pressure wave from a hydrogen/oxygen ignition. Components are a cDAQ-9188 with modules 9222 (x3 high speed AI), 9481 (x2 relay), 9402  (x1 I/O Module), 9221 ("Low" Speed AI). 

 

Based upon recommendations in this forum I've placed my DAQ in a producer/consumer architecture. 

 

At this point the system mostly works, I still have a few more things to add for all the information I want to collect. However, it records at high speed and the 9221 and the 9222 modules are synchronized. It has successfully collected good data as of this writing.

 

When the system starts it will monitor, but not record. I need to fill the test structure with gas to a specific concentration before I ignite/record. When I press the record button I send a TTL signal from the 9402 to my high speed camera and I close a relay on a 9481 which engages a spark system. The spark system takes a variable amount of time to charge and fire so I have a timer that leaves the TTL and the relay active for a half second.

 

My problem, and it's a small one, comes in with the monitoring system and the synchronization. In order to get the system to synchronize properly I had to generate an external pulse into PFI0 to use as a trigger. I attempted to assign the various clocks available as a start trigger but I ended up with unsynchronized data.  

 

Is there a way to generate a pulse on my 9402 to use as a trigger? It feels silly to me to use an external device when I have something that can generate the signal I need.

 

In thinking about this post I might have solved my problem, at least in my head. I'm thinking I can move the TTL output VI (which I will eventually change to DAQmx) into the producer loop and move my true/false statements to the consumer loop as a 1D array within my queue to start the record. Probably more to it than that but I can only learn by experimentation right?

 

Thoughts? Recommendations?

 

VI attached. 

 

 

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

You can't generate a pulse with the 9402 itself. The pulse would actually be generated by the 9188. You should create a Counter Output task to generate a pulse train. Try the attached example as a start point to experiment with the counter.

 

This Vi is for LabVIEW 2013, if you have an older version let me know and I will try to convert it.

Camilo V.
National Instruments
Message 2 of 4
(2,336 Views)

Thanks a lot for this! I'll check it out tomorrow when I return to the office!

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

Wow, did this ever work well!

 

I fired it up and had it output over the 9402 to verify it was working. Copied and pasted into my code and it works perfectly!

 

Time to fiddlel with time stamping!

 

 

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