Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Preconfiguration "PmChar - Communication set with data and panel"

Communication driver configuration PmChar - Driver for communication by user defined ASCII/BIN protocol.
 
This preconfiguration can be activated when creating a new object (e.g. by "New object" in the local object menu or after pressing the Insert key after selecting the object) and is included in the group: " / Communication / PmChar configurable protocol".

This preconfiguration can be used with the objects: PmaFolder or PmaRoot.

 
The preconfiguration allows to choose two types of connection with the computer:
- via Ethernet
- via the computer's serial port (RS232/RS485..)

The created preconfigured connection is functional usually immediately. Otherwise it is necessary to obtain the connection parameters specified by the device manufacturer or in the documentation: PmChar - Driver for communication by user defined ASCII/BIN protocol.

- The panel is used for communication testing and it is not essential for the functionality.
These configurators can be set before the preconfiguration is created:
The name of created objectName of the object created in the tree of Pma objects. The maximum Pma object name length is 31 characters. This is a system name, so it must contain only alphanumeric and must not contain any diacritics, empty string, spaces and the first character must not be a number.

Default: "CommChar"

Communication type
Network TCP/IP communication (default)
Serial communication
Network addressNetwork address to which the communication will be connected. The address can be entered by both IP address (e.g. 192.168.0.15) or by name (e.g. server11).

Macro expression can be used for input (it is evaluated after starting the application).

After this preconfiguration is created, the configurator is se to: PmaComm > Setting the parameters of the Ethernet-client > Network address
TCP/UDP port numberEthernet port number for communication.
Ethernet transfer typeDeatiled Ethernet protocol type specification.
TCP (default) - Allows unlimited, security checked data transfers. The data is transferred by separate portions so-called packets.
UDP - Only limited data transfers are allowed (often limited to 500 Bytes). The data transfer is very fast.
Close the connection after each transmissionThis option sets the following configurators simultaneously:

Not connect until first transfer. See: PmaComm > Setting the parameters of the Ethernet-client > Not connect until first transfer

Close connection after every transfer. See: PmaComm > Setting the parameters of the Ethernet-client > Close connection after every transfer

Serial portSelection of the communication serial port.

The value can be change by the OpenPort method. The value can be detected by method GetProtParam(""SerPort"").

After this preconfiguration is created, the configurator is se to: PmaComm > Setting the parameters of the serial link > Serial port.

Not set - The object is not connected to any port after starting the application and the serial port can be selected dynamically by the algorithm (by the PmaComm.OpenPort method).
COM1, COM2,..,COM66 - The specified serial port is opened after starting the application. This port must be correctly configured and accessible in the OS Windows (no one can use it).

For serial link each PmaComm object object must have defined another communication port. For example, if one PmaComm object communicates through COM1, then next PmaComm object can communicate for example through COM2 (COM3,..) but it mustn't communicate through COM1.

Baud rateSelection of the baud rate (bps, bit per second).

This configurator sets the initial value of the property BaudRate.

After this preconfiguration is created, the configurator is se to: PmaComm > Setting the parameters of the serial link > Baud rate

110
300
600
1200
2400
4800
9600
14400
19200
38400
57600
115200
128000
256000
ParityParity selection. Appropriate value for the device, which it is communicated with, must be selected.

This configurator sets the initial value of the property Parity.

After this preconfiguration is created, the configurator is se to: PmaComm > Setting the parameters of the serial link > Parity

NO
ODD
EVEN
Number of stop bitsAppropriate value for the device, which it is communicated with, must be selected.

This configurator sets the initial value of the property StopBits.

After this preconfiguration is created, the configurator is se to: PmaComm > Setting the parameters of the serial link > Number of stop bits

1 stopbit
1.5 stopbit
2 stopbit
Creates message of type: MasterAfter this preconfiguration is created, the configurator is se to:PmaCommMsg > Parameters > Message type
Receive dataThe data will also be received after sending.
Maximum number of characters in the valueMaximum number of characters in the value
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 only in 'Data-received'The sane as the previous configurator, only for the Data-received page.

The Pm.TransformValue(241) method can be used for processing the received data.

Creates message of type: SlaveAfter this preconfiguration is created, the configurator is se to:PmaCommMsg > Parameters > Message type
Send dataThe data will also be sent after receiving.
Maximum number of characters in the valueMaximum number of characters in the value
There is HexaString only in 'Data-sent'If checked, then it is presumed that there is only a single variable of the String type on the "Data-sent" page. 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:

For 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.

There is HexaString only in 'Data-received'The sane as the previous configurator, only for the Data-received page.

The Pm.TransformValue(241) method can be used for processing the received data.


History:
Pm8.03.21: Communication driver configuration PmChar including panel and controls - can be used as a simple communication terminal
PROMOTIC 9.0.7 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice