Method ITComOnlineChange:PrepareOnlineChange

This method is called to prepare the Online Change.

The method is called by TwinCAT to execute the OnlineChange. 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;

Parameter

ipOldObj: (Type: ITComObject*) Reference to the existing object to be exchanged.

pOldInfo: (type: TmcInstData*) reference to information of the existing object.

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.

Description

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);