3. Instruction Set 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. 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. When 2.0B is selected, S 2 (Lo-word) and S 2 +1 (Hi-word) are both 29 bits of ID code.
3-581 API Mnemonic Operands Function Controllers ES2- SS2 SA2/ SX2 C SE 340 CANRS S 1, S 2, S 3, D 1, D 2 User-defined CAN communication sending and receiving 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 S 1 * * * S 2 * S 3 * D 1 * D 2 * Controllers ES2- SS2 SA2/ SX2 C SE PULSE 16-bit 32-bit ES2/ SA2/ ES2- SA2/ ES2/ SA2/ SS2 SX2 SS2 SX2 SS2 SX2 EX2 SE C SE EX2 SE S 2 No. S 2 S 2+1 Description Msg. ID Data Length