LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Choice of the file for saving data

I have an appication, I have an sub vi named «Entrées Consignes », Id like save the différentes data which I enter in the list in a file when I click to Modifier Données.I think saving my data but when I open my file , I don't read the good values .
What I do?
My second question is, when I enter the differents values in the list, I'd like that when I close this vi and I open again, the same values display instead of zero everywhere.
Is it possible?
Thanks a lot for helping me.
Bye!!
0 Kudos
Message 1 of 6
(2,749 Views)
Les données sont correctement enregistrées, mais pas sous une forme directement lisible avec un éditeur de texte (Word, Excel...). Elle sont codées directement sous forme binaire, et il faut réaliser le décodage inverse pour les retrouver. C'est ce que fait le vi attaché, en demandant la lecture du fichier, et en précisant que les données sont un cluster de 6 nombre flottants en double précision...
Ce même vi peut d'ailleurs être utilisé pour "recharger" les valeurs des contrôles lors du lancement de votre vi. Mais pour celà, il faut connaître le nom du fichier à relire, et ensuite utiliser des variables locales pour écrire dans les différents contrôles.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 6
(2,741 Views)
The attached vi will open the file, read the data previously saved, store it into your controls, allow you to modify, and write back to the same file.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 6
(2,736 Views)
Hello,
I try to run the vi EntrConsignes[1].vi with the file which contain the 6 data, but I can't see the displaying, then I bring a modification in my method but I am not sure if it is good.I send the file EntrConsignes[modif].I send you also the file which contains the data. TextFile2
My second question why to change the data to string before save it in the file?
May be for visualize the file .
0 Kudos
Message 4 of 6
(2,725 Views)
Hello,
I try to run the vi EntrConsignes[1].vi with the file which contain the 6 data, but I can't see the displaying, then I bring a modification in my method but I am not sure if it is good.I send the file EntrConsignes[modif].I send you also the file which contains the data. TextFile2
My second question why to change the data to string before save it in the file?
May be for visualize the file .
0 Kudos
Message 5 of 6
(2,725 Views)
I like to convert the data to a string so that I can see the numbers when I open the text file with Notepad or Word. Your method, and the one described by Chilly Charlie works also, but if you open the file, you cannot see the numbers because the data is in binary format. But if you run your vi, change the data, click the modify button, it saves the new data to the file. You can see this by closing the vi, and opening it again. When you run it, the latest data is shown. So your vi works like you want it, just you cannot see the data in the file with a word processor.
- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 6
(2,721 Views)