PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Detecting events and threads
  • Managing very close events
  • Disabling one or more events
  • Closing the port
  • 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
Branches an event on a serial port.
WEBDEV - Server code This function returns information regarding the server.
Versions 16 and later
WINDEVJava This function is now available for the Java applications.
New in version 16
WINDEVJava This function is now available for the Java applications.
WINDEVJava This function is now available for the Java applications.
Example
// Detect characters on COM1 port
sEvent(1, sEveCharReceived, "ReadCharacter")
// -- Reading procedure
PROCEDURE ReadCharacter(PortNum, EventNum)
Trace(sRead(1, sInEntryQueue(1)))
Syntax
<Result> = sEvent(<Port Number> , <Event Managed> , <Procedure Name>)
<Result>: Boolean
  • True if the function was run,
  • False otherwise. sEvent has no effect if the le port was not opened beforehand in "Event management" mode (by sOpen).
<Port Number>: Integer
  • Number of serial port (1, 2, 3, up to 32 for COM1, COM2, COM3, ... COM32).
  • Port number returned by sOpen (if this function was called with a port name).
<Event Managed>: Integer constant (or combination of constants)
Event to retrieve on the port:
sEveBreak
(value: 64)
Receive a "Break line" event
sEveCharReceived
(value: 1)
Receive a character
sEveCTS
(value: 8)
Change of CTS status
sEveDSR
(value: 16)
Change of DSR status
sEveTransmitCompleted
(value: 4)
The output buffer is empty
sEveError
(value: 128)
Detect an error on the line
Versions 16 and later
Java This constant is not available.
New in version 16
Java This constant is not available.
Java This constant is not available.
sEvePrinterError
(value: 512)
Printer error detected
Versions 16 and later
Java This constant is not available.
New in version 16
Java This constant is not available.
Java This constant is not available.
sEveEntryQueue80
(value: 1024)
The input buffer is full at 80%
Versions 16 and later
Java This constant is not available.
New in version 16
Java This constant is not available.
Java This constant is not available.
sEveRing
(value: 256)
Detect the "Ring" signal (ring)
sEveRLSD
(value: 32)
Change of RLSD status
Versions 16 and later
Java This constant is not available.
New in version 16
Java This constant is not available.
Java This constant is not available.
<Procedure Name>: Character string
Name of WLanguage procedure called whenever the specified event is detected. This procedure has the following format:
PROCEDURE <Procedure Name>(<Port Number>, <Event Number>)
where <Port Number> corresponds to the port where the event occurred
where <Event Number> corresponds to one of the event constants.
Remarks

Detecting events and threads

The detection of events is performed in a specific thread of WLanguage. The call to the WLanguage procedure is performed in this thread. Therefore, this procedure is subject to thread limitations (especially for the display).
See Managing threads for more details.

Managing very close events

If another event is triggered during the procedure triggered by the event, this last event will not be detected.
If very close events are likely to be triggered, we advise you to:
  • read the event data (with sRead) in the procedure triggered by sEvent,
  • perform the rest of process in another thread.

Disabling one or more events

To disable the management of one or more events, use sEndEvent.

Closing the port

When closing the port, all the events managed on this port are disabled. When re-opening the port, you must re-run sEvent to define the events managed on this port.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Java wd230java.jar
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment