12-29-2016 03:48 PM
Hi,
I'm bacially trying to replicate a pulse generator using an NI 6602 driver + LabView software. The problem I'm running into is that I can't seem to sync my separate channels. Not sure why I can't get the DAQmx Start Trigger (Digital Edge) VI to work. Without it, I can easily generate as many finite pulse trains as I have channels available (well, every other one since finite pulse trains require two channels), but they're not synced to the same start time. And it's a difference of 8 microseconds, but I'd ideally like to generate pulses on the order of 20 microseconds, so that's a huge delay comparatively.
VI screenshot attached. The top task doesn't work (it gets hung up on the wait until done and I get the error -200560; increasing the timeout doesn't work, and I can't figure out a good way to debug if the trigger just is acting funky, other than to say that other VIs using the same trigger work fine), but the bottom task chugs along just fine.
I haven't tried using another counter to sync these pulse trains, since I'm hurting for counter space. As it stands, I'll probably need another slot in my DAQ to run another set of frequency outputs. I'd like to be able to sync these using the internal clock, but that's not as intuitive as I think it should be.
Any help much appreciated.
Anna
Solved! Go to Solution.
12-30-2016 03:11 PM
Hi Anna,
Did you check if the trigger signal is arriving at the module? It looks like it never starts the generation.
Check if you are sending the correct trigger on the PXI trigger line. Remember that if you don’t specify a trigger, DAQmx will use the default trigger which is immediate. That’s why the VI on the bottom works fine. To check the trigger line, you can send a trigger manually. In that way you will know the exact moment the task should start.
Regards,
01-03-2017 04:58 PM
There's a little trick where you can generate your own trigger signal using a Digital Output, provided it goes to a pin that the counters can "see" as a PFI line. That'll let you sync up 4 finite pulse trains on your 6602 by having them react to the same Start Trigger. Here's a LV2013 snippet to illustrate:
-Kevin P
01-03-2017 07:20 PM
Thank you! I'd been going in circles for days trying to figure this out!
On a somewhat related note, any idea if I can share a common gate to increase the number of output channels from four to seven?
01-04-2017 12:22 PM
To share a common gate, you'd need to configure the output tasks for pause triggering. I'm pretty sure that you can't have both a start trigger *and* a pause trigger in the same task though. Also, the idea of sharing a pause trigger only makes sense if all the outputs are supposed to generate pulses during the exact same period of time.
I don't have 6602 hw handy to test with, but here's a couple ideas that *might* work:
1. Configure 7 counter tasks to be pause triggered by the output of the 8th counter, pause when low. Do *NOT* configure any start trigger for these 7 tasks. They will also have to be configured for Continuous Samples b/c Finite isn't compatible with pause triggering.
The 8th counter should be a single pulse with a precise high time that represents the duration of active pulse generation. (If all the same freq, then high time == N*period will allow for exactly N pulses). I'd probably configure it for a start trigger. Then I'd start this task first (to forcibly set the output to idle state), followed by starting the 7 output tasks, followed by issuing the trigger signal. When this single pulse task is done, you should stop all the other output tasks.
2. Not sure about this, but *maybe* (?) you can configure both an Arm Start and a Pause Trigger on the 7 output tasks? Even if so, most everything else would be a duplicate of the approach above, so dunno if it'd gain you much.
-Kevin P