Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Industrial Technology

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:

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:

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

  1. 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.

  2. 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:

  1. Open a secure shell session on the PLCnext Control device using the admin user account.

  2. In the shell session, execute the following command:

     podman pull docker.io/fullstorydev/grpcurl:latest-alpine
    

    This downloads an OCI image containing the grpcurl command-line tool to the PLCnext Control device.

  3. 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 list
    

    Response:

    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
    
  4. (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" 
    
  5. 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.GetItem
    

    Response:

    {
     "_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

  1. Integrating Machine Learning into PLCnext Controllers
  2. Through-Hole Technology: Why It Remains Essential in Modern PCB Design
  3. Avoiding Conflicts: How Multiple Tolerances Impact Cost and Quality
  4. Shaper Machines Explained: Definition, Components, and Operation
  5. Understanding the Data Bus: A Comprehensive Guide
  6. Machining vs. Grinding: Key Differences Explained
  7. How to Build an Audio Mixer: 5 Practical Methods
  8. Mastering Modern Woodworking: Trends, Tech, and Techniques
  9. Mastering Cross-Border E‑Commerce Delivery: Avoid Common Pitfalls & Boost Customer Satisfaction
  10. 2600 mAh Lithium‑Ion Battery: Specs, Function, Circuit Design, and Practical Tips