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 calculate the cosine value of.

The Hexadecimal value range is H0000 ~ H9999.
The binary-coded decimal (BCD) value range is 0 ~ 360.
DThe second operand.
Entries are only 8-digit binary-coded decimal (BCD) data registers.
The cosine is saved as an 8-digit binary-coded decimal (BCD) data register in degrees.
This requires 3 data registers.

Result Storage

Data RegisterStorage
DSign
D + 1Integer Part
D + 2Fractional Part

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.

Instruction Behavior

The BCOS and BCOSP instructions behave as follows:

  • The value resulting from the BCOS or BCOSP instruction is saved as a degree.
  • If the value assigned to S is equal to or greater than 360, the angle data in degrees is specified by the remainder of value of S ÷ 360.
    • Example: if S equals 362, the remainder is 2. The equivalent value of S is 2.
  • If the calculation result is positive, 0 is stored in the data register D.
  • If the calculation result is negative, 1 is stored in the data register D.
  • The range of the calculation result is -1.0000 ~ 1.0000.
  • The calculation result is rounded off from the fifth decimal place.
  • The instructions perform raw Hexadecimal cosine of the value S.
    • Only the number 0-9 can be used.
      • A-F will NOT work.

Ladder Diagram Examples

BCOS

The BCOS instruction calculates the cosine of the 4-digit binary coded decimal (BCD) operand, S, and saves the result in an assigned 8-digit binary co

The BCOS instruction calculates the cosine of the 4-digit binary coded decimal (BCD) operand, S, and saves the result in an assigned 8-digit binary coded decimal (BCD) data register, D.

When the contact, M0.2, is ON (1), the instruction executes cos(H9245) and saves the result, H00000001.

When the contact, M0.2, is ON (1), the instruction executes cos(H9245) and saves the result, H00000001. The fractional result is saved as H4226.

Ladder Diagram Example for MapleLogic BCOS/BCOSP instruction.

Memory Monitor

Memory Monitor for MapleLogic BCOS/BCOSP instruction.

BCOSP

The BCOSP one-shot instruction calculates the cosine of the 4-digit binary coded decimal (BCD) operand, S, and saves the result in an assigned 8-digit

The BCOSP one-shot instruction calculates the cosine of the 4-digit binary coded decimal (BCD) operand, 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, M0.3, is ON (1), the instruction executes cos(H4573) and saves the result, H00000001.

When the contact, M0.3, is ON (1), the instruction executes cos(H4573) and saves the result, H00000001. The fractional result is saved as H2924.

Ladder Diagram Example for MapleLogic BCOS/BCOSP instruction.

Memory Monitor

Memory Monitor for MapleLogic BCOS/BCOSP instruction.