ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Serial/Parallel Ports functions
  • Using an external library: RXTX
  • Features specific to Android and Android widget
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Runs different functions that directly affect the bits of serial port, parallel port or infrared port, independently of the communication protocol. These functions are used to manage:
  • the DTR signal,
  • the RTS signal,
  • the XOFF and XON characters.
Remarks:
  • The port must be opened beforehand (sOpen).
  • LinuxAndroidAndroid Widget Java Infrared ports are not supported.
  • WEBDEV - Server code This function returns information regarding the server.
Example
// Efface le signale DTR
sEscape(NumPort, "CLRDTR")
Syntax
<Result> = sEscape(<Port number> , <Function>)
<Result>: Boolean
  • True if the function was run,
  • False otherwise. If the port was not opened beforehand (by sOpen), sEscape has no effect.
<Port number>: Integer
Identifier of the port used:
  • Port number:
    • Serial port number: 1, 2, 3, ... 32 for COM1, COM2, COM3, ... COM32.
    • Parallel port number: -1, -2, -3 or -4 for LPT1, LPT2, LPT3 or LPT4.
    • Infrared port number: 1, 2, 3, ... 32 for IR1, IR2, IR3, ... IR32.
  • Port identifier returned by sOpen (if this function was called with a port name).
    LinuxAndroidAndroid Widget Only this type of parameter is available.
<Function>: Character string
Function to run:
CLRBREAKClears the "Break line" signal.
Java This function is not supported.
CLRDTRClears the DTR signal.
CLRRTSClears the RTS signal.
RESETDEVReinitializes the device if possible.
AndroidAndroid Widget Java This function is not supported.
SETBREAKEnables the "Break Line" signal.
Java This function is not supported.
SETDTRSends the DTR signal.
SETRTSSends the RTS signal.
SETXOFFThe transmission behaves like if the XOFF character was received.
AndroidAndroid Widget Java This function is not supported.
SETXONThe transmission behaves like if the XON character was received.
AndroidAndroid Widget Java This function is not supported.
Remarks
Linux Special case for Linux:
  • Only serial ports can be opened and initialized.
  • By default, users do not have access to serial ports. It is necessary to grant them specific rights to manage serial ports.
Java

Using an external library: RXTX

In Java, the use of serial and parallel port manipulation functions (functions 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).
You can download the RXTX library and its documentation from the following link: http://users.frii.com/jarvi/rxtx/index.html (link valid at the time of writing).
Attention: Infrared port management not available in Java.
AndroidAndroid Widget

Features specific to Android and Android widget

In Android and Android widget mode, the serial and parallel port functions can be used:
  • Only on serial (not parallel or infrared) ports.
  • Only with devices that support the CDC/ACM protocol (Arduino ATmega32U4) and the following USB to serial converter chips:
    • FTDI FT232R, FT232H, FT2232H, FT4232H, FT230X, FT231X, FT234XD
    • Silabs CP210x
    • Qinheng CH340, CH341A
    • Prolific PL2303
Business / UI classification: Business Logic
Component: wd300com.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help