13.07.2015 Views

1766-RM001A-EN-P MicroLogix 1400 Programmable Controllers ...

1766-RM001A-EN-P MicroLogix 1400 Programmable Controllers ...

1766-RM001A-EN-P MicroLogix 1400 Programmable Controllers ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

232 Math InstructionsUse the XPY instruction to raise a value (source A) to a power (source B)and store the result in the destination. If the value in source A is negative,the exponent (source B) should be a whole number. If it is not a wholenumber, the overflow bit is set and the absolute value of the base is usedin the calculationEnter the following parameters when programming this instruction:• Source A is a value of base to power• Source B is a value or address to compute exponent• Destination is the address to store the result of computationAddress Levels for the operands involved in the XPY can be ALL word,ALL double word, ALL float, or a combination. These operands shallundergo a conversion to float. The calculation of the source (in float) isthen performed, and the result is then cast to the data type of Destination.XPY Instruction Valid Addressing Modes and File TypesFor definitions of the terms used in this table see Using the Instruction Descriptions on page 92.Data Files Function Files (1)Address Mode (3)Address LevelParameterOISBT, C, RNFSTLMG, PDRI/RIXPLSRTCHSCPTOX, PWMXSTIEIIBHIMMILCDCS - CommsIOS - I/ODLS - Data Log (2)DirectIndirectImmediateInt16Immediate Int32Immediate FloatBitWordDouble WordElementFloatSource A/B • • • • • • • • • • • • • •Destination • • • • • • • • • • • • •(1) PTOX and PWMX files are only for use with <strong>MicroLogix</strong> <strong>1400</strong> BXB or BXBA unit.(2) The Data Log Status file can only be used for the following math instructions: ADD, SUB, MUL, DIV, NEG, and SCP.(3) See Important note about indirect addressing.IMPORTANTYou cannot use indirect addressing with: S, MG, PD, RTC, HSC, PTOX,PWMX, STI, EII, BHI, MMI, CS, IOS, and DLS files.Instruction OperationWhen the rung is true, this instruction shall compute the Source A topower Source B and place the result in Destination.If the Destination is floating point, the result shall always be roundedusing the round to even rule.Publication <strong>1766</strong>-<strong>RM001A</strong>-<strong>EN</strong>-P - October 2008

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!