LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Channels with Single Digital Edge Trigger

Solved!
Go to solution

I have a simple vi where two analog channels are read in and recorded simultaneously to a lvm file and plotted on a waveform graph. I need a digital edge to post trigger the data acquisition for both channels. 

 

I can get this vi to work with one analog channel and the digital edge trigger just fine.

 

When I remove the digital edge trigger, I can get the vi to work with both analog channels. Both signals plot on a waveform graph, and record nicely in the lvm file.

 

The issue is how I am setting up the digital trigger (see attached).  The program is never entering the while loop. Where am I going wrong?

 

Chassis:cDAQ-9172

Analog Card:NI 9205 (Trigger Source PFI0)

LabView: 8.6

OS: Windows XP

 

 

0 Kudos
Message 1 of 18
(5,476 Views)
What error message is being generated?
0 Kudos
Message 2 of 18
(5,470 Views)

I am not getting any errors.  The program is simply not entering the while loop.  I know this because nothing is plotted on the waveform graph and the file name I input to log to is never created. 

 

0 Kudos
Message 3 of 18
(5,463 Views)

gardma,

 

Turn on highlight execution and run your vi.  I'm sure that an error is being generated.

0 Kudos
Message 4 of 18
(5,459 Views)

Gardma,

 I am going to take a quick guess (I'm lazy and haven't actually tested the code Smiley Very Happy), but, since it works without the trigger and given that you have it so that the read never times out (i.e. = -1), there is something going on such that the trigger is never generated on the source pin.  Just a thought.

 

Cheers, Matt

0 Kudos
Message 5 of 18
(5,453 Views)
Oops.  Should have explained that a little further - you are most likely entering the while loop, but since the read is set to never time out, you are just sitting there waiting for a trigger and you do not recieve the 1000 points you request.
0 Kudos
Message 6 of 18
(5,451 Views)

I turned on highlight execution. I found the program was going past the digital trigger once it was applied,and did move into the while loop. The program stopped at the DAQmx Read. I placed probes before and after the the DAQmx Read and found no errors.

 

0 Kudos
Message 7 of 18
(5,450 Views)
I changed the time out to 100s and the results were the same. The program is not moving past the DAQmx Read.  The highlight execution shows only gray wires after this function.
0 Kudos
Message 8 of 18
(5,447 Views)

So, you set the timeout to 100 seconds and then waited that 100 seconds?  The DAQmx Read should only wait that 100 s and then if it does not receive the 100 samples you request, it should move on, generating an error.  I will try out your code.

 

Cheers, m

0 Kudos
Message 9 of 18
(5,442 Views)

gardma,

 

Sounds like your trigger is never happening.  Can you provide more detail on source of digital trigger?

Message 10 of 18
(5,436 Views)