Operating Systems
Query OPC UA Industrial Systems with cnspec
Query Linux-based industrial systems via OPC UA with cnspec
Rely on cnspec to query Linux-based industrial control systems through the OPC UA (Open Platform Communications Unified Architecture) protocol. This provider is designed for industrial automation systems such as Phoenix Contact PLCnext controllers that run Linux-based operating systems.
Prerequisites
To analyze and explore your industrial systems with cnspec, you must have:
- cnspec installed on your workstation
- Network access to the OPC UA endpoint on the industrial device
Connect to an industrial system
To query a Linux-based industrial system via OPC UA, provide the endpoint URL:
cnspec shell opcua --endpoint opc.tcp://HOST:PORT| For... | Substitute... |
|---|---|
| HOST | The industrial system hostname or IP address |
| PORT | The OPC UA server port (typically 4840) |
For example, to connect to a PLCnext controller:
cnspec shell opcua --endpoint opc.tcp://192.168.1.50:4840Example queries
Retrieve OPC UA server information
cnspec> opcua.server
opcua.server: {
...
}Retrieve all namespaces
cnspec> opcua.namespaces
opcua.namespaces: [
0: opcua.namespace name="http://opcfoundation.org/UA/"
...
]Retrieve the root node
cnspec> opcua.root
opcua.root: opcua.node id="i=84" name="Root"List all nodes
cnspec> opcua.nodes
opcua.nodes: [
0: opcua.node id="i=84" name="Root"
1: opcua.node id="i=85" name="Objects"
...
]Learn more
-
To learn more about how the MQL query language works, read Write Effective MQL.
-
For a list of all the OPC UA resources and fields you can query, read the OPC UA Resource Pack Reference.