Local gRPC Interaction with PLCnext Control via grpcurl in OCI Container
This is the latest installment in a series about using gRPC to interact with the PLCnext Runtime on a PLCnext Control device.
Earlier posts in the series included:
- Remote gRPC using grpcurl
- Secure remote gRPC using grpcurl
- Remote gRPC using reflection
The articles listed above show how to access the gRPC server on a PLCnext Control device from a remote client device. This post gives an example of a local gRPC client - that is, a gRPC client running on a PLCnext Control device, which accesses the gRPC server on the same device.
Other examples of local gRPC clients on PLCnext Control devices can be found here:
- How to create a client for the PLCnext Control gRPC server in C#
- Use gRPC to interface Python scripts with PLCnext Engineer Projects.
Since there is no gRPC client software installed on PLCnext Control devices as standard, this article shows how to run a gRPC client (in this case, grpcurl) in an OCI container using Podman and a suitable image from dockerhub.
Prerequisites
-
A suitable PLCnext Control device, with internet access. Examples: AXC F 3152 with firmware version 2025.0 or later; AXC F 1252 with firmware version 2026.0 or later. Currently, the OCI image used in this article is not available for armv7 targets like the AXC F 2152.
-
In a browser, open the Web-based Management (WBM) site on the device and, on the System Services page, make sure the GRPC LOCAL SERVER feature is activated.
Procedure:
-
Open a secure shell session on the PLCnext Control device using the admin user account.
-
In the shell session, execute the following command:
podman pull docker.io/fullstorydev/grpcurl:latest-alpineThis downloads an OCI image containing the grpcurl command-line tool to the PLCnext Control device.
-
List the gRPC services available on the local PLCnext Control device:
podman run -it --rm -v /run/plcnext/:/run/plcnext/ --userns=keep-id docker.io/fullstorydev/grpcurl:latest-alpine --plaintext unix:///run/plcnext/grpc.sock listResponse:
Arp.Device.Interface.Services.Grpc.IDeviceControlService Arp.Device.Interface.Services.Grpc.IDeviceInfoService Arp.Device.Interface.Services.Grpc.IDeviceSettingsService Arp.Device.Interface.Services.Grpc.IDeviceStatusService Arp.Io.Axioline.Services.Grpc.IAcyclicCommunicationService Arp.Io.Axioline.Services.Grpc.IAxioMasterService Arp.Plc.Gds.Services.Grpc.IDataAccessService Arp.Plc.Gds.Services.Grpc.IForceService Arp.Plc.Gds.Services.Grpc.ISubscriptionService Arp.Services.DataLogger.Services.Grpc.IDataLoggerService2 Arp.Services.NotificationLogger.Services.Grpc.INotificationLoggerService Arp.System.Commons.Services.Io.Grpc.IDirectoryService Arp.System.Commons.Services.Io.Grpc.IFileService Arp.System.Commons.Services.Io.Grpc.IFileSystemInfoService Arp.System.Lm.Services.Grpc.ILicenseStatusService Arp.System.Nm.Services.Grpc.INotificationManagerService Arp.System.Security.Services.Grpc.IAuthenticationService Arp.System.Um.Services.Grpc.IAuthorizationInfoService Arp.System.Um.Services.Grpc.IPasswordAuthenticationService grpc.reflection.v1.ServerReflection grpc.reflection.v1alpha.ServerReflection -
(Optional) Create an alias to simplify subsequent grpcurl commands:
alias grpcurl="podman run -it --rm -v /run/plcnext/:/run/plcnext/ --userns=keep-id docker.io/fullstorydev/grpcurl:latest-alpine" -
Retrieve the board temperature from the PLCnext Control device:
grpcurl -format json -d '{"identifier":"Status.Board.Temperature.Centigrade"}' --plaintext unix:///run/plcnext/grpc.sock Arp.Device.Interface.Services.Grpc.IDeviceStatusService.GetItemResponse:
{ "_ReturnValue": { "TypeCode": "CT_Int8", "Int8Value": 46 } }
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.
Industrial Technology
- Integrating Machine Learning into PLCnext Controllers
- Through-Hole Technology: Why It Remains Essential in Modern PCB Design
- Avoiding Conflicts: How Multiple Tolerances Impact Cost and Quality
- Shaper Machines Explained: Definition, Components, and Operation
- Understanding the Data Bus: A Comprehensive Guide
- Machining vs. Grinding: Key Differences Explained
- How to Build an Audio Mixer: 5 Practical Methods
- Mastering Modern Woodworking: Trends, Tech, and Techniques
- Mastering Cross-Border E‑Commerce Delivery: Avoid Common Pitfalls & Boost Customer Satisfaction
- 2600 mAh Lithium‑Ion Battery: Specs, Function, Circuit Design, and Practical Tips