Drivers

PLCnextAPI
PLCnextAPI

The PLCnextAPI driver connects automatically to the PLCnext Engineer process running on the controller. However, both the PLCnextAPI driver and eHMI services (activates the PLCnext Runtime web API) are disabled by default.

Activating eHMI Services for PLCnext 2022 and Beyond

In PLCnext Engineer, simply navigate to the HMI Web Server configuration page and check the Enable REST Interface checkbox. Be sure to save your project before uploading.

Activating eHMI Services for PLCnext 2022 and Beyond

Activating eHMI Services for PLCnext 2021 and Earlier

For versions of PLCnext earlier than 2022, the Enable REST Interface checkbox did not exist. The following minimum procedure must be followed instead.

Add an eHMI page

1. Add an eHMI page

Open the HMI page and drag an object to it.

2. Open the HMI page and drag an object to it. In the example, I use a simple ellipse shape.

Tag the object.

3. Tag the object. There must exist at least one logical pairing like this for the eHMI service to activate. The example uses a system variable. The start of this process involves adding a Dynamic to your HMI object and then attaching a variable to it. The Dynamic used in the example will change the color fill of the ellipse when the tag value changes.

system variable PND_S1_PLC_RUN

In the example, the ellipse is tagged with system variable PND_S1_PLC_RUN.

Disable eHMI security in order to gain API access

4. Disable eHMI security in order to gain API access.

Set your page as the default page.

5. Set your page as the default page. SAVE, then write your project to the controller.

Enabling the PLCnextAPI Driver in Edge Gateway

Enabling the PLCnextAPI Driver in Edge Gateway

Moving to the PLCnext Edge Gateway, by default the PLCnextAPI driver is disabled. To enable it, navigate to Settings > Services and click Enable next to dslink-plcnext-api.

PLCnext Edge Gateway Broker view

PLCnext Edge Gateway Broker view

Passing Data from PLCnext to Edge Gateway

Passing Data from PLCnext to Edge Gateway

Moving forward, any tag checked as an HMI tag will show up in your PLCnext Edge Gateway application.

Now, as soon as the project has been built and deployed to the controller, the PLCnextAPI driver will automatically poll these tags. The tag values will then be available in the data directory. If data is being retrieved, the status of the driver should change from 'Unavailable' to 'Available'.