|
V+ 12.4 Release Notes |
STATE (select)
Return a value that provides information about the robot system state.
The STATE function returns information for the robot selected by the task executing the function.
select Real value, variable, or expression (interpreted as an integer) that selects the category of state information returned, as described below.
When select = 1, the function value returns information about the overall robot state as follows:
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.
Interpretation (when select = 2) No motion instructions executed yet. Normal trajectory evaluation is in progress (including normal acceleration, deceleration, and segment transitions). Motion stopped at a planned location.1 Position error is being nulled at unplanned final location. Motion stopped at an unplanned location due to a belt window violation.2 Decelerating due to a triggered REACTI or BRAKE instruction. Stopped due to a triggered REACTI or BRAKE instruction.b Decelerating due to a hardware error, panic button, or estop instruction. Stopped due to a hardware error, panic button, or estop instruction.b Decelerating due to a stop-on-force condition. Stopped due to a stop-on-force condition. Nulling at completion of a spin motion. Stopped after completion of a spin instruction.
When select = 3, the function value returns information about the current manual control mode as follows:
Interpretation (select = 3) Manual mode without selection. Free-joint mode. Individual joint control. World coordinates control. Tool coordinates control. 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.
Interpretation when bit set (select = 4) Front panel hardware is connected. The PROGRAM START button is pushed. A hardware panic button is pushed. 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.)
Interpretation (select = 5) The VFP is disconnected. Both auto and local are set. Both manual and local are set. Both auto and NETWORK are set. 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.
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:
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/MOVESFWhen 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:
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" ENDNETWORK (real-valued function)
SELECT (device_type, mode) (program instruction and real-valued function)
|
Please submit comments to: techpubs@adept.com |