Standard Library Documentation ¶ Company System Title Standard Version 3.5.15.0 Categories Application|Common Author 3S - Smart Software Solutions GmbH Placeholder Standard Description 1 ¶ Functions and functionblocks defined in the IEC61131-3 standard Contents: ¶ Bistable Function Blocks RS (FunctionBlock) SR (FunctionBlock) Counter CTD (FunctionBlock) CTU (FunctionBlock) CTUD (FunctionBlock) Miscellaneous RTC (FunctionBlock) String Functions CONCAT (Function) DELETE (Function) FIND (Function) INSERT (Function) LEFT (Function) LEN (Function) MID (Function) REPLACE (Function) RIGHT (Function) Timer TOF (FunctionBlock) TON (FunctionBlock) TP (FunctionBlock) Trigger F_TRIG (FunctionBlock) R_TRIG (FunctionBlock) Indices and tables ¶ 1 Based on standard.library, last modified 24.07.2019, 08:30:36. LibDoc 4.4.0.0-b.27 The content file standard.clean.json was generated with CODESYS V3.5 SP15 on 24.07.2019, 08:30:38.
Bistable Function Blocks ¶ RS (FunctionBlock) SR (FunctionBlock)
RS (FB) ¶ FUNCTION_BLOCK RS Realizes a bistable reset-dominat latch (* Example declaration *) RSInst : RS ; (* Example in ST *) RSInst ( SET := VarBOOL1 , RESET1 := VarBOOL2 ); VarBOOL3 := RSInst.Q1 ; InOut: Scope Name Type Comment Input SET BOOL Rising edge: Set Q1 to TRUE RESET1 BOOL Rising edge: Reset Q1 to FALSE (dominant) Output Q1 BOOL Output value
SR (FB) ¶ FUNCTION_BLOCK SR Realizes a bistable set-dominat latch (* Example declaration *) SRInst : SR ; (* Example in ST *) SRInst ( SET1 := VarBOOL1 , RESET := VarBOOL2 ); VarBOOL3 := SRInst.Q1 ; InOut: Scope Name Type Comment Input SET1 BOOL Rising edge: Set Q1 to TRUE (dominant) RESET BOOL Rising edge: Reset Q1 to FALSE Output Q1 BOOL Output value
Counter ¶ CTD (FunctionBlock) CTU (FunctionBlock) CTUD (FunctionBlock)
CTD (FB) ¶ FUNCTION_BLOCK CTD Decrements a given value (* Example declaration *) CTDInst : CTD ; (* Example in ST *) CTDInst ( CD := VarBOOL1 , LOAD := VarBOOL2 , PV := VarWORD1 ); VarBOOL3 := CTDInst.Q ; VarWORD2 := CTDInst.CV ; InOut: Scope Name Type Comment Input CD BOOL Rising edge: Decrementing CV by one LOAD BOOL TRUE : Set CV to the start value PV PV WORD Start value for decrementing Output Q BOOL TRUE if CV = 0 CV WORD Current counter value
CTU (FB) ¶ FUNCTION_BLOCK CTU Increments a given value (* Example declaration *) CTUInst : CTU ; (* Example in ST *) CTUInst ( CU := VarBOOL1 , RESET := VarBOOL2 , PV := VarWORD1 ); VarBOOL3 := CTUInst.Q ; VarWORD2 := CTUInst.CV ; InOut: Scope Name Type Comment Input CU BOOL Rising edge: Incrementing CV by one RESET BOOL TRUE : Reset CV to 0 PV WORD Upper limit for incrementing Output Q BOOL TRUE if CV >= PV CV WORD Current counter value
AtomicWriteULInt (FUN) ¶ FUNCTION AtomicWriteULInt : BOOL InOut: Scope Name Type Return AtomicWriteULInt BOOL Input pDest POINTER TO ULINT uliValue ULINT
Counter ¶ LCTD (FunctionBlock) LCTU (FunctionBlock) LCTUD (FunctionBlock)
LCTD (FB) ¶ FUNCTION_BLOCK PUBLIC LCTD Decrements a given value (* Example declaration *) LCTDInst : LCTD ; (* Example in ST *) LCTDInst ( CD := VarBOOL1 , LOAD := VarBOOL2 , PV := VarLWORD1 ); VarBOOL3 := CTDInst.Q ; VarLWORD2 := CTDInst.CV ; InOut: Scope Name Type Comment Input CD BOOL Rising edge: Decrementing CV by one LOAD BOOL TRUE : Set CV to the start value PV PV LWORD Start value for decrementing Output Q BOOL TRUE if CV = 0 CV LWORD Current counter value