Skip to main content

Machine Control

Send commands to devices and machines

Enabling feedback to the machinery involves sending messages to the PLC that manages the OT protocol. The necessary inputs are the variables or registers to be written to pass the feedback to the machinery and/or where to write specific files in machines that have such interfaces.

Zerynth OT commands

Our current setup consists of a device, whether physical or virtual, capable of receiving jobs and interacting with the PLC.

The operator can define one or more OT commands using the Zerynth Configurator, clicking on Create button under Opcua Commands section.

createCommand

Once the operator defines OT commands, that enables default OT jobs in the relevant device for the writing registers:

  • opcua.command({"command1": value, "command2": value, ...})
  • modbus.command({"command1": value, "command2": value, ...})
  • s7.command({"command1": value, "command2": value, ...})

These jobs can be remotely activated with the current APIs. Therefore, the partner, assuming the variables are established, can call the cloud/on-prem APIs to send feedback to the machinery.

As said, the operator can modify the OT blocks of the configurator to define a mapping between a Zerynth command and a PLC variable.

createTestCommand

The first field Command is the command name that will be used in the OT job: the Zerynth device will receive it and send to the PLC. The second field Namespace is the namespace (information model) of the variable inside the PLC the operator want to write. The third field Identifier is the identifier for the node the operator want to write in the OPC server's address space. The fourth field Type is the data type of the node the operator wants to write.

This then facilitates the creation of custom dashboards, where it will not be necessary to remember that the command "TestCommand" is "ns=1;i=8" but can simply use "TestCommand":"myorder_code" in "TestCommand" job. This mapping can be done within the current OT blocks of the configurator, where the partner associates "TestCommand" with "ns=1;i=8" for that PLC. The mapping is communicated as part of the graph and used by OT jobs to translate "TestCommand" into the correct variable.

From the Edge Devices section under Device Management, the operator can select the device which has been previously configured using the configurator. By clicking on the name of the device, the Overview of the specific device whill be shown. By using Jobs in the right upper section of the page, the operator can schedule a job for its device.

jobTestCommand

In the Schedule job pop-up, the operator can select opcua.command and write the command to send in a JSON format, where the key is the name of the command defined using the configurator and the value is the new values the operator wants to write in the PLC.

Of course, OT jobs remain "open" and partners can send custom registers and values as needed by defining commands at wishes..

With this standardized list of jobs, we could also consider creating a standard Grafana component that, when added to the dashboard, includes a section with boxes for entering orders, pieces, etc., and a button to send track or aggregate commands. This speeds up the creation of Grafana dashboards for machine control but would be especially useful for our partners who would otherwise have to study the integration between Grafana and our jobs.