05-07-2010
09:15 AM
- last edited on
02-12-2025
11:18 AM
by
Content Cleaner
Hi all,
I have a system with a PCIe 1429 connected to a Basler A504 camera and a I use a clock generator (SRS CG635) set at 3.9 kHz to trig the image acquisition.
On the same system I need to add a PCI 6221 37 pin to acquire :
- 2 AI at 39 kHz, synchronized with the image acquisition. (10 AI sample for each image)
- 1 counter to measure a frequency
Since the accuracy of my 3.9 kHz clock is much higher than what I have on the DAQ board, I figured a nice option would be to have a retriggerable DAQmx task that generates 10 pulses at 39 kHz for each pulse received from the clock and then use this to trigger the DAQmx AI task.
Of course this can only work if the "trigger" sources that I define for these two tasks don't take the two counters I have on the board.
So let's describe the DAQmx tasks :
- here's the one that generate the 39 kHz on counter 0, from the 3.9 kHz that I input as a trig source on PFI 4
- here is the analog input task for which I set the trigger on PFI 6.
Question is : can I "softwarely" tell the board to route the output counter (Ctr0) to PFI 6? And if yes, how?
Thanks in advance for any help!
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
Solved! Go to Solution.
05-07-2010 09:49 AM
oups, first question should have been : if I don't "softwarely route" but do it physically (with a wire) is it going to work?
The main concern in fact is to know if I can have 2 counters (one input for the frenquency measurement and one output for the 39 kHz clock) AND two triggered tasks (the AI task and the the finite pulse generation (10 pulses at 39 kHz)) at the same time, running on the 6221.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-07-2010 12:50 PM
Sorry, no can do on the counters. The M-series boards would use up both counters for the task of generating a finite pulse train so there'd be no counters left for freq measurement. From what I've read, the newer X-series boards only use 1 counter for finite pulse trains (and also have 4 total available.)
FWIW and for future reference, software routing of signals *will* work though there are some restrictions on which signals can be routed to where. The M-series boards are generally very flexible though, and you can double check the routing options in MAX. Also, in general, there's no particular problem running 2 tasks of the type you proposed simultaneously. Note though that the term "trigger" has a more specific meaning in LabVIEW-land than it may have in normal life. Here you were using the counter output as an "external sample clock" which is distinct from using it as a trigger. Triggers initiate tasks, then sample clocks cause samples to be taken during them.
Anyway, here's a possible workaround which doesn't require you to generate any counter pulses, so you can perform your freq measurement and still have a spare counter left over.
1. Configure your AI task to use the external 3.9 kHz signal directly as its sample clock.
2. Also configure your AI task so that the channel list contains at least 10 duplicates of each of your 2 AI channels, along the lines of "ai0,ai0,ai0,...ai1,ai1,ai1,..." Or you could alternate them back and forth if you want. You'll have to trade off the importance of the time difference between the two AI channels vs. the risk of the crosstalk-like effect from mux'ing back and forth on each sample. Myself, I'd probably make a channel list with 12 dupes of ai0 followed by 12 dupes of of ai1 and later ignore the first 2 conversions on each channel just to be more sure the ADC has settled after muxing between them.
3. Finally configure your AI task to use a specific timing for its "convert" or "channel" clock. Since the timebase for your AI board is independent of the more accurate external 3.9 kHz clock, you should err on the side of caution. For example, supposing you were going to take exactly 20 scans within each sample interval, I'd pick a convert clock rate that's a bit higher than the apparent minimum of 20x3.9kHz=78 kHz. Probably something in the 80-100 kHz realm.
-Kevin P
05-07-2010 02:02 PM
Thanks very much for the answer Kevin!
I eventually figured out (by testing) that when configuring the counter generation to "finite", it sucks up both counters. I found no documentation about that though...
I thought about the options you mentioned but I think I'll try something else.
The point is that the board's clock is 1e-5 s accurate that means it can be around 1 second inaccurate after a day. I my system the image (acquired at 3.9 kHz, that can't be changed) have to be synchronized with the AI channel and the clock generator for the images is much more time-accurate than the board, so I need to be sure even after ten day of measurement that everything is on the same clock.
First thing I will try is to set the generated clock to "continuous" instead of "finite" and start/stop the task each minute or so to be sure they stay synchronized, if that doesn't do the job, I'll probably add a second 6221 board.
Thanks alot for your answer!
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
05-07-2010 02:54 PM
Maybe you missed something I didn't really emphasize in my post. The method I described would use the accurate 3.9 kHz external clock as a sample clock so you would *not* be in danger of losing sync by 1 sec/day. You would only have to wire that clock signal into an available PFI pin and configure the AI task correspondingly. The 80+ kHz clock that controls the conversions within each sample cycle *would* be generated by the 6221 board, but it wouldn't accumulate any out-of-sync error because it gets "retriggered" on every leading edge of the accurate 3.9 kHz clock.
-Kevin P
05-07-2010 04:28 PM
Hmmm... I did miss that the first time 😮
Thanks for coming back, I'll have a go with this on monday.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
03-14-2013 03:54 PM
Dear TiTou & folks,
Is there a SRS CG635 (2.05 GHz synthesized clock generator)Labview driver available that I can download? I would like to check for driver availability before investing too much time on controlling this SRS CG635 clock generator unit.
Many thanks.
Michael