10-24-2005 11:45 AM
10-24-2005 01:17 PM
Jamie,
Sounds like you're using traditional NI-DAQ, right? Search the DAQ palette for 'Route Signal.vi' and check out the online help. There should be a way to programmatically route a signal named something like "AI ScanStart" out to a PFI pin on your terminal block. This will produce 1 pulse per sample, automatically starting and stopping in sync with the AI task.
Will this solve your problem? Or do you need the pulse train at a different frequency than the AI, or do you need a specific duty cycle? If so, post back -- there are other options that require a bit more DAQ programming...
(Sorry, can't look at your code now -- I'm not near an LV PC).
-Kevin P.
10-24-2005 02:07 PM
Thanks for your suggestion Kevin -
I used the Route Signal to put the AI Scan Start to PF7 line (I have E series board). This only generated one pulse at the start of acquisition (I noticed this through an oscilloscope, unfortunately the system I am trying to communicate to didn't recognize this pulse). It didn't generate a continuous train of pulses, which is what I need. I don't necessarily need the same duty cycle, however each pulse needs to be at least 50 microseconds in width.
I also use two other route signal vis to synchronize a couple E-series boards. I put the third one (for AI Scan Start) in series and maybe I didn't do this properly (although I do get 1 pulse).
Any other suggestions?
Thanks,
Jamie
10-25-2005 04:38 PM
Hi Jamie,
Which board and which version of DAQ and LabVIEW are you using? If you
are using LabVIEW 7.0 or higher, then I would really recommend one of the DAQmx
shipping examples. Signal routing and synchronization is one of the
things that DAQmx really makes easier. In fact there are a lot of
examples if you go to: Help > Find Examples > Browse > Hardware
Input and Output > DAQmx > Synchronization. Particularly Multi-Function-Ctr
Pulse Train Genereration for AI Sample Clock.vi. In this example you
can see how you synchronize an analog input operation and a counter.
Another way you could make it work is have parallel AI and CTR tasks where the
CTR tasks is triggered on the aiSampleClock line. That means that the
first sample that you take on your analog input would begin your pulse train
that you could output. You can find examples on how to do these in the
same DAQmx Folder within the NI Example Finder.
Right now it looks like you might be trying to do some software timed
operations. Those will severely slow down your outputs and be unnecessarily
complex. In fact, if you could even make two parallel DAQ Assistants and
create this whole applications with just 2 VIs!
Best of luck,
10-25-2005 05:02 PM
10-26-2005
04:16 PM
- last edited on
02-05-2025
05:19 PM
by
Content Cleaner
Hi Jamie,
It still sounds like you want to have an analog input start at the same time as an counter output. You can find some examples for 6.1 by looking in the following path:
C:\Program Files\National Instruments\LabVIEW 6.1\examples\daq\counter\daq-stc.llb
You might be able to run one of these examples such as Generate Pulse Train (DAQ-STC).vi and get the characteristics from the pulse train that you are looking for. It sounds like you want to just run a pulse train, and then once you're done stop it. You might still be able to use the Route Signal.vi like Kevin said earlier, so that you can get both operations to start at the same time with the start trigger.
Basically you will want to generate a pulse train rather than single individual pulses as those will require configuration, starting and stopping with each iteration of the loop in software.
(And of course you can always upgrade to LabVIEW 8.0 if you want the best stuff available!)
Regards,
10-26-2005 04:41 PM
Thanks Otis -
We are actually playing around with this sub-vi right now, but are struggling to get it to start and stop properly. It does generate pulses like we want. I will keep playing around with it.
Thanks again.
Jamie
12-20-2005 02:20 PM
12-21-2005 12:00 PM
James -
Yes, I got it working. I used the "Route Signal", using AI Scan Start as the signal source and PF7 as the signal name and line. Then I used the "Generate Pulse Train. vi" and set the gate selection to PF7. There are other parameters you can set in this vi (i.e, frequency of pulses). The program sends pulses when you start acquiring data, then stops when the program stops running (not when the program stop acquiring data, but when the program completely stops). At the end you must use Route Signal again to clear the PF7 line (i.e., signal source = 'none', signal name = 'PF7).
Hope this helps.
Jamie
12-21-2005 12:05 PM