Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Device Synchronization

It also seems to me that you probably ought to put both cDAQ modules together in the same multi-module chassis to simplify the sharing of timing signals. Right, I have complicated it as things have progressed I have changed hardware. I changed to exclusively using cDAQ 1988 chassis for the modules. The chassis can receive a trigger so it I am no longer using the original chassis.

 

14. So now you're set up in a situation where the TC task might be prone to missing some 10 Hz pulse train triggering signals while it's stopping and restarting.  Meanwhile the camera and the other AI task will sample on all of them and not miss any.  So you need to deal with this somehow. What I did is used the same ctr0 to generate two signals from the same PFI. One at 10 Hz and one at 5 Hz. This way the leading edge is at the 'same' time. The camera trigger has to be at 10 Hz. I'll just ask for more sample reads from the read loop. The small time error from missing one sample is something I can live with

This can't be right.  What you stated is impossible.  A single counter channel (ctr0) cannot generate 2 output signals at 2 different frequencies at the same time.  Nor can 2 distinct counter outputs be mapped to the same PFI pin at the same time.

 

Oops On BNC 2120 I used the ao0 to send a pulse to PFI0. Then started 2 ctrs (0 & 1), each pulls from PFI0 to generate the AO signal. It seems to work except the trailing edge randomly stays high. If you want to see what I did, I have the code attached below (SyncTest2.vi).

 

I took your advice and am trying to use the counter pulse train. It has simplified the code quite a bit. The only problem I see right now is the first time I use the Boolean to send the triggers, the two triggers (5hz and 10 hz) begin on the same count. Anytime after that, the 5hz signal begins on the second 10 hz trigger. I think this solution is more promising and I have this code attached too (Digital Trigger.vi). Sorry this is getting more complicated. I appreciate your help!

 

 

Download All
0 Kudos
Message 11 of 12
(275 Views)

I really can't figure out what you're trying to do any more.  You seem to be making 2 distinct pulse trains and yet you're also still doing that thing with a 5V AO pulse using software timing that's de-rated by 1%.

 

My advice was admittedly not fully detailed and explicit, but it would have led you to an approach with 1 counter output task, 1 counter input task, 1 AI task, and no AO.  Timing would have been driven by hardware, not software.  Please re-read my msg #8 again carefully and let's start dealing with a small # of things at a time.

 

For example, let your counter output signal act as the trigger for your AI task and for the external camera.  There will be some overhead when you have to stop and restart AI to be ready for another trigger, so you won't be able to go line-to-line with your timing.  (Per your description, you wanted to trigger at 10 Hz and have each trigger result in a capture of 7 samples at 70 Hz.  That's what I mean by line-to-line.  The entire time between triggers is consumed by capture, leaving no time to reconfig for the next trigger.)

 

At some point, you're going to need to make some trade-offs.  You could trigger at a lower rate, you could capture fewer samples per trigger, you could maybe make your particular device sample faster by capturing fewer channels, you could identify missed triggers (but live with them) using my edge-counting suggestion back in msg #8.   Else you could buy a data acq device that's fully capable of what you need.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 12 of 12
(248 Views)