Methods, Open, Close – EUCHNER ActiveX Module serial/USB User Manual

Page 8: Read, Write, 1 open, 2 close, 3 read, 4 write, Manual eks activex

Advertising
background image

Manual EKS ActiveX

®

Module serial / USB

3.4 Methods

3.4.1 Open

 Description

Opens the serial interface to the EKS with the properties set (BaudRate, Port, KeyType,
StartAdress, CountData ...).

 Syntax

Boolean = object.EKS.Open;

 Comments

The EKS must be connected and ready for operation before this method is used. The
method returns the value True (error-free execution) or False (status message has been
generated). If a status message has been generated the cause can be determined
using the property LastState. You will find an overview on the status messages for the
ActiveX

®

module in section 3.5.4. On completion of the asynchronous execution the

event OnKey is triggered. To get the actual condition of the method Open, the property
Opening can be polled. At the end of a program any open serial connections must be
closed again by calling the method Close.

Information!
The method Open starts a background process which establishes the communication with the device.
The return value True signals only, that the background process could be started. Hereby a physical
connection to the device is not checked.

3.4.2 Close

 Description

Closes the serial interface to the EKS.

 Syntax

Boolean = object.Close ();

 Comments

This method must be run at the end of the user program to clear the PC's serial
interface.

3.4.3 Read

 Description

Method for reading data from the Electronic-Key (start address is defined in the property
StartAdress and the number of bytes of data in the property CountData)

 Syntax

Boolean = object.Read ();

 Comments

If the method returns True, the data will be read from the EKS. These data are to be
found in the property Data after the event OnRead is triggered. If False is returned it
was not possible to start the read request without errors. In this case the status number
is given in the property LastState. You will find an overview on the status messages for
the ActiveX

®

module in section 3.5.4.

Information!
If you only want to read the data on the EKS Electronic-Key, you do not need to explicitly call the
method Read. As soon as the event OnKey is triggered and the property is KeyState = EKS_KEY_IN,
the data on the actual key are available in the property Data. Prior to triggering the event OnKey the
method Read is executed internally in the ActiveX

®

module.

3.4.4 Write

 Description

Method for writing data to the Electronic-Key (start address is defined in the property
StartAdress and the number of bytes of data in the property CountData)

 Syntax

Boolean = object.Write ();

 Comments

If the method returns True, the data will be written to the Electronic-Key. The write
request is complete after the event OnWrite is triggered. If False is returned it was not
possible to start the write request without errors. In this case the status number is given
in the property LastState. You will find an overview on the status messages for the
ActiveX

®

module in section 3.5.4.

Page 8

/

20

Subject to technical modifications

098655-03-10/12

Advertising