LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to repeatedly save my data ?

Greetings me newbie,
How to repeatedly save my data ?Here i can only save the data once?Thanksyou
0 Kudos
Message 1 of 11
(4,320 Views)
Hi,
Set your 'Open/Create/Replace.vi' to 'open or create' and set the 'write file.vi' posmode to 'end'. This will append any new data to the file.
0 Kudos
Message 2 of 11
(4,312 Views)
Greetings,
What you meant by set the 'write file.vi' posmode to 'end'? By the way my function is already set to open and create.
0 Kudos
Message 3 of 11
(4,305 Views)
Hi keeper,

The 'Write/Create/Replace File.vi' is set to 'create or replace' in your example.
Nevertheless, on the 'Write File.vi' wire right click on the 'posmode(0:2)' terminal, select 'create constant' and choose 'end'.

Hope this helps.
0 Kudos
Message 4 of 11
(4,302 Views)
Greetings,
Sry but it still cannot be done.It still only records one data only.
0 Kudos
Message 5 of 11
(4,295 Views)
Hi,
Put the open/create/replace file.vi and close file.vi outside of the while loop.

Brs,

George.
0 Kudos
Message 6 of 11
(4,271 Views)
Greetings,
Cant do that as it might cause some errors in other events...Anyone else can help me?Thanks you
0 Kudos
Message 7 of 11
(4,262 Views)
Hi Keeper

I modified your program as DavidT suggested and it works fine ie a new row of data every time you press the Save File button. I would have another try.
0 Kudos
Message 8 of 11
(4,258 Views)
Greetings,
But i want it to save all the data coming in when i only press the save button once. when i wanna stop saving i press "stop" or "something" to stop saving...Not everytime i press then i saved the data ... i can do it last time b4 i had the event structure but not wif it i cannot do it.. Thanks you
0 Kudos
Message 9 of 11
(4,255 Views)
Hi Keeper
The code in the event stucture only operates once when the button value changes, for continuous logging you need to bring the file vi's out from the event structure into the main body of the while loop. See the attached picture. Watch out though your Save File button has it's 'Mechanical Action' set to 'Latch when Released' you need to swap this to 'Switch when pressed'. (Right click on the button to change this.

I hope this gives you what you're looking for.
0 Kudos
Message 10 of 11
(4,244 Views)