FB_MlSvrPrediction
FB_MlSvrPrediction
is a TcMlServer client that provides asynchronous and optionally hardware-accelerated AI model inference for the PLC.
The function block is located in the PLC library Tc3_MlServer.
Syntax
Declaration:
fbMlSvr : FB_MlSvrPrediction;
Definition:
FUNCTION_BLOCK FB_FTR_IIRCoeff
VAR_INPUT
stPredictionParameter : ST_PredictionParameter;
END_VAR
VAR_OUTPUT
bError : BOOL;
nErrorCode : HRESULT;
bConfigured : BOOL;
nMaxInferenceDuration : UDINT;
END_VAR
Inputs
Name | Type | Description |
---|---|---|
ST_PredictionParameter | Configuration structure of the Machine Learning Server session |
Outputs
Name | Type | Description |
---|---|---|
bError | BOOL | TRUE if the currently pending asynchronous request to the TcMLServer was canceled with an error. |
nErrorCode | HRESULT | Return code for the currently pending asynchronous request to the TcMlServer. |
bConfigured | BOOL | TRUE if the configuration was successful. Indicates whether the function block has a valid session with the TcMlServer. If FALSE, "configure" must be called. Please note: bConfigured can change to FALSE due to an error during the execution of the request at the TcMlServer. |
nMaxInferenceDuration | UDINT | Maximum number of PLC cycles required to execute an inference. See also Execute AI model. |
Methods
Name | Definition location | Description |
---|---|---|
Local | Create a session for the FB instance on the TcMlServer according to the configuration defined in stPredictionParameter. | |
Local | End a session of the function block on the TcMlServer. The allocated resources on the server are released again. | |
Local | Get custom attributes of type ARRAY of the AI model | |
Local | Get custom attributes of type BOOL of the AI model | |
Local | Get custom attributes of type LREAL of the AI model | |
Local | Get custom attributes of type LINT of AI model | |
Local | Get custom attributes of type STRING of the AI model | |
Local | Transmission of an asynchronous inference request to the TcMlServer | |
Local | Transmission of an asynchronous, bundled inference request to the TcMLServer |