3. Instruction Set
API
Mnemonic Operands Function
Controllers
340 CANRS
S
1
, S
2
, S
3
, D
1
, D
2
communication
Type
OP
Bit Devices Word devices Program Steps
X Y M S K H KnX
KnY
KnM
KnS
T C D E F
CANRS: 11 steps
EX2/
SS2
SE
SX2
ES2
C
SS2
SE
SX2
EX2/
SS2
SE
SX2
Operands
S
1
: Communication mode setting
S
2
: Communication ID (MsgID) and data length
S
3
: Starting device where sent source data are stored
D
1
: Starting device where received data are stored
D
2
: Communication completion flag
Explanation
1. The CANRS instruction is applicable to PLCs with CAN BUS communication port, e.g.
ES2-C and PLC that connects with let-side communication modules, e.g. DVPCOPM-SL:
when it acts as Master and no slaves are configured.
2. There is no limit to the number of times of using the instruction. But only one CAN
communication command is allowed to be sent every time. If one command is being sent or
received currently, the next CANRS instruction cannot be enabled. And PLC executes the
instruction that is being scanned first.
3. The CANRS instruction can use CAN BUS 2.0A (ID 11-bits) (Arbitration) and 2.0B (ID 29-bits)
protocols. The default is 2.0B (M1620=OFF). If 2.0A is needed, you can set M1620 to ON
when the PLC runs for the first time. Note: this communication protocol can only be set once
when switching Stop to Run.
4. When it is set in Master mode, you can use M1621. The default is M1621=OFF (Master
mode), and it will send and then receive. When M1621=ON (Slave mode), it will receive and
then send during communication.
5. S
1
sets the communication port number. When DVPCOPM-SL is installed on the left-side of
the PLC as the first module, its number is K100; the second one is K101; the eighth one is
K107 and so on. If the PLC CPU is ES2-C, its built-in communication port number is K0.
6. S
2
is the ID of the transmitted message and data length. According to 2.0A or 2.0B protocol,
the transmitted data automatically occupies D buffer registers.
When 2.0A is selected, S
2
is 11 bits of ID code with the following data transmission format.
S
2
No. S
2
S
2
+1
Description
Msg. ID Data Length