![]() |
|
|
Functional Description
The following example in LabVIEW 8.6 shows how to use DAQmx Counter tasks to generate two continuous pulse trains, where one is continuously falling out of phase when compared with the other. In order to achieve this alter the default settings for the high/low tick inputs of the DAQmx Create Channel (CO-Pulse-Generation-Tickets).VI from 100 to the period you require. In this example the timebase is 20MHz, where one tick it every 50ns and hence the default waveform has a 10ms period, 5ms high and low time. To create one waveform to follow slightly out of phase continuously, just alter one of the tasks high/low tick count to a little higher or lower.
Figure 1: Trys to show the affect of altering the high/low ticket count. Notice that at point 1. the two square waves are very similar in phase. The red waveform is high for a few more ticks. At point 2. you can see the waveforms are 180 degrees out of phase. At point 3. you can see the waveforms are inphase. Note, this achieved by effetely missing one period of the waveform over 12 periods of the waveform. (White has 12 periods, Red has 11 periods).
Note: White Waveform has high/low tick number of 500 & Red has high/low tick number of 550.
Figure 2: Shows the block diagram of the DAQmx VIs used to generate such a waveform.
Note: Remember to change the Device name to the correct device you are using. To find out this information you can use Measurement and Automation Explorer (MAX) which installs with most NI Drivers. Make sure also that your DAQ device has counters, and that they are not being used by any other application.
Caveats and Additional Notes
The example attached is for LabVIEW 8.6.
This type of application will not be LabVIEW version specific.
The DAQmx code requires the NI-DAQmx driver to be installed, which can only be used with NI Hardware.
A similar type of coding can be used for the Traditional DAQ applications.
There are no comments on this document