LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog I/0 sync

I read change buffer and stuff , downloaded many examples of sync but seens just work with regular DAQmx not myDAQ , fist code I did was using 2 daq assitant I/O works like I get random sync , this software should be more intuitive and I/O ports should be sync as standard settings , most of errors are your device not support or buffer errors

0 Kudos
Message 11 of 23
(622 Views)

I be glad if you have a specific code for NI myDAQ device for this task because the usual errors I got is your device isnt supported

0 Kudos
Message 12 of 23
(615 Views)

Hi Chris,

 


@Chris9823Alb wrote:

because the usual errors I got is your device isnt supported


You do your job in the wrong order!

You cannot blame the hardware that it doesn't support your requirements: you need to select hardware in the first place to fulfill those requirements!

 


@Chris9823Alb wrote:

this software should be more intuitive and I/O ports should be sync as standard settings


Which software needs to be "more intuitive"?

Why should "I/O ports be sync as standard"? Syncing AI and AO ports needs specialized hardware features, and you don't want to pay for features you don't need when buying "standard" hardware!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 23
(607 Views)

Chris9823Alb_0-1703090436322.png

Hey there I'm trying sync input and output samples with this simple code how can I sync if I set any timing clock I get this error mensage I'musing NI myDAQ  device.

0 Kudos
Message 14 of 23
(606 Views)

Hi Chris,

 

it doesn't make sense to start a new thread for the same topic, so keep things in one place!

 

You cannot use features that your hardware doesn't support!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 23
(586 Views)

I just want a code which sync both analog I/Os (same input signal is output signal like a repeater ) and works on myDAQ device

0 Kudos
Message 16 of 23
(586 Views)

To help with tradeoffs, we'd need more detailed info.  But don't kid yourself -- in the general case there WILL be tradeoffs, you WON'T be able to perfectly reproduce any arbitrary input signal at your output with 0 delay.  Unless you have very special circumstances, the best feasible outcome is a "pretty close" reproduction with a "pretty small" delay.

So here are some specific questions:

1. What do your input signals look like?  Completely arbitrary?   Or very well behaved, such as piecewise-constant or a nearly-pure sine wave?

 

2. What kind of measurement resolution do you need?  And what does this imply about the sample rate you need for the kinds of signals you expect to see? 

    For example, a starting rule of thumb for sine waves in the time domain is to oversample at >= 20x the sine wave frequency, giving you 20+ samples per cycle.  WIth something like this as a guide, you can figure out your biggest voltage change between samples based on your sample rate and the waveform shape.

    Understanding these requirements starts to steer some of the input task decisions.

 

3. What kind of max latency can you tolerate, i.e., how soon after the input voltage changes must you be able to replicate that change in the output?

    Picture a piecewise-constant input.  There will be sudden voltage step changes where adjacent samples are at the two different levels with no samples catching the transition in between.   How much delay can you tolerate between when this step change occurs at the input and when it occurs at the output?

    Understanding this requirement helps steer some of the output task decisions.

 

And more generally, what's the big picture here?  As a crotchety old-timer, I've found that many newcomer questions are built on unrevealed (maybe unrecognized) assumptions.  Sometimes by taking a couple steps back, there's a different question that starts you a better path toward an acceptable solution to your bigger-picture app.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 17 of 23
(564 Views)

 

Thanks for the reply I'm new on Labview and have doubt to make this code on syncronization part and example codes was made for DAQmx . I'm using myDAQ device, in my tests I was using a sine wave from my signal generator but can be arbitrary waves , and measure input and output signals on oscilloscope to compare they , by the primary results they are having random lags my objective is having constant delay between I/O waves , 1st moment I want equal signals on both channels than after I edit a function to modulate the output signal, its a simple code but I'm having doubt how to sync the signal on this device and final objective is control a servo motor.

Chris9823Alb_0-1703167494717.png

 

0 Kudos
Message 18 of 23
(536 Views)

Hi Chris,

 


@Chris9823Alb wrote:

its a simple code but I'm having doubt how to sync the signal on this device and final objective is control a servo motor.


Yes, your code is simple - and so it produces simple results…

 

When you want to have a lag of less than 1ms between reading an AI sample and outputting this very sample on an AO channel (and some other stuff inside that loop too!) then you very quickly need a FPGA target! Using a FPGA you can define the lag between AI and AO on a hardware-timed cycle clock, only depended on the sample rates offered by your AI/AO hardware!

On a Windows computer you will not reliable reach your goal (reliable)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 23
(525 Views)

Yea have hardware limit but my goal is get lowest lag with this device ,  I have only myDAQ of NI controllers I just want a way to sync both waves , I dont know how to make FIFO with this because maybe works

0 Kudos
Message 20 of 23
(511 Views)