<< Click to Display Table of Contents >> Navigation: »No topics above this level« Recording data with a unit |
mapp Services V5.16
A temperature value should be recorded every 2 seconds in a machine. The recorded data should be visible in the HMI application. The temperature value should be displayed with a unit.
Depending on which system of units is used, it should be possible for the temperature value to be displayed in different units in the HMI application.
3 different systems of units are available. The metric, imperial and imperial US system.
If the metric system is selected, the temperature value should be displayed in degrees Celsius. If an imperial system is selected, however, the temperature value should be displayed in degrees Fahrenheit.
To define the unit of a process variable, the engineering unit and the display unit must be defined. In the first step, the engineering unit must be defined for a process variable that should be switched with the display unit later on. The unit is specified in the OPC UA default view configuration.
The unit defined here is the so-called engineering unit. This means that this unit is used for the process variable in the application. The temperature process variable should be defined as an engineering unit in degrees Celsius. For additional information, see section Unit system.
In order to make the system of units available, the OPC UA server of the target system used must be enabled. In addition, the user role system must be added and user "Anonymous" assigned to role "Everyone".
Depending on which system of units is used, the process variable must indicate the correct unit. This means that the display unit is defined in the next step. When using the metric system, the process variable should be displayed in degrees Celsius. If the imperial or imperial US system is selected, the process variable is displayed in degrees Fahrenheit. The relationship between the system of units and the display unit for the process variable is defined in the MpComUnit configuration. The desired process variable is specified under "Datapoints".
Depending on the system of units, the unit must be specified in the form of a unit code. For information about the unit codes used by the units, see here. Unit code CEL is used for degrees Celsius; FAH is used for degrees Fahrenheit.
The conversion from degrees Celsius to degrees Fahrenheit takes place automatically since the fixed engineering unit is degrees Celsius. It is possible to convert to the desired display units from this unit. For more information about unit management in mapp components, see Unit management.
For the recording of process variables, the MpDataRecorder configuration is added.
The system of units that should be used in mapp Data is defined in the configuration under "Unit definition". "Measurement system based" is selected. The system of units is defined under "Measurement system". The metric system should be used. "Unit display" specifies how the unit of the PV should be displayed in mapp Data. The unit can be displayed as an abbreviation, with a full name or not at all. The full unit name is selected.
MpDataRecorder collects and manages all data recordings. "mpDATA_RECORD_MODE_TIME" is used as the recording mode. 2 seconds are specified for the sampling time.
MpDataRegPar is used to determine which process variable should be recorded. The temperature process variable is specified.
For information about how to use and configure MpDataRecorder and MpDataRegPar, see tutorial mapp Data. |
Recording is started using "Record = TRUE" to MpDataRecorder. As previously configured, the process variable is recorded every 2 seconds.
MpDataTableUI can be used to display the recorded data in an HMI application. The recorded data are displayed at input parameter "UIConnect". A process variable of data type MpDataTableUIConnectType must be created and appended to "UIConnect". This process variable can be combined with an HMI application.
Parameter "Language" is used to determine the unit of the UIConnect process variable in which the recorded temperature value should be displayed. If "|metric" is specified, the metric system is used. If "|imperial" is specified, the imperial system is used. For additional information, see section Units of process data.