User Manual
Table Of Contents
- About This Guide
- Introduction
- Kit Installation
- iB-5209 Network Monitor Operations
- iB-5209 Network Monitor Overview
- Setting Thread Priority
- Configuring a Node’s Operation
- Using Watch function to display current I/O information
- Configuring Sample Interval of Single Node
- Configuring Sample Interval of all Network Nodes
- Configuring Digital I/O Operation
- Configuring UART Operation
- Configuring AD (analog-to-digital) Converter Operation
- Configuring RS-232 Operation (RT-5209 only)
- Configuring RS-485 Operation (RT-5209 only)
- Labeling i-Bean Endpoint or i-Bean Router
- Creating an Event Log File
- Configure Persistence Attributes
- Configure Serial and ADC Data Formats
- Select Com Port on Host PC
- View Monitor Statistics
- View Contents of Event Log File
- Enable Multiple Capture
- API Functions
- Sample Application
EK-5209-5 Evaluation Kit User’s Guide A-23
iBeanAPI_IO.h
13. ibApi_IO_ReadSerial()
ibApi_FUNC ibApi_IO_ReadSerial (
ibApi_APIHANDLE api_hdl,
ibApi_DEVICEID device_id,
ibApi_UINT8 buffer[],
ibApi_UINT8 buffer_size,
ibApi_UINT8 seq_num
);
For the given device, this retrieves the user data packet that arrived most recently. The
ibApi_IO_SERIALMODE setting must have been previously something other than
ibApi_IO_SERIALMODE_DISABLED. The input buffer holds a single packet (i.e., an
arriving packet overwrites the previous one). Lost packets can be detected by gaps in the
sequence numbers, which increment whenever a packet is received. If no new data is
available, then the return value is 0.
Parameters:
api_hdl: (input) API handle returned from ibApi_Open().
device_id: (input) ID of the device to be accessed.
buffer[ ]: (output) Buffer to store the incoming user data packet.
buffer_size: (input) Maximum size for buffer[ ].
seq_num: (output) Sequence number identifying this packet, or NULL if this information
is not needed.
Return Value:
Error code or the actual size of the result (which could exceed buffer_size if the written
data was truncated)