Before using this driver in the PROMOTIC application it is highly recommended to read the chapter: Communication using the PROMOTIC drivers
Basic properties of the driver
- Usage of this driver requires purchase of the PmChar license
. With the freeware version PmFree
, or when developing the application (with development environment
for tersting purposes), this component is always functional.
It is also necessary to purchase the corresponding number of PmDataClient licences. This number is indicated in the "Maximum number of clients" configurator.
- In the PmFree
mode, the number of clients is set to 2.
- When developing and testing the application with the development licence, the number of clients is set to 10.
- The communication is done for Ethernet
(PROMOTIC application is server) (for Ethernet-client or for serial link use the the PmChar
The driver is simple but powerful tool for communication by user configured
protocol. It is determined first of all for the communication where using a special communication protocol doesn't pay in the end.
The usage of this driver is especialy handy for:
- communications by simple protocols.
- both text and binary oriented communications.
- testing purposes.
The driver so far allows using only the message of the Slave type
driver is not determined for the emulation of more complex protocols. We'll be glad to help
you with the decision if the given protocol can be implemented by the PmCharServer
driver; don't hesitate to contact us! (email@example.com
Recommended parameters values:
Description and recommended values for the Protocol parameters:
| Received data will always be in only one packet||If checked, then it is assumed that the entire contents of the received message will always fit into a single IP packet. |
This setting affects the optimization of the reception rate:
Once the packet is received the reception is terminated and the system does not wait for timeout (defined in the "Timeout of one packet transfer [ms]" configurator).
The packet size is predefined by current network. It can be e.g. 521 bytes, 1024 bytes etc.
The communication description by the PmaCommMsg objects
| There is HexaString in 'Data-sent'||On the "Data-sent" page there is always only one of the String type variable. |
If checked, then it is presumed that the content of this variable is so-called HexaString
that can be used in order to transfer binary values in the String
type as folows:
Example: if you are to send 4 bytes with binary values of 01 A0 00 B3 (hexadecimaly), then it is necessary to put into the variable of the String type the value of "01A000B3" - i.e. the text of 2*4=8 characters.
This way you can easily transfer data containing binary zeroes, that are forbidden in the value of the String type.
The Pm.TransformValue(240) method can be used for preparation of the transferred data.
If not checked, then it is not possible to send binary data, only text data sending is allowed - the exact content of the of the String type variable is sent.
| There is HexaString in 'Data-received'||The sane as the previous configurator, only for the Data-received page. |
If checked, then the Pm.TransformValue(241) method can be used for processing the received data.
There are following variables on the "Data-sent
Data - (String) Data for sending.
There are following variables on the "Data-received
Data - (String) The received data is stored here.
object can be set so far for only messages of the Slave type
. The transfer procedure for this message type is following:
- The object waits for receiving the data from other side.
- After the message is received from the other side it is decided which Slave
object this message belongs to. If there is only a single Slave
type object, then the data is transferred there, otherwise the procedure goes as follows:
The received message length is compared to requested messages defined on Data-received pages. The received message is assigned to the object that requested message of equal length (as the received message).
- After the received data is saved into the variable Data
on the "Data-received
" page of corresponding object, the onDataReceive
event is triggered. The designer can then set the data for transfer on the "Data-sent
- If on the "Data-sent
" page the Data
variable contains empty string then the transfer is terminated (the onEndOfTransfer
event is triggered). This is used if the PRMOTIC is not requested to send a reply to the other side.
- If on the "Data-sent
" page the Data
variable contains non-empty string then the content of this variable is modified (e.g. the transformation from HexaString
to binary form) and the modified data is then sent to the other side.