01-13-2023 04:54 AM
Hi, I'm trying to display my waveform graph with my previous data. Once I hit the run button, I lose the previous data. I want to be the data "stacked" on the same waveform graph.
For now, the first time I hit the run button, I get
For the second time I hit the run button, I get
So what I want is when I hit the run button, these data to be together in the same waveform graph.
I would be very thankfull for a specific code.
I will also attach my code.
Thank you
Yoo
Solved! Go to Solution.
01-13-2023 05:07 AM
Use a feedback node:
Use 'build array' instead if you want to overlap instead of append
01-13-2023 07:30 AM
With a Graph (as opposed to a Chart), you "draw the entire Graph all-at-once". Generally, graphs are "static", charts are "dynamic" (you basically plot only the "new" points).
To do what you want to do, you can do the following:
Oops -- the Graph can accept either a Waveform or an Array of Waveforms. So, try again (I'm doing this "in my head" as I write this ...)
Bob Schor
P.S. -- I really should write a little test routine to see if this works, but I'll let my colleagues on the Forum take pot-shots at it ...
01-13-2023 09:42 AM - edited 01-13-2023 09:43 AM
As a first step, you probably should go back to the tutorials. Currently, your VI is a "one shot downhill" deal because it does not even have a toplevel while loop. You should have a simple state machine. (I really hope you are not using the "continuous run" button to operate this!!!)
Also think about the problem. If you would append new data forever, you'll eventually run out of memory (OTOH, a chart has a limited history length, discarding the oldest data).
Why is there So. Much. Duplicate. Code????
For example the following could be replaced by a singe FOR loop autoindexing on arrays of waits and booleans. NO need for locals or sequences! Your current code does not guarantee synchronicity between the various "trains". Shouldn't there also be some synchronization between the upper and lower code islands?
01-15-2023 11:38 PM
Thanks everyone for the reply. Everyone helped. I'm now getting in to labview so, my codes are kind of inefficient. I'm working on to imporve it.
Thanks again
Yoo
01-15-2023 11:38 PM
It worked! I got exactly what I wanted using the feedback node + build array.
Thanks a lot!
Yoo