Rockwell Automation Allen-Bradley ControlLogix 1756-MVI Programming Reference Manual page 115

Multi-vendor interface module
Hide thumbs Also See for Allen-Bradley ControlLogix 1756-MVI:
Table of Contents

Advertisement

MVIsp_PutData
Syntax:
int
MVIsp_PutData(int comport, BYTE *data, int *len, DWORD
timeout);
Parameters:
comport
port to which data is to be sent
data
pointer to array of bytes to be sent
len
pointer to number of bytes to send / bytes sent
timeout
amount of time to wait to send byte
Description:
This function is used to transmit an array of bytes across a serial port.
comport must be previously opened with MVIsp_Open.
data is a pointer to an array of bytes to be sent.
MVIsp_PutData sends each byte in the array data to the serial port. len
should point to the number of bytes in the array data to be sent.
All data sent to a port is queued before transmission across the serial
port. Therefore, some delay may occur between the time this function
returns and the actual time that the bytes are transmitted across the
serial line. This function attempts to insert the bytes into the
transmission queue, and return values correspond accordingly.
timeout specifies the amount of time in milliseconds to wait. If timeout
is TIMEOUT_ASAP, the function will return immediately if any of the
bytes cannot be queued immediately. If timeout is
TIMEOUT_FOREVER, the function will not return until all the bytes
are queued successfully.
If all the bytes can be queued immediately, MVIsp_PutData returns
MVI_SUCCESS. If the characters cannot be queued immediately,
MVIsp_PutData tries to queue the bytes until the timeout elapses. If
the timeout elapses before the bytes can be queued,
MVI_ERR_TIMEOUT is returned.
When MVIsp_PutData returns, it writes to the int pointed to by len the
number of bytes queued successfully. len is written for successfully
sent bytes as well as timeouts.
Note: If software handshaking is enabled on the external serial device,
sending data that contains XOFF characters may stop transmission
from the external serial device.
If handshaking is enabled and the receiving serial device has paused
transmission, timeouts may occur after the queue becomes full.
Serial Port API
Publication 1756-RM004B-EN-P - October 2000
5-27

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents