Record readings on an MC252
Цей контент ще не доступний вашою мовою.
An MC252 program can record parameter values on the device’s microSD card with PARAMLOG. HMI
imports the recorded readings into history and removes the files it imported from the card, so
history has no gaps while the device or its connection is down. How imports work is in
recorded readings.
Before you start
Section titled “Before you start”- The endpoint is an MC252 connected by PIN, with a microSD card.
- The device logs in the binary format (
.DATfiles). HMI does not import.CSVlogs. - The device clock is right: set its time zone and NTP servers in the device settings. HMI imports nothing while the clock is more than five minutes off.
- The parameters you want history for exist in the workspace, on the same endpoint, with the same
unit ID, table, and first address that the program logs. For the device’s own registers (
MBSELFin programs), use the device’s own unit ID, 111 unless it was changed on the device.
Record readings
Section titled “Record readings”-
In a program of the device, add
PARAMLOGfor each parameter to record, with the conditions that decide when a value is written. See the MC252 device documentation for the command, and MC252 edge programs for managing programs in the workspace. -
Log parameters of a device, not memory parameters: logging a
MEMTEMP,MEMBAT,MEMFILE, orMEMFLASHparameter stops all program logging on the device until it restarts. To record a value a program keeps in its own registers, declare a second parameter at the same table and address on anMBSELFdevice and log that one:DEF self MBSELFDEF counter UINT16 MEMTEMP H 5000DEF counter_log UINT16 self H 5000PARAMLOGNOCOMMENT counter_log -
Deploy the program (Deploy programs to an MC252).
-
Optional: to change how often HMI imports the recordings, open the endpoint’s Programs tab, select Settings, and set Readings import period, minutes (1–1440, default 15). Then select Save.
The readings appear in the history of the matching parameters within one import period, with the times the device recorded them.
Fix the device clock
Section titled “Fix the device clock”If the device’s status page in Setup → Endpoints shows Recorded readings are not imported: the device clock is wrong, or you get a notification about it:
- Set the time zone and NTP servers in the device settings.
- Wait for the next import. It brings in everything the device recorded meanwhile and withdraws the notification.
Readings recorded while the clock was wrong keep the device’s times, so that part of their history may be shifted.
See which parameters get recorded readings
Section titled “See which parameters get recorded readings”- Open Setup → Parameters. A history icon next to a parameter’s name marks a parameter whose history includes readings recorded on the device.
- Hover over the icon, or tap it on a phone, to see how often readings are imported, the last import, and the time through which the history is complete.
Bring recorded addresses into parameters
Section titled “Bring recorded addresses into parameters”Readings of an address that no parameter reads are kept for 90 days.
- Open Setup → Endpoints, open the MC252, and select the Recorded readings tab. It lists each recorded address without a parameter: unit ID, table, address, how many readings are stored, and the latest one.
- Select Create parameter on a row. The parameter form opens with that endpoint, unit ID, table, and address.
- Choose the value type from the device’s type for the address, as listed in value type for a logged parameter. The list’s last value is the device’s own converted value. Set the other fields, then save.
After saving, HMI fills the new parameter’s history with the stored readings of that address and notifies you when it is done. From then on, the address’s recorded readings go straight to the parameter’s history.
A parameter created another way, through the API, hmi push, or a template, gets the readings
recorded after it exists. To bring in the stored ones too, see
stored records.