04-05-2021 08:51 AM - edited 04-05-2021 08:52 AM
Hello Folks,
I am developing a GUI for doing a transfer function measurement using a function generator and an oscilloscope. Due to restriction, I cannot be able to post my whole program but I made a demo and attached herewith.
Till now saving and loading control data values is working but I cannot get any idea how can I save and restore all indicator and waveform graph data.
What I’m trying to do any values that are present in all indicator, control, and last data in the waveform graph will be saved by using the SAVE button (in a file). Then from that file restoring all values in indicators, controls, and waveform graph will be possible.
I need urgent help. Thanks in advance for your precious time.
Till then,
- Reduanul
04-05-2021 09:15 AM - edited 04-05-2021 09:16 AM
Last time I did something like this was a slightly different implementation. This was for a solar system and I had 24hour graphs of solar, input output, etc. I used an X/Y graph and saved the data point to a temporary file at the same time as I plotted it. If the program was stopped and restarted the user was given an option to restore the graphs.
If you use a waveform graph, just save the waveform to a file and restore in on start up.
04-05-2021 11:01 AM
Instead of just the term "all controls & indicators" if you know statically the controls and indicators, you could read all those controls & indicator data on SAVE button click and structure the data appropriately (like cluster) and write to a file (like binary) and on relaunch (or READ button click), read that file and write the data to respective controls & indicators.
Since this is an application-level requirement, you would need to be the judge of what is required and implement what you want.
04-05-2021 12:24 PM
@ RTSLVU,
Thanks for your heads up.
Actually I'm also using XY graph in my main program. But as an inexperience programmer in LabVIEW I'm not getting the analogy for saving and loading waveform graph data. Most importantly how same save button will save continuous waveform graph data ?
Is it possible to give any idea on my demo file ?
04-05-2021 01:00 PM - edited 04-05-2021 01:06 PM
@REDUANUL wrote:
@ RTSLVU,
Thanks for your heads up.
Actually I'm also using XY graph in my main program. But as an inexperience programmer in LabVIEW I'm not getting the analogy for saving and loading waveform graph data. Most importantly how same save button will save continuous waveform graph data ?
Is it possible to give any idea on my demo file ?
This is my "Grid Graph" VI. It displays the power bought and sold to the electrical grid over a 24 hour period.
I used what we like to call an "Action Engine".
The Action engine has four "actions"
So on program startup I offer the user a chance to restore the previous data, as when working with Watthours and solar harvest it's important to not lose half a days data if the program had to be restarted.
Every time I take a measurement, send it an array, call this vi, and Write
Initially at midnight every night I would call this VI and Clear the chart, but after I added the save to file and restore. I started calling it to Initialize so it would delete yesterday's temp file.
There are probably better ways (memory usage wise) to do this but I had this running for years. Sometimes updating the graph at one second intervals for months and never had an issue.
Edit: Attached the graph control