You are on page 1of 10

MAROUHT9307191E REV B 14.

ADVANCED FUNCTIONS

Table 14–127. Request Menu Macro Description

MACRO ITEM DESCRIPTION


Syntax: Request Menu(request_code, status_reg)
Parameters: request_code - This item determines which event is triggered on the PC. It can be a
value between 0 and 255.
Status_reg - This item is a register which is used to store either the answer or the error
status from the PC. If 0, no register is used and no answer from the PC is reported to the
calling teach pendant program. The teach pendant program always waits for the PC to
answer, but the answer is not placed into a teach pendant register. If an error occurs, the
teach pendant program is aborted.
If status_reg is not 0, this is the teach pendant register that is used to report either the
PC's answer or error status back to the teach pendant program. R[number] is set to
9999 if an error occurs.
The default value of status_reg is 0. This parameter is optional.

Request Menu Sample Teach Pendant Program

PROG TEST1
1: ! Send Event 42
2: ! The PC knows which menu we want
3: ! Automatically wait for PC
4: Request Menu(42,0)
PROG TEST2
1: ! Send Event 42
2: ! The PC knows which menu we want
3: ! Wait for the operator to select
4: ! something on the menu. The Pc
5: ! reports what was selected in R[6]
6: Request Menu(43,6)
7: IF R[6]<9999,JMP LBL[10]
8: ! Error in macro
9: !
10: LBL[10]

14.48 RSI INTERFACE


Remote Sensor Interface (RSI) is a function that facilitates communication with an RSI device.
This function sends position data, etc., to the device, which supports RSI in real time.

The order number of this function is “RSI Interface” (J802).

Sending time is better with this function if one of the following Main boards, with a fast
communication processor (COMM CPU), is ordered.

• Main board C (Force sensor I/F, fast communication processor) A05B-2600-H003

14–493
14. ADVANCED FUNCTIONS MAROUHT9307191E REV B

• Main board F (Force sensor I/F, fast communication processor, I/O Link i slave compliant)
A05B-2600-H006

Data is sent by the robot controller through the Ethernet port UDP communication to the external
device every communication interval of this function regardless of the selected COMM CPU. The
current communication interval is set by means of the system variable $RSI.$INTERVAL.

There are 2 types of Cartesian positional data that this option sends: Measured and Forward. Both
are represented in XYZWPR format.

The Measured Position is the actual position to which the robot moved. The Measured Position is
abbreviated as M_*, where * are each of the XYZWPR positional elements.

The Forward Position is the robot pre-planned position; by default, three interpolation times ahead
of the actual (or Measured) position. Forward Position is abbreviated as F_*, where * are each of
the XYZWPR positional elements.

Figure 14–194 depicts the relationship between the Forward Position and the Measured Position

Figure 14–194. Relationship Between Forward and Measured Position

When the target position is planned in the robot controller, the target position data is immediately
sent to the external device via RSI, but the actual move is delayed by the delay time contained in a
variable ($AVC_GRP[1].$AVC_MODE[2]). Therefore, there may be a delay when this function is
enabled and the delay time is set. The cycle time may become slightly longer; the communication
interval time is set in $RSI.$INTERVAL (units in milliseconds).

Time Before and Distance Before functions would consequently shift by the same amount.

When this option is not ordered, the robot will move just after the target position is internally
planned by the robot controller.

14.48.1 Format of the data sent by the robot

The robot sends XML data that looks like the following:

14–494
MAROUHT9307191E REV B 14. ADVANCED FUNCTIONS

<Rob Type=”FANUC”>
<M_X>-2851.123</M_X>
<M_Y>1931.863</M_Y>
<M_Z>1295.158</M_Z>
<M_W>-91.728728</M_W>
<M_P>17.543543</M_P>
<M_R>177.519519</M_R>
<F_X>2856.183</F_X>
<F_Y>1931.863</F_Y>
<F_Z>1295.158</F_Z>
<F_W>-91.728728</F_W>
<F_P>17.543543/F_P>
<F_R>177.519519</F_R>
<IPOStat>0</IPOStat>
<BMode>3</BMode>
<TRG>0</TRG>
<myRob>0</myRob>
<IPOC>27189883</IPOC>
</Rob>

