CONFIGURING OPERATION MODES

of the ZETLAB Digital Sensors

In most cases, the ZETSENSOR units are configured with the standard ZETLAB software, in the Device Manager on the “Service” tab. However, some applications require to change the digital sensor setting without using the ZETLAB software. For this purpose, a dedicated algorithm of working with ZETSENSOR is provided (see Figure 1).

Алгоритм по работе с ZETSENSOR
Figure 1

When operating with the digital sensors, ZETLAB software creates a so-called “setting snapshot” for each of them representing a “.dat” file with binary contents. The name of this file has the following format: ZET 7AAA # 0xBBBBBBBBBBBBBBBB_C.dat, where 7AAA is a type (e.g. 7121), BBBBBBBBBBBBBBBB is a serial number in the hexadecimal format, (e.g. 2b0c575b5a2f0922), and C is device address (e.g. 4). The contents of the file fully matches the contents of the measuring unit registers. The process of configuration is changing the configuration file content in accordance with the register table for each unit. The register address table is generated using SensorWork software. After the configuration file is changed, the program working with ZETSENSOR picks up the changes and introduces them to the device automatically.

From the programming point of view, the configuration procedure is as shown below:

Search for the required file in “…configZET7xxx” directory by the device type, serial number, and address. The path to the “config” directory is stored in the registry and can be obtained via the ZETPath.ocx component.

Пример программирования 1
Identifying file size, opening the file to read and reading its contents to a byte array.

Пример программирования 2
Modifying the array read from the file. The place of modification is determined by the shift and register size from the registry address table.
Пример программирования 3
Writing the modified contents to the configuration file.

Пример программирования 4