PDA

View Full Version : IsoPodX state machine question


kmowbray
08-13-05, 12:07 PM
I am attempting to implement the following state machine (modelled after the SLOW_GRN example:

LOOPINDEX CYCLE-COUNTER
DECIMAL 100 CYCLE-COUNTER END
1 CYCLE-COUNTER START

MACHINE SERVO_TEST

ON-MACHINE SERVO_TEST
APPEND-STATE FULL_CLOCKWISE
APPEND-STATE FULL_COUNTER
APPEND-STATE CENTER_0
APPEND-STATE CENTER_1

IN-STATE CENTER_0
CONDITION CYCLE-COUNTER COUNT
CAUSES ALL_CENTER
THEN-STATE FULL_CLOCKWISE
TO-HAPPEN

IN-STATE FULL_CLOCKWISE
CONDITION CYCLE-COUNTER COUNT
CAUSES FULL_CW
THEN-STATE CENTER_1
TO-HAPPEN

IN-STATE CENTER_1
CONDITION CYCLE-COUNTER COUNT
CAUSES ALL_CENTER
THEN-STATE FULL_COUNTER
TO-HAPPEN

IN-STATE FULL_COUNTER
CONDITION CYCLE-COUNTER COUNT
CAUSES FULL_CCW
THEN-STATE CENTER_0
TO-HAPPEN

CENTER_0 SET-STATE
INSTALL SERVO_TEST

The routines FULL_CW, ALL_CENTER and FULL_CCW all work when I type the commands. This state machine does not appear to start. In other words nothing happens.

Any ideas?

Thanks

RMDumse
08-13-05, 02:14 PM
Well, this may not be it, but the first thing I notice, is the counter is never reset. So the beginning number is not known.

In your initialization,

CENTER_0 SET-STATE
INSTALL SERVO_TEST

try adding a reset of the counter first

CYCLE-COUNTER RESET
CENTER_0 SET-STATE
INSTALL SERVO_TEST

The delay should be 1 second by default (although I think you actually get 99 instead of 100 periods because you start at 1 instead of 0) . If the counter was initally sitting at a count of 200 for instance, it might take a minute before it would start. So try that and let me know. If that isn't it, we'll look further.

kmowbray
08-14-05, 09:52 AM
I added the CYCLE-COUNTER RESET statement and I observed no difference.

kmowbray
08-14-05, 10:22 AM
I had a SCRUB statement as the first command in my file.

When I remove the SCRUB statement, the program works as expected.

Is this a side-effect or what? I was under the impression the SCRUB statement cleared all/any previously stored statements.

Thanks,

RMDumse
08-14-05, 11:39 AM
I had a SCRUB statement as the first command in my file.

When I remove the SCRUB statement, the program works as expected.

Is this a side-effect or what? I was under the impression the SCRUB statement cleared all/any previously stored statements.

Thanks,

Yes, somewhat of a side effect. The difference between the intended document (IsoPod User Manual) and the actuall implimentation by the programmer. The original intention was the scheduled runs start up after reset, but the SCRUB shuts them down before clearning things, and then doesn't start them up again.

What is missing is ISOMAX-START prior to INSTALL xxxx.

Try this initialization:

CYCLE-COUNTER RESET
ISOMAX-START
CENTER_0 SET-STATE
INSTALL SERVO_TEST

kmowbray
08-15-05, 05:09 PM
That fixed things up!

Thanks for the support.