LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change X Value of Dynamic Data

I want to increase the x value of dynamic data (the purple signal wire). I used the simple add icon and it only adds to the Y value.

The problem I have is that there are two signals I want to compare on one graph using only one x-axis scale, but one graph is shifted. I think the only way to compensate for the shift is to add/subtract a value from the x-axis.
0 Kudos
Message 1 of 10
(3,135 Views)
Ive tried converting the dynamic data to a waveform and used the build waveform block. Problem is that there is no option to change or add onto the x values.
0 Kudos
Message 2 of 10
(3,116 Views)
I don't think you understand the concept of a waveform. You have a single Y array and a t0 and dt. The t0 defines where in time the x axis starts. The dt defines the spacing between each of the elements in the Y array. If you want to add more elements along the x axis, you would use the Get Waveform Components and select the Y array. You would then use the array functions to append or insert a new element into the array. Then you would use the Build Waveform to replace the old Y array with the one you just modified.
 
Without seeing your data, I don't know if this will fix your problem. There are other waveform operations that might be more suitable. For example, there is the Align Waveform Timestamps function.
0 Kudos
Message 3 of 10
(3,108 Views)
I took part of my VI and made a simple example. All I want is to shift the wave by the delay amount.
0 Kudos
Message 4 of 10
(3,102 Views)

Message Edited by virus86 on 08-09-2007 10:58 AM

0 Kudos
Message 5 of 10
(3,094 Views)
I looked at posts regrading shifting arrays and I think it works now. Problem is that it runs slow because it is shifing a lot of Y values.
0 Kudos
Message 6 of 10
(3,084 Views)
It looks like you want to add 5 seconds to the start time of the second waveform. Is that correct? Your graph is set to ignore time stamps. Right click on the graph and uncheck that setting.
0 Kudos
Message 7 of 10
(3,083 Views)
I do not want to look at the timestamp. The time will range from 0 to 200u. The amount shifted will be user controled and will be around 50u-100u.
0 Kudos
Message 8 of 10
(3,078 Views)
Then you can modify the Y array as I mentioned. You pad the front of the array with another array with the number of elements equal to the sample rate times the delay. Try the attached modification. With the value of the new elements set to NaN, they will not be displayed on the graph.
Message 9 of 10
(3,072 Views)
Thanks alot! Works perfectly and faster!
0 Kudos
Message 10 of 10
(3,066 Views)