Chapter 5 Applied Instructions S : Source device; D : Device in which a result is stored The square root of the value in S is calculated, and the result is stored in D . The value in S can only be a positive value. If the value in S is a negative value, an error will occur, and the instruction will not be executed. The value stored in D is an integer. The fractional part of a square root calculated is dropped. If the fractional part of a square root calculated is dropped, SM601 will be ON. If the value in D is 0, a zero flag will be ON. SM1064 is the zero flag in an Ox motion subroutine, and SM968 is the zero flag in O100.
SM1065 is the borrow flag in an Ox motion subroutine, and SM969 is the borrow flag in O100. SM1066 is the carry flag in an Ox motion subroutine, and SM970 is the carry flag in O100. Explanation When X2.0 is ON, the square root of the value in D0 is calculated, and Example the result is stored in D12. X2.0 D0 D12 5-69 API Instruction code Operand Function Square root of a binary 48 D SQR P S, D value Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S D Pulse instruction 16-bit instruction (5 steps ) 32-bit instruction (6 steps ) SQR D0 D12