LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i save the output array of the invoke node "commands values" into a specific file

I must save the setup of vi commands'. I use an invoke node called "command value" wich give me an array with the name of the specific command and his value. How can i save this array into a specific file to load it later if o need. Must i change the array format?
Thank you
0 Kudos
Message 1 of 12
(4,763 Views)
Can you attach some example code that shows how you are getting the array and then give us an idea of how you want to save it? We should be able to get to the right format for you from that.
0 Kudos
Message 2 of 12
(4,733 Views)
Alexis,

I think you might mean "control" instead of "command." There's a VI method called Get All Control Values that returns an array like the one you are describing.

One answer for you is that you can use Advanced >> Data Manipulation >> Flatten To String to turn your control value array into a string that you can easily save to file with the high-level file I/O VIs. You can also use the more advanced VIs to save your array to file without converting to a string first (explore the help and the examples on Read File, Write File, etc. to learn about all your options here).

If your real goal is to load and save default control settings, then you will find a wealth of different techniques for doing so by searching this site for "labview default values" or similar.

Regards,
John
Message 3 of 12
(4,728 Views)
Hi,

I have attached two VIs.
The first one "Ecriture fichier tableau" (writer) permits to collect all control's values in an array (dbl) and to save it as .bin file. You had to convert variant type into dbl type. (You can do the same with string type if you wish. You will save datas as .txt file for example)
The second VI "Lecture tableau fichier" (reader) permits to retrieve all the datas you saved in the file.

I think this responds to your question.
Regards,
Message 4 of 12
(4,711 Views)
Hello,

First of all thank you for your help. But now i've got another problem but it seems to be the last one.
I've attached two vi wich get all control's values and save it, and another one which load saved files and must load it on the front panel. When i use the load vi i see that it's load names and values in array but i think that the invoke node "Set control value" doesn't work, or i don't use it correctly. Can you help me please?

Regards
alexis
0 Kudos
Message 5 of 12
(4,686 Views)
Bonjour,

Je vous conseille d'enregistrer directement vos données à la sortie du "get control values". Vous n'êtes pas obligé de décomposer chaque type d'élément. De plus, au moment du "set control value", il manque la référence du VI ainsi que les commandes dans lesquelles les valeurs vont venir s'afficher.

Je vous ai joint un dossier qui contient deux VIs qui reprennent ce que vous souhaitez faire.
Je vous en souhaite bonne réception.
Cordialement

David D.
Message 6 of 12
(4,680 Views)
Bonjour,

Merci, pour l'aide. Cependant bien que la sauvegarde marche très bien je ne parvient pas à charger les données après, je croyais que c'était le path qui n'était pas bon mais il semblerait que non.
Je vous envoie l'exemple sur lequel je travaille afin que vous voyez le VI dans son entier peut etre est-ce tout autre chose.
Je suis bien bloqué merci d'avance pour votre aide

Cordialement
Alexis COLLIN
0 Kudos
Message 7 of 12
(4,665 Views)
 
0 Kudos
Message 8 of 12
(4,631 Views)
Hello


I have problem's when i load data files wich contains controls names and values. I save this file with labview and get the values with "get all controls values".I have attached my VI's with everything in can you take a look on it and help me.

Thank you

Regards

Alex
0 Kudos
Message 9 of 12
(4,631 Views)
Alexis there is another option that I think might work better for you. LabVIEW has what you are trying to do built in.

What you are looking for is the "Data logging" Option under the operate menu. I would suggest searching for datalagging in the VI how to help. It will start to help you reach your goal.

Basically you can tell the VI to automatically save its data to a file, which LabVIEW can then read back in later. So say you ran it once a day it would save Mon, Tue, and Wed final values.

If on Thursday you wanted to start with one of those days values, you can just select them.

If you want to do this programatically you need to place your VI as a SubVI of another VI. Then right-click on the VI and select "Enable Database Access". You will get a yellow "halo" around the SUbVI, which has inputs you can use to select which dataset you want to use. Lastly configure your VI to open its front panel when it is called and you are done.
0 Kudos
Message 10 of 12
(4,618 Views)