L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 663

Advertising
background image

L-force | PLC Designer

PLC Designer Libraries



DMS 3.2 EN 02/2011 TD29

661

PACK

Provided by util.lib.

This function is capable of delivering back eight input bits B0, B1, ..., B7 from type
BOOL as a BYTE.

The function block UNPACK is closely related to this function.

PUTBIT

Provided by util.lib.

The input to this function consists of a DWORD X, a BYTE N and a BOOLean value B.

PUTBIT sets the N

th

bit from X on the value B, whereby it starts counting from the zero

bit.

Example in ST:

A:=38; (* binary 100110 *)

B:=PUTBIT(A,4,TRUE); (* Result : 54 = 2#110110 *)

C:=PUTBIT(A,1,FALSE); (* Result : 36 = 2#100100 *)

UNPACK

Provided by util.lib.

UNPACK converts the input B from type BYTE into 8 output variables B0,...,B7 of the
type BOOL, and this is the opposite to PACK.

Example in FBD: Output:

Advertising