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

This is a discussion on How to read a same file several times in a loop? - labview ; 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 ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

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

  1. Default 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?????


    for Mike 2nd one.PNG:
    http://forums.ni.com/attachments/ni/170/326270/1/for Mike 2nd one.PNG


    for Mike 1st one.vi:
    http://forums.ni.com/attachments/ni/170/326270/3/for Mike 1st one.vi


    get several measurement.vi:
    http://forums.ni.com/attachments/ni/170/326270/4/get several measurement.vi

  2. Default Re: How to read a same file several times in a loop?

    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


    for%20Mike%201st%20one_LV80.vi:
    http://forums.ni.com/attachments/ni/...%20one_LV80.vi

  3. Default ??? Re: How to read a same file several times in a loop?

    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

  4. Default Re: ??? Re: How to read a same file several times in a loop?

    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

  5. Default ??? Re: ??? Re: How to read a same file several times in a loop?

    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

  6. Default Re: ??? Re: ??? Re: How to read a same file several times in a loop?

    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

  7. Default ??? Re: ??? Re: ??? Re: How to read a same file several times in a loop?

    Hi Mike
     
    where does the reset input to "true" you mean ? which reset?
     
    Jing
     

  8. Default Re: ??? Re: ??? Re: ??? Re: How to read a same file several times in a loop?

    Hi jing,
    i have insert it into your example.
    Mike


    for%20Mike%201st%20one_LV80.vi:
    http://forums.ni.com/attachments/ni/...%20one_LV80.vi

  9. Default ??? Re: ??? Re: ??? Re: How to read a same file several times in a loop?

    Mike
    yes now I have all data  in one file,
    Jing

  10. Default ??? Re: ??? Re: ???

    Ok ! Mike
     
    Danke sooo.....oooo  much!
     
    Jing

+ Reply to Thread
Page 1 of 2 1 2 LastLast