READCOMMDEVICE@

Platform

Win32

Purpose

To read data from an open serial port.

Syntax

INTEGER (KIND=3) READCOMMDEVICE@(PORTNUM,STRING,NREAD)
INTEGER (KIND=3) PORTNUM,NREAD
CHARACTER (LEN=*) STRING

Description

Use this function to read data from a serial port that has been opened by a call to OPENCOMMDEVICE@. PORTNUM must be a valid port number in the range 1 to 4 and NREAD is set as the maximum number of characters to be read. After the call STRING will contain the data held in the serial port up to NREAD characters. Fewer than NREAD characters will be read if one of the termination characters (set using SETCOMMTERMINATECHAR@) is encountered.

Return value

READCOMMDEVICE@ returns the number of characters read or -1 if an error occurred.

Notes

To access this routine you need to provide a definition by, for example, including the file clearwin.ins or by using the MSWIN module.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited