LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ramping the signal

Hi,

I have created a VI for controlling laser diode through a ramp signal. In this VI, I have used sawtooth signal with frequency of 50Hz, sample rate of 100k S/s and sample size of 1000. Is this fine or is there any other direct way of getting a ramp signal ??(From direct I mean if I can select ramp signal instead of sawtooth). I am using labview 7.1 . And what is the use of sample clock ??

0 Kudos
Message 1 of 18
(5,265 Views)

There is a ramp pattern but it is part of the Signal Generation VIs (Signal Processing...Signal Generation...) in the Full Development System.

 

The sample clock determines the bandwidth of your output signal.

 

If you change the DAQ Write polymorphic instance to Analog 1 Channel N Samples, you can write the entire waveform on each iteration of the loop, unlike what you have now. 

 

And you would normally clear the DAQ task outside of any loops, otherwise your DAQ task will have the overhead of stariting and stopping every iteration. 

Message 2 of 18
(5,258 Views)

Thanks.

I tried putting the clear DAQ task outside the for loop but it gives an error.

0 Kudos
Message 3 of 18
(5,253 Views)

What error code are you getting?

0 Kudos
Message 4 of 18
(5,251 Views)

When I connect the DAQ write task( inside the loop ) to the clear task (outside the loop) it gives the following error:

 

You have connected an array data type to its element data type. This type conflict may be resolved by indexing the array to access individual elements of the array. Check for a tunnel on a loop that has indexing incorrectly enabled.
The type of the source is 1-D array of GenericRefnum Tag.
The type of the sink is Task."

 

How can I get signal generation VIs ?

 

By giving N samples, I will get 10 ms waveform in each iteration, right??

0 Kudos
Message 5 of 18
(5,246 Views)

You need to turn OFF auto-indexing of the task reference as it leaves the For loop. That should eliminate your error.

 

The Signal Generation VIs are part of the Signal Processing addon which comes with all versions of LabVIEW except the BASE version (and maybe student version). It's on the block diagram palette.

 

ramp.png

 

And yes, your waveform will be 10msec long given the sample rate and number of samples.

Message 6 of 18
(5,244 Views)

How can I get the waveform graph from Read DAQ task ??

I get the following error

 

You have connected a scalar (non-array) data type to an array of the same data type. This type conflict may be resolved by building the scalar type into an array. Check for a tunnel on a loop that has indexing incorrectly disabled.
The type of the source is double [64-bit real (~15 digit precision)].
The type of the sink is Dynamic Data.

0 Kudos
Message 7 of 18
(5,238 Views)

Can you post a screenshot or the VI? 

0 Kudos
Message 8 of 18
(5,236 Views)

Find attached the VI

0 Kudos
Message 9 of 18
(5,224 Views)

Hi bsunny,

 

use a chart instead of a graph when you only fetch scalar values from DAQmx...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 18
(5,221 Views)