MBShift

PLCopen motion icon

 FunctionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Multi-byte shift / rotate.

Inputs

Input

Data Type

Range

Unit

Default

Description

Buffer

SINT / USINT

 

 

 

Array of bytes.

Pos

DINT

 

 

 

Base positionClosed Position means a point in space which is described by different coordinates. Depending on the used system and transformation it can consist of a maximum of six dimensions (coordinates).This means three Cartesian coordinates in space and coordinates for the orientation. In ACS there can be even more than six coordinates. If the same position is described in different coordinate systems the values of the coordinates are different. in the array.

NbByte

DINT

 

 

 

Number of bytes to be shifted or rotated.

NbShift

DINT

 

 

 

Number of shifts or rotations.

ToRight

BOOL

FALSE, TRUE

 

 

  • TRUE for right.
  • FALSE for left.

Rotate

BOOL

FALSE, TRUE

 

 

  • TRUE for rotate.
  • FALSE for shift.

InBit

BOOL

FALSE, TRUE

 

 

Bit to be introduced in a shift.

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

FALSE, TRUE

 

TRUE if successful.

Remarks

  • Use the ToRight argument to specify a shift to the left (FALSE) or to the right (TRUE).
  • Use the Rotate argument to specify either a shift (FALSE) or a rotation (TRUE).
  • In case of a shift, the InBit argument specifies the value of the bit that replaces the last shifted bit.

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

Q := MBShift (Buffer, Pos, NbByte, NbShift, ToRight,
Rotate, InBit);