Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous mode simultaneous synced read and write (like an oscilloscope)

6288 DAQ, using NIDAQmx, (pretty much a newbie)

My app is essentially an oscilloscope:  generate a ramp, read a voltage.
I've been using Finite mode transfers, starting and stopping tasks linked by triggers and looping in software.   A new set of tasks each time it loops.
Now I'd like to see if I can reduce some of the overhead by using Continuous mode.

Here's what I've been trying to do:

-Build array containing ramp
-Start a new thread for reading...
    -- at the moment this thread consists of a loop containing a Finite Input task ...
    -- start the task at the top of the loop and stop it at the bottom.
    --  the Read task is triggered on /Dev/ao/StartTrigger
    --  some data processing occurs during the loop
-Start a continuous mode analog Output task

The idea is that the loop in the thread would run as fast as it can, and when it's ready to deal with more data it will start a new Input task and wait for a trigger from the Output task.  I crossed my fingers and hoped that a new StartTrigger would be generated at the start of each Output cycle.

The output appears on the port as expected (and is periodic as expected).
But the input part isn't working.  I'm going to guess that StartTrigger is generated once at the start of the task, and not again.
If I remove the trigger condition on the read, then I can acquire data, but it is not synced to the ramp.

Does there exist a trigger signal generated each time the output recycles ("flies back")?

Or is there some better way to achieve this goal?

I suppose that ideally I would use continuous mode for Input and Output.  Perhaps I should just start with that goal, but it sounds like it would be tricky to read, write, and process data at the same time.  The philosophy has been "one step at a time", but if I'm just making more work for myself, I can skip the intermediate step.

Thanks,
garyp


0 Kudos
Message 1 of 2
(2,952 Views)

Hi garyp,

I understand that you are trying to synchronize an Analog Input and an Analog Output task; I’m assuming that you are using the 6289 that is one of our M-Series cards. If I understood correctly you want to start the analog input task when the analog output task start as well, so you are using the ao/StartTrigger signal to synchronize both. With the ao/StartTrigger signal you can initiate a new generation, so it is the trigger to start the analog output. That’s why right now your program doesn’t work when you set the analog input to wait on the ao/StartTrigger to start.

I don’t know what programming language you are using but I would like to point you to the Synchronization examples, with the DAQmx drivers there are shipping examples installed, I recommend looking at the Synchronization > Multi-Function-Synch AI-AO. That example sets the Analog Output to trigger off the AI Start Trigger. Please let me know if I misunderstood your application or if you have more questions. I hope this is helpful,

Ana P
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(2,923 Views)