Delta Electronics — 6.3.2 Explanation of Data Conversion Instructions

Chapter 6 Applied Instructions Symbol D : Device in which the two’s complement is stored Explanation 1. This instruction converts a negative binary value into the two’s compliment. 2. Only the DNEG instruction can use the 32-bit counter. 6_ 3. Generally, you use the NEGP and DNEGP pulse instructions. Example 1 When X0.0 is switched from OFF to ON, this instruction inverts all bits in D0 (0 becomes 1, and 1 becomes 0), and 1 is added to the result, and then stores the final value in the original register D10.

6-95 API Instruction code Operand Function 0210 D NEG P D Finding the two’s complement Device X Y M S T C HC D FR SM SR E K 16# “$” F D        BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type D        Pulse instruction 16-bit instruction 32-bit instruction AS AS AS