LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1 sec pulse

I am trying to create a program that when started, will generate a 1 second pulse in the high state.  The pulse will be used to trigger external equipment but at the same time, I would like for an analog voltage input to be read on the rising edge of the pulse.  I've been playing with this for awhile now and haven't gotten much further than generating a pulse using digital out.  Unfortunately I'm not able to control the pulse time.  Anyone have any suggestions?

Thanks in advance
0 Kudos
Message 1 of 3
(3,194 Views)
I seem to have gotten it.  The chain of events in the bottom is just labview generated code from a DAQ assitant that generates a 1 sec high pulse.  I'm still getting some sort of timing error with this set up and I'm sure I will eventually figure it out. 

What I want to know is how can I output the pulse onto the graph so that the pulse lays on top of the data acquired?

Thanks again in advance
0 Kudos
Message 2 of 3
(3,179 Views)

Hello Yin,

What DAQ board are you using?  You could use a counter to generate the 1 sec pulse. (Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Generating Digital Pulses >> Gen Dig Pulse.vi)  If the pulse starts out high, then you will not have a rising edge for analog acquisition.  If you put an initial delay on the pulse, then you would have a rising edge for data acquisition.

The analog input task is going to be triggered off the rising edge of the counter.  This can be done by changing the source of the trigger to the output of the counter.  Right-click on the I/O control and select I/O Name Filtering.  This should bring up a new window with a check box for advanced terminals.  Once this box is selected, you should be able to select Ctr0InternalOutput as your source.  This will automatically internally route the signals.  Now your analog acquisition will start on the rising edge of your counter pulse.

There is a great example that demonstrates how to synchronize two different tasks.  (Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Synchronization >> Multi-Function >> Multi-Function-Synch AI-AO.vi)  You want to make one task a slave and the other task a master.  You want to start the slave task then start the master task. 

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
Message 3 of 3
(3,143 Views)