LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

triggering counter from thermocouple on CompactDAQ

Hi,

 

I am in desperate need for direction with the following problem. 

 

I am trying to record 8 thermocouple inputs continuously at approximately 0.5 Hz.  One of these temp inputs however should trigger a digital  out and a 5 minute timer (software is fine) when the temp reaches 500 C (falling edge) and after the 5 minutes is up a counter should output a 20ms x 100ms  PWM for 1200 pulses.  All while storing the temp data from the 8 channels.  Is there any examples/recommendations I have overlooked to put me on the right path.  I am using Labview 8.2 and compactDAQ with 9211's 9481 and a counter module.   

 

Thanks

Chris

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

Chris,

 

Thank you for posting your question on NI Forums. I have attached a shipping example "Generate Digital Pulse Train - Finite" that I have modified to trigger from an analog level. There is also a Trigger Property Node that allows for a delay to be set. With this example you can set the source of the trigger as well as the level, and rising/falling edge. I am guessing you already have code that brings in the 8 thermocouple measurements, so all you will need to do is use this code with the code for the thermocouples. Hope this helps with your programming.

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 2 of 4
(2,499 Views)

Aaron,

 

I had to take a different approach.  It turns out the falling analog Temp was not enough info to accurately trigger when I want to so I had to take additional logic to make a decision to trigger.  Therefore now my code consists of two independent loops.  The first that records and stores data and the second that also has two loops which are started with logic one starts a counter that outputs a PWM for a specified time and the other that simultaneously outputs two relay outputs.  Initially the two relay outputs are 0,0 then when the PWM starts it then goes to 1,0 for half the time and finally 0,1 for half the time before returning to the default state.  It seems all of this works, however, this test needs some safety features.  I would like a button that if pressed stops all the loops even if the counters/relays are mid task and returns all signals to the default states (Low).  I am currently am using notifiers to control the two loops and program execution but when I abort the signals (cDAQ 9481 relays) do not return to default any recomendations? 

 

Thanks,

Chris

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

Chris,

 

One possible solution for you to have a case structure in the while loop, and have some "abort" control be the item that controls that case structure. If the case if false, continue to write data normally. If your "abort" control is true, case structure is true, write zeros out to the lines. Further, you would need to have a true constant in the true event of the case structure and have that wired to your stop terminal of the while loop. The false case of the case structure would have a false constant instead of the true constant. That is just an initial thought on how to create some "abort" feature. 

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 4 of 4
(2,453 Views)