beckhoff TwinCAT 3 — 12.8.4 Interface ITcCyclicCaller

Programming Reference | Interfaces Required include: TcIoInterfaces.h Methods The ITcCyclic interface is implemented by TwinCAT modules. This interface is passed to the ITcCyclicCaller::AddModule() method when a module logs itself on to a task, usually as the last initialization step during the transition from SafeOP to OP. After login, the CycleUpdate() method of the module instance is called. 12.8.3.1 Method ITcCyclic: CycleUpdate | Method ITcCyclic: CycleUpdate The CycleUpdate method is normally called by a TwinCAT task after the interface has been logged in.

Syntax HRESULT TCOMAPI CycleUpdate(ITcTask* ipTask, ITcUnknown* ipCaller, ULONG_PTR context) Return value If successful, S_OK ("0") or another positive value will be returned, cf. Return values [ } 161] . Extended messages refer in particular to the column HRESULT in ADS Return Codes [ } 323] . At present, the return value is ignored by the TwinCAT tasks. Parameter Description In a task cycle, the CycleUpdate() method is called after InputUpdate() has been called for all registered module instances. As a result, this method must be used to implement cyclic processing.

12.8.4 Interface ITcCyclicCaller | Interface ITcCyclicCaller Interface for logging in or out of the ITcCyclic interface of a module in a TwinCAT task. Syntax TCOM_DECL_INTERFACE("0300001E-0000-0000-e000-000000000064", ITcCyclicCaller) struct__declspec(novtable) ITcCyclicCaller : public ITcUnknown Required include: TcIoInterfaces.h Methods TwinCAT 3 162 Version: 1.19.1 Name Description CycleUpdate [} 162] Is called once per task cycle if the interface is logged on to a cyclic caller. Name Type Description ipTask ITcTask Refers to the current task context. ipCaller ITcUnknown Refers to the calling instance.

Context ULONG PTR _ Context contains the value that was passed to the ITcCyclicCaller::AddModule() method. Name Description AddModule [} 163] Login module that implements the ITcCyclic interface. RemoveModule [} 164] Log off the previously logged in ITcCyclic interface of a module.