11-25-2012 12:05 AM
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 ??
11-25-2012 01:49 AM - edited 11-25-2012 01:59 AM
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.
11-25-2012 02:02 AM
Thanks.
I tried putting the clear DAQ task outside the for loop but it gives an error.
11-25-2012 02:04 AM
What error code are you getting?
11-25-2012 02:19 AM
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??
11-25-2012 02:28 AM
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.
And yes, your waveform will be 10msec long given the sample rate and number of samples.
11-25-2012 04:18 AM
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.
11-25-2012 04:37 AM
Can you post a screenshot or the VI?
11-25-2012 11:39 AM
Find attached the VI
11-25-2012 12:07 PM