F_ARGCMP

This function compares two variables of type T_Arg and supplies the result as return parameter.
FUNCTION F_ARGCMP: DINT
VAR_INPUT
VAR_INPUT
typeSafe: BOOL;
arg1 : T_Arg;
arg2 : T_Arg;
END_VAR
typeSafe: If TRUE => Only equal types can be compared (type safe compare). FALSE => Different types can be compared(type independent compare).
arg1: First variable to be compared.
arg2:Second variable to be compared.
Return parameter | Relation of the first different byte (type, length, value) in the first and second variable |
---|---|
-3 | Length of arg1 less than arg2 |
-2 | Type of arg1 less than arg2 |
-1 | Value of von arg1 less than arg2 |
0 | arg1 equal with arg2 |
1 | Value of arg1 greater than arg2 |
2 | Type of arg1 greater than arg2 |
3 | Length of arg1 greater than arg2 |
0xFF | False parameter values, type, length, value of arg1 or arg2 = 0 |
Requirements
Development Environment | Target System | PLC libraries to include |
---|---|---|
TwinCAT v2.10.0 Build >= 1326 | PC or CX (x86, ARM) | TcUtilities.Lib |