Programming Reference | Interfaces Description A TwinCAT module class normally uses a Smart Pointer to refer to the cyclic I/O caller of type ITcIoCyclicCallerPtr. The object ID of the cyclic I/O caller is stored in this Smart Pointer and a reference can be obtained via the TwinCAT object server. In addition, the Smart Pointer class already contains a list item. Therefore the Smart Pointer can be used as the first parameter for the AddIoDriver method. The following code sample illustrates the login of the ITcIoCyclicCaller interface.
HRESULT hr = S_OK; if ( m_spIoCyclicCaller.HasOID() ) { if ( SUCCEEDED_DBG(hr = m_spSrv->TcQuerySmartObjectInterface(m_spIoCyclicCaller)) ) { if ( FAILED(hr = m_spIoCyclicCaller->AddIoDriver(m_spIoCyclicCaller, THIS_CAST(ITcIoCyclic))) ) { m_spIoCyclicCaller = NULL; } } } 12.8.8.2 Method ITcIoCyclicCaller:RemoveIoDriver | Method ITcIoCyclicCaller:RemoveIoDriver Remove a module instance from being called by a cyclic I/O caller. Syntax virtual HRESULT TCOMAPI RemoveIoDriver(STcIoCyclicEntry* pEntry)=0; 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] . The method returns E_FAIL if the entry is not in the internal list. Parameter Comparable with the AddIoDriver() method, the smart pointer is used for the cyclic I/O caller as a list item if the module instance is to be removed from the cyclic I/O caller. Declaration and use of the Smart Pointer: ITcIoCyclicCallerInfoPtr m_spIoCyclicCaller; if ( m_spIoCyclicCaller ) { m_spIoCyclicCaller->RemoveIoDriver(m_spIoCyclicCaller); } m_spCyclicCaller = NULL; 12.8.9 ITComOnlineChange interface | ITComOnlineChange interface The ITComOnlineChange interface is used to perform Online Changes of modules.
Syntax TCOM_DECL_INTERFACE ("D28A8CD2-5477-4B75-AF0F-998841AF9E44", ITComOnlineChange) TwinCAT 3 175 Version: 1.19.1 Name Type Description pEntry STcIoCyclicEntry Refers to the list item to be removed from the internal list of the cyclic I/O caller.