TCatIoGetOutputPtr

The TCatIoGetOutputPtr function allocates an output buffer for the outgoing process image.

LRESULT TCatIoGetOutputPtr ( 
  USHORT nPort, 
  VOID** ppOutp,
  int nSize 
);

Parameters

nPort

Port id of the I/O task whose process image should be used to transfer the output data. For further information on defining the task process image see the TwinCAT System Manager documentation, chapter "Additional tasks".

ppOutp

Address of the pointer to get the address of the output buffer. If TCatIoGetOutputPtr succeeds, the pointer is initialized to the address of the output buffer.

nSize

Number of bytes for the requested process image buffer.

Return Values

If the function fails, the return value is non zero.

Remarks

TCatIoGetOutputPtr allocates a user buffer for the process image of the specified task and returns the address in ppOutp. If the buffer was already allocated, TCatIoGetOutputPtr returns the address of the previously allocated buffer. The output data will be transferred through this buffer. If TwinCAT is stopped or restarted while the user mode process is running the output address remains valid, although the I/O transfer is temporarily stopped. In case of a TwinCAT Restart, the user mode process can resume the execution without any extra calculation.

QuickInfo

For Windows NT:    

For Windows CE:

See Also

TCatIoGetInputPtr ()