Preconfiguration "eWON - Communication with cloud service eWON Talk2M by means of the M2Web API interface - Communication set with data and panel"

Configuration of the communication with eWON.

This preconfiguration can be activated when creating a new object (e.g. by "New object ..." in the local object menu or by pressing the Insert key after selecting the object) and is included in the group: "/ Communication / PLC devices and meters / eWON - PLC device".
This preconfiguration can be created in the object: PmaFolder or PmaRoot.

The preconfiguration creates an object of the PmaFolder type that contains following objects:
Comm - (PmaFolder object) provides communication interface for selected devices connected to cloud
View - (PmaFolder object) allows searching for connected devices (eWONs), reading names of variables and their current values, and writing new value(s) into selected variable(s).
data1 - (PmaData object) object prepared for processing data from specified device
Timer - (PmaTimer object) object prepared for periodical communication

In the "GetAuthentication" method of the PmaFolder object there are all login entries requested for cloud service access.

Comm - PmaFolder This object has a communication interface consisting of three methods:
RequestEwons - for obtaining a list of devices
RequestGetCsvData - for detecting current status of all variables of selected device
RequestSetCsvData - for writing data into single or multiple variable(s) of selected device

There is a subobject in this folder of the PmaSequencer type that provides the communication functionality. The result of successful communication is then processed by the methods ReplyEwons, ReplyGetCsvData or ReplySetCsvData of the object that was defined by the oRcv parameter. The corresponding method must exist in this object.

View - PmaFolder The PmaFolder object has methods that are required by the communication interface of the Comm object described above. Methods for processing received data Reply ... write into variables of the data subobject. These are then used for processing and displaying returned data in the panel. The "PanelTest" testing panel is used for displaying received data. Here it is possible to use the configurators in order to put together requested method and command parameter. It also allows to detect the settings and export a list of variables of selected eWON for further parametrization and import of variables into the data1 object.

data1 - PmaData The data1 object has interface prepared for processing data received in the method ReplyGetCsvData and ReplySetCsvData. The "RequestGetCsvData" method can be called without parameter but the "RequestSetCsvData" method is prepared for changing the value only of a single variable (parameters itemName and itemVal).

In order to achieve correct functionality of the data1 object, it is necessary to:
- Define the name of specified device (eWON) together with corresponding login name and password in the "eWonAuth" method. These entries are available in the PanelTest panel after successful communication by the getcsvdata method with selected eWON
- Create a list of variables with names that correspond to the names of variables existing in selected eWON. These variables can be imported into the object on the "Data" tab by the "" button from the DataVars.csv file. The file is created after pressing the "Export Settings" button in the PanelTest panel after successful communication by the getcsvdata with selected eWON.

Timer1 - PmaTimer Allows periodical refresh of current data by calling the "RequestGetCsvData" method of the data1 object.
These configurators can be set before the preconfiguration is created:
The name of created objectName of the object created in the Pma objects tree. The maximum name length is 30 characters. This is a system name, so it must contain only alphanumeric and must not contain any diacritics (i.e. national dependent characters), empty string, spaces and the first character must not be a number.
Default: "eWonM2Web"
Service account identifierassigned identification code of service account
Account nameUser account name
UserAccount login name
PasswordAccount login password
Demonstration of the communicationCreates View folder for demonstration and testing of the communication
Data for reading the values of variablesCreates objects data1 and Timer1 for reading values of variables

Pm8.03.29: Communication with cloud service eWON Talk2M by means of the M2Web API interface
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.