04-29-2014
10:47 AM
- last edited on
04-28-2025
09:52 AM
by
Content Cleaner
We are developing a simulator, a tool to train operators of a hydraulic power plant. We modeled the power plant in LabVIEW. The problem we are facing is that we need to save and restore the memory state of all under a certain VI, VIs that describe the power plant. In other words we need a snapshot of the model to restore the simulation process, even after a computer shut down.
Since there is no command to save VI's memory directly (we hope it become available) we manage to save all data except the information on the Shift Registers and Feedback Nodes in Reentrant SubVIs. We already talked to NI guysl, but only workarounds where presented, no a real solution.
According to NI a VI has four major components (https://www.ni.com/docs/en-US/bundle/labview/page/vi-memory-usage.html). Does anyone knows how to save and recover certain VIs the “data” memory?
04-29-2014 12:18 PM
Are you looking for a way to save, and load every value, on every wire of all VIs in an application? That is far too much data and much of it is going to be duplicates anyway. Write code to load and save the things you care about if this is the case.
If you are not asking for that and instead are just looking for a way to Save and Load front panel control and indicator values, then you should look into the OpenG Write Panel to INI and Read Panel from INI. Running this will save your VIs controls to a human readable INI file and then can load them back.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-29-2014 01:32 PM
I need to save the “state” of a VI, a “snapshot”. The idea is to continue running the process later, after I turned the computer off and back on. I was able to save individually all data to get back at same state, except the information placed in Shift Registers and Feedback Nodes placed on Reentrant VIs.
Trying to fix the only remaining problem, I was able to identify, at runtime, each instance of the reentrants VIs, save and restore the data. The problem is that there is no guarantee that they will be the same instance (number) after a VI change (code editing) or LabVIEW update/upgrade.
LabVIEW has four major areas: Front panel, Block diagram, Code (diagram compiled to machine code) and Data (control and indicator values, default data, diagram constant data, and so on). The ability to save and recover the “Data” information would be a definitive solution. This method can be applied for debugging systems that have data from hardware. Saving the “Data” information of a VI before the problem happens, after the data has been acquired, would allow the developer run the same situation as many times he wants without need to do new acquisitions. To test many possibilities no hardware needed, saving time and resources.
04-29-2014 01:50 PM
I doubt there's any way to implement this as just saving the "data". For instance, if you make a code change to a VI with shift registers in it, then how is LabVIEW supposed to know which shift register the data belongs to?
You'll likely need to save the data from the shift registers and other internal data as well, and then use that to initialize values when you restore a previous state.
04-29-2014 02:13 PM
If a change is made to the code, may not be possible to restore previously saved data, requiring the creation of a new saved “Data”.