About companyProductsShopTechnical support
Moravian Instruments
Main page
About company
Software download
Documents download
Products
The Control Web System
VisionLab Machine Vision Software
DataCam Cameras and DataLight Lighting Units
DataLab industrial input/output system
Scientific cameras
Price list
Services
Custom-made Solutions
Technical support
Control Web Examples

Main pageControl Web ExamplesControl web Documentation

Communication with Peripherals — Drivers

A driver in the Control Web serves for communication with a peripheral. For each device it is necessary to use the corresponding driver. The driver is inserted into the application, it is configured, and then it is possible to insert channels into the application. Channels communicate with the peripheral via the driver. Some drivers are part of Control Web installation, others must be installed before their use.

Inserting Driver Into an Application

Driver configuration in the application is performed in Data Inspectors. Switch to the Data Inspectors tab and select the driver item in the tree . The Control Web displays all drivers in your application in the table in the right part of the data inspectors. If you want to add new driver to your application, click in the table on the last line with the <add> text and set all required parameters. For each driver, it is necessary to set its identifier (it is possible to use it in the application or during the channels definition) and the driver type. The driver type (it is set in the Driver column) specifies which driver (i.e. which library) will be used for communication. Control Web offers the list of all currently installed drivers.

Drivers configuration in Data inspectors

Drivers configuration in Data inspectors

If the driver, you want to use, is not in the list, this driver is not currently installed.

Additionally, it is necessary to specify the driver parameter file name and the driver map file name. These external text files are used for driver configuration. The last parameter Hidden enables to hide the window with information about the driver during the application running if the driver offers it.

Driver startup mode

With this parameter, you can start the driver in simulation mode. It is possible to develop and test the application even if the device communicating with driver is not connected or if the driver is not installed.

The parameter has the following options:

  • run

    Driver run. Starting the application loads the driver, channel reading or writing cause communication.

  • check

    Simulated driver run. The driver is not loaded at application start, channel reading or writing is ignored. Control Web checks the numbers, types and directions of channels used in the application according to a mapping file (DMF). If the driver does not use the mapping file and the channels are defined, this option cannot be used.

  • simulate

    Similar as check, but the Control Web does not check numbers, directions or types of channels.

Driver Configuration

Each driver connected to Control Web application, must be correctly configured. The driver parameter file is used for driver configuration. The driver parameter file is an text file, usually with the PAR extension. The structure and the content of the file depend on used driver. Control Web does not read this file during the application running, it only pass its name to the driver. In most cases, the parameter file structure is identical with commonly used INI files.

The parameter file contains parts, so-called sections. Each section starts with its name in square brackets. As a rule, one line in section contain only one parameter. In the line after the parameter name and the equal sign, there is the parameter value or more values separated by a comma. Below, there is simple parameter file example.

[this is the section name] 
  parameter_1 = value
  parameter_2 = 123 
  parameter_3 = true 

[section_2] 
  parameter = a, b, c 

As well as during application creation in the Control Web, it is possible to configure drivers either in the text editor or in the graphic inspector by completing a well arranged table. You can run the driver inspector by push button in the Data inspectors. The driver inspector is not supported by all drivers, some drivers have their own configuration tools (detailed description is in the driver documentation). The following Chapter describes the universal inspector for driver configuration.

Driver Inspector

After starting, the inspector is displayed similarly as in the following picture. Using the Properties and Source Text tabs, it is possible to switch between text editing (i.e. parameter file editing) and editing the parameters in the table.

Driver inspector

Driver inspector

In the picture, there is the driver inspector with the ascdrv driver parameter file (driver for ASCII communication). The following picture shows driver parameters editing in the table. The table structure always corresponds to the parameter file structure, therefore, it is specific for each driver type.

Driver inspector

Driver inspector

Driver Channels Configuration

Channels are used for communication between an Control Web application and the driver (and through the driver with a peripheral). Each channel created in the application must be correctly set in the map (DMF file) and, also in the driver parameter file. The map file tells to the Control Web core which channels are offered by the driver, and the parameter file tells the driver which device or memory area relates to the channel (exceptions are the fixed set channels of some drivers, e.g. channel number 4 in the ASCII driver serves for text string sending). Each channel must have its own number, data type and direction.

If you configure the driver in the driver inspector graphic part (the Properties tab), you modify the driver parameter through the table, as well as the driver map (DMF) file.

Configuration of the driver channels

Configuration of the driver channels

In the upper part of the table, the driver parameters are set (in the picture, there are the parameters of driver for TCP/IP communication — cwnetdrv). In the second table, there is the list of all defined channels (in fact, it is the DMF file list).

If some channels in the table are displayed in grey, they are defined only in the DMF file and they are not defined in driver parameters (in the upper part of the table — i.e. in the parameter file). If such channels are used in the application, their reading or writing will not have any effect.

Searching for Connected Devices

Some Control Web drivers can search for peripherals that are currently connected to the computer and correctly set the driver parameters according to them (modify the parameter file). If the driver supports searching, you will run it in the driver inspector from the Tools menu by the Device search option.

If you run device searching, the inspector runs the driver, searches for the device and displays all found devices in a tree. In the tree of currently connected devices, you can select which devices will be connected to the application (inserted into the parameter file). If you confirm the option, the driver modifies its configuration.

 
 | About company | Products | Technical support | Software download | Documents download | 
Moravian Instruments, Masarykova 1148, Zlin 4, CZ-76302, Czech Republic