Go to Post It's not about the numbers, it's what you can do with them. - AlecMataloni [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 23-03-2009, 00:38
IceStorm IceStorm is offline
Mentor FRC 5046, FTC 8688
AKA: Chad
FRC #5046 (Jacked Up Jackets)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Michigan
Posts: 136
IceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of lightIceStorm is a glorious beacon of light
Send a message via AIM to IceStorm Send a message via Yahoo to IceStorm
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 23-03-2009, 01:51
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: file i/o

You should be able to open files inside of a while loop, and it is normal that the fileref is increasing but...

it sounds like what you really want to do is select a file, which you can easily do from a case structure. im not sure i understand why you need a loop to do this? are you loading many file's contents into an array?
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
Reply With Quote
  #3   Spotlight this post!  
Unread 23-03-2009, 08:25
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: file i/o

To avoid as many changes to your tele, I'd build the array in the tele -- either keep all drive values, or encode them as dT and dDrive. After tele is over, save it to a file by opening writing, and closing. You may also be able to use the Write to binary file and a Close, but I'm not sure if RT will raise the file dialog correctly. You should be able to do file I/O at a pretty good clip, so if you'd rather do it in the loop, go ahead, but don't open and close it for each element you write, or the overhead will cause changes to how your program behaves.

Greg McKaskle
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use the data obtain in one C file to another C file? tommy_chai Programming 8 11-01-2008 02:17
"Error.MCP" file after HEX file trans iwdu15 Programming 1 24-01-2007 20:05
Help! making an inventor file into an autodesk file kjhobin Inventor 5 19-03-2006 23:04
Configuration File? FFnut Programming 2 03-02-2006 17:38
How do we convert a modified user routines file into a valid .HEX file HuskieRobotics Programming 13 28-02-2004 12:12


All times are GMT -5. The time now is 10:36.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi