Go to Post As usual, I mistakenly look for a technical solution to a social problem. - MrForbes [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-12-2002, 21:21
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
Muiltiprograms

Last year was my first year as programmer and I was a freshman who just happened to have a computer so I got the job. I know that sounds like a bad idea but that is what happened.
Anyway what my question is, How do I download multi-programs to the controller? I know how to call other programs but how do I install them with out overwriting the first?
  #2   Spotlight this post!  
Unread 13-12-2002, 22:37
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Use the {$STAMP} directive to tell the BASIC Stamp Editor the names of the program files that belong in the other slots.

Let's say you have a Prog0.bsx which does the initialization, Prog1.bsx contains the main program loop, and Prog2.bsx contains the serout command. Prog0.bsx will need to contain the following line:

Quote:
{$STAMP BS2SX, Prog1.bsx, Prog2.bsx}
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #3   Spotlight this post!  
Unread 13-12-2002, 22:46
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
Ok that makes sence but is/are there any limitations to the other programs and what variables are carried over between programs?
  #4   Spotlight this post!  
Unread 13-12-2002, 23:07
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
You need to remember that the 26 bytes of variable storage are shared between all program slots. This means that you either need to insure that all variables are defined identically in all your programs, or you will have to assume that none of your variables will be preserved whenever you execute the run command.

I go with the former strategy, and to help me accomplish this, I wrote a BASIC Stamp Preprocessor which allows me to include a file which contains all data definitions into all my source files.

The preprocessor is available in the Programming section of the White Papers.

The older versions of my white paper have gone missing, and the one that is currently there only mentions the features added in that version of the program. Hopefully, this weekend I will be able to upload an update of the preprocessor and some more complete documentation.

In the mean time, you will need to know that the syntax for including a file is:
Quote:
{$INCLUDE file}
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #5   Spotlight this post!  
Unread 14-12-2002, 09:20
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
OK. I think I understand but is there a way to undeclare varibles. ie I would want to undeclare the varibles in a automation program so I would have more variables to work with.
  #6   Spotlight this post!  
Unread 14-12-2002, 10:40
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
I'm not sure I understand what you mean when you say undefine.

Of course you can delete variable definitions that you don't need. If you need a variable in one of your program slots that you don't need in another, then you'll need to be a little more creative.

We usually have a pool of temporary variables which may be used locally (within a subroutine or program slot) which may be used elsewhere with impunity.

These temp variables are named temp1, temp2, etc. We then either use those variables directly, or alias them to something like temp1_tableOffset, temp2_scaledY, etc.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me

Last edited by Greg Ross : 14-12-2002 at 10:42.
  #7   Spotlight this post!  
Unread 14-12-2002, 16:41
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
I mean to undeclared or define the varibles for the IO. If I could do this then I would have more varibles to work with. I want to do this to because it would alow more to be done, but if I am understanding your post it can't be done and I should keep trying to use less varibles.
  #8   Spotlight this post!  
Unread 15-12-2002, 01:08
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Are you talking about inputing, for example, p1_x sometimes and not inputing it at others? If so, my advice would be to still input it for simplicity, but immediately after the serin change its value to whatever you want it to be. Likewise, you can always alias a more convient name to use the same space as p1_x. For example:

newVarName VAR p1_x

just remember that anything you write to newVarName will also change the contents of p1_x, and vice-versa.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #9   Spotlight this post!  
Unread 15-12-2002, 08:22
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
That makes sense now. It is not really what I wanted but I guess it will have to do. I think what I want is not possible in the code. Thank you for your help.
  #10   Spotlight this post!  
Unread 15-12-2002, 12:17
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
True, "undefining" variables is not possible as they are created at compile time by the PBASIC interpreter. However, as I said previously, you can always pretend they don't exist and use them for something else. If that's not what you are looking for, would you mind posting some more details? There's always a way to do pretty much anything you want, sometimes it's just a little more complicated.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #11   Spotlight this post!  
Unread 15-12-2002, 12:36
rust710's Avatar
rust710 rust710 is offline
Registered User
#0862 (Lightning Robotics)
 
Join Date: Dec 2002
Location: Canton, MI
Posts: 103
rust710 is an unknown quantity at this point
Send a message via AIM to rust710
No I guess that will have to do. It is not so much not what I wanted as not what I wanted to hear. I wanted to undeclare the OI variables if they are not needed like if automation is required for half the match or something similar.
Closed Thread


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


All times are GMT -5. The time now is 19:31.

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