05-02-2016
08:26 AM
- last edited on
06-04-2025
02:35 PM
by
Content Cleaner
Hello,
Here is a part of my initial setup:
This setup doesn't work, generate error 200284 (some or all samples requested have not been required).
Similar example I've found here:
http://www.ni.com/example/25905/en/
Thanks in adavnce.
05-02-2016 08:33 AM
A couple of questions.
Bob Schor
05-02-2016 09:06 AM
Indeed, "read" starts first.
So, the solution would be put start/stop staff for generation branch also inside loop ?
05-02-2016 09:18 AM
No, to start both outside the loop. Think about the sequence you want to have happen. Both the AI and AO systems are running, waiting for something to do. The AO gets a trigger, does its thing, generates (after a delay) the AI trigger, the AI is Ready to Roll so it also does its thing, the loop "loops", and you Do It Again. The point being, everybody is running and waiting for their signal.
Bob Schor
05-02-2016 10:08 AM
Here is what I tried.
Once running it generates the following error:
Error -200557 occurred at Property Node DAQmx Trigger (arg 1) in read_input_with_delay (1).vi
Possible reason(s):
Specified property cannot be set while the task is running.
Set the property prior to starting the task, or stop the task prior to setting the property.
Property: Start.Delay
Task Name: _unnamedTask<36>
It seems that "Start" block should be used after "Start Trigger". Isn't it ?
05-02-2016 03:11 PM
@Pavel_47 wrote:It seems that "Start" block should be used after "Start Trigger". Isn't it ?
No. You have the trigger being set up after you call the DAQmx Start Task. All of your trigger setup should be done before that and before the loop.
05-03-2016
04:44 AM
- last edited on
06-04-2025
02:35 PM
by
Content Cleaner
Thank you for suggestion.
Here is what I've tried (snippet below).
The same error: some of all samples requested have not been acquired.
I've looked through a number of examples concerning synhronization.
None corresponds to my setup.
All of them uses waveform defined outside loop, whereas in my case the output is generated inside loop.
For example this one:
https://forums.ni.com/t5/NI-DAQmx-Examples/Multi-function-Synchronization-for-AI-and-AO/td-p/3490608
05-03-2016 07:22 AM
The issue seems to be enchanted.
Having no solution with HW triggering, I've tried to create something similar using only LabVIEW programming features.
And even this doesn't work.
Here is the gernerated error (apparently it's impossible to copy error message as text !)
05-03-2016 09:06 AM
Wow. I got it to work, and in the process, learned something I didn't know about Finite Sampling.
So I have a USB-6009 that has 2 D/A output channels and A/D input channels, so I thought "Why not run this program on my own DAQ device?". Of course, it didn't work, but for different reasons, such as my not having set the Max/Min properties of the Channels (your device probably allows D/A ranges of ±10V, but the USB-6009 is 0 to +5. Not only do you need to set the Output Scales (easy to do with MAX Tasks), but you need to be sure that when you send the Averaged A/D Voltage out, you don't send a negative value (since I had no signal, I just send "Average + 1").
I simplified my DAQmx coding by using MAX Tasks (see "Learn 10 Functions in NI-DAQmx ..." -- a Web Search will surely find this very nice NI White Paper). But it still didn't work -- it failed on the second loop. Now, I've never done Finite A/D sampling under program control before (I usually use Continuous Samples), so I wondered "Maybe I need the Start and Stop Task function inside the loop". And then it worked.
Here's my slightly-revised code (I did some wiring cleanup). Note that V_Output, V_Control, and V_Sample are the names of the DAQmx Tasks I created (where the "DAQmx Details" are hidden). I did my best to get rid of frames, keeping only the one needed to "separate" the AO from the AI.
Bob Schor
05-03-2016 10:51 AM
Bob_Schor a écrit :Wow. I got it to work, and in the process, learned something I didn't know about Finite Sampling.
So I have a USB-6009 that has 2 D/A output channels and A/D input channels, so I thought "Why not run this program on my own DAQ device?". Of course, it didn't work, but for different reasons, such as my not having set the Max/Min properties of the Channels (your device probably allows D/A ranges of ±10V, but the USB-6009 is 0 to +5. Not only do you need to set the Output Scales (easy to do with MAX Tasks), but you need to be sure that when you send the Averaged A/D Voltage out, you don't send a negative value (since I had no signal, I just send "Average + 1").
I simplified my DAQmx coding by using MAX Tasks (see "Learn 10 Functions in NI-DAQmx ..." -- a Web Search will surely find this very nice NI White Paper). But it still didn't work -- it failed on the second loop. Now, I've never done Finite A/D sampling under program control before (I usually use Continuous Samples), so I wondered "Maybe I need the Start and Stop Task function inside the loop". And then it worked.
Here's my slightly-revised code (I did some wiring cleanup). Note that V_Output, V_Control, and V_Sample are the names of the DAQmx Tasks I created (where the "DAQmx Details" are hidden). I did my best to get rid of frames, keeping only the one needed to "separate" the AO from the AI.
Bob Schor
Bob, thanks a lot.
I've tried your example and it works.
Unfortunately the accuracy with SW timing is quite mediocre ... instead of specified 50ms the delay is about 75ms (please the snapshot from oscilloscope).
For our actual testbend is sufficient, but with some advanced features (that we planify to integrate in the future) such accuracy will be probably insufficient.
It's 2nd day I'm searching for a solution with HW timing (i.e. using "Start Trigger" and "Start.Delay" property node), but without success: all the examples that I've found until now uses perdefined waveform (i.e. defined before loop), whereas in my setup output value is generated inside loop. Have you any experience with "Start Trigger" ?
Thanks in advance.
Pavel.