You have quite a few options to do this, and the
best solution really depends upon what you are wanting to accomplish.
Here are a couple basic options, though.
First, is it
important that you read from the text file each iteration? Could you
simply read out the entire file's position data then cycle through that
data later? If so, you could just read the file once at the beginning
and use a FOR loop to cycle through the points. Here is a screenshot of
example reads a text file with the following data:
will read out the data into a 2D array which can be fed directly into a
FOR loop to cycle through each line of position data. The use of
indexed tunnels allows the FOR loop to only iterate the number of
dimensions of the array (number of rows in this case). Note that when
using the Array to Cluster function, you will need to specify the number
of elements as 7. It does not dynamically adjust. If you must read
from the text file each iteration, here is another simple example using a
simple examples so you would want to make sure and check the robot
status and do proper error handling for each method. Is this close to
what you were looking for? I would also look into the File I/O examples
that ship with LabVIEW for other options.
Yes, since the position array's tunnel is set to be auto-indexed, it will cycle through each line of the 2D array each iteration. When you connect an array to side of a FOR loop, it will be set to auto-indexed by default, so you do not have to change that.