LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Staircase looking sawtooth while using DAQmx

Hello,

 

While using DAQ assistant for sawtooth generation, the shape of the output of my DAQ USB 6343 was quite perfect.

Recently (according to some advices on this forum) I replaced "DAQ assistant" by DAQmx blocks.

And with this last solution my sawtooth no more perfect, but staircase looking.

The bottom wavegraph is exactly the same that I observe on oscilloscope (AO0 is connected to AI0 and also to oscilloscope)

Probably I missed some parameter(s), while configuring my setup ?

 

Thanks in advance.

 

Pavel.

 

USB-6343 Sawtooth Generation with DAQmx - Control Panel.JPG

 

 

USB-6343 Sawtooth Generation with DAQmx - Diagram.JPG

0 Kudos
Message 1 of 9
(3,400 Views)

Hi Pavel,

 

which sample rate and sample number have you configured for the SimulateSignal?

And why do you create and delete the AO task in each iteration?

 

I would also recommend to stay away from ExpressVIs.

SimulateSignal is an ExpressVI… 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,392 Views)

A small additional question - is it possible to change the name of signal in "WaveForm graph" - e.g. instead of "Dev2/ai0" display, for instance "AAAA".

I've tried with signal label ... doesn't work.

0 Kudos
Message 3 of 9
(3,385 Views)

Create a copy of the DAQ Assistant and then right click one of them and select "Convert to DAQmx Code" to see what you might have missed. 

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 4 of 9
(3,383 Views)

Hello GerdW,

 

... which sample rate and sample number have you configured for the SimulateSignal?

I've tried with 10000/10000 - the same as with "DAQ assistant"

 

And why do you create and delete the AO task in each iteration?

I want to change the waveform parameters (amplitude/offset/frequency) in runtime. If I put create outside of the loop, I can't control waveform.

 

I would also recommend to stay away from ExpressVIs.

Probably you have a reason, but in all examples I've seen until now, "Simulate Signal" was used to define waveform.

Without doubts there are another techniques to do this job ... all suggestions welcome.

 

Thanks

 

Pavel

0 Kudos
Message 5 of 9
(3,371 Views)

Hello Aputman,

 

Indeed, the generated code is quite different from my staff.

When creating my setup I was inspired by "Signal Generation using NI-DAQmx"  (article of Wei Lin). He used "Simulate Signal" block to define waveform.

I searched for examples that don't use "Express" blocks for generating analog waveforms, but for the moment didn't find something relevant.

All llinks welcome.

 

Best Regards

 

Pavel.

0 Kudos
Message 6 of 9
(3,359 Views)

Hi Pavel,

 

I searched for examples that don't use "Express" blocks for generating analog waveforms,

Have you searched for examples in the LabVIEW example finder? (Help menu…)

Do you mind to attach your VI?

 

I want to change the waveform parameters (amplitude/offset/frequency) in runtime. If I put create outside of the loop, I can't control waveform

Generation of the waveform (using SimulateSignal or any other function) is not related to your AO DAQmxTask.

You need to create the task just once before the loop and delete it once after the loop - the same as you do with the AI task!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 9
(3,328 Views)

Hi GerdW,

 

Thanks for suggestions. I've tried Voltage - Continious Output from "Hardware Inout and Output/DAQmx/Analog Output".

Indeed, the waveform is quite smooth - no more staircase effect.

Besides this example is rather complicated ... there is a lot of staff, that I don't need.

At other side, there is no run-time control: in order to change waveform parameters one must stop execution.

But Ok, it's good point to start.

 

Only thing that troubles me is waveform on certain frequencies: when frequency is low and not "integer" (e.g. 1.24Hz as in the example below), the shape of waveform looks "broken".

Below is snapshot given from oscilloscope Tektronix TDS 2004C.

Is it issue of synchronization, or some particularity of device (USB-6343).

 

Best Regards

 

Pavel

 

sawtooth_output_oscilloscope.jpg

0 Kudos
Message 8 of 9
(3,291 Views)

Resolved - after a sending a series of samples, new series starts with phase = 0.

0 Kudos
Message 9 of 9
(3,269 Views)