MC_ActivateExternalSetpointGeneration
This function block activates external setpoint generation. Setpoints are generated by a function block, which is called through the ITcMcExternalSetpointGenerator interface from the MC context. Additionally custom startup data can be passed through the generator.
Syntax
Definition:
FUNCTION_BLOCK MC_ActivateExternalSetpointGeneration
VAR_IN_OUT
Axis : Reference To AXIS_REF;
END_VAR
VAR_INPUT
Execute : BOOL;
ExternalSetpointGenerator : ITcMcExternalSetpointGenerator;
AllowOtherContext : BOOL;
EnableDynamicChecks : BOOL;
InvokeId : XWORD;
BufferMode : EBufferMode;
END_VAR
VAR_OUTPUT
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorId : UDINT;
END_VAR
Inputs
|
Name |
Type |
Default |
Description |
|---|---|---|---|
|
Execute |
BOOL |
|
Trigger the command with rising edge. |
|
ExternalSetpointGenerator |
ITcMcExternalSetpointGenerator |
|
Function block that implements (cyclic) methods for external setpoint generation |
|
AllowOtherContext |
BOOL |
false |
Allow the calling task to differ from the MC task (MET task). When TRUE, ensure compatible update rates and safe data access in the ITcMcExternalSetpointGenerator methods. |
|
EnableDynamicChecks |
BOOL |
true |
Trigger error on inconsistent setpoint values (position, velocity, acceleration) if EnableDynamicChecks = TRUE. |
|
InvokeId |
XWORD |
0 |
Invocation identifier, passed through to the external setpoint generator. Can be used to distinguish multiple activations of the same generator, or to pass custom data (e.g. a pointer). |
|
BufferMode |
Aborting |
Chronological sequence of the command |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
Busy |
BOOL |
Function block is not finished and new output values are to be expected. |
|
Active |
BOOL |
Function block has active control on the axis. |
|
CommandAborted |
BOOL |
Command is aborted by another command. |
|
Error |
BOOL |
Error occurred within function block. |
|
ErrorId |
UDINT |
Error identifier |
Weiterführende Informationen
Mögliche Fehlercodes
Für diesen Funktionsbaustein sind unter anderem die folgenden Werte für den Ausgang ErrorId möglich:
Fehler(Hex) | Fehler(Dez) | Fehlertyp | Beschreibung |
|---|---|---|---|
0x813c | 33084 | Parameter | Der Buffer-Modus ist ungültig. Der am Funktionsbaustein angegebene BufferMode ist unbekannt oder wird vom Kommando nicht unterstützt (einige Kommandos akzeptieren z.B. nur Aborting, andere nur Buffered). |
0x8145 | 33093 | Funktionsbaustein | Die Verknüpfung des zyklischen Interfaces zwischen NC und SPS fehlt (z.B. AXIS_REF, AXES_GROUP_REF, ...). Eine vom Funktionsbaustein verwendete Referenz (z.B. auf eine Achse, Gruppe, einen Mover oder ein anderes Motion-Objekt) ist nicht mit dem zugehörigen NC-Objekt verknüpft oder die zyklische Verknüpfung ist unvollständig. |
0x81af | 33199 | Funktionsbaustein | Ungültiges Objekt oder ungültige Objekt-Referenz an Funktionsbaustein übergeben. Dem Funktionsbaustein wurde eine ungültige oder fehlende Objekt-Referenz übergeben (z.B. fehlende CamObject-Referenz an MC_CamIn, MC_CamTableSelect oder MC_CamScaling). |
Eine Übersicht aller NC-Fehlercodes finden Sie hier:
Im Zusammenhang mit den Taskeinstellungen und dem Eingang AllowOtherContext = FALSE kann es zum Fehler ADSERR_DEVICE_INVALIDCONTEXT (0x709; 1801) kommen, falls die MC3 und die PLC nicht von der gleichen Task aufgerufen werden.
Eine Übersicht aller ADS Return Codes finden Sie hier:
Versionsinformation
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.6