V+ 12.4 Release Notes

Displays the Table of Contents for the current document
Displays the previous topic in the current document
Displays the next topic in the current document
Displays the Index for the current document

STATE (select)

 
Function

Return a value that provides information about the robot system state.

Usage Considerations

The STATE function returns information for the robot selected by the task executing the function.

Parameter

select Real value, variable, or expression (interpreted as an integer) that selects the category of state information returned, as described below.

Details

When select = 1, the function value returns information about the overall robot state as follows:
Value
Interpretation (when select = 1)
0
Resetting system after robot power has been turned off.
1
A fatal error has occurred and robot power cannot be turned on.
2
Waiting for user to turn on robot power.
3
Robot power was just turned on; initialization is occurring.
4
Manual control mode is active.
5
A CALIBRATE command or instruction is executing.
6
Not used.
7
Robot is under program control.
8
Robot power is on; robot is not calibrated and cannot be moved.

When select = 2, the function value returns information about the current or previous robot motion as follows. These modes can change only when the robot is under program control-that is, when STATE(1) = 7.

Value
Interpretation (when select = 2)
0
No motion instructions executed yet.
1
Normal trajectory evaluation is in progress (including normal acceleration, deceleration, and segment transitions).
2
Motion stopped at a planned location.1
3
Position error is being nulled at unplanned final location.
4
Motion stopped at an unplanned location due to a belt window violation.2
5
Decelerating due to a triggered REACTI or BRAKE instruction.
6
Stopped due to a triggered REACTI or BRAKE instruction.b
7
Decelerating due to a hardware error, panic button, or estop instruction.
8
Stopped due to a hardware error, panic button, or estop instruction.b
9
Decelerating due to a stop-on-force condition.
10
Stopped due to a stop-on-force condition.
11
Nulling at completion of a spin motion.
12
Stopped after completion of a spin instruction.
1
A RETRY command has no effect.
2
A RETRY command completes the previous motion.

When select = 3, the function value returns information about the current manual control mode as follows:
Value
Interpretation (select = 3)
0
Manual mode without selection.
1
Free-joint mode.
2
Individual joint control.
3
World coordinates control.
4
Tool coordinates control.
5
Computer control enabled.

When select = 4, the function value returns information about the controller's front-panel control settings and other hardware status to be read by programs. Interpret the value as a set of bit flags, each of which indicates a corresponding condition.
Bit mask
Interpretation when bit set (select = 4)
1
Front panel hardware is connected.
2
The PROGRAM START button is pushed.
4
A hardware panic button is pushed.
8
The high power on/off button is pushed.

