LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read a same file several times in a loop?

Dear all:
 
I want to read a file several times in a loop from "read from a measurement file", as for every time the result of lower part of my whole VI need to compare the data from the same file from "read from a measurement file".
 
 
But I don't know why, I only can get one correct result for my whole VI, whenever my whole VI run to second time, there will show an error from  "read from a measurement file". The error is "Error 4 occurred at Read From Measurement File -> get several measurement.vi, Possible reason(s):
LabVIEW:  End of file encountered.
=========================
NI-488:  Invalid argument or arguments to function call."
 
and to Mike:
 
I tried to change my VI as your two ways, The first one, although there is no error it still can only get one result, not the number I define for the loop N. The second one, I have wire problems, please check.
 
Thank you for any help!
 
Jing
 


帖子被菁菁在05-26-2008 04:03 AM时编辑过了
0 Kudos
Message 1 of 14
(4,111 Views)

Hi jing,

if a run the attached example the loop runs 7 iterations. So if you really load every time the same file, it should work for you.

Mike

0 Kudos
Message 2 of 14
(4,105 Views)

Hi Mike

It looks run 7 times and no error but I only get one file in the path of "write to a measurement file"

Jing

0 Kudos
Message 3 of 14
(4,093 Views)

Hi jing,

it could be, because you have everytime the same path. You can use the "Format into String function" to add the loop count to your filename.

Mike

0 Kudos
Message 4 of 14
(4,091 Views)
Hi Mike
 
The "configure write to measurement file" I choose "If a file already exists Rename existing file"
Is that possible when the second file come the file can be named "backup" or something like this? and I still can get the 7 files just the name is backup or?
 
Jing
0 Kudos
Message 5 of 14
(4,088 Views)

Hi jing,

yes you are right, this should also work. You should have all data now in one file, right? Change the reset input to "true". This should work.

Mike

0 Kudos
Message 6 of 14
(4,085 Views)
Hi Mike
 
where does the reset input to "true" you mean ? which reset?
 
Jing
 
0 Kudos
Message 7 of 14
(4,083 Views)

Hi jing,

i have insert it into your example.

Mike

0 Kudos
Message 8 of 14
(4,079 Views)

Mike

yes now I have all data  in one file,

Jing

0 Kudos
Message 9 of 14
(4,078 Views)
Ok ! Mike
 
Danke sooo.....oooo  much!
 
Jing
0 Kudos
Message 10 of 14
(4,075 Views)