Basic properties of the driver:- Using this driver is bound to purchase the license:
PmInmat66.
With the freeware version
PmFree,
or when developing the application
(with
development environment for tersting purposes),
this component is always functional.
-
The communication is done via Ethernet
or via standard serial link
(COM1, COM2 ...).
Sending the same data via Ethernet and via serial link is currently implemented.
-
The PROMOTIC application is the MASTER
(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.
It is possible to add an
PmComm object and then configure it properly,
but
it is recommended to use:
-
The communication enables 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 communication supports 5 data types:
-
signed int:
2-byte integer (from
-32 768 to
+32 767).
In the PROMOTIC application represented by the data type:
Integer.
-
unsigned int:
2-byte integer (from
0 to
65 535).
In the PROMOTIC application represented by the data type:
Long.
-
long:
4-byte integer (from
-2 147 483 648 to
+2 147 483647).
In the PROMOTIC application represented by the data type:
Long.
-
float:
4-byte real number.
In the PROMOTIC application represented by the data type:
Single.
-
string:
the number of chars 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 the response message string,
it is necessary to set the length of the read string increased by 1 in the received data
(we read even the end char 0).
If the length of the read string in the
Data-received is lower than the real length of the read string,
the system reports the "bad data read" (66) error.
If we don't know the exact length, 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:
The address can be chosen by selecting the memory name in the message parameters
and the system itself adds the INX value.
If we want to enter the INX value directly,
we can select the "Memory type"->"INX common value" in the message parameters.
- addressing by segment and offset:
This direct addressing type is called physical addressing
and it consists in entering the values of the segment and the offset.
Recommended parameters values:
The communication uses the
RS485 interface.
That's why we recommend the intelligent converter
that switches itself the
RTS signal
(see :
PROMOTIC communication drivers).
| Baud rate | 9600 Bd |
|---|
| Number of data bits | 8 |
|---|
| Parity | EVEN |
|---|
| Number of stop bits | 1 |
|---|
Sending the same data via Ethernet and via serial link is currently implemented. The Ethernet parameters can be set accorting to the Eternet/serial link converter in this case.
The communication description by the PmCommMsg objects
The description of the communication messages:The message 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 in the
Data-received is 0.
- Identify: Reading device identification.
Getting the producer, 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 isn't possible 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 isn't 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 enables to display the indication of the
receipt (Rx*),
response (Tx*) and
errors (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.