PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Serial port/parallel port/infrared port
  • Using an external library: RXTX
  • USB port
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
Managing the ports (serial ports, parallel ports, USB ports, ...)
Overview
Several devices can be managed directly via a management of the ports used by these devices to communicate with the computer. Therefore, the management of a serial, parallel or infrared port can be used to directly manage a bar code reader or a print as you go.
WINDEV, WEBDEV and WINDEV Mobile allow you to manage the actions performed on these different ports.
Serial port/parallel port/infrared port
Several WLanguage functions can be used to easily manage the serial and parallel ports. All these functions start with the letter s.
You can for example:
  • open a serial or parallel port (sOpen) or close it (sClose).
  • write into a serial port (sWrite) or read its content (sRead).
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.
USB port
The management of a USB port does not depend on the port itself but on the device that is attached to it. The management of a USB port to which a printer is connected differs from the management of a USB port to which a scanner is connected. No management standard can be defined.
The USB port is not a passive port like the serial port or the parallel port. It is always subject to the use of a specific driver for the device used.
Therefore, WINDEV or WEBDEV does not manage the USB port but the device that is installed on this port. If the device installed is:
  • a printer, you have the ability to use the print functions.
  • a scanner, you have the ability to use the TWAIN functions,
  • ...
In most cases, the devices connected to a USB port are supplied with a driver. We advise you handle this driver from WINDEV directly.
WINDEV proposes USB functions to handle the elements accessible from a USB port.
Related Examples:
Direct print Unit examples (WINDEV): Direct print
[ + ] Direct print on a dot-matrix printer with the WLanguage functions.
The following topics are presented in this example:
1/ the functions for managing the communication ports
2/ sending sequences to a printer.

This example powered by WINDEV is used to directly print on the dot-matrix printer connected to the parallel port of your choice.
This example is using the WLanguage "sWrite" function.
This feature is very useful for the applications exploiting cash registers.
This example is not suited for a laser printer ; in this case, we recommend that you use the report editor of WINDEV.
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment