BYTE_AS_BIT (FB) ¶ FUNCTION_BLOCK BYTE_AS_BIT Converts an input value of data type byte into 8 outputs of data type BOOL InOut: Scope Name Type Comment Input B BYTE Input value Output B0 BOOL Output bit 0 B1 BOOL Output bit 1 B2 BOOL Output bit 2 B3 BOOL Output bit 3 B4 BOOL Output bit 4 B5 BOOL Output bit 5 B6 BOOL Output bit 6 B7 BOOL Output bit 7
DWORD_AS_BIT (FB) ¶ FUNCTION_BLOCK DWORD_AS_BIT Converts an input value of data type DWORD into 32 outputs of data type BOOL InOut: Scope Name Type Comment Input X DWORD Input value Output B00 BOOL Output bit 0 B01 BOOL Output bit 1 B02 BOOL Output bit 2 B03 BOOL Output bit 3 B04 BOOL Output bit 4 B05 BOOL Output bit 5 B06 BOOL Output bit 6 B07 BOOL Output bit 7 B08 BOOL Output bit 8 B09 BOOL Output bit 9 B10 BOOL Output bit 10 B11 BOOL Output bit 11 B12 BOOL Output bit 12 B13 BOOL Output bit 13 B14 BOOL Output bit 14 B15 BOOL Output bit 15 B16 BOOL Output bit 16 B17 BOOL Output bit 17 B18 BOOL Output bit 18 B19 BOOL Output bit 19 B20 BOOL Output bit 20 B21 BOOL Output bit 21 B22 BOOL Output bit 22 B23 BOOL Output bit 23 B24 BOOL Output bit 24 B25 BOOL Output bit 25 B26 BOOL Output bit 26 B27 BOOL Output bit 27 B28 BOOL Output bit 28 B29 BOOL Output bit 29 B30 BOOL Output bit 30 B31 BOOL Output bit 31
EXTRACT (FUN) ¶ FUNCTION EXTRACT : BOOL Returns bit number N of value X Example in ST: FLAG := EXTRACT ( X := 81 , N := 4 ); (* Result : TRUE, because 81 is binary 1010001, so the bit '4' is 1 *) FLAG := EXTRACT ( X := 33 , N := 0 ); (* Result : TRUE, because 33 is binary 100001, so the bit '0' is 1 *) InOut: Scope Name Type Comment Return EXTRACT BOOL The Nth bit of value X Input X DWORD Input value N BYTE Number of the bit to be extracted. Counting starts at 0.
GETBIT (FUN) ¶ FUNCTION GETBIT : BOOL Returns the bit value at position N of value X InOut: Scope Name Type Comment Return GETBIT BOOL Input X LWORD Variable from which the bit is chosen, value has to be unsigned N BYTE The bitnumer 0…(size of datatype)
PACK (FUN) ¶ FUNCTION PACK : BYTE Packs 8 bits into 1 byte InOut: Scope Name Type Comment Return PACK BYTE Value for the input BO .. B7 Input B0 BOOL Input bit 0 B1 BOOL Input bit 1 B2 BOOL Input bit 2 B3 BOOL Input bit 3 B4 BOOL Input bit 4 B5 BOOL Input bit 5 B6 BOOL Input bit 6 B7 BOOL Input bit 7
PUTBIT (FUN) ¶ FUNCTION PUTBIT : DWORD Sets a bit of a DWORD value Example in ST: var1 := 38 ; (* binär 100110 *) var2 := PUTBIT ( A , 4 , TRUE ); (* Result: 54 = 2#110110 *) var3 := PUTBIT ( A , 1 , FALSE ); (* Result: 36 = 2#100100 *) InOut: Scope Name Type Comment Return PUTBIT DWORD Value with the changed bit Input X DWORD Value to be manipulated N BYTE Position of the bit to be changed, starting with 0 B BOOL Value of specified bit
SETBIT (FUN) ¶ FUNCTION SETBIT : BOOL Sets the value of bit at position N of variable X to B InOut: Scope Name Type Comment Return SETBIT BOOL Input X __SYSTEM.AnyType Variable to be modified N BYTE Bitnummer 0…(to size of datatype) B BOOL Desired value of the bit
Library Reference ¶ This is a dictionary of all referenced libraries and their name spaces.
Util Library Documentation ¶ Company System Title Util Version 3.5.19.0 Categories Application|Common Author 3S - Smart Software Solutions GmbH Placeholder Util Description 1 ¶ Provides data types for generator modes and points. And provides function blocks and functions for the following use cases: Analog monitors, BCD conversions, bit/byte functions, controller, function manipulators, mathematical functions and signals. In the folder TimerSwitch the types, functions and function blocks are located for handling UTC and local time and the implementation of a timer switch. Contents: ¶ Analog Monitors HYSTERESIS (FunctionBlock) LIMITALARM (FunctionBlock) BCD Conversions BCD_TO_BYTE (Function) BCD_TO_DWORD (Function) BCD_TO_INT (Function) BCD_TO_WORD (Function) BYTE_TO_BCD (Function) DWORD_TO_BCD (Function) INT_TO_BCD (Function) WORD_TO_BCD (Function) Bit/Byte Functions BIT_AS_BYTE (FunctionBlock) BIT_AS_DWORD (FunctionBlock) BIT_AS_WORD (FunctionBlock) BYTE_AS_BIT (FunctionBlock) DWORD_AS_BIT (FunctionBlock) EXTRACT (Function) GETBIT (Function) PACK (Function) PUTBIT (Function) SETBIT (Function) SWITCHBIT (Function) UNPACK (FunctionBlock) WORD_AS_BIT (FunctionBlock) Constants TextBlockSize (ParamList) Controller PD (FunctionBlock) PID (FB) Temperature control with PID and LIMIT PID_FIXCYCLE (FunctionBlock) Datatypes GEN_MODE (Enum) POINT (Struct) PT_SIZE (Struct) Encoding BASE64 (Function) Function Manipulators CHARCURVE (FunctionBlock) RAMP_INT (FunctionBlock) RAMP_REAL (FunctionBlock) Gray Conversions BYTE_TO_GRAY (Function) DWORD_TO_GRAY (Function) GRAY_TO_BYTE (Function) GRAY_TO_DWORD (Function) GRAY_TO_WORD (Function) WORD_TO_GRAY (Function) HEX/ASCII Functions BYTE_TO_HEXinASCII (Function) HEXinASCII_TO_BYTE (Function) WORD_AS_STRING (Function) Library Information GetLibVersion (Function) GetLibVersionNumber (Function) IsLibReleased (Function) Mathematical Functions DERIVATIVE (FunctionBlock) INTEGRAL (FunctionBlock) LIN_TRAFO (FunctionBlock) ROTATION_DIFFERENCE (FunctionBlock) STATISTICS_INT (FunctionBlock) STATISTICS_REAL (FunctionBlock) VARIANCE (FunctionBlock) Signals BLINK (FunctionBlock) FREQ_MEASURE (FunctionBlock) GEN (FunctionBlock) TimerSwitch Enums FunctionBlocks Functions GlobalConstants Interfaces Structs Types Indices and tables ¶ 1 Based on Util.library, last modified 02.03.2023, 10:46:37. LibDoc 4.4.0.0-b.27 The content file Util.clean.json was generated with CODESYS V3.5 SP16 Patch 3 on 02.03.2023, 10:46:40.
HYSTERESIS (FB) ¶ FUNCTION_BLOCK HYSTERESIS Realizes a hysteresis function InOut: Scope Name Type Comment Input IN INT Input value HIGH INT Upper limit LOW INT Lower limit Output OUT BOOL TRUE : Input IN is less than input LOW FALSE : Input IN is greater than input HIGH