EasyManua.ls Logo

Rockwell Automation Allen-Bradley ControlLogix 1756-MVI - Page 111

Rockwell Automation Allen-Bradley ControlLogix 1756-MVI
145 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Publication 1756-RM004B-EN-P - October 2000
Serial Port API 5-23
MVIsp_Puts
Syntax:
int MVIsp_Puts (int comport, BYTE *str, BYTE term, int *len,
DWORD timeout);
Parameters:
comport port to which data is to be sent
str string of characters to be sent
term termination character of string
len pointer to BYTE to receive number of characters sent
timeout amount of time to wait to send character
Description:
This function is used to transmit a string of characters across a serial
port. comport must be previously opened with MVIsp_Open.
str is a pointer to an array of characters (or is a string) to be sent.
MVIsp_Puts sends each char in the array str to the serial port until it
encounters the termination character term. Therefore, the character
array must end with the termination character. The termination
character is not sent to the serial port.
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 characters are transmitted across
the serial line. This function attempts to insert the characters 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
characters cannot be queued immediately. If timeout is
TIMEOUT_FOREVER, the function will not return until all the
characters are queued successfully.
If all the characters can be queued immediately, MVIsp_Puts returns
MVI_SUCCESS. If the characters cannot be queued immediately,
MVIsp_Puts tries to queue the characters until the timeout elapses. If
the timeout elapses before the characters can be queued,
MVI_ERR_TIMEOUT is returned.
If len is not NULL, MVIsp_Puts writes to the int pointed to by len the
number of characters queued successfully. len is written for
successfully sent characters as well as timeouts.
Note: If handshaking is enabled and the receiving serial device has
paused transmission, timeouts may occur after the queue becomes
full.

Table of Contents

Other manuals for Rockwell Automation Allen-Bradley ControlLogix 1756-MVI

Related product manuals