MC_ExternalSetpointGenerator

This function block provides the API to implement an external setpoint generator from the PLC environment.
The included callback methods are called from MC task context.
At least the OnCyclicSetpointGeneration method must be implemented.

Requirements for deriving function block:
- The function block must implement ITcMcExternalSetpointGenerator interface.
- The function block and all overridden ITcMcExternalSetpointGenerator methods must have {attribute 'c++_compatible'}.
- The function block must override FB_init.

Notes:
For online change compatibility the function block must have a FB_reinit method, in which MC_ExternalSetpointGenerator.FB_reinit() is called.

Do not call the main FB directly. Only use the available methods.

MC_ExternalSetpointGenerator 1: Methods

Name

Description

FB_reinit

 

OnPreparation

Called once when the external setpoint generator is being prepared for activation.

OnStartPointInitialization

Called to initialize the starting point before cyclic setpoint generation begins.

OnCyclicSetpointGeneration

Called every MC cycle to compute the next setpoint values. Must be overridden.

OnDeactivation

Called when the external setpoint generator is deactivated/aborted.

Weiterführende Informationen

Versionsinformation

  • TwinCAT Standard >= v3.1.4026.23.1
  • TF5500 MC3 Base >= v4.0.6