F_ARGCMP

This function compares two variables of type T_Arg and supplies the result of the comparison as return parameter.
Return value
Name | Type | Description |
---|---|---|
F_ARGCMP | DINT |
|
Inputs
VAR_INPUT
typeSafe : BOOL;
arg1 : T_Arg;
arg2 : T_Arg;
END_VAR
Name | Type | Description |
---|---|---|
typeSafe | BOOL | If TRUE => identical types can be compared (type-safe comparison). FALSE => different types can be compared (type-independent comparison). |
arg1 | T_Arg | First variable to be compared (type: T_Arg). |
arg2 | T_Arg | Second variable to be compared (type: T_Arg). |
Return parameter | Relationship 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 arg1 less than arg2 |
0 | arg1 identical to arg2 |
1 | Value of arg1 greater than arg2 |
2 | Type of arg1 greater than arg2 |
3 | Length of arg1 greater than arg2 |
0xFF | Wrong parameter values, type, length, value of arg1 or arg2 = 0 |
Requirements
Development environment | Target platform | PLC libraries to be integrated (category group) |
---|---|---|
TwinCAT v3.1.0 | PC or CX (x86, x64, Arm®) | Tc2_Utilities (System) |