07-14-2008 06:13 PM
07-15-2008 12:30 AM
07-15-2008 07:40 AM
07-15-2008 10:56 AM
Hello Lanny22,
Lynn is correct. If you have hardware timed (correlated) digital lines then you can do this by using the values he suggested. If you're using a National Instruments multifunction DAQ device with LabVIEW then I would recommend looking at this example program. Open LabVIEW and go to Help» Find Examples. Then navigate to Hardware Input and Output» DAQmx» Digital Generation» Cont Write Dig Port-Ext Clk.vi. This is the example program I would use to generate this pulse train.
Cheers,
07-29-2008 08:17 PM
07-30-2008 11:15 AM
Hello Lanny22,
The PCI-6221 has 8 clocked lines that you can run at up to 1 MHz. This means that you can update the digital output with any patter you want at a rate of up to 1 MHz--you should be just fine with this board unless you need more than 8 lines.
Cheers,
07-30-2008 04:05 PM
An alternate way to do this is to use your board's 2 counters in tandem.
1. Configure Ctr0 for continuous pulse generation at 50 Hz and 0.5 duty cycle (or whatever duty cycle you need). Configure it to be Pause-Triggered by the digital level of "Ctr1InternalOutput", and set to to Pause When Low. (These settings require you to use the DAQmx Trigger property node). Note for future reference - your 50 Hz pulse train has a 20 msec period.
2. Configure Ctr1 for continuous pulse generation with high time=60 msec, low time = 140 msec. The total period is thus 200 msec as needed. The 60 msec high time is chosen to be equal to 3 full periods of Ctr0's 50 Hz pulse train.
3. Start the Ctr0 task first. Because Ctr1's output (likely) defaults to the low state, Ctr0 is paused and no output pulse train signal is being generated.
4. Now start the Ctr1 task. During the 60 msec of high time, the Ctr0 task will operate normally and produce 3 pulses at 50 Hz. Then there is 140 msec of low time which prevents Ctr0 from generating pulses. Then you get 60 msec more of high time and 3 more pulses. Etc. Note that the 3-pulse bursts start at 200 msec intervals.
-Kevin P.
07-30-2008 07:17 PM
07-30-2008 11:50 PM
07-31-2008 09:23 AM
1. Re: clocking. I'm pretty sure you can't use any of the internal clocks directly to generate a sample clock. You need to share a timing signal from another timed task or use an external signal. You can borrow from another task without wiring if you designate something like "Dev1/AISampleClock" or "Dev1/Ctr0InternalOutput" for correlating with an AI task or a Counter pulse train task respectively. Alternately, you can specify something like "Dev1/PFI0" to wire an exteral signal into the PFI0 terminal. I would have expected your selection of "Dev1/10MHzRefClock" to produce an error dialog -- didn't it?
2. The likely reason you don't see anything on your scope is that you clear your task *immediately* after starting it. The call to start the task will *NOT* wait for the task to complete. So even if you had specified a valid sample clock signal, you'd have ended your task too soon to see any output changes. Try inserting a "DAQmx Wait Until Done" function after DAQmx Start. (Note that you should only "wait until done" when you have a reasonably short finite sampling task.)
-Kevin P.