Delta Electronics — 6.27.2 Explanation of CANopen Communication Instructions

Chapter 6 Applied Instructions Example: The index address of PXX-YY=0x2000 + XX (hexadecimal); The sub index address is YY+1 (hexadecimal) The index address of P10-15 = 0x2000 + 0x000A = 0x200A The sub index address is 0x0F+1= 0x10 10. Since this instruction uses SDO (Service Data Objects) and the communication mode is one transmission (one sending/one receiving) at a time, it is not suggested to use 2 COPRW instructions at a time in one scan cycle. And it is not suggested to use this instruction in a function block.

Because when this instruction is written in a function block, there will be 2 POU in the PLC program and when the function block is called, 2 instructions will be enabled at the same time. 11. The request codes for normal SDO are 16#0021 and 16#0041, available for PLC with firmware V1.04.80 or later. 12. When the request code is 16#0021, S 5 is the data length (“n” byte) to write into the slave. S 5 +1~ S 5 +((n+1) / 2) is the data to write into the slave. For example, if S 5 is specified as D100 and the value in S 5 is 16.

This instruction sends data in D101 ~ D108 to the slave in the following order, lower 8-bit in D101, upper 8-bit in D101, lower 8-bit in D102, upper 8-bit in D102 and so forth. 13. When the request code is 16#0041, when received responses from the slave, this instruction stores the data length (“n” byte) in S 5 and data in S 5 +1~ S 5 +((n+1) / 2). For example, if received 15 bytes of data length, D100 is 15 and D102, upper 8-bit in D102 and so forth. store the data Byte[0], Byte[1].. Byte[14] in the following order, lower 8-bit in D101, upper 8-bit in D101, lower 8-bit in 6_ 14. The maximum data length is 255 bytes.

To prevent too many Normal SDO transmissions, if the data length exceeds 255 bytes, PLC only sends or receives 255 bytes. Example (using Expedited SDO) 1. When M0 changes from OFF to ON, the INITC instruction starts to initialize the servos at station addresses 1–3, until SM1681 is ON. 2. When M1 changes from OFF to ON, the PLC writes the 2-byte data ( S 2 =16#002B) in D100 to P5-04 ( S 3 =16#2504) of servo 3, using the COPRW instruction. When the writing is complete, M100 is ON. 3. When M2 changes from OFF to ON, the PLC reads the value of P4-07 ( S 3 =16#2407) of servo 3 and stores the value( S 2 =16#0040) in D106. When the reading is complete, M106 is ON. 6-923