Makers Blog Communication iot Node-RED PLCnext Connector PLCnext Technology

Node-RED communication with an AXC using the PLCnext Connector

Stefan Brinkmann 13 May 2022 min. read
646 views 0 comments

There is a new package available for Node-RED that enables the user to communicate with the PLCnext controller via the REST api. The name of the package is node-red-plc-next-connector. It can be installed via the “Managa palette” menu in Node-RED.

The package includes nodes to browse the available variables and datatypes, to read and write variables and to handle sessions and groups.

The first example shows how to browse all available variables. At the beginning, a new plc-connector must be created, i.e. a connection to the PLC must be configured. This plc-connector can then be used for all other nodes as well.

The result is returned as a dictionary.

Reading variables from the PLC is also very simple. In the read variables node, the plcnext connector must be selected. After that, you can select the variables from a dropdown list. The result is returned as an array of struct, containing the variaable path and the value.

The writing of variables works the same way. The plc-write-variables node expects the msg.payload in json format.

Here is an example payload:

msg.payload= {variables : [
{
  "path": "Arp.Plc.Eclr/I_WarehouseControl1.HMI_rTemperature",
  "value": 12.34,
  "valueType": "Constant"
},
{
  "path": "Arp.Plc.Eclr/I_WarehouseControl1.HMI_iHumidity",
  "value": 85,
  "valueType": "Constant"
} 
]};

Note:

The Makers Blog shows applications and user stories of community members that are not tested or reviewed by Phoenix Contact. Use them at your own risk.

Discussion

Please login/register to comment
Login/Register
Newsletter
Never miss a new article
Sign up for the newsletter
Never miss news about PLCnext Technology
Get interesting content via newsletter four times a year
Receive exclusive information before all other users