Programming Reference | Interfaces 12.8.5.2 Method ITcFileAccess:FileClose | Method ITcFileAccess:FileClose Closes a file. Syntax virtual HRESULT TCOMAPI FileClose(PTcFileHandle phFile); 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] . A particularly interesting error code is ADSERR_DEVICE_TIMEOUT if the timeout (5 seconds) has elapsed. Parameter 12.8.5.3 Method ITcFileAccess:FileRead | Method ITcFileAccess:FileRead Reads data from a file.
Syntax virtual HRESULT TCOMAPI FileRead(TcFileHandle hFile, PVOID pData, UINT cbData, PUINT pcbRead); 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] . A particularly interesting error code is ADSERR_DEVICE_TIMEOUT if the timeout (5 seconds) has elapsed. Parameter 12.8.5.4 Method ITcFileAccess:FileWrite | Method ITcFileAccess:FileWrite Write data to a file.
Syntax virtual HRESULT TCOMAPI FileWrite(TcFileHandle hFile, PCVOID pData, UINT cbData, PUINT pcbWrite); 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] . A particularly interesting error code is ADSERR_DEVICE_TIMEOUT if the timeout (5 seconds) has elapsed. TwinCAT 3 166 Version: 1.19.1 Name Type Description phFile TcFileHandle [out] returned file handle of the file to be closed Name Type Description hFile TcFileHandle [in] refers to the previously opened file. pData PVOID [out] storage location of the data to be read.
cbData PVOID [in] maximum size of the data to be read (size of the memory behind pData). pcbRead PUINT [out] size of the data read.