UNPACK8

Function block - Extract bits of a byte

Inputs

IN : USINT  8 bit register

Outputs

Q0 : BOOL  Less significant bit
...
Q7 : BOOL 
Most significant bit

Remarks

In LD language, the output rung is the Q0 output. The operation is executed only in the input rung (EN) is TRUE.

ST Language

(* 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;

FBD Language

LD Language

(* The operation is performed if EN = TRUE *)

IL Language:

(* MyUnpack is a declared instance of the UNPACK8 function block *)
Op1: CAL MyUnpack (IN)
     LD  MyUnpack.Q0
     ST  Q0
     (* ... *)
     LD  MyUnpack.Q7
     ST  Q7

See also

PACK8