In this chapter we will show you an example of communication by the Modbus
Ethernet protocol (the PmModbusMr
communication driver). However the procedure of configuring a functional communication is similar for any other PROMOTIC driver (e.g. for the driver PmS7
- Into the PmaRoot
object add a new PmaFolder
object named "Communication".
Note: The PmaFolder
objects can be used in order to create logical structure of the application.
- In the upper portion of the following window select the communication type "Network TCP/IP communication".
- Enter the PLC network address
Keep other settings unchanged and confirm:
Compile all panels.
By the procedure described above, you have just added and configured the communication driver. The system created automatically communication objects PmaComm and PmaCommGroup with corresponding settings.
Following objects were also created:
- Data containing prepared variables with communication data extension.
- and graphic panel PanelData displaying values read from the device.
Note: Any modification made in the connected PmaData object is automatically projected into this panel (current data is read automaticaly).
Now let's connect the variable "Temperature" to communication data. This setup is similar to setting variables trending by data extensions.:
- Select page Data
in "BoilerPlant/Boiler1/Data" object.
- Select variable: "Temperature". Open configuration window of this variable ("
" button or mouse doubleclick).
- Create new data extension ("Add" button) and select: Data extension: ExtComm
- In the "Target object (PmaCommGroup)
" configurator select (use the button with three dots) the previously created object of the PmaCommGroup
type (the path to the object "/Communication/CommModbus/Comm/Data
- Open the "ItemID
" configurator (use the button with three dots). All steps mentioned above are common for all communication protocols.
- Then set the parameters specific only for Modbus and save the changes.
Compile all panels and launch the application into runtime. Click the "Panels" icon in the upper toolbar which opens a window listing all panels of the application. Select "Modbus - Received data" from the list.
You can use the INFO system
to monitor the status and quality of communication.
Additional communication options
In the previous cases you have always defined the address of the variable in the device from which the variable was read. This kind of communication is not suitable in some specific situations and some protocols do not even have such option available.
An example of such protocol may be represented by the general character/binary protocol PmChar, that allows the application designer to create a unique communication protocol for devices with simple but non-standardized communication.
For this kind of low level communication the PmaCommMsg object can be used. This object can be created only in the PmaComm object. In the PmaCommMsg object, it is possible to define the communication message, that will be sent into the corresponding device and the PmaCommMsg object can also process the reply to such message.
More detailed information can be found in the description of the PmaCommMsg object.