Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx trigger.vi causes an error out of DAQmx Read.vi

Hello

It is my first post. It might take me a few tries to figure this forum out. I recently passed the Certified LabView Associate Developer certification but I don't have much actual programming under my belt yet. I am primarily an electro-mechanical guy.

 

I am trying to acquire an analog signal from two inputs of a PCI-6122S. I have a pair of super high resolution optical pressure transducers imbedded in something. I need to collect data at a rate as high as 200k Hz but only for a second or two. I have this part of the program working. The problem is I need to set up something like a "wait for signal" state. I can't predict exactly when I need to collect the data, however there will be a slight bump in the analog voltage out of the transducer module. That bump is when I need to trigger the data collection state. So, I need to have a way to monitor the analog signals in real time, and at the moment the voltage from either input crosses some user defined set-point, the state is changed to the data collection state and the signal is captured.

 

I am trying to use the DAQmx Trigger vi to cause a state change in my state machine. This seems like a good idea but I am open to suggestions. Right now I have a case statement around the Trigger vi so I can turn it off and on. At this point I only have the task/channel in and out, error in and out, and the trigger level connected. I'm not sure what to connect to thesource or slope inputs.

 

When the case is false the task and error just pass through and change the state. With the case false I collect data as soon as I press Start with no errors. When I make the case true and try to use the trigger level to change states, the program errors. With the highlight execution ON I can see there is no error after Trigger vi, then it goes to the Sample clock vi, still no error. It is when I get to the DAQmx Read vi that the error occurs. 

 

Why does this happen only when the Trigger vi is in the path? Can someone give me some clues as to what to do next?

 

Thank-You, and I hope to be a regular part of this forum.

 

~Ross

0 Kudos
Message 1 of 2
(2,947 Views)

Hi Ross!

 

So you are trying to set up a "Wait for signal" state in your VI.

 

I have written some example code that may be of use to you. You set the voltage limit through the "User Defined Voltage Threshold" input. It then reads the input voltage and changes the state of the case structure depending on your set limit. You will need to set the input channel to your transducer and then expand the code if you need 2 inputs.

 

I hope this solves your problem but if you have any further questions then please post them here.

 

Kind Regards.

 

Owen.S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,887 Views)