LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read an instruction from a file and wait condition to read the next instruction

How can i read an instruction from a file, for example, "OPEN", and read the condition that i want to read the next instruction?It is to say, i read "open", and i send the instruction by serial port, and i wait the answer of my robot, that is "Done>". My condition to exit of the loop is ">". Then, when i read ">", i want to read the next instruction from a file. How can i do it?

Thanks.
0 Kudos
Message 1 of 3
(2,678 Views)
I am not 100% sure of what your asking, but I will try to give you an answer. 
 
You could open and read all your instructions from your file and place the instructions in a 1d or 2d array. Then when you are ready to read again just pick the element in the array you want to use.
Brian
0 Kudos
Message 2 of 3
(2,661 Views)
I aggree with brian, this would be the best way. if your commands are in the format one command per line, best function would be "read from spreadsheet file". Another way is to use the function "read file" with "line mode" = True, you can call it every time you need the next command.
Greets, Dave
Greets, Dave
0 Kudos
Message 3 of 3
(2,653 Views)