When select = 5, the function value indicates the settings of the controller keyswitches on the external front panel (VFP). (For information on this panel, refer to the Adept MV Controller User's Guide.)
Value
Interpretation (select = 5)
0
The VFP is disconnected.
1
Both auto and local are set.
2
Both manual and local are set.
3
Both auto and NETWORK are set.
4
Both manual and NETWORK are set.

When select = 6, the function returns an indication of whether or not the real-time path-modification facility (alter mode) is enabled. If zero is returned, alter mode is disabled for the current motion. If a nonzero value is returned, alter is enabled, and the low byte of this value contains bits that correspond to the mode specified in the ALTON instruction that initiated the path modification.

When select = 7, the function returns an indication of whether or not the real-time path-modification facility (alter mode) is enabled for the next planned motion. If zero is returned, alter mode is disabled for the next motion. If a nonzero value is returned, alter is enabled, and the low byte of this value contains bits that correspond to the mode specified in the ALTON instruction that initiated the path modification. (This option is available only if your Adept system is equipped with the V+ Extensions option.)

When select = 8, the number of the robot selected by the manual control pendant is returned.

When select = 9, the function returns the time (in seconds) left until completion of the current motion. Zero indicates that no motion is in progress. For continuous-path motions, the value of STATE(9) decreases during each motion until the transition to the next motion, and then the value suddenly changes to the time left in the next motion. That is, STATE(9) does not reach 0 before it is reset to reflect the next motion.

When select = 10, the function returns the percentage of the current motion that has completed. The value 100 indicates that no motion is in progress. For continuous-path motions, the value of STATE(10) increases during each motion until the transition to the next motion, and then the value suddenly changes to close to 0 to reflect the start of the next motion. That is, STATE(10) does not reach 100 before it is reset to reflect the next motion.

When select = 11, the function returns detailed information on which portion of the acceleration profile is currently being generated for the selected robot.
Value
Interpretation (select = 11)
0
Idle, not evaluating trajectory
1
Ramping up acceleration for new segment
2
Constant acceleration section
3
Ramping down acceleration
4
Constant velocity section
5
Ramping up acceleration for the next motion during the transition section between motions
6
Constant acceleration for the next motion during the transition section between motions
7
Ramping down acceleration for the next motion during the transition section between motions
8
Ramping up deceleration
9
Constant deceleration
10
Ramping down deceleration
11
Nulling final errors

When select = 12, the function returns a flag that is set to nonzero when an ALTER program instruction is executed for the currently selected robot, and cleared after the trajectory generator processes the posted ALTER data. This flag can be used to coordinate the execution of ALTER instructions with the processing of the data by the trajectory generator.

When select = 13, the function returns the trajectory generator execution rate in hertz. That is, if the trajectory generator is executed once each major V+ cycle, this function returns the value 62.5.

When select = 14, the function returns the servo code execution rate in hertz. That is, if the servos are executed each 1 msec, this function returns value 1000 (1kHz).

When select = 15, the function returns the number of the motion that is being executed by the selected robot. This number is zeroed when a program that is attached to the robot first begins executing. The counter is reset to 1 at the start of each execute cycle. The value is incremented each time the trajectory generator begins evaluating a new motion (or transitions to a new continuous-path motion). The value of STATE(15) ranges from 0 to ^HFFFF. After reaching ^HFFFF, the value rolls back to 0.

When select = 19 (supported only by V+ version 12.3 and later), the function returns a flag that indicates if the current motion (or the previously executed motion if the robot is stopped) is an optimized motion (i.e., MOVEF or MOVESF). The possible values returned by this function are:
Value
Interpretation (select = 19)
0
Not a MOVEF/MOVESF motion.
1
Depart segment of MOVEF/MOVESF
2
Horizontal segment of MOVEF/MOVESF
3
Final segment of MOVEF/MOVESF

When select = 20 through 27 (supported only by V+ version 12.3 and later), the function returns detailed information on the planned execution time of the current motion (or the previously executed motion if the robot is stopped). Note that , unlike STATE(9) that returns the remaining motion execution time corrected for the monitor speed setting, the values returned by STATE(20) through STATE(27) are the planned values and are not affected by the setting of the monitor speed value. The values (with units of seconds) returned by these functions are:
Select
Information returned
20
Acceleration ramp-up time
21
Constant acceleration time
22
Acceleration ramp-down time
23
Constant velocity time
24
Deceleration ramp-up time
25
Constant deceleration time
26
Deceleration ramp-down time
27
Total motion time (sum of STATE(20) through STATE(26))

Example

The following example shows how the STATE function can be used to determine whether or not a REACTI was triggered during a robot motion:

	REACTI 1001 										;Set up the reaction 	
	MOVES final 										;Start the robot motion 	
	BREAK 										;Wait for the motion to complete 
	CASE STATE(2) OF 					;Decide what happened 	 
	  VALUE 2: 	
		TYPE "Motion completed normally" 
	  VALUE 6: 	
		TYPE "Motion stopped by REACTI" 
	  VALUE 8: 	
		TYPE "Motion stopped by panic button" 
	END 	 
Related Keyword s

CONFIG (real-valued function)

NETWORK (real-valued function)

SELECT (device_type, mode) (program instruction and real-valued function)

STATUS (monitor command and real-valued function)

TASK (real-valued function)

Syntax
TIMER-I

Please submit comments to: techpubs@adept.com

Last modified on: 06/28/2004
Copyright © 2004 by Adept Technology, Inc.
All rights reserved.