Method ITComOnlineChange:PrepareOnlineChange

This method is called by TwinCAT to prepare for the Online Change.

It runs asynchronously in the background, which must be taken into account when accessing the existing object.
The preparation should include all operations that can already be performed.

Syntax


virtual HRESULT TCOMAPI PrepareOnlineChange(ITComObject* ipOldObj, TmcInstData* pOldInfo) = 0;

Method ITComOnlineChange:PrepareOnlineChange 1: Return value

If successful, S_OK ("0") or another positive value will be returned, cf. Return values. Extended messages refer in particular to the column HRESULT in ADS Return Codes.

Parameter

Name

Type

Description

ipOldObj

ITComObject*

Reference to the existing object to be exchanged.

pOldInfo

TmcInstData*

Reference to information of the existing object.

Via ipOldObj, the data of the existing object is made available for transfer so that it can be applied.

For example:

ULONG nData = sizeof(m_Parameter);
PVOID pData = &m_Parameter;
ipOldObj->TcGetObjPara(PID_Module1Parameter, nData, pData);