07-13-2023 04:31 PM
Dear Community members,
I am having a hard time with fixing the timestamp on waveform chart. I am sharing a pseudo code of my problem. I am trying to get multiple plots on the wavechart. I am bundling all the data and passing to waveform chart. I also set the properties as "system time" so that it gets time stamp on X axis. However, for some reason, the time stamp starts from 1903.
So I tried "build waveform", it fixes the issue with date and time. However, I cannot add multiple plots in it.
Can you suggest a solution for this? Thank you.
Solved! Go to Solution.
07-13-2023 06:27 PM
07-13-2023 09:50 PM
In your Chart, did you specify the X axis as "Absolute time", and did you plot your data as a 1D (or 2D if multiple channels) Array? Are you in Alaska?
The reason your Time axis starts at 4 pm on the day before 1 Jan 1904 is that corresponds to t = 0 in Time Zone UTC-8, which corresponds to midnight on 1 Jan 1904, the "time 0" for LabVIEW's TimeStamp "time" data type. In the US, Alaska is UTC-8. If you change the Chart to plot "relative time", the X axis values would start at 0.
Bob Schor
07-14-2023 06:41 AM
@Jarir wrote:So I tried "build waveform", it fixes the issue with date and time. However, I cannot add multiple plots in it.
That chart can accept an array of waveforms, each element being a different plot. Use a FOR loop or Build Array to create this array.
Here is an example from another thread:
07-14-2023 07:20 AM
@crossrulz wrote:
That chart can accept an array of waveforms, each element being a different plot. Use a FOR loop or Build Array to create this array.
This will dramatically increase the complexity of the underlying data structures because each point is basically it's own waveform with its own t0 definition! I really don't recommend that for typical use. You might want to do that if the points are not spaced equally in time, but that's obviously not the case here, where dt is a constant 0.5s
After defining t0 and dt as I showed earlier, you can easily add as many plots as you want, either as an array or cluster. My picture above already shows a chart with two traces. That's all you ever need! Keep it simple!!!
07-14-2023 03:26 PM
I was looking for this to keep the code simple. Thank you!
07-19-2023 10:44 AM
I have two questions. Could you please help?
a. Why did you connect the error of property node to the while loop?
b. What will happen if I leave the XScale Multiplier blank? or what if it doesn't match the sampling rate of the loop?
Thank you.
07-19-2023 12:17 PM
The problem I am facing is that for some reason I am having different "wait time" for each loop. Therefore, the XAxis Multiplier does not match with the sampling rate. So, it changes the time stamp. For example, after 8 hours of experiment. It is 10.10AM. But it shows 8.05 AM or something like that. Do you know a way to fix this?
07-19-2023 12:54 PM
@Jarir wrote:
I have two questions. Could you please help?
a. Why did you connect the error of property node to the while loop?
b. What will happen if I leave the XScale Multiplier blank? or what if it doesn't match the sampling rate of the loop?.
a. Strandard practice for a dataflow language. we want the property node to execute before the while loop. Wihtout the error wire, the while loop and property node run in parallel.
b. The multiplier is the time between points in seconds. If you set it to any random value, your time axis will be wrong. It needs to be based on the update rate of the chart, i.e. the loop rate. You cannot leave it blank, but if you eliminate it, it will assume 1. (or whatever the last setting was when the VI was saved).
07-19-2023 02:26 PM
Is there any other way to get the timestamp only when the loop runs? I can't set a constant xscale multiplier because the wait time for loop depends on one instrument's response, and it varies every loop. Could you please suggest what to do in this situation?
Thanks,
Jarir