Unpack8

PLCopen motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Extract bits from a byte.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN

USINT

 

 

 

8-bit register.

Outputs

Output

Data Type

Range

Unit

Description

Q0

BOOL

FALSE, TRUE

 

Less significant bit.

Q7

BOOL

FALSE, TRUE

 

Highest significant bit.

Remarks

  • The operation is executed only in the input rung (EN) is TRUE.

FBD Language Example

FFLD Language Example

  • In the FFLD language, the output rung is the Q0 output.
  • The operation is performed if EN = TRUE.

IL Language Example

(* MyUnpack is a declared instance of the UNPACK8 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. block *)
Op1: CAL MyUnpack (IN)
     FFLD  MyUnpack.Q0
     ST  Q0
     (* ... *)
     FFLD  MyUnpack.Q7
     ST  Q7

ST Language Example

(* MyUnpack is a declared instance of the UNPACK8 function block *)
MyUnpack (IN);
Q0 := MyUnpack.Q0;
Q1 := MyUnpack.Q1;
Q2 := MyUnpack.Q2;
Q3 := MyUnpack.Q3;
Q4 := MyUnpack.Q4;
Q5 := MyUnpack.Q5;
Q6 := MyUnpack.Q6;
Q7 := MyUnpack.Q7;

See Also

Pack8