Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Enormous latency while working with NI USB-6521

Solved!
Go to solution

Hello,

 

The setup of my testbend is shown on Fig.1, Fig.2.

Here are its features:

  • "Simulate Signal" block generates Sawtooth signal with adjustable parameters - ampl, freq, offset, phase
  • the output of "Simulate Signal" is wired to the driver of the output AO0 (block "USB-6521 AO0") of the USB-6521 device
  • the output AO0 is cabled to the input AI0 of the USB-6521 device
  • the output of the driver of the input AI0 (block "USB-6521 AI0") is wired to Waveform Graph (blue line) as well as the input to the driver "USB-6521 AO0" (red line)

Playing with thist testbend I've observed 2 strange phenomenas:

  • when I modify some of Sawtooth parameters (i.e. ampl, freq, offset) the latency is about 15 seconds
  • while the signal, generated by "Simulate Signal" is perfect Sawtooth, the "USB-6521 AO0" output is not perfect ... in other words its shape doesn't always follow the source shape (I control also by oscilloscope).

Any comments welcome.

 

Thanks in advance

 

Pavel

 

Fig.1

USB-6521 Testbend - BlockDiagram.JPG

 

Fig.2

USB-6521 Testbend - FrontPanel.JPG

0 Kudos
Message 1 of 10
(5,421 Views)
I don't understand how you calculate 15 seconds. The graph shows about 15 msec delay. The delay is probably just due to your sample rate and number of samples. You don't show this and the attachment of just a picture means you can't get a more complete answer.
0 Kudos
Message 2 of 10
(5,411 Views)

Denis,

 

First, thanks for feedback.

 

"Calculate" probably isn't proper word.

But, Ok ... I proceed this way:

  1. Change some paramater on front panel, e.g. amplitude passes from 2.5V to 1.0V
  2. See at my watch and notice the time
  3. Control the waveform on osciloscope
  4. Certify that waveform on osciloscope changes about 15sec. later

Regards

 

Pavel

0 Kudos
Message 3 of 10
(5,405 Views)

Pavel_47 wrote:  Certify that waveform on osciloscope changes about 15sec. later

Now that just opens up another can of worms.  What oscilloscope?  What settings are you using for the oscilloscope (timebase, display mode, trigger settings, etc)?

 

My suspicion is that you are using a setting that the scope does not show the waveform until is has been fully captured and you have a really large timebase so that it takes 15 seconds for a waveform to display on the scope.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 10
(5,403 Views)
Or, it could be that your number of samples is 15 times the rate you have specified so that it takes 15 seconds before a change will take affect. Since you still have not attached any code or your DAQ Assistant settings, I'm not going to speculate any more.
0 Kudos
Message 5 of 10
(5,388 Views)

Dennis,

 

Here is my code (in attachment).

 

I've sligthly modified my setup - on Fig.1 and Fig.2 - the snapshots of the Block Diagram and running Front Panel.

I've also change oscillscope: before it was very old HP 150MHz 4-channel, now it's Tektronix TDS 2004C.

Just before changing it seems that HP didn't work at all, so probably Crossrulz had reason.

Now the visual oscilloscope reaction is much better ... at least it's less than 15sec, but still isn't instant.

Also waveform deformation persists - it isn't perfect Sawtooth as it's supposed to be ... especially at low frequencies.

I will further investigate is it the problem of synchronization.

Can you, please, just check if the timing parameters in 3 "players" ("Simulate Signal" and 2 "DAQ Assistant") are coherent.

Also is it possibly to display on WaveForm graph more than 1 period of waveforms.

When I set X-axis to "Autoscale", only 1 period of waveform is displayed.

When I uncheck "Autoscale" and set maximum to 1 sec (with Autoscale it's 0.1 sec), axis scale indeed rises to 1sec, but waveforms remain displayed until 0.1 sec.

 

Thanks in advance

 

Pavel

 

 P.S. In the post that will follow I'll also send the table where I resume timing parametrs of different blocks (due to message lengt limitation)

 

 

Fig.1

USB-6521 Testbend - BlockDiagram (2).JPG

 

Fig.2

USB-6521 Testbend - FrontPanel (2).JPG

0 Kudos
Message 6 of 10
(5,383 Views)

In the attached .pdf - timing parameters of "Simulate Signal" and 2 DAC assistants.

Regards

Pavel

 

0 Kudos
Message 7 of 10
(5,380 Views)
Solution
Accepted by topic author Pavel_47
It's not supposed to be instant. If you understood the basic arithmetic, you would know that it takes 10 milliseconds to acquire and display the signal - exactly what you are showing.

To display multiple periods, you need to acquire more samples. Again, this is just basic arithmetic.
Message 8 of 10
(5,376 Views)

I'm not sure how a USB 6521 works, mainly because I can't find it on NI's website anywhere.  As far as I know, two express VIs can't run at the same time on the same device and you have no dependency between the two VIs to guarantee the order of operation. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 9 of 10
(5,373 Views)

It seems to be Ok.

I succeed to have both signals (output from "Simulate Signal" and from Analog Input) to have the same scale on WaveGraph (i.e. 5 periods of 5Hz-Sawtooth on 1-sec X-scale)

The only combination of the timing parameters where it was Ok were all timing parameters in 3 blocks were equal to 100k.

In this case all ratios are 1. In other case, where all ratios are equal to 10, both signals have also the same scale, but on 0.1 X-scale, so only half-period of 5Hz-Sawtooth is displayed).

When ratios aren't equal, either both signals have different scales, either VI doesn't run and outputs error.

 

Simulate Signal

Analog Output

Analog Input

Samples per second

Number of samples

ratio

Samples to Write

Rate [Hz]

ratio

Samples to Read

Rate [Hz]

ratio

100k

100k

1

100k

100k

1

100k

100k

1

 

The time of reaction to parameter change seems to be correct ... at least less than 1 sec, difficult to estimate more precisely using only visual control.

In the case where only half-period is displayed it's quite difficult to estimate reactivity even visually, that's why I searched for correct parametrizing.

 

Thanks a lot to all participants.

 

Best Regards

 

Pavel

0 Kudos
Message 10 of 10
(5,325 Views)