Figure 14–195. Wireshark Ethernet Log

14–495
14. ADVANCED FUNCTIONS MAROUHT9307191E REV B

Table 14–128. Description of Each Tag

XML Tag Description Unit Value


Rob Type Identifier of the robot - FANUC
manufacturer
M_* Measured position -
X,Y,Z: mm

W,P,R: degree
F_* Forward position -
X,Y,Z: mm

W,P,R: degree
IPOStat Status of the path 0
interpolator. Currently
always 0.
BMode Describes the status of 3 -
mode switch of the robot. 1: T1

2: T2

3: AUTO
TRG Signal "TRIGGER" for - 0/1
device. Static and as a
pulse.
myRob Describes what the robot is -
handling. 0: Workpiece

1: RSI device
IPOC This is incremented at every ms
frame by communication e.g. 16
interval time. possibility to
detect any missing frames. (3rd frames, when
communication interval
is 8ms. This value is 0 when
1st frame.)

14.48.2 Setting

Set the robot controller IP address and subnet mask etc. in the screen displayed by pressing the
following key sequence; MENU -> 6 SETUP -> Host Comm. -> TCP/IP.

Set the following system variables. To enable the change in settings, perform a COLD START
or HOT START.

$AVC_GRP[1].$AVC_MODE[1] Default : 1

14–496
MAROUHT9307191E REV B 14. ADVANCED FUNCTIONS

0: Disable this function (no robot data will be streamed to device)

1: Enable this function

$AVC_GRP[1].$AVC_MODE[2] Default : 0 (Max value is 20)

Delay time

F_* is 3 communication interval faster than M_* when this variable is set to 0.

When you set n to this variable, F_* becomes (n+3) communication interval faster than M_*.

$RSI.$INT_PORT Default:2

1: Using Main board Ethernet port 1 (CD38A)

2: Using Main board Ethernet port 2 (CD38B)

$RSI.$INTERVAL

Communication interval is showed to this variable with ms unit. Value is set at power-on time.

This system variable can’t be changed.

$RSI.$PRIORITY Default:16

Priority of communication task in COMM CPU.

If jitter performance is not enough, change this system variable to lower value.

1 is highest priority.

255 is lowest priority. (Not running.)

$RSI.$PORT_NUM Default:31439

Source port number of the robot in UDP communication.

14.48.2.1 Configuration of the Data Connection

On a PC, using any text editor, create the following configuration XML file and copy it manually
to the controller at the main root of FR:

Its file name can be selected by using RSI_CREATE, which is a KAREL program used to set
the communication setting (Section 14.48.3 ).

e.g. abc.xml

14–497
14. ADVANCED FUNCTIONS MAROUHT9307191E REV B

<CONFIG>
<IP_NUMBER>136.230.168.112</IP_NUMBER>
<PORT>6008</PORT>
<SENTYPE>IPFO</SENTYPE>
<ONLYSEND>TRUE</ONLYSEND>
</CONFIG>

Remarks:

Start tag and end tag should be exactly same case sensitive.

IP_NUMBER = IP address of the RSI device

PORT = Port number of the RSI device.

SENTYPE = Any name describing external device.

ONLYSEND = Unidirectional (TRUE) or bidirectional (FALSE) data connection. Only


Unidirectional (TRUE) is supported. If ONLYSEND is set other than to TRUE, STOP global
alarm “HOST-390 RSI: ONLYSEND in RSI configuration XML should be TRUE” will occur.

14.48.3 KAREL Programs and Builtins

If you ordered “RSI Interface” (J802), KAREL programs, the following builtins are loaded on the
controller. The name of the KAREL programs do not contain the “_I” from the builtin name (e.g.
RSI_CREATE_I -> RSI_CREATE) because it is not acceptable to name the KAREL program and
the builtin the same thing. The arguments of KAREL programs are same as with builtins. There
is no value returned from KAREL programs. If you want to use the following builtins, please
include rsi.ev (environment file) by writing “%ENVIRONMENT RSI” in your KAREL program.

14.48.3.1 RSI_CREATE_I ()

This function sets the communication setting.

Syntax RET = RSI_CREATE_I(File:IN)

14–498
MAROUHT9307191E REV B 14. ADVANCED FUNCTIONS

