
ControlLogix Platform ♦ "C" Programmable CIP API Functions
Linux Application Development Module Developer's Manual
ProSoft Technology, Inc. Page 101 of 264
March 12, 2014
OCXcip_ReadConnected
Syntax
int OCXcip_ReadConnected(OCXHANDLE apihandle,
OCXHANDLE connHandle,
BYTE *dataBuf,
WORD offset,
WORD dataSize );
Parameters
handle returned by previous call to OCXcip_Open
handle of open connection
pointer to buffer to receive data
offset of byte to begin reading
Description
This function is used by an application to read data being received on the open
connection specified by connHandle.
apiHandle must be a valid handle returned from OCXcip_Open. connHandle must be
a handle passed by the connect_proc callback function. offset is the offset into
the connected data buffer to begin reading. dataBuf is a pointer to a buffer to
receive the data. dataSize is the number of bytes of data to be read.
Notes: When a connection has been established with a ControlLogix controller, the first 4 bytes of
received data are processor status and are automatically set by the controller. The first byte of data
appears at offset 4 in the receive data buffer.
Return Value
data was read successfully
apihandle does not have access
connHandle or offset/dataSize is invalid
Example
OCXHANDLE apihandle;
OCXHANDLE connHandle;
BYTE buffer[128];
// Read 128 bytes from the connected data buffer
OCXcip_ReadConnected(handle, connHandle, buffer, 0, 128 );
See Also
OCXcip_WriteConnected
Kommentare zu diesen Handbüchern