TwinCAT PLC Library Hydraulics - Version 1.4 — 4.1.14 MC_SetReferenceFlag_BkPlcMc (from V3.0)

PLCopen Motion Control VAR_INOUT Axis: Axis_Ref_BkPlcMc; END_VAR Execute : A positive edge at this input sets the actual position of the axis. Position : [mm] The new actual position of the axis. Mode : This parameter specifies the operating mode. If Mode = TRUE, the actual position is changed by Position , if Mode = FALSE, the actual position is set to Position. Done : This indicates successful processing of the command. Busy : This output is TRUE while the command is being processed. Error : The occurrence of an error is indicated here. ErrorID : An encoded indication of the cause of the error is provided here. Axis :

Here, the address of a variable of type Axis_Ref_BkPlcMc [ } 67] should be transferred. Behavior of the function block The function block is activated by a positive edge at Execute , and investigates the axis interface that has been passed to it. A number of problems can be detected and reported during this process: Depending on the encoder type specified in Axis.pStAxParams^.nEnc_Type , either ST_TcHydAxRtData.fEnc_RefShift or ST_TcHydAxParam.fEnc_ZeroShift is updated such that the actual position of the axis assumes the required value. If the encoder types is unknown or the encoder does not permit the actual value to be set, the system responds with Error and ErrorID :=dwTcHydErrCdEncType.

If ST_TcHydAxParam.fEnc_ZeroShift changes recognizable during this process, Axis_Ref_BkPlcMc [ } 67] . ST_TcHydAxRtData [ } 99] .bParamsUnsave is set. NOTE! This function block may cause the actual position and/or the target position of the currently processed motion to be moved after an active software limit switch. This is not monitored by the function block. If these checks could be performed without problem, all other affected elements in ST_TcHydAxRtData are automatically updated. This function block can therefore also be activated for axes, which perform an active motion. The successful execution of the function is indicated with Done .

A negative edge at Execute clears all the pending output signals. 4.1.14 MC_SetReferenceFlag_BkPlcMc (from V3.0) (Function is not defined by PLCopen) The function block defines the referencing flag of the axis. VAR_INPUT Execute: BOOL; ReferenceFlag: BOOL; END_VAR VAR_OUTPUT Done: BOOL; Busy: BOOL; Error: BOOL; ErrorID: UDINT; END_VAR PLC Library Hydraulics 40 Version: 1.4