LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create waveform from timetable and datatable

How do I create a waveform with exact timing from a two column table. The first column sets the timing, the second column sets the values at these timings. For instance I want to set 1V at 0 seconds, then 2V at 10 ms, then 3V at 30 ms, then 0V at 35 ms and so on.

0 Kudos
Message 1 of 7
(2,656 Views)

On X axis you want time or value?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 7
(2,655 Views)

Check this....

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 7
(2,651 Views)

Thanks for your reply!

This looks already fine, but I also want the previous value to be kept constant until a new value is set at a new time. In your application there is a linear interpolation between consecutive samples. Is this easily done?

0 Kudos
Message 4 of 7
(2,647 Views)

I am not sure. Frankly I dont understood what is causing problem. Can you elobrate with an example Smiley Wink

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 7
(2,638 Views)

@Claude2 wrote:

How do I create a waveform with exact timing from a two column table. The first column sets the timing, the second column sets the values at these timings. For instance I want to set 1V at 0 seconds, then 2V at 10 ms, then 3V at 30 ms, then 0V at 35 ms and so on.


To have "exact" timing it would be preferable to use a timed loop where you set the loop delay at each iteration. Now if you want to generate a real waveform you will also need some hardware like an analog I/O card and use the daqmx functions to control it.

 

Ranjeet vi is a simulation where the x-axis values correspond to the timing values but where the actual delay between points is not exact (e.g. it didn't take 10ms between first and second point). To change the interpolation type of the graph click in the plot legend and then select interpolation.

 

 

interpolation type.png

 

Ben64

0 Kudos
Message 6 of 7
(2,622 Views)

Thanks for the reply!

I'm a newbee to Labview... indeed the samples are not interpolated as you show in the graph.

I have the NiDAQ9178. For now I use equidistant points in time but haven't found yet how to do it with different delta times.

I need dt values of order 0.010 to 1 milliseconds, so I cannot do it in a loop.

Maybe I can create a waveform and then resample it and send it to the DAQ.

 

Regards, Claude.

0 Kudos
Message 7 of 7
(2,618 Views)