06-07-2018 03:46 AM
Hi,
I made Vi by using the john_P1´s raster scan Vi,
so could you check the logic of the Vi, whether it is right or not ?
I use raster scan Vi of john_P1´s and than I fed the output of the raster scan to the write Daqmx via function generator and the input signal from the mirrors will be read by the read Daqmx.
Please find attached Vi for better understanding
Thanks.
06-07-2018 07:16 AM
You'll need to sync the AO and AI tasks so you know which AI sample corresponds to which AO sample.
I recommend sharing a sample clock to keep the sampling in hardware sync. Once you get that going, I'd also recommend that you generate AO on the *leading* edge of the clock while sampling AI on the *trailing* edge. That gives your system a little opportunity to respond and settle between the generated AO stimulus and the measured AI response.
Here's one recent thread I was in that addresses how to sync AO and AI by sharing a sample clock.
-Kevin P
06-14-2018 04:06 AM
hi,
As you recommended to share the sample clock of AI and AO for the sync.
but as you see the attached VI, I am sharing the sample clock.
what should I do next is it ok ?
06-15-2018 06:57 AM
What you're doing is not what I mean by "sharing the sample clock". What you're doing is sharing the parameters that define the sample clock rate. You aren't yet getting the two tasks into hardware sync by literally sharing the same timing signals for sampling. It's a subtle but crucial distinction.
Here's a thread that starts with an example that shows how to achieve a hardware-shared sample clock. The AI task is configured to use the signal "/Dev1/ao/SampleClock" as its own sample clock. And then dataflow sequencing is used on the error wires to make sure the AI task is started *before* the AO task. That way, the AI task is ready and waiting to receive the AO sample clock signal when the AO task starts.
Once you get yourself configured for hardware sync via shared sample clock signal, you can come back to the rest of the thread to see whether the further discussion is needed for your app. (It's basically about the idea that you'd often want the AI sample to occur just a little later than the AO so that the AO value and system response are stable at the time AI is sampled.)
-Kevin P