Using OpcCmd Utility as OPC UA Client: Difference between revisions

From OPC Labs Knowledge Base
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 3: Line 3:


= Commands, Arguments and Options =
= Commands, Arguments and Options =
== Command: uaClient browse ==
Setting a "browse chunk" size:
<pre>
uaClient
set IsolatedParameters.SessionParameters.MaximumReferencesPerBrowseNode [Int32]400
browse opc.tcp://localhost:49320 nsu=KEPServerEX;ns=2;s=Simulation.Functions
</pre>


== Command: uaClient subscribe ==
== Command: uaClient subscribe ==
Line 10: Line 19:
uaClient
uaClient
subscribe opc.tcp://opcua.demo-this.com:51210/UA/SampleServer nsu=http://test.org/UA/Data/;i=10849
subscribe opc.tcp://opcua.demo-this.com:51210/UA/SampleServer nsu=http://test.org/UA/Data/;i=10849
</pre>
Obtaining server condition statistics:
# Enter <code>uaClient --ConnectionMonitoring</code>.
# Enter <code>subscribe opc.tcp://opcua.demo-this.com:51210/UA/SampleServer nsu=http://test.org/UA/Data/;i=10849</code>.
# Optionally terminate the command prematurely by pressing {{Style=keyboard|X}}.
# Wait for approx. 10 seconds.
# Enter <code>events?</code>, or shortened: <code>ev?</code>. Note the index of the last event (in the "[]" column).
# Enter <code>events? --!extractElement <nn> --!extractMember EventArgs.Statistics.StateDictionary</code>, or shortened: <code>ev? -!xe <nn> -!xm EventArgs.Statistics.StateDictionary</code> where <nn> is the index of the last event, taken in previous step.
Sample output:
<pre style="font-size:11px;">
Events (extracting: element 77, member 'eventargs.statistics.statedictionary') (sequence): 5 element(s)
╒═════════════╤═════╤════════════╤════════════╤════════════╤══════════════════╤════════════╤═══════════════════╤══════════════════╤══════════════════╤══════════════════╤══════════════════╕
│[]          │Enter│First Enter │Last Cycle  │Last Cycle  │Last Cycle Time  │Last Enter  │Current Active Time│Accumulated Time  │Minimum Time Span │Average Time Span │Maximum Time Span │
│            │Count│Time Local  │Enter Time  │Leave Time  │Span              │Time Local  │Span              │Span              │                  │                  │                  │
│            │    │            │Local      │Local      │                  │            │                  │                  │                  │                  │                  │
╞═════════════╪═════╪════════════╪════════════╪════════════╪══════════════════╪════════════╪═══════════════════╪══════════════════╪══════════════════╪══════════════════╪══════════════════╡
│Connected    │    1│18:21:30.691│18:21:30.691│18:22:52.225│0:00:01:21.5320000│18:21:30.691│0:00:00:00.0000000 │0:00:01:21.5320000│0:00:01:21.5320000│0:00:01:21.5320000│0:00:01:21.5320000│
│Connecting  │    1│18:21:29.928│18:21:29.928│18:21:30.691│0:00:00:00.7650000│18:21:29.928│0:00:00:00.0000000 │0:00:00:00.7650000│0:00:00:00.7650000│0:00:00:00.7650000│0:00:00:00.7650000│
│Disconnected │    2│18:21:29.841│18:21:29.841│18:21:29.928│0:00:00:00.0780000│18:22:52.400│0:00:00:00.0000000 │0:00:00:00.0780000│0:00:00:00.0780000│0:00:00:00.0780000│0:00:00:00.0780000│
│Disconnecting│    1│18:22:52.225│18:22:52.225│18:22:52.400│0:00:00:00.1870000│18:22:52.225│0:00:00:00.0000000 │0:00:00:00.1870000│0:00:00:00.1870000│0:00:00:00.1870000│0:00:00:00.1870000│
│Unconnected  │    2│18:21:29.841│18:21:29.841│18:21:30.691│0:00:00:00.8430000│18:22:52.225│0:00:00:00.1870000 │0:00:00:00.8430000│0:00:00:00.8430000│0:00:00:00.8430000│0:00:00:00.8430000│
╘═════════════╧═════╧════════════╧════════════╧════════════╧══════════════════╧════════════╧═══════════════════╧══════════════════╧══════════════════╧══════════════════╧══════════════════╛
</pre>
</pre>

