LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting DAQ data along with generated sine function

This question is the continuation from this thread:

http://forums.ni.com/ni/board/message?board.id=170&thread.id=343662&view=by_date_ascending&page=2

Since the problem described in that thread was solved and new ones arouse, a new thread was necessary for archives purposes.

Anyways, everything in my VI works so far except for two plotting issues.  First, I am trying to plot the incoming signal from the DAQ along with a sine wave generated by the PID controller.  Theoretically they should match, but I want to plot them together to verify this and keep an eye on things.

Second, how do you format a plot so that it starts at zero and not the date from the DAQ waveform?  I have tried setting plot history attribute nodes to zero and this doesn't work in or out of the while loop.  Making the waveform into an array doesn't work because of the PID controller.  I also tried modifying the waveform by setting the t0 value to zero, but then the chart only display 0.1seconds of data.  Any suggestions?




Message Edited by bjohnson on 07-30-2008 05:03 PM
0 Kudos
Message 1 of 5
(2,893 Views)
Hi bjohnson,
 
You forgot to include your sine generation VI.
 
You should be able to get what your want by modifying the t0 of the waveform. You said you tried this and only saw .1 sec of data, could you click on the right most x axis value and increase it?
 
You can take just the Y values from the waveform components and graph that. It will give you the waveform vs. sample number. You can also use the properties of the graph to specify the number of points to plot or the range of the x axis.
 
Sappster
0 Kudos
Message 2 of 5
(2,875 Views)
Mark,

I have tried all your suggestions without any luck.  I cannot get both signals to display on the same chart.  I have done countless things with the waveform attributes and modification, but no luck.  I am at a loss here. 

Attached is the new VI with several sub VI's. 


Message Edited by bjohnson on 07-31-2008 01:39 PM
0 Kudos
Message 3 of 5
(2,857 Views)
Hi bjohnson,

I wasn't able to run your VIs exactly since I don't have the exact same hardware, but I did copy over your exact chart and its combined signal input. When I attache a pair of generated sine waves, I get the exact behavior your looking for (they plot on the same graph over eachother, and they time starts at zero.) You might try taking the dynamic data types, and converting them to just waveforms before you plot them. If that doesnt work, try stripping the t0 all together.
Asa Kirby
CompactRIO Product Marketing Manager
________________
Sail Fast!
0 Kudos
Message 4 of 5
(2,833 Views)

I finally got some time to finish up this portion of the project.  While there are still other issues, the snapshot below shows how I got everything to work.

 

 

0 Kudos
Message 5 of 5
(2,747 Views)