REST data interface - Collections and dictionaries

Available from firmware 2019.9

This topic shows how to retrieve the dictionaries for the REST data interface, and gives exemplary postman collections for the commands that are described thoroughly in the respective topics.

Note: Phoenix Contact reserves the right to make changes and additions in further versions that might lead to incompatibilities. Therefore it is highly recommended to call this REST data interface out of your application explicitly with the version used during development, not with the latest key.

Postman collections

To download a collection of the requests in this REST data interface, just click the links and unpack:

Note: Consider the API version addressed therein.

Dictionaries

To retrieve a dictionary, you can use the following calls:

Retrieving the data dictionary

GET https://%PlcAddress%/ehmi/data.dictionary.json

where

%PlcAddress% is the address of the PLC

returns a JSON with all available variables and their type information.

Hide the exampleClick to show an example response

Example response:

{
    "$schema":"http:\/\/json-schema.org\/draft-0\/schema#",
    "title":"DataDictionary",
    "HmiVariables2":
      {
        "Arp.Plc.Eclr/ESM_DATA.ESM_INFOS[1].TICK_COUNT":
          { 
            "Type": "DINT",
            "InitValue": "0",
            "ReadOnly": true
          },
        "Arp.Plc.Eclr/Test_Global":
          {
            "Type": "BOOL",
            "InitValue": "FALSE"
          },
        "Arp.Plc.Eclr/Test_Global_GroupVar1":
          {
            "Type": "BOOL",
            "InitValue": "FALSE"
          },
        "Arp.Plc.Eclr/Test_Global_GroupVar2":
          { 
            "Type": "BYTE",
            "InitValue": "BYTE#16#0"
          },
        "Arp.Plc.Eclr/Test_Global_GroupVar3":
          {
            "Type": "WORD",
            "InitValue": "WORD#16#0"
          },
        "Arp.Plc.Eclr/Test_Global_GrouptVar4":
          {
            "Type": "DWORD",
            "InitValue": "DWORD#16#0"
          },
        "Arp.Plc.Eclr/TestArray":
          {
            "Type": "arrByte_Stream",
            "InitValue": ""
          }
      }
  }

Retrieving the type dictionary

GET https://%PlcAddress%/ehmi/type.dictionary.json

where

%PlcAddress% is the address of the PLC

returns a JSON with all used datatypes.

Hide the exampleClick to show an example response

Example response:

{
  "$schema":"http:\/\/json-schema.org\/draft-0\/schema#",
  "title":"TypeDictionary",
  "Types": 
  [
    {
      "Name": "DINT",
      "RuntimeType": "System.Int32",
      "RuntimeSize": 4,
      "RuntimeAlignment": 4,
      "Kind": "Elementary"
    },
    {
      "Name": "BOOL",
      "RuntimeType": "System.Boolean",
      "RuntimeSize": 1,
      "RuntimeAlignment": 1,
      "Kind": "Elementary"
    },
    {
      "Name": "BYTE",
      "RuntimeType": "System.Byte",
      "RuntimeSize": 1,
      "RuntimeAlignment": 1,
      "Kind": "Elementary"
    },
    {
      "Name": "WORD",
      "RuntimeType": "System.UInt16",
      "RuntimeSize": 2,
      "RuntimeAlignment": 2,
      "Kind": "Elementary"
    },
    {
      "Name": "DWORD",
      "RuntimeType": "System.UInt32",
      "RuntimeSize": 4,
      "RuntimeAlignment": 4,
      "Kind": "Elementary"
    },
    {
      "Name": "arrByte_Stream",
      "RuntimeType": "ProConOS_eCLR.arrByte_Stream",
      "RuntimeSize": 28,
      "RuntimeAlignment": 1,
      "Kind": "Array",
      "ElementType": "BYTE",
      "Dimensions": 
      [
        {
          "StartIndex": 0,
          "Length": 28
        }
      ]
    }
  ]
}

 

 


• Published/reviewed: 2024-10-30   ☀  Revision 074 •