The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
S
D

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
SThe first operand.
Entries are 4-digit binary-coded decimal (BCD) data registers or constants.
This is the value to square root.

The value range is H0000 ~ H9999.
DThe second operand.
Entries are only 8-digit binary-coded decimal (BCD) data registers.
This is where the square root is saved.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type. F11.0 turns ON when the value of the data for the calculation exceeds the data register assigned to S or D. When the value assigned to S exceeds its range, the value, Infinity (1.#INF00), is stored in the data register D.

Instruction Behavior

The BSQR and BSQRP instructions behave as follows:

  • The value of S can only be a positive number.
  • The square root result is rounded off from the fifth decimal place.

Ladder Diagram Examples

BSQR

The BSQR instruction calculates the square root of the 4-digit binary coded decimal (BCD) value, S, and saves the result in an assigned 8-digit binary

The BSQR instruction calculates the square root of the 4-digit binary coded decimal (BCD) value, S, and saves the result in an assigned 8-digit binary coded decimal (BCD) data register, D.

When the contact, M1.3, is ON (1), the instruction takes the square root of the value, H4321, into the resulting radian value, H73430065.

When the contact, M1.3, is ON (1), the instruction takes the square root of the value, H4321, into the resulting radian value, H73430065.

Ladder Diagram Example for MapleLogic BSQR/BSQRP instruction.

Memory Monitor

Memory Monitor for MapleLogic BSQR/BSQRP instruction.

BSQRP

The BSQRP one-shot instruction calculates the square root of the 4-digit binary coded decimal (BCD) value, S, and saves the result in an assigned 8-di

The BSQRP one-shot instruction calculates the square root of the 4-digit binary coded decimal (BCD) value, S, and saves the result in an assigned 8-digit binary coded decimal (BCD) data register, D. Every time this instruction executes, it energizes the output only once.

When the contact, M1.4, is ON (1), the instruction takes the square root of the value, H9876, into the resulting radian value, H378000099.

When the contact, M1.4, is ON (1), the instruction takes the square root of the value, H9876, into the resulting radian value, H378000099.

Ladder Diagram Example for MapleLogic BSQR/BSQRP instruction.

Memory Monitor

Memory Monitor for MapleLogic BSQR/BSQRP instruction.