PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Various
  • Transmission between two computers that use character strings in different formats (UNICODE and ANSI)
  • Using an external library: RXTX
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).
Windows Mobile Reads a buffer in the entry buffer of the specified serial port or infrared port. The port must be opened beforehand (sOpen).
Remarks:
  • This function cannot be used with a parallel port.
  • WEBDEV - Server code This function affects the server.
  • Versions 16 and later
    Java Infrared ports are not managed.
    New in version 16
    Java Infrared ports are not managed.
    Java Infrared ports are not managed.
  • Versions 25 and later
    Linux Only serial ports are managed.
    New in version 25
    Linux Only serial ports are managed.
    Linux Only serial ports are managed.
Versions 16 and later
Java This function is now available for the Java applications.
New in version 16
Java This function is now available for the Java applications.
Java This function is now available for the Java applications.
Versions 25 and later
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
New in version 25
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for WEBDEV sites in Linux.
WINDEVLinux This function is now available for WINDEV applications in Linux.
Example
WINDEVWEBDEV - Server codeReports and QueriesAjaxUser code (UMC)
// Read 20 characters in the Message variable from
// the entry buffer of COM1
Msg is string
Msg = sRead(1, 20)
Windows Mobile
// Read 20 bytes in the Message variable from the entry buffer of COM1
Msg is Buffer
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).
    Versions 25 and later
    Linux Only this type of parameter is available.
    New in version 25
    Linux Only this type of parameter is available.
    Linux Only this type of parameter is available.
<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.
Windows Mobile

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

<Result> = sRead(<Port number> , <Size to Read>)
<Result>: Buffer
  • Buffer read in the entry buffer,
  • 0 if the read operation was not performed.
<Port number>: Integer
Relevant port number:
  • Number of serial port: 1, 2, 3, ... 32 for COM1, COM2, COM3, ... COM32.
  • Number of infrared port: 1, 2, 3, ... 32 for IR1, IR2, IR3, ... IR32.
  • Port number returned by sOpen (if this function was called with a port name).
<Size 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.
Windows Mobile Reminder: In UNICODE, each character occupies two memory bytes.
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.
WINDEVWEBDEV - Server codeWindows MobileAjaxUser code (UMC)

Transmission between two computers that use character strings in different formats (UNICODE and ANSI)

Some conversions are required to perform a transmission between two computers that use different formats of character strings (Windows (ANSI) and Windows Mobile (UNICODE) for example):
Format of character strings on the current computerWrite operation
(sWrite)
Read operation
(sRead)
Buffer containing a string in
ANSI format
Buffer containing a string in
UNICODE format
ANSI
(PC running Windows XP for example)
The character string will be in ANSI formatNo conversion is required
Conversion required (UnicodeToAnsi)
UNICODE
(Pocket PC running Windows CE for example)
The character string will be in UNICODE format
Conversion required (AnsiToUnicode)
No conversion is required
Versions 16 and later
Java

Using an external library: RXTX

In Java, the use of functions for handling the serial and parallel ports (sOpen, sWrite, sRead, ...) requires the presence of an external library: RXTX.
This library includes a Jar archive and one or more native libraries that depend on the operating system on which the application is run. To use these functions:
  • the Jar archive (RXTXComm.jar) must:
    • be found in the same directory as the Java application generated by WINDEV,
    • be found in the execution classpath of the application,
    • be directly included in the generated application (from the wizard for Java generation).
  • the native libraries corresponding to the operating system on which the application is run must be found:
    • in the same directory as the Java application generated by WINDEV,
    • in the path of the application libraries (librarypath).
The RXTX library and its documentation can be downloaded from: http://users.frii.com/jarvi/rxtx/index.html (link valid at the time this documentation was published).
Caution: The management of infrared ports is not available in Java.
New in version 16
Java

Using an external library: RXTX

In Java, the use of functions for handling the serial and parallel ports (sOpen, sWrite, sRead, ...) requires the presence of an external library: RXTX.
This library includes a Jar archive and one or more native libraries that depend on the operating system on which the application is run. To use these functions:
  • the Jar archive (RXTXComm.jar) must:
    • be found in the same directory as the Java application generated by WINDEV,
    • be found in the execution classpath of the application,
    • be directly included in the generated application (from the wizard for Java generation).
  • the native libraries corresponding to the operating system on which the application is run must be found:
    • in the same directory as the Java application generated by WINDEV,
    • in the path of the application libraries (librarypath).
The RXTX library and its documentation can be downloaded from: http://users.frii.com/jarvi/rxtx/index.html (link valid at the time this documentation was published).
Caution: The management of infrared ports is not available in Java.
Java

Using an external library: RXTX

In Java, the use of functions for handling the serial and parallel ports (sOpen, sWrite, sRead, ...) requires the presence of an external library: RXTX.
This library includes a Jar archive and one or more native libraries that depend on the operating system on which the application is run. To use these functions:
  • the Jar archive (RXTXComm.jar) must:
    • be found in the same directory as the Java application generated by WINDEV,
    • be found in the execution classpath of the application,
    • be directly included in the generated application (from the wizard for Java generation).
  • the native libraries corresponding to the operating system on which the application is run must be found:
    • in the same directory as the Java application generated by WINDEV,
    • in the path of the application libraries (librarypath).
The RXTX library and its documentation can be downloaded from: http://users.frii.com/jarvi/rxtx/index.html (link valid at the time this documentation was published).
Caution: The management of infrared ports is not available in Java.
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