Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize continuous analog input and continuous analog output using single DAQ card PCI6024E

Solved!
Go to solution

Hi,

 

I want to generate continuous signal and at the same time I want to read that signal that I generate using a single DAQ card. I want the generate signal and the receive signal is synchronized and in phase. 

I've looked several samples about synchronization but it quiet confusing. One using the same clock input while other use a start trigger. I'm using PCI-6024E DAQ card.

Can anyone help me regarding this matter?

 

 

0 Kudos
Message 1 of 8
(5,020 Views)

If you're acquiring and generating at the same rate you can simply share a sample clock between the two tasks without a start trigger.  The master task will not produce a sample clock until it is started in software, so by starting the slave before the master you ensure both tasks start together.

 


Best Regards,

John Passiak
0 Kudos
Message 2 of 8
(5,019 Views)

Thanks but how about the continuous signal analog output generation. I attached the sample that share a sample clock. Does the signal that generated is continuous as the basic function generator block is outside the loop?

0 Kudos
Message 3 of 8
(5,016 Views)

The data that you write before the task is started will be looped continuously by default.

 

I noticed that you're probably using the AO to clock AI.  If that's the case, you'll need to start the AI task first (for reasons I mentioned above). 

 

 

That example looks a lot like the shipping example but with the shared start trigger removed.  Sharing a start trigger is also acceptable since the two tasks derive their clock from the same timebase.  If you decide to use the internally derived clocks on each task with a shared start trigger, please note that rates which aren't an integer divide down of the 20 MHz timebase are coerced.  AI will always truncate to an available sample rate that is higher than what you specify, whereas AO will round to the closest available rate.

 

 

Best Regards,

John Passiak
0 Kudos
Message 4 of 8
(5,008 Views)

oh great so I don't have to put the basic function generator in the loop in order to generate continuous signal as there are example that put the block in the loop to generate the continuous signal like example 1 that I attached.

 

Yeah. I'm using the AO to clock AI. How I'm going to start the AI first? I'm quite new in this labview. Your guidance is much appreciated. I attached the VI circuit for your convenience.

 

 

 

Download All
0 Kudos
Message 5 of 8
(5,006 Views)

You'll probably want to read up on the concept of Data Flow.  In LabVIEW, a subVI or function doesn't execute until it receives all of its inputs.  So, you can use the error wires to force the functions to execute in a certain order.  For example:

 

 

AO Executes First in the following scenario (like you have currently):

        2010-12-16_191341.png

 

 

AI Executes first in this scenario:

         2010-12-16_191511.png

 


Of course, you could use either task as the master.  You could start AO first, but then you should make AI use the internally derived clock, and AO would use aiSampleClock for its source.

 

 

The example that you linked uses non-regeneration ("Do Not Allow Regeneration"), which is useful if the output cannot be pre-defined.  If you don't explicitly set this, the driver will regenerate the same waveform continuously (on a continuous task).

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 8
(5,001 Views)

Hi John,

 

Many thanks for the explanation. I just read the data flow. Now I have construct two versions circuit design in version 1 and version 2. Both intended for AI to execute first. 

Could you confirm if both versions are correct or not?

 

Yeah. If I not wrong, I can just use my previous circuit, the only change I have to made is make AI use the internally derived clock and AO would use AI sample clock for its source.

 

 

What do you mean the output cannot be predefine? Is this related to frequency output?

 

 

 

 

Download All
0 Kudos
Message 7 of 8
(4,978 Views)
Solution
Accepted by topic author yusof

In both of those screenshots, the AI task will start first (which is what you want, since it is the slave task).

 

Typically for AO, you can just write a single period of your waveform, then regenerate it over and over again.  Your waveform would be pre-defined before the task is started.  If you need to update the waveform on-the-fly depending on programmatic input while the task is running, you'd want to disable regeneration.  Also, if the waveform is such that it can't be easily represented by a pre-defined buffer (e.g. it is an odd frequency that is not an even divide-down of the sample clock), then non-regeneration is the way to go.

 

 

Best Regards,

John Passiak
0 Kudos
Message 8 of 8
(4,950 Views)