[Instruction] Contents
[Instruction] Contents [Instruction] Contents
Advanced Function InstructionFUN 28 D PABSABSOLUTE(Take the absolute value)FUN 28 D PABSD : Register to be taken absolute valueD may combine with V, Z, P0~P9 to serve indirect addressapplicationOperandRangeWY WM WS TMR CTR HR OR SR ROR DR XRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095P0~P9D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When operation control "EN" = 1 or "EN↑" ( P instruction) from 0 to 1, calculate the absolute value of thecontent of the register specified by D, and write it back into the original D register.X0EN28DPABSR 0• The instruction at left calculates the absolute value ofthe R0 register, and stores it back in R0.D R1 R0 −12345 CFC7H X0=D R1 R0 12345 3039H7-7
Advanced Function InstructionFUN 29 D PEXTSIGN EXTENSIONFUN 29 D PEXTD : Register to be taken sign extensionD may combine with V, Z, P0~P9 to serve indirect addressapplicationOperandRangeWY WM WS TMR CTR HR OR SR ROR DR XRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095P0~P9D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When operation control "EN" = 1 or "EN↑" ( P instruction) from 0 to 1, this instruction will sign extent the 16bit numerical value specified by D to 32-bit value and store it into the 32-bit register comprised by the twosuccessive words, D + 1 and D. (Both values are the same, only it was originally formated as a 16 bitnumerical value, and was then extended to be formated as a 32 bit numerical value.)• This instruction extent the numerical value of a 16-bit register into an equivalent numerical value in a 32-bitregister (for example 33FFH converts to 000033FFH), Its main function is for numerical operations(+,-,*,/,CMP......) which can take the 16 bit or 32 bit numerical values as operand. Before operation all theoperand should be adjusted to the same length for proper operation.X0EN29PEXTR 0• The instruction at left takes a 16 bit numerical value R0,and extends it to an equivalent value in 32 bits, thenstores it into a 32 bit register (DR0=R1R0) comprised R0and R1DR1 R0R1 B15 R0 B0Ignore the value of R1 before1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 -12345extension X0=B31 R1 B16 B15 R 0 B0D R1 R0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 -12345Fill B15 value into B31-B16,(if B15 is 0, then B31-B16 are all 0)Before extension(16 bits) R0= CFC7H=−12345After extension(32 bits)R1R0=FFFFCFC7H=−12345The two numerical values are actually the same7-8
- Page 64 and 65: 5.3.2 The Coding of Numeric Numbers
- Page 66 and 67: (2). 0.5 = (-1) 0 * 2 ( 01111110 )
- Page 68 and 69: While all FBs-PLC numerical operati
- Page 70 and 71: Basic Function InstructionT TIMER T
- Page 72 and 73: Basic Function InstructionT TIMER T
- Page 74 and 75: Basic Function InstructionCCOUNTER(
- Page 76 and 77: Basic Function InstructionSET D PSy
- Page 78 and 79: Basic Function InstructionRST D PSy
- Page 80 and 81: Basic Function InstructionFUN 0MCSy
- Page 82 and 83: Basic Function InstructionFUN 1MCES
- Page 84 and 85: Basic Function InstructionFUN 2SKPS
- Page 86 and 87: Basic Function InstructionFUN 4DIFU
- Page 88 and 89: Basic Function InstructionFUN 6 D P
- Page 90 and 91: Basic Function InstructionFUN 7 DUD
- Page 92 and 93: Basic Function InstructionFUN 9 D P
- Page 94 and 95: Basic Function InstructionFUN 11 D
- Page 96 and 97: Basic Function InstructionFUN 13 D
- Page 98 and 99: Basic Function InstructionFUN 14 D
- Page 100 and 101: Basic Function InstructionFUN 15 D
- Page 102 and 103: Basic Function InstructionFUN 17 D
- Page 104 and 105: Basic Function InstructionFUN 19 D
- Page 106 and 107: Basic Function InstructionFUN 21 D
- Page 108 and 109: Advanced Function InstructionFUN22
- Page 110 and 111: Advanced Function InstructionFUN 24
- Page 112 and 113: Advanced Function InstructionFUN 26
- Page 116 and 117: Advanced Function InstructionFUN 30
- Page 118 and 119: Advanced Function InstructionFUN32A
- Page 120 and 121: Advanced Function InstructionFUN 36
- Page 122 and 123: Advanced Function InstructionFUN 40
- Page 124 and 125: Advanced Function InstructionFUN 42
- Page 126 and 127: Advanced Function InstructionFUN 44
- Page 128 and 129: Advanced Function InstructionFUN 46
- Page 130 and 131: Advanced Function InstructionFUN 48
- Page 132 and 133: Advanced Function InstructionFUN50
- Page 134 and 135: Advanced Function InstructionFUN 52
- Page 136 and 137: Advanced Function InstructionFUN 54
- Page 138 and 139: Advanced Function InstructionFUN55
- Page 140 and 141: Advanced Function InstructionFUN56
- Page 142 and 143: Advanced Function InstructionFUN 58
- Page 144 and 145: Advanced Function InstructionFUN 59
- Page 146 and 147: Advanced Function InstructionFUN 59
- Page 148 and 149: Advanced Function InstructionFUN 61
- Page 150 and 151: Advanced Function InstructionFUN 63
- Page 152 and 153: Advanced Function InstructionFUN 64
- Page 154 and 155: Advanced Function InstructionEND PR
- Page 156 and 157: Advanced Function InstructionFUN 66
- Page 158 and 159: Advanced Function InstructionFUN 68
- Page 160 and 161: Advanced Function InstructionFUN 70
- Page 162 and 163: Advanced Function InstructionFUN 74
Advanced Function <strong>Instruction</strong>FUN 29 D PEXTSIGN EXTENSIONFUN 29 D PEXTD : Register to be taken sign extensionD may combine with V, Z, P0~P9 to serve indirect addressapplicationOperandRangeWY WM WS TMR CTR HR OR SR ROR DR XRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095P0~P9D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When operation control "EN" = 1 or "EN↑" ( P instruction) from 0 to 1, this instruction will sign extent the 16bit numerical value specified by D to 32-bit value and store it into the 32-bit register comprised by the twosuccessive words, D + 1 and D. (Both values are the same, only it was originally formated as a 16 bitnumerical value, and was then extended to be formated as a 32 bit numerical value.)• This instruction extent the numerical value of a 16-bit register into an equivalent numerical value in a 32-bitregister (for example 33FFH converts to 000033FFH), Its main function is for numerical operations(+,-,*,/,CMP......) which can take the 16 bit or 32 bit numerical values as operand. Before operation all theoperand should be adjusted to the same length for proper operation.X0EN29PEXTR 0• The instruction at left takes a 16 bit numerical value R0,and extends it to an equivalent value in 32 bits, thenstores it into a 32 bit register (DR0=R1R0) comprised R0and R1DR1 R0R1 B15 R0 B0Ignore the value of R1 before1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 -12345extension X0=B31 R1 B16 B15 R 0 B0D R1 R0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 0 0 1 1 1 -12345Fill B15 value into B31-B16,(if B15 is 0, then B31-B16 are all 0)Before extension(16 bits) R0= CFC7H=−12345After extension(32 bits)R1R0=FFFFCFC7H=−12345The two numerical values are actually the same7-8