07-28-2005 06:27 AM
07-29-2005 04:04 AM
I tried calling
DAQmxErrChk( DAQmxCfgSampClkTiming(s_hTaskDig,"/Dev1/ai/StartTrigger",1.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1) );
on my NI6143 board, but it fails saying that it only support DAQmx_Val_OnDemand?
Please help !!!!
-cpede
07-29-2005 03:14 PM
You could try this:
1. Create a pulse generation counter output task. Use units of time and create a single pulse that is high for the desired duration of your analog input. This pulse will appear at the I/O connector on some default pin that you have to look up. Or you can specify the output terminal.
2. Create your analog input task such that it uses a digital level Pause trigger. Set the Pause When attribute to pause when Low. You can just set the sample mode to Continuous. The analog input will only run while the pulse from the counter task is high.
07-29-2005 03:15 PM
08-01-2005 06:19 AM
Thanks for the reply.
What you describe is how to control the AI from a digital pulse.
What I'm interested in is simply to make port0/line0 go high while the AI is running.
There must be a simpler solution.
-cpede
08-08-2005 03:00 AM
08-08-2005 04:12 AM
08-08-2005 04:30 AM
Thanks for the reply,
What I want is to start both a analog input and a digital output using a digital (or analog) input trigger.
The digital output should only go high during the analog input operation which is limited by number of samples acquired (DAQmx_Val_FiniteSamps).
Time: ________S____________________T_______________ACQ_______________END_____________
Action: StartTask Input Trigger Acquire AI Num. of samples acq.
Wait for trigger Trigger happens Acq running Acq stopped
Digital ___________________________________ Hi
Output___________________________I I__________________ Low
-cpede
08-11-2005 01:46 AM
Could anyone show me how to make this happen, please?
-cpede
08-11-2005 10:18 AM
While some of our boards have what we call 'correlated digital I/O', where you can clock out digital data by using your ai/sampleClock for example, I don't think this feature solves your problem. You could use the ai/StartTrigger as your clock, but it only ticks once. I don't think the board emits a signal upon completion of a finite analog input acquisition. Even if it did, you can't switch from one clock to another for your correlated digital output while it's running.
Here's a suggestion involving counters again.
1. Configure a counter output: pulse generation: ticks channel . Configure its idle state to be low. Configure the minimum number of low ticks, which is 2.
2. Configure the source of ticks to be the ai/SampleClock. Configure the number of high ticks to be the number of samples you are acquiring. You may want to subtract the number of low ticks from this.
3. Configure a Start Trigger for your counter pulse generation task. Configure the source for the Start Trigger to be ai/StartTrigger.
4. If you don't like (or know) the default output terminal of the counter pulse, configure a different output terminal.
That should give you *almost* what you want. I say almost because the pulse will go high not immediately upon arrival of the Start Trigger but a number of sample clocks later (equal to the value of the low ticks you used in step 1).
Good luck.