Assert

Validates a condition and outputs an ERROR message via the ADS logging system if the condition is FALSE. The function block offers various versions with 0 to 5 additional parameters.
Assert (without parameters)
Validates a condition without any additional parameters.
METHOD Assert : BOOL
VAR_INPUT
sLogCode : STRING := '';
sLogText : T_MaxString;
bResult : BOOL := FALSE;
END_VARName | Type | Description |
|---|---|---|
sLogCode | STRING | Optional log code for uniquely identifying the message. |
sLogText | Message text to be output. | |
bResult | BOOL | Condition that is being validated. If it is FALSE, the message is output. |
Assert1 (with 1 parameter)
Validates a condition using an additional parameter, tArg1.
METHOD Assert1 : BOOL
VAR_INPUT
sLogCode : STRING := '';
sLogText : T_MaxString;
tArg1 : T_Arg;
bResult : BOOL := FALSE;
END_VARName | Type | Description |
|---|---|---|
sLogCode | STRING | Optional log code for uniquely identifying the message. |
sLogText | Message text with placeholders for parameters. | |
tArg1 | The first parameter to be included in the message. | |
bResult | BOOL | Condition that is being validated. If it is FALSE, the message is output. |
Assert2 (with 2 parameters)
Validates a condition using two additional parameters, tArg1 and tArg2.
METHOD Assert2 : BOOL
VAR_INPUT
sLogCode : STRING := '';
sLogText : T_MaxString;
tArg1 : T_Arg;
tArg2 : T_Arg;
bResult : BOOL := FALSE;
END_VARName | Type | Description |
|---|---|---|
sLogCode | STRING | Optional log code for uniquely identifying the message. |
sLogText | Message text with placeholders for parameters. | |
tArg1 | The first parameter to be included in the message. | |
tArg2 | Second parameter to be included in the message. | |
bResult | BOOL | Condition that is being validated. If it is FALSE, the message is output. |
Assert3 (with 3 parameters)
Validates a condition using three additional parameters.
METHOD Assert3 : BOOL
VAR_INPUT
sLogCode : STRING := '';
sLogText : T_MaxString;
tArg1 : T_Arg;
tArg2 : T_Arg;
tArg3 : T_Arg;
bResult : BOOL := FALSE;
END_VARAssert4 (with 4 parameters)
Validates a condition using four additional parameters.
METHOD Assert4 : BOOL
VAR_INPUT
sLogCode : STRING := '';
sLogText : T_MaxString;
tArg1 : T_Arg;
tArg2 : T_Arg;
tArg3 : T_Arg;
tArg4 : T_Arg;
bResult : BOOL := FALSE;
END_VARAssert5 (with 5 parameters)
Validates a condition using five additional parameters.
METHOD Assert5 : BOOL
VAR_INPUT
sLogCode : STRING := '';
sLogText : T_MaxString;
tArg1 : T_Arg;
tArg2 : T_Arg;
tArg3 : T_Arg;
tArg4 : T_Arg;
tArg5 : T_Arg;
bResult : BOOL := FALSE;
END_VAR![]() |
|
