This driver serves for communication with
INMAT66/51 heat meters. See also
Communication with INMAT heat meter (Czechia).
Before using this driver in the PROMOTIC application it is highly recommended to watch "
PROMOTIC video tutorial 4 - Communication drivers".
Basic properties of the driver:
- Usage of this driver requires purchase of the
PmInmat66 licence. When developing the application in the freeware mode
PmFree, or with
development environment and while testing it in runtime, this component is always functional.
- The communication is done for Ethernet (PROMOTIC application is client) or for serial link (COM1, COM2 ...). For now, sending the same data via Ethernet as for serial link is implemented.
Even if the device does not have the Ethernet interface it is possible to connect it by "serial link-Ethernet" converter and let it communicate with the PROMOTIC application via Ethernet.
- The PROMOTIC application is the Master (it means that it initiates the data transfer) from this communication point of view.
- The communication allows sending messages with high and low priority (for more details see the INMAT documentation). The selection of the message priority (if it is possible in the message) is made in the message parameters.
The driver supports the following data types:
-
signed int: 2-byte integer (from
-32 768 to
+32 767).
In the PROMOTIC application represented by the
Integer data type.
-
unsigned int: 2-byte integer (from
0 to
65 535).
In the PROMOTIC application represented by the
Long data type.
-
long: 4-byte integer (from
-2 147 483 648 to
+2 147 483647).
In the PROMOTIC application represented by the
Long data type.
-
float: 4-byte real number.
In the PROMOTIC application represented by the
Single data type.
-
string: The number of characters is limited by the size of the message data part, thus it can hold values from 0 to 246 bytes.
If we know the exact length of the response message string, then it is necessary to set the length of the read string increased by 1 in the received data (we read even the end character 0).
If the length of the read string on the "
Data-received" tab is lower than the real length of the read string, then the system reports the "
66" error.
If we don't know the exact length, then the maximum value can be set.
Device addressing:
Each device (
Master and
Slave) has its own unique address. The addresses can lie in the range from 0 to 63. The number of the control station (the computer with the PROMOTIC system) is entered in the protocol parameters. The number of the receiving device (
INMAT) is entered in the sent data of the message.
Memory addressing:
- Addressing by INX: It is possible to choose the address by selection the memory name in the message parameters and the system itself adds the INX value. If we want to enter the INX value directly, then it is possible to choose the "Memory type"->"INX common value" in the message parameters.
-
Addressing by segment and offset: This direct addressing type is called physical addressing and is based on entering the values of the segment (defines the memory area) and the offset (address in the memory area).
INMAT66 has 2 memory areas with segments 0000H and 0010H-0013H:
segment 0000H: In this segment the whole memory area is directly accessible by the processor. There are variables, part of the archive memory and the program. The offset can be from 0000H to FFFFH.
segment 0010H-0013H: The archive data is saved here up to 256kB. The offset can be from 0000H to FFFFH. Segment 0010H addresses the memory 00000H-0FFFFH, segment 0011H addresses 10000H-1FFFFH, segment 0012H addresses 20000H-2FFFFH, segment 0013H addresses 30000H-3FFFFH. If the installed memory is smaller than 256kB, then the corresponding segments are invalid.
Recommended values of the PmaComm object parameters:
The communication uses the
RS485 interface. That's why we recommend the intelligent converter that switches itself the
RTS signal (see:
Communication drivers).
Baud rate | 9600 Bd |
Number data bits | 8 |
Parity | EVEN |
Number of stop bits | 1 |
---|
For now, sending the same data via Ethernet as for serial link is implemented. In this case, the Ethernet parameters can be set accorting to the Eternet/serial link converter.
The communication description by means of the PmaCommMsg object
List and description of communication messages:
The messages names equal to the message names from the
INMAT documentation. For more details refer to this source.
-
Status:
Getting status. The link-up of the communication to the
INMAT. If everything is all right, then the
FC value on the "
Data-received" tab is 0.
- Identify: Reading device identification. Detects the manufacturer, the type and the version of the device.
- Read: Reading one value. The message allows reading only one value whose type depends on the type of the read memory. By this message it is not possible to to read values from the matrix memory types.
- Read item of matrix: Reading one value from matrix of values. The message allows reading only one value whose type depends on the type of the read memory. By this message it is possible to read only values from the matrix memory type.
- Read block of matrix: Reading block of values from matrix. The message allows reading the matrix of values whose size is given by the message parameters.
- Write: Writing one value. The message allows writing only one value whose type depends on the type of the written memory. By this message it is not possible to write values into the matrix memory types.
- Write item of matrix: Writing one value into the matrix of values. The message allows writing only one value whose type depends on the type of the written memory. By this message it is possible to write only values from the matrix memory type.
- Write block of matrix: Writing block of values into matrix. The message allows writing the matrix of values whose size is given by the message parameters.
- PhysRead: Reading from memory on physical address. The message amends the previous messages for reading. But it uses physical addressing by the segment and the offset. Only one value can be read.
- PhysWrite: Writing into memory on physical address. The message amends the previous messages for writing. But it uses physical addressing by the segment and the offset. Only one value can be written.
Testing communication on INMAT:
The
INMAT allows to display the indication of the receipt (
Rx*), response (
Tx*) and error (
Err), which is suitable for debugging the communication. For displaying this information it is necessary to choose the
"CONFIG" menu and the
"Rx Tx Err 0" item. For more details see the
INMAT documentation.