12-19-2023 12:20 PM
Hey I would like how to sync analogic input with output on NI myDAQ, the code I sugest daq read and after write the input signal but I measure on my osciloscope and they not have a right timing wave , I hope someone can help with a code
12-19-2023 12:43 PM
You can refer to DAQmx Multifunction Synchronization with Shared Sample Clock
Just change DI to AO.
12-19-2023 01:05 PM
I changed the code but didnt work and seens its reading , my goal is get same signal on input as on output but with sync both
12-19-2023 05:45 PM
Post your code so that we can have a look.
12-20-2023 06:34 AM
Other than certain fairly rare exceptions, setting up continuous sampling with a sample clock also sets up buffering. And buffering *necessarily* brings with it latency. And latency means that your scope traces will inevitably show some delay from your input to your output.
In general, latency is harder to control on the output side than on the input side of things. The most suitable compromise may well be to run your output task in software-timed on-demand mode (without a clock or buffer).
You can time your loop rate by choosing the # samples to read from your input task. A smaller # leads to lower latency but there are still limits due to overhead associated with each read. For example, you'd be quite unlikely to achieve a 10 kHz loop rate. With some devices, especially those on an indirect bus like USB or ethernet, you'll probably be limited to 100's of Hz or less.
You could run both input and output as software-timed on-demand tasks to give you even lower latency, but your sample and update rates will be both limited in speed and more irregular.
In the end, it comes down to tradeoffs. Like usual.
-Kevin P
12-20-2023 07:10 AM
I tried that code but usually I see on forum is made for DAQmx I'm using NI myDAQ device
,my objective is have same signal I insert on daq input I want daq reproduce on output because I test and they are having ramdom lags , after they are sync I want modulate the output signal with a function, I'm reading both signals with a oscilloscope
12-20-2023 07:13 AM
I know ll have a latency but the wave lag is random not a sync delay I would like find a code for ni mydaq because on NI site I just find codes for DAQmx and I try change physicals channels and get some errors
12-20-2023 07:16 AM - edited 12-20-2023 07:18 AM
Hi Chris,
@Chris9823Alb wrote:
my objective is have same signal I insert on daq input I want daq reproduce on output because I test and they are having ramdom lags
Currently you read your AI signal, then you display it in a chart and output that very same signal with this AO channel. This way the AO channel will always lag the AI reading!
You can minimize the lag by reducing the number of sample read from AI channel, with a minimum of 1 sample (giving a lag time with respect to your sample rate)…
@Chris9823Alb wrote:
on NI site I just find codes for DAQmx and I try change physicals channels and get some errors
Because DAQmx is used to handle your myDAQ AI/AO channels.
Which errors do you get?
12-20-2023 07:36 AM
I'm new on lab view and try make a code for this , my system is windows 11 using labview 2019 and NI myDAQ device I would like how is the right code for this task I'm getting errors like that and change buffer to standard (100samples/1k hz) and still error.
12-20-2023 07:57 AM