Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

RoboBAsic and ACTION command

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
6 postsPage 1 of 1
6 postsPage 1 of 1

RoboBAsic and ACTION command

Post by robots42 » Wed Jul 30, 2008 4:27 pm

Post by robots42
Wed Jul 30, 2008 4:27 pm

Hi
Looking throufg the Forum posts to see if my previous questions had already been resolved I came across one about ACTION
Somebody seems to have got it to work but I can't.

What does ACTION do?
on testing
ACTION 5 'this does K7, but only once after reset or power on!!!??? why?

Anybody know?
David
Hi
Looking throufg the Forum posts to see if my previous questions had already been resolved I came across one about ACTION
Somebody seems to have got it to work but I can't.

What does ACTION do?
on testing
ACTION 5 'this does K7, but only once after reset or power on!!!??? why?

Anybody know?
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by i-Bot » Wed Jul 30, 2008 5:19 pm

Post by i-Bot
Wed Jul 30, 2008 5:19 pm

To understand the action command you must really understand how the template works.

The start of the template
GOTO AUTO
FILL 255,10000

compiles to:
0x10 @0x40 = 0
0x15 GOTO [ 0x2728]

then 10000 nops
so the next line
IF RR > 50 AND RR < 83 THEN GOTO action_proc
will sit at location 0x2728 and subsequent code loaded there

If the template is run it operates as expected.

The important thing is that when a new program is stored lower in memory the template is not overwritten, so you can still call the template routines from a program which does not have the fill instruction.

In this lower program you use the ACTION command
ACTION 5 will compile to:
@0x40 = 55 ' location 40 is the first variable and is RR
GOSUB [ 0x2728]

so the ACTION will call the template routine
To understand the action command you must really understand how the template works.

The start of the template
GOTO AUTO
FILL 255,10000

compiles to:
0x10 @0x40 = 0
0x15 GOTO [ 0x2728]

then 10000 nops
so the next line
IF RR > 50 AND RR < 83 THEN GOTO action_proc
will sit at location 0x2728 and subsequent code loaded there

If the template is run it operates as expected.

The important thing is that when a new program is stored lower in memory the template is not overwritten, so you can still call the template routines from a program which does not have the fill instruction.

In this lower program you use the ACTION command
ACTION 5 will compile to:
@0x40 = 55 ' location 40 is the first variable and is RR
GOSUB [ 0x2728]

so the ACTION will call the template routine
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by robots42 » Fri Aug 01, 2008 1:42 am

Post by robots42
Fri Aug 01, 2008 1:42 am

Thank you.
I would never have imagined that from the manual. Is there a document somewhere with it in?
The reason 5 ran 7 was because I had altered the range of the Action command check from (50 - 82) to (48 - 88) as this allowed me to use the PC keyboard to send 0-9 and A-W via the programming cable.

So now I understand what GOTO AUTO and FILL do, I guess there could have been a range of nested programs except that I can't get it to work if FILL is not FILL 255,10000. Ie FILL 255,5000 doesn't work.
I may be missing something but why would anyone want to split their program into two with such primitive parameter passing?
David
Thank you.
I would never have imagined that from the manual. Is there a document somewhere with it in?
The reason 5 ran 7 was because I had altered the range of the Action command check from (50 - 82) to (48 - 88) as this allowed me to use the PC keyboard to send 0-9 and A-W via the programming cable.

So now I understand what GOTO AUTO and FILL do, I guess there could have been a range of nested programs except that I can't get it to work if FILL is not FILL 255,10000. Ie FILL 255,5000 doesn't work.
I may be missing something but why would anyone want to split their program into two with such primitive parameter passing?
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by i-Bot » Fri Aug 01, 2008 8:48 am

Post by i-Bot
Fri Aug 01, 2008 8:48 am

There is no manual. I have a small Visual c# program which dumps the .obj file to display the code created by the compiler. Then I look at the disassembled source for the controller to figure it out.

The fill only works for 10000. The AUTO location 0x2728 is hardcoded. The GOTO is 3 bytes long, so the next location is 10000 nops + 0x18 = 0x2728.

I wonder if the name "overall" for the template should have been "overlay". Anyway, I don't use the GOTO AUTO. Too confusing, and as you say makes a second use of location RR.
There is no manual. I have a small Visual c# program which dumps the .obj file to display the code created by the compiler. Then I look at the disassembled source for the controller to figure it out.

The fill only works for 10000. The AUTO location 0x2728 is hardcoded. The GOTO is 3 bytes long, so the next location is 10000 nops + 0x18 = 0x2728.

I wonder if the name "overall" for the template should have been "overlay". Anyway, I don't use the GOTO AUTO. Too confusing, and as you say makes a second use of location RR.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by robots42 » Fri Aug 01, 2008 6:48 pm

Post by robots42
Fri Aug 01, 2008 6:48 pm

I don't know what I did wrong before but FILL works with any byte value, and any number of bytes bigger than the size of the low memory program which must be loaded second.
Can't call program3 from program2 though.
Also can't pass back parameters using Var1, it always seems to be 3 after a return to program1.
(Var1 is first variable).

I think maybe it was for all the moves to be in Prog2 while Prog1 held the Remocon key mapping then alternative Prog1s could be loaded for different scenarios, being small they load fast.
David

I have been rewriting the RoboBasic Manual as html because I got fed up with all the C2000 stuff and the non searchable pages. I will put it up here when done. Did you write the big table of byte commands? I would like to add such a table to the manual so all the information is in one searchable place. and is there an uptodate version? I have come across two modifications to the table in the posts.
David
I don't know what I did wrong before but FILL works with any byte value, and any number of bytes bigger than the size of the low memory program which must be loaded second.
Can't call program3 from program2 though.
Also can't pass back parameters using Var1, it always seems to be 3 after a return to program1.
(Var1 is first variable).

I think maybe it was for all the moves to be in Prog2 while Prog1 held the Remocon key mapping then alternative Prog1s could be loaded for different scenarios, being small they load fast.
David

I have been rewriting the RoboBasic Manual as html because I got fed up with all the C2000 stuff and the non searchable pages. I will put it up here when done. Did you write the big table of byte commands? I would like to add such a table to the manual so all the information is in one searchable place. and is there an uptodate version? I have come across two modifications to the table in the posts.
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by robots42 » Sat Aug 02, 2008 4:27 pm

Post by robots42
Sat Aug 02, 2008 4:27 pm

Slight problem before with not clearing memory!!!!!!
FILL does need to be 10000 for Auto to work
David
Slight problem before with not clearing memory!!!!!!
FILL does need to be 10000 for Auto to work
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England


6 postsPage 1 of 1
6 postsPage 1 of 1