Skip to main content

Arccosine (4-Digit BCD)

Instruction Parameters

Supported PLC Series

XPnA/1RXPnBXPnEXPnFCP3A/B/P/U
CP4A~D/U
CPnECPnFBPPLC-S
----

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 arccosine value of.
The value must be cosine data.
This requires 3 data registers.

The Hexadecimal value range is H0000 ~ H9999.
DThe second operand.
Entries are only 8-digit binary-coded decimal (BCD) data registers.
The arccosine is saved as an 8-digit binary-coded decimal (BCD) data register.

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 BACOS and BACOSP instructions behave as follows:

  • The value resulting from the BACOS or BACOSP instruction is saved as a degree.
  • The range of cosine data for S is from -1.0000 ~ 1.0000.
  • Values assigned to S+1 and S+2 cannot exceed 1.0000.
  • If the cosine data to be calculated is positive, 0 is stored in the data register D.
  • If the cosine data to be calculated is negative, 1 is stored in the data register D.
  • The fractional part of the result is rounded.
  • The binary coded decimal (BCD) values store in the data register D range from 0 ~ 180 degrees.
  • The instructions perform raw Hexadecimal arccosine of the value S.
    • Only the number 0-9 can be used.
      • A-F will NOT work.

Examples