FB_MllPrediction
Syntax
Definition:
FUNCTION_BLOCK FB_MllPrediction
VAR_INPUT
stPredictionParameter : ST_MllPredictionParameters;
eTraceLevel : TcEventSeverity;
END_VAR
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
ipResultMessage : I_TcMessage;
hrErrorCode : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
stPredictionParameter |
General Prediction parameters | |
eTraceLevel |
TcEventSeverity |
Eventlogger trace level. Default = Critical. Must be set before Configure method is called |
Outputs
Name |
Type |
Description |
---|---|---|
bBusy |
BOOL |
True if a asynchronous action is taking place |
bError |
BOOL |
Indicates error in method |
ipResultMessage |
I_TcMessage |
Contains the last invoked error |
hrErrorCode |
HRESULT |
Unique error code |
Methods
Name |
Description |
---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
General information
The FB_MllPrediction
is a central Function Block for the usage of TC3 Machine Learning in the PLC. The Function Block offers a variety of Methods as described above. Basically, the FB_MllPrediction
offers the functionality to load and to execute ML models. Hence, it is an interface to the TwinCAT 3 integrated inference engine (ML Runtime).
Error handling
Note that all methods of FB_MllPrediction
return a BOOL
which indicates if the execution on the method caused any error, e.g.
bFailed := fbprediction.GetInputDim(nInputDim);
The evaluation of the return value of the methods is equivalent to the evaluation of the Output bError
of FB_MllPrediction
.
Further, FB_MllPrediction
references the TwinCAT 3 EventLogger and thus ensures that information (events) is provided via the standardized interface I_TcMessage. The trace level can be adjusted using TcEventSeverity.
Sample Code
Sample code for the usage of the Function Block is available here.