PmMicroUnit - Driver for communication with MicroUNIT PLC devices

This driver is used for communication with MicroUNIT PLC devices. See also Communication with TEDIA systems (Czech republic).
Before using this driver in the PROMOTIC application it is highly recommended to read the chapter: Communicaton using the PROMOTIC drivers.
Basic properties of the driver:
- Using this driver is bound to purchase the license: PmMicroUnit. With the freeware version PmFree, or when developing the application (with development environment for tersting purposes), this component is always functional.
- Driver communicates with modules MicroUnit serie of the Tedia czech firm, by the AIBus protocol.
- The communication is done via standard serial link (COM1, COM2 ...).
- The PROMOTIC application is the MASTER (i.e. it initiates the data transfer) from this communication point of view.
- The driver is incorporated into the PROMOTIC system by means of the PmComm object.

Driver supports to usage of PmCommMsg object. The PmCommData object cannot be used.

For easy integration of this driver into the application it is handy to use: Preconfigurations in group "MicroUnit PLC"

The protocol of the MicroUNIT AIBus modules is specified is the technical documentation as the communication between the MASTER unit(PC) and the SLAVE unit (individual modules). The protocol operates in such way that at first the "MASTER-SLAVE" message is sent that is used by the Master(PC) to prompt the module for the requested action. Modules are defined by their address in the RS485 network. Then after the prompt, the Slave responds with the "SLAVE-MASTER" message which contains the response in the form of the STATUS byte or the requested data. According to the specification, the protocol is formed of 10 bytes in the following order:
- DATA: 4B
- CRC: 2B

Some special peripheries require another length of the data but this protocol isn't described in the technical documentation and it isn't supported by the present version of the driver.


It is the mandatory parameter of the message that defines the address of the unit (module) in the RS485 network. If the segment 2 of the DIL switch SW is switched ON, the address is fixed and it is set to 0. If the segment 2 is switched OFF, the address is given by the value on the address 62 (COM_BD) of the configuration EEPROM (periphery no.0). The address and the speed rate are always initiated only on switching on the power of the module.


It determines the function that is requested from the module and it is the communication message parameter of the PmCommMsg object. The selection of the function is made by the "FUNCTION" listbox in the message parameters window. Besides defined functions it is possible to set the "User DEFINED function" function. Then the extra "Function" data item appears on the Data-sent page into which the user enters the function number directly, according to the technical documentation, or if needed, according to the numbers stated before the function names in the "FUNCTION" listbox.

A list of functions that can be used:
FN0 - Direct reading from the external unit
FN1 - Direct writing into the external unit
FN2 - Addressable reading from the external unit
FN3 - Addressable writing into the external unit
FN100 - Direct reading from the internal unit
FN101 - Direct writing into the internal unit
FN102 - Addressable reading from the internal unit
FN103 - Addressable writing from the internal unit
FN200 - Module identification
User DEFINED function

It determines which of functional blocks is written or read. For example digital I/O, timers, configuration EEPROM, and others (see the list) belong here. The periphery is selected by the same way as the function, by the "PERIPHERY" listbox in the message parameters window respectively. Like at functions it is possible to set the "User DEFINED periphery", which causes adding the "Periphery" item into the Data-sent page.

A list of peripheries that can be used:
0-15: ANALOG channel no.0 up to no.15
16: Sensor of the cold end
64: DIGITAL port no.0
65: DIGITAL port no.1
80-95: 32-bits COUNTER no.0 up to no.16
0: STATUS Register
1: RTC Time
2: RTC Date
3: TIME of outage
4: DATE of outage
5: TIME of power recovery
6: DATE of power recovery
0: Configuration EEPROM
1: User EEPROM
0,1,2: Module IDENTIFICATION, register no.0, no.1, no.2
xxx: Module service and DIAGNOSTIC
User DEFINED periphery
Data format:

The protocol library supports four extra formats of transmitted and received data, the following data types respectively:

- Byte (4 values)
- Integer (2 values)
- Long (1 value)
- Single (1 value)
- String (1 4-chars string) for reading values of the Module IDENTIFICATION

On entering these data types the type conversion to the MicroUNIT modules compatible format is kept.

Note: If you address, for example, the internal unit like the EEPROM configuration, have a look thoroughly at the description of addressing in the documentation. You can see that some peripheries have their own way of addressing that is not described in the AIBus protocol specification (instead of 2-bytes ADR, 1-byte ADR is sent twice). That's why the data format of 4-bytes variables is implemented.

Recommended values for the Serial link parameters:
Number of data bits8

The transfer is asynchronous in Full-duplex or Half-duplex mode. In case of the Half-duplex mode (for example on using RS485) it is necessary, according to the AIBus documentation, to control the parity bit (the prompt is transmitted with the even parity, the response with the odd parity). The PROMOTIC driver ignores the parity bits that's why it is possible to set to the fixed even parity.

Number of stop bits1
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice