PlcOperationControl.xDisableApplicationBreakpoint (PROP) ¶ PROPERTY xDisableApplicationBreakpoint : BOOL
PlcOperationControl.xDisableApplicationDelete (PROP) ¶ PROPERTY xDisableApplicationDelete : BOOL
CTUD (FB) ¶ FUNCTION_BLOCK CTUD Increments and decrements a given value Note Datatype WORD , which is used for PV in CODESYS, does not match the IEC standard, which for PV defines datatype INT . (* Example declaration *) CTUDInst : CUTD ; (* Example in ST *) CTUDInst ( CU := VarBOOL1 , CD := VarBOOL2 , RESET := VarBOOL3 , LOAD := VarBOOL4 , PV := VarWORD1 ); VarBOOL5 := CTUDInst.QU ; VarBOOL6 := CTUDInst.QD ; VarWORD2 := CTUDInst.CV ; InOut: Scope Name Type Comment Input CU BOOL Rising edge: Incrementing CV by one CD BOOL Rising edge: Decrementing CV by one RESET BOOL TRUE : Reset CV to 0 LOAD BOOL TRUE : Set CV to the start value PV PV WORD Start value for decrementing / upper limit for incrementing Output QU BOOL TRUE if CV >= PV QD BOOL TRUE if CV = 0 CV WORD Current counter value
Miscellaneous ¶ RTC (FunctionBlock)
RTC (FB) ¶ FUNCTION_BLOCK RTC Calculates the elapsed time since a given start time Usage Examples: This function block can be used as an operation hour counter, when PDT is set to DT#1970-01-01-00-00:00 , or is simply not connected. This function block can be used to return the current date and time, by adjusting the FB to the current local time. Just, set the input PDT to the current local time, on the rising edge of EN . Note This counter will have an overflow at the 7th February, 2106. (* Example in ST *) RTC ( EN := VarBOOL1 , PDT := DT#2006-03-30-14:00:00 , Q => VarBOOL2 , CDT => VarTimeCur ); InOut: Scope Name Type Comment Input EN BOOL Rising edge: CDT is set to PDT and CDT starts increasing. Falling edge: CDT is set to DT#1970-01-01-00:00:00 . PDT DT Preset date and time Output Q BOOL TRUE as long as CDT is counting CDT DT Date and time, elapsed since PDT
String Functions ¶ CONCAT (Function) DELETE (Function) FIND (Function) INSERT (Function) LEFT (Function) LEN (Function) MID (Function) REPLACE (Function) RIGHT (Function)
CONCAT (FUN) ¶ FUNCTION CONCAT : STRING(255) Concatenates two strings CONCAT(STR1,STR2) means: Connect STR1 and STR2 to a single string STR1STR2 . (* Example declaration *) VarSTRING1 : STRING ; (* Example in ST , result is 'SUSIWILLI' *) VarSTRING1 := CONCAT ( 'SUSI' , 'WILLI' ); InOut: Scope Name Type Comment Return CONCAT STRING(255) Concatenated string, max. 255 characters. If the result doesn’t fit into these 255 bytes, it will be silently truncated. No error is produced. Input STR1 STRING(255) String 1 to be concatenated, max. 255 characters STR2 STRING(255) String 2 to be concatenated, max. 255 characters
DELETE (FUN) ¶ FUNCTION DELETE : STRING(255) Deletes a number of characters from a string DELETE (STR, LEN, POS) means: Delete LEN characters from STR , beginning with the character in the POS position. POS = 0 or POS = 1 , are both addressing the first character. Note The current implementation is unfortunately not correct for the case Pos=0 . The implementation cannot be changed for compatibility reasons. If Pos=0 is used, the parameter LEN is internally reduced by one! It is generally recommended to use values in the range specified by IEC 61131-3. The smallest value for Pos is specified there as 1 . (* Example declaration *) VarSTRING1 : STRING ; (* Example in ST , result is 'SUSI' *) VarSTRING1 := DELETE ( 'SUXYSI' , 2 , 3 ); InOut: Scope Name Type Comment Return DELETE STRING(255) String remaining after deletion Input STR STRING(255) String to be modfied LEN INT Length of the partial string to be deleted, number of characters POS INT Position in STR after which the deletion starts. Counted from left, starting with 1
FIND (FUN) ¶ FUNCTION FIND : INT Searches for the position of a partial string within a string. FIND(STR1, STR2) means: Find the position of the first character where STR2 appears in STR1 for the first time. If STR2 is not found in STR1, then OUT:=0. (* Example declaration *) arINT1 : INT ; (* Example in ST , result is '4' *) arINT1 := FIND ( 'abcdef' , 'de' ); InOut: Scope Name Type Comment Return FIND INT Character position of the first occurance of STR2 in STR1 . If no occurance is found, result is 0 Input STR1 STRING(255) String within which STR2 is searched STR2 STRING(255) String whose position is searched in STR1
INSERT (FUN) ¶ FUNCTION INSERT : STRING(255) Inserts a string into another string at a specific position INSERT (STR1, STR2, POS) means: Insert STR2 into STR1 after position POS . (* Example declaration *) VarSTRING1 : STRING ; (* Example in ST , result is 'SUXYSI' *) VarSTRING1 := INSERT ( 'SUSI' , 'XY' , 2 ); InOut: Scope Name Type Comment Return INSERT STRING(255) Resulting string Input STR1 STRING(255) String into which STR2 is inserted STR2 STRING(255) String to be inserted into STR1 POS INT Insert position. If POS is > 255 OR < 0, the result equals STR1 0 : Inserts before the first character 1 : Inserts after the first character.