|
file i/o
Is it possible to open a file off the crio read or write to the file and close the file all inside of a while loop. I have been able to open the file outside of the loop, then read or write to the file inside of the loop and close the file after the while loop is done but this stops me from being able to choose from a bunch of files on the fly while the loop is running and open / close the files as needed.
When I move the open/close's inside of the loop the fileref number increases at the same speed as the iteration counter for that loop.
I would post a sample of what I have been trying to do but can't seem to find it on my system.
what i'm trying to accomplish is the ability to create a series of "macro" files that we can update in teleop mode by choosing which one we want to update. press a button or two on the joystick run the robot on the field for 15 seconds and then close the file.
then in the "other" or disabled state i want to be able to select one of those file and when we enter into auto enabled open and run that file then close the file before we enter teleop mode.
Thank you for any help.
|