PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

  • Various
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Reads a character string in the entry buffer of the specified serial port. The port must be opened beforehand (sOpen).
Remarks:
  • This function cannot be used with a parallel port.
Example
Reports and Queries
// Read 20 characters in the Message variable from
// the entry buffer of COM1
Msg is string
Msg = sRead(1, 20)
Syntax

Reading a number of bytes and retrieving a string Hide the details

<Result> = sRead(<Port number> , <Number of bytes to read>)
<Result>: Character string
  • Character string read in the entry buffer,
  • 0 if the read operation was not performed.
<Port number>: Integer
  • Number of the relevant serial port: 1, 2, 3, ... 32 for COM1, COM2, COM3, ... COM32.
  • Identifier of the serial port returned by sOpen (if this function was called with a serial port name).
<Number of bytes to read>: Integer
Number of bytes to read in the entry buffer of the serial port. The number of bytes to read is returned by sInEntryQueue.
Remarks

Various

  • sRead has no effect if the port was not opened by sOpen.
  • sRead clears the input queue from the number of bytes actually read.
  • A 32-bit application is locked during the duration of the transfer. To avoid this lock, the time-out between two read operations must be specified in sOpen. Once the time-out is over and if the read operation was not performed, sRead returns 0.
  • WLanguage does not allow you to manage the control signals.
Business / UI classification : Business Logic
Component : wd250com.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment