LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Detect if a VI is in memory?

How can I monitorize if my Top VI is in memory?? So every time it closes I can generate a event and save some data?

 

PD: I achived this by calling a subvi in the main vi that looks for it, but when I click the stop button the Main VI wont stop till the subvi has ended, and I want to know it the vi is in memory, so when the Main Vi is not running but in memory I do not want to close my subvi so the main vi is able to stop... 

0 Kudos
Message 1 of 5
(3,048 Views)

Drop a property node, use All VIs in Memory, it will return an array of strings that you can show on your front panel and see all VIs in memory.

 

If you have a lot, you might want to filter the array with the VI you're interested in.

 

Cheers,

2015-04-23 15_40_36-Program Manager.png

0 Kudos
Message 2 of 5
(3,032 Views)
If you close the "Top level VI" who is going to fire the event? And who's going to receive it? And why can't the Vi itself fire the event saying that its closing? And why can't it save the data itself before it closes? And is "monitorize" a real word?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 5
(3,022 Views)

Sorry about my english mike, my problem was that when I clik the stop button, the vi is no longer running and therfore cannot tell me if it's in memory or not, ofc I am saving the data when I stop/close the vi, but If the user simple stops it and then lunches it again with the run button, I dont want to reload from a file becouse all the data is still there. Only when you close the vi and reopen it, everything goes back to default. Whan I end up doing is setting the default value of a string to "Load from File" and conected it to a case structure, then when I run the vi for the first time I change the string to "Values in memory" so any subsecuent stop/re-run does not make a reload. I need to do this since I will have in memory plots with 500K points (wich are beeing decimated) and Im not goign to save them since they are stored already in a database, but reading them is slow so i dont want to re-read everytime I stop/run the vi again wihout closing it.

 

BTW, any thougths on changing a scrollbar size programatically? I guees you cannot simple do it cos propety is not writable.

 

startup.png  

0 Kudos
Message 4 of 5
(2,974 Views)

You can use an uninitialized shift register (e.g. containing a boolean) to see if the VI has been run before. Set it permanently to true when running the VI. It will be true the next time you run it unless the VI has been freshly loaded.

0 Kudos
Message 5 of 5
(2,957 Views)