JSON

The power supplies of the PS2000 series with EtherCAT interface have the option of retrieving a log file in the form of a JSON document. This contains, for example, the currently set threshold values, minimum and maximum voltages and currents that have occurred, as well as an error history. The file also contains static product properties such as the nominal current, nominal voltage, product name and a unique serial number (BIC/eBIC).

The error history contains up to ten undervoltage, overvoltage, overcurrent and overtemperature events. The value of the over/underrun and the time of occurrence are stored for each event.

Exemplary representation of the JSON file.

{
  "Product": "PS2001-4810",
  "BIC": "1P551049SBTNasdfghjk1KPS2001-4810-1001              Q1    52SP12345678           ",
  "NominalCurrent": 20.000000,
  "NominalVoltage": 24.000000,
  "MinInputVoltage": 228.000000,
  "MaxInputVoltage": 240.000000,
  "MaxPeakInputVoltage": 340.000000,
  "InputUndervoltageCounter": 0,
  "InputOvervoltageCounter": 0,
  "MaxOutputVoltage": 28.531250,
  "MaxOutputCurrent": 0.062500,
  "MinTemperature": 18.656250,
  "MaxTemperature": 30.156250,
  "DcOkThreshold": 23.000000,
  "OvervoltageWarnThreshold": 28.799999,
  "OvercurrentWarnThreshold": 24.000000,
  "OvertemperatureWarnThreshold": 120.000000,
  "UndervoltageEvents": 
  [
    {
      "Value": 22.386719,
      "DcTimestamp": 695747772293000000,
      "Time": "2022-01-17T15:16:12"
    }
  ]
}

Reading the JSON log file

The file can be read via a FoE upload

JSON 1:
Reading the JSON log file using the PS2001-2420-1001 as an example

Update the time for the JSON file

The power supply has no information on the current local time. For this reason, the time of the events is always displayed as 0 by default.

The CoE object 0x10F9:01 can be used to inform the EtherCAT slave of the current time. The time of this object corresponds to the notation for 64-bit EtherCAT timestamps.

Theoretically, it is sufficient to transfer the current time once after switching on. The internal clock of the power supply unit is set and continues to run automatically. However, to ensure that the time of the master and the power supply unit do not drift apart, a regular update is recommended. (e.g. every minute).

JSON 2:
Sample code for writing the time every minute

PLC library:Tc3_JsonXml

With the aid of the PLC library Tc3_JsonXml, SAX and DOM parser technologies can be used to create and navigate through JSON and XML documents.