Latest revision as of 16:40, 30 May 2024

For general information about the OpcCmd tool, see Category:OpcCmd Utility.

Commands, Arguments and Options

Command: uaClient browse

Setting a "browse chunk" size:

uaClient 
set IsolatedParameters.SessionParameters.MaximumReferencesPerBrowseNode [Int32]400
browse opc.tcp://localhost:49320 nsu=KEPServerEX;ns=2;s=Simulation.Functions

Command: uaClient subscribe

OpcCmd -i
uaClient
subscribe opc.tcp://opcua.demo-this.com:51210/UA/SampleServer nsu=http://test.org/UA/Data/;i=10849

Obtaining server condition statistics:

  1. Enter uaClient --ConnectionMonitoring.
  2. Enter subscribe opc.tcp://opcua.demo-this.com:51210/UA/SampleServer nsu=http://test.org/UA/Data/;i=10849.
  3. Optionally terminate the command prematurely by pressing X.
  4. Wait for approx. 10 seconds.
  5. Enter events?, or shortened: ev?. Note the index of the last event (in the "[]" column).
  6. Enter events? --!extractElement <nn> --!extractMember EventArgs.Statistics.StateDictionary, or shortened: ev? -!xe <nn> -!xm EventArgs.Statistics.StateDictionary where <nn> is the index of the last event, taken in previous step.

Sample output:

Events (extracting: element 77, member 'eventargs.statistics.statedictionary') (sequence): 5 element(s)
╒═════════════╤═════╤════════════╤════════════╤════════════╤══════════════════╤════════════╤═══════════════════╤══════════════════╤══════════════════╤══════════════════╤══════════════════╕
│[]           │Enter│First Enter │Last Cycle  │Last Cycle  │Last Cycle Time   │Last Enter  │Current Active Time│Accumulated Time  │Minimum Time Span │Average Time Span │Maximum Time Span │
│             │Count│Time Local  │Enter Time  │Leave Time  │Span              │Time Local  │Span               │Span              │                  │                  │                  │
│             │     │            │Local       │Local       │                  │            │                   │                  │                  │                  │                  │
╞═════════════╪═════╪════════════╪════════════╪════════════╪══════════════════╪════════════╪═══════════════════╪══════════════════╪══════════════════╪══════════════════╪══════════════════╡
│Connected    │    1│18:21:30.691│18:21:30.691│18:22:52.225│0:00:01:21.5320000│18:21:30.691│0:00:00:00.0000000 │0:00:01:21.5320000│0:00:01:21.5320000│0:00:01:21.5320000│0:00:01:21.5320000│
│Connecting   │    1│18:21:29.928│18:21:29.928│18:21:30.691│0:00:00:00.7650000│18:21:29.928│0:00:00:00.0000000 │0:00:00:00.7650000│0:00:00:00.7650000│0:00:00:00.7650000│0:00:00:00.7650000│
│Disconnected │    2│18:21:29.841│18:21:29.841│18:21:29.928│0:00:00:00.0780000│18:22:52.400│0:00:00:00.0000000 │0:00:00:00.0780000│0:00:00:00.0780000│0:00:00:00.0780000│0:00:00:00.0780000│
│Disconnecting│    1│18:22:52.225│18:22:52.225│18:22:52.400│0:00:00:00.1870000│18:22:52.225│0:00:00:00.0000000 │0:00:00:00.1870000│0:00:00:00.1870000│0:00:00:00.1870000│0:00:00:00.1870000│
│Unconnected  │    2│18:21:29.841│18:21:29.841│18:21:30.691│0:00:00:00.8430000│18:22:52.225│0:00:00:00.1870000 │0:00:00:00.8430000│0:00:00:00.8430000│0:00:00:00.8430000│0:00:00:00.8430000│
╘═════════════╧═════╧════════════╧════════════╧════════════╧══════════════════╧════════════╧═══════════════════╧══════════════════╧══════════════════╧══════════════════╧══════════════════╛