LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save and restore Indicator and waveform graph data

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

0 Kudos
Message 1 of 5
(1,335 Views)

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. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(1,317 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 3 of 5
(1,284 Views)

@ 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 ?

 

 

0 Kudos
Message 4 of 5
(1,269 Views)

@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"

  1. Initialize: Clear chart and indicators, set chart X-Axis, and delete the temp file.
  2. Clear: Clear the charts, indicators, and set X-Axis
  3. Write: Writes a measurement to the chart and temporary file 
  4. Restore: Reads the temporary file and restores the graph and indicators

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

========================
=== Engineer Ambiguously ===
========================
Download All
Message 5 of 5
(1,263 Views)