Table 14–129. RSI_CREATE_I () Elements

Element Description
RET
Type: INTETGER

Return values:

• OK(0): Function executed successfully

If an alarm occurs, the KAREL program will stop with


“INTP-103(RSI_CREATE, 22) Program error” and the
detail (cause code) indicates the reason.
File:IN
Type: STRING

Path and name of the configuration XML file: Ex .fr:abc.xml

14.48.3.2 RSI_DELETE_I ()

This function deletes the communication setting.

Syntax RET = RSI_RESET_I( )

Table 14–130. RSI_DELETE_I () Elements

Element Description
RET
Type: INTEGER

Return values:

• OK(0): Function executed successfully

• If function is not executed successfully the program


is stopping by error.

14.48.3.3 RSI_RESET_I ()

This function does absolutely the same thing as RSI_DELETE_I( ).

Syntax RET = RSI_RESET_I( )

14–499
14. ADVANCED FUNCTIONS MAROUHT9307191E REV B

Table 14–131. RSI_DELETE_I () Elements

Element Description
RET
Type: INTEGER

Return values:

• OK(0): Function executed successfully

• If function is not executed successfully the program


is stopping by error.

14.48.3.4 RSI_ON_I ()

Data is sent every communication interval after this function is finished.

The value of IPOC tag is reset to 0 by doing this function.

Syntax RET = RSI_ON_I(<Correction mode:IN>,<Coordinate system:IN>)

Table 14–132. RSI_ON_I () Elements

Element Description
RET
Type: INTEGER

Return values:

• OK(0): Function executed successfully

• If function is not executed successfully the program


is stopping by error.
Correction mode: IN
Type: INTEGER

Correction mode:

• ABSOLUTE (1) : Absolute correction


Coordinate system: IN
Type: INTEGER

Reference coordinate system

• BASE (1) : active UTOOL is used

• BASE (1) : active UTOOL is used

• UTOOL (3) : active UTOOL is used, referenced from


the time of activation RSI_ON_I(). See a following
sketch example to show offset behavior.

14–500
MAROUHT9307191E REV B 14. ADVANCED FUNCTIONS

Figure 14–196. RSI_ON_I () Example

14.48.3.5 RSI_OFF_I ()

Data is not sent after this function is finished.

Syntax RET = RSI_OFF_I( )

Table 14–133. RSI_OFF_I () Elements

Element Description
RET
Type: INTEGER

Return values:

• OK(0): Function executed successfully

• If function is not executed successfully the program


is stopping by error.

14.48.3.6 RSI_WRXML_I ()

This function changes the value of an XML tag.

Syntax RET = RSI_WRXML_I(<XML attribute:IN>, <value:IN>)

14–501
14. ADVANCED FUNCTIONS MAROUHT9307191E REV B

Table 14–134. RSI_WRXML_I () Elements

Element Description
RET
Type: INTEGER

Return values:

• OK(0): Function executed successfully

• If function is not executed successfully the program


is stopping by error.
XML attribute: IN
Type: STRING

This argument indicates which XML tag to write (e.g.


‘TRG’). Case sensitive.
Value: IN
Type: STRING

This argument indicates which value to write in the selected


XML tag

This supports only “myRob ” and “TRG” for XML attribute and the value should be 1 character
at present.

The tag to change (write) is specified by argument 1. to changing multiple tags, this program
should be called n times with a different 1st argument, which means XML attribute.

If a non support tag is set to the XML attribute (1st argument), the STOP global alarm “HOST-391
RSI: 1st argument in RSI_WRXML_I is not supported” will occur.

If the value of the 2nd argument is larger than 1 character, the STOP global alarm “HOST-392
RSI: 2nd argument in RSI_WRXML_I should be 1 character” will occur.

14.48.4 Details

• Variables under $RSI are saved to rsi.sv.


• If this function J802 is ordered, $KAREL_ENB becomes 1 as default then KAREL can be
used as default.
• FR:$RSI*.xml are saved and loaded for all backup. * can be no character or any number or
any characters.
• KAREL programs, which are RSI_CREATE, RSI_DELETE, RSI_RESET, RSI_ON,
RSI_OFF, and RSI_WRXML, are write protected.

14–502

You might also like