04-11-2014 12:25 PM
I have saved to file and I have used the save to file function.
It works well and for each run I have 6 values, however on the second run there, the first new value replaces the old first value but others work well.
What can I do?. I set the position to end for each value collected.
Thanks
Solved! Go to Solution.
04-11-2014 12:37 PM
It's impossible to debug a paragraph.
Try attaching your VI.
04-11-2014 01:33 PM
I attach the VI.
Thanks
04-11-2014 01:49 PM
I think you would benefit greatly from looking at the LabVIEW tutorials.
A few things right off the bat:
Try and get away from using Stacked Sequences to repeat code. You'll do much better with a state machine or by using a subVI.
Don't use a local variable for the FileRefnum. Use the wire itself.
04-11-2014 01:56 PM
Thanks.
I know how to use a state machine but then this is a relatively simple program and runs peferctly but for the svaing option.
I would trying using the wire for the file refnum
Thanks
04-11-2014 02:19 PM - edited 04-11-2014 02:19 PM
Hi concacid,
even for this "relatively simple" program you should THINK DATAFLOW and use wires in favor of local variables…
In your case an autoindexing loop for your 6 channels would be ok too!
That being said:
- Using file refnums should append writes at the end of the file. Please test this after replacing all "refnum out" variables by wires.
- When you insist on using SetFilePosition you should set the write position before doing the actual write, not afterwards. Seems more logical to me…
04-11-2014 03:18 PM
@GerdW wrote:
Hi concacid,
even for this "relatively simple" program you should THINK DATAFLOW and use wires in favor of local variables…
In your case an autoindexing loop for your 6 channels would be ok too!
That being said:
- Using file refnums should append writes at the end of the file. Please test this after replacing all "refnum out" variables by wires.
- When you insist on using SetFilePosition you should set the write position before doing the actual write, not afterwards. Seems more logical to me…
Thank you!
Points noted
04-11-2014 06:31 PM
The state machine and 'all wires' did the trick.
Scrap the local variable then. Its more or less useless.
Thanks guys