Stat Function

Returns the execution status information of the controller.

Syntax
Stat(address)

Parameters

address
Specifies an address (integer between 0 and 2) indicating the controller status.

Return Values
Returns a 4 byte value that presents the status of the controller. Refer to table below.

Description
The Stat instruction returns information as shown in the table below:

Address Bit Controller Status Indicated When Bit is On
0 0-15 &H1 to &H8000 Task (1~16) is being executed (Xqt) or in Halt State
16 &H10000 Task(s) is being executed
17 &H20000 Pause condition
18 &H40000 Error Condition
19 &H80000 Teach mode
20 &H100000 Emergency Stop Condition
21 &H200000 Low Power Mode (Power Low)
22 &H400000 Safeguard Input is Closed
23 &H800000 Enable Switch is Open
24 &H1000000 Undefined
25 &H2000000 Undefined
26 &H4000000 Test mode
27 &H8000000 T2 mode
28-31 Undefined
1 0 &H1 Log of Stop above target position upon satisfaction of condition in Jump...Sense statement. (This log is erased when another Jump statement is executed).
1 &H2 Log of stop at intermediate travel position upon satisfaction of condition in Go/Jump/Move...Till statement. (This log is erased when another Go/Jump/Move...Till statement is executed
2 &H4 Undefined
3 &H8 Log of stop at intermediate travel position upon satisfaction of condition in Trap statement
4 &H10 Motor On mode
5 &H20 Current position is home position
6 &H40 Low power state
7 &H80 Undefined
8 &H100 4th Joint motor is on
9 &H200 3rd Joint motor is on
10 &H400 2nd Joint motor is on
11 &H800 1st Joint motor is on
12 &H1000 6th Joint motor is on
13 &H2000 5th Joint motor is on
14 &H4000 Axis T motor is on
15 &H8000 Axis S motor is on
16 &H10000 7th Joint motor is on
17-31 Undefined
2 0-15 &H1 to &H8000 Task (17~32) is being executed (Xqt) or in Halt State

See Also
EStopOn Function, TillOn Function, PauseOn Function, SafetyOn Function

Stat Function Example

Function StatDemo

    Integer rbt1_sts
    rbt1_sts = RShift((Stat(0) And &H070000), 16)
    Select TRUE
        Case (rbt1_sts And &H01) = 1
            Print "Tasks are running"
        Case (rbt1_sts And &H02) = 2
            Print "Pause Output is ON"
        Case (rbt1_sts And &H04) = 4
            Print "Error Output is ON"
    Send
Fend