LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display Graph of DAQ Output

I am having trouble displaying the waveform graph of a DAQ voltage output. The program can successfully output a voltage to my specifications, but I am unable to figure out how to display that on the front panel. I've attached my attempt below.

 

I also want to create a VI that produces a sine wave by calculating the values once, ahead of time, and then using them as needed in a loop. I want it to Store the values in an array, and arrange to cycle through, sending one number after another to the Digital to Analog Converter but am unsure how to do so.

 

If anyone can help, that would be greatly appreciated!

0 Kudos
Message 1 of 10
(4,857 Views)

While the DAQ Assistant is a convenient way for prototyping, i recommend you to not use it.

 

I recommend you to follow these steps:

1. Modify the DAQ Assistant to generate a signal from a waveform, not software single point (as you currently have)

2. Create a LV programm from your DAQ Assistant by right-click on it and select Generate NI-DAQmx Code

3. Use LV waveform functions to create a sine signal in the waveform (you already use the function)

4. Wire up the sine waveform as input to the DAQmx code and the graph

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 10
(4,825 Views)

i try to change some part of your vi I hope it could be helpful

just change it in way that you want

0 Kudos
Message 3 of 10
(4,812 Views)

Hatef,

 

i'm sorry to say that you should NOT do what you did in the VI. Your waveform gets longer each iteration of the loop which means that

a) You will eventually run out of memory

b) The DAQ task takes longer for output each iteration. After many iterations you will literally have to wait hours for the DAQ task to finish

 

Never append arrays without limitation!

 

Norbert

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 10
(4,804 Views)

yes you are right I just attention to array problem of our friend and forget to attention about that 

off course we have to care about the daqّ FIFO for read and write in that 

0 Kudos
Message 5 of 10
(4,795 Views)

The problem is I want to generate a sine wave that can have a sampling rate that is less than or equal to the twice sine frequency. The sine waveform generator prohibits this, but using the DAQ doesn't. Is there a workaround to this at all?

 

I am also still unsure how to code my second question. To repeat it here, I want to create a VI that produces a sine wave by calculating the values once, ahead of time, and then using them as needed in a loop. I want it to Store the values in an array, and arrange to cycle through, sending one number after another to the Digital to Analog Converter but am unsure how to do so.

 

Thanks

0 Kudos
Message 6 of 10
(4,750 Views)
You would pass the array to a for loop and inside the for loop is a DAQmx Write set for 1Samp. Unless you configure the DAQ device (assuming it supports it) for hardware timed single output, the frequency is dependent on software timing with a wait. This will be subject to jitter because of Windows as a non-deterministic os.
Message 7 of 10
(4,738 Views)

This 'jitter' that you talk about, is it affected by the load on the CPU? That's what I'm trying to figure out, is that if the computer is really slow, is there any advantage to generating all the sine values at once over generating a value every 10 ms? 

 

Is this VI any more immune toto a slow computer? Do you think the limiting factor in the output timing precision is the calculation of values of the sine function?

0 Kudos
Message 8 of 10
(4,726 Views)
The jitter is affected by the other processes that might be running on the pc. If you have hardware timed output, that will not be subject to any jitter. This has already been mentioned to you.
0 Kudos
Message 9 of 10
(4,710 Views)

@Valsae wrote:

The problem is I want to generate a sine wave that can have a sampling rate that is less than or equal to the twice sine frequency. [...]


You never heared of Niquist, did you?

That being said, the minimum sampling rate has to be twice the sine frequency.

As the DAQ output is not a sine generator (using appropriate filters to form a sine out of two samples per period) you are recommended to use at least a 10 time oversampling rate (10 samples per sine period) in order to get the shape of the sine.

 

Please read all the DAQ tutorials on ni.com and other web pages to understand continuous output.

 

Norbert

 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 10
(4,702 Views)