Difference between revisions of "Using OpcCmd Utility as OPC UA PubSub Subscriber"

From OPC Labs Knowledge Base
Jump to navigation Jump to search
Line 33: Line 33:
 
   --ConnectionResourceUri|-cru <uri>                                  PubSub connection resource URI
 
   --ConnectionResourceUri|-cru <uri>                                  PubSub connection resource URI
 
   --ConnectionTransportProfile|-ctp <uri>                              PubSub connection transport profile
 
   --ConnectionTransportProfile|-ctp <uri>                              PubSub connection transport profile
   --PcapReaderCaptureFile|-prcf <fileName>                            Pcap reader capture file
+
   --PcapReaderCaptureFile|-prcf <fileName>                            Pcap reader capture file (requires OpcLabs.Pcap)
 
   --ConnectionBrokerAuthenticationProfileUri|-cbapu <uri>              PubSub connection broker authentication profile URI
 
   --ConnectionBrokerAuthenticationProfileUri|-cbapu <uri>              PubSub connection broker authentication profile URI
 
   --ConnectionBrokerResourceUri|-cbru <uri>                            PubSub connection broker resource URI
 
   --ConnectionBrokerResourceUri|-cbru <uri>                            PubSub connection broker resource URI

Revision as of 14:38, 17 July 2019


Introduction

(TBD)

Note2-icon.png

Note: This page describes a preliminary version (5.55.0.3) of the program; the behavior is subject to change in future versions. This version only supports the OPC UA UDP transport protocol mapping (UADP over UDP). We plan to add more features and mappings in the future. Once released, the documentation to the OpcCmd (intended to be a superset of this page) will be found in the QuickOPC User's Guide and Reference.

Note2-icon.png

Note: OpcCmd may be enhanced in the future to support other OPC-related functionality, for Client-Server or PubSub. This page, however, is only for the PubSub subscriber aspect of the OpcCmd tool.

Usage

(TBD)

Command-line Options

OpcCmd has a concept of (possibly nested) commands and options. For the usage as OPC UA PubSub subscriber, you will need one command (uaSubscriber) and one sub-command (subscribeDataSet), so they will practically always be present on the command line, and you will just give them additional options as needed. For this reason, most of your commands will start with:

OpcCmd uaSubscriber subscribeDataSet

Parameters of the subscribeDataSet command can be influenced by various options given after it on the command line. They are (obtained through OpcCmd uaSubscriber subscribeDataSet --help):

Usage: OpcCmd uaSubscriber subscribeDataSet [options]

Options:
  --SleepTimeMilliseconds|-stm <milliseconds>                          Sleep time (-1 for Infinite, default=1 minute)
  --SleepTimeSpan|-sts <timespan>                                      Sleep timespan (e.g. hh:mm, or hh:mm:ss)
  --ResolverPublisherEndpointUri|-rpeu <uri>                           Resolver publisher endpoint URI
  --ResolverPublisherFileResourceUri|-rpfru <uri>                      Resolver publisher file resource URI
  --ResolverKind|-rk <None/Discovery/PublisherEndpoint/PublisherFile>  Resolver kind [DISCOVERY NOT IMPLEMENTED]
  --ConnectionNetworkInterface|-cni <name>                             PubSub connection network interface
  --ConnectionName|-cn <name>                                          PubSub connection name
  --ConnectionResourceUri|-cru <uri>                                   PubSub connection resource URI
  --ConnectionTransportProfile|-ctp <uri>                              PubSub connection transport profile
  --PcapReaderCaptureFile|-prcf <fileName>                             Pcap reader capture file (requires OpcLabs.Pcap)
  --ConnectionBrokerAuthenticationProfileUri|-cbapu <uri>              PubSub connection broker authentication profile URI
  --ConnectionBrokerResourceUri|-cbru <uri>                            PubSub connection broker resource URI
  --ConnectionDatagramDiscoveryUri|-cddu <uri>                         PubSub connection datagram discovery URI
  --MaximumNetworkMessageSize|-mnms <uint32>                           Maximum network message size (ignored)
  --MessageReceiveTimeout|-mrt <double>                                Message receive timeout (milliseconds)
  --SecurityGroupId|-sgi <name>                                        Security group Id
  --SecurityKeyServiceEndpointUris|-skseu <uris>                       Security key service endpoint URIs
  --SecurityMode|-sm <securityMode>                                    Security mode (None/SecurityNone/SecuritySign/SecuritySignAndEncrypt)
  --BrokerAuthenticationProfileUri|-bapu <uri>                         Broker authentication profile URI
  --BrokerMetaDataQueueName|-bmdqn <name>                              Broker metadata queue name
  --BrokerQueueName|-bqn <name>                                        Broker queue name
  --BrokerRequestedDeliveryGuarantee|-brdg <guarantee>                 Broker requested delivery guarantee (NotSpecified/BestEffort/AtLeastOnce/AtMostOnce/ExactlyOnce)
  --BrokerResourceUri|-bru <uri>                                       Broker resource URI
  --DataSetOffset|-dso <uint16>                                        Dataset offset
  --GroupVersion|-gv <uint32>                                          Group version
  --NetworkMessageNumber|-nmn <uint16>                                 Network message number
  --DataSetClassId|-dsci <guid>                                        Dataset class Id
  --AllowDataMessages|-adm <bool>                                      Allow data messages (default=true)
  --AllowEventMessages|-aem <bool>                                     Allow event messages (default=true)
  --DataSetWriterId|-dswi <uint16>                                     Dataset writer Id
  --DataSetWriterName|-dswn <name>                                     Dataset writer name
  --PublisherIdNumeric8|-pin8 <byte>                                   Publisher Id (Byte)
  --PublisherIdNumeric16|-pin16 <uint16>                               Publisher Id (UInt16)
  --PublisherIdNumeric32|-pin32 <uint32>                               Publisher Id (UInt32)
  --PublisherIdNumeric64|-pin64 <uint64>                               Publisher Id (UInt64)
  --PublisherIdString|-pis <string>                                    Publisher Id (String)
  --WriterGroupId|-wgi <uint16>                                        Writer group Id
  --WriterGroupName|-wgn <name>                                        Writer group name
  --MessageOriginFilter|-mof <string>                                  Message origin filter (ipaddress:port for UDP)
  --PublishedDataSetName|-pdsn <name>                                  Published dataset name
  -?|-h|--help                                                         Show help information

Usage examples:

Subscribe to a dataset, specifying physical parameters:
	OpcCmd uaSubscriber subscribeDataSet -cru opc.udp://239.0.0.1:4840
	OpcCmd uaSubscriber subscribeDataSet -cru opc.udp://224.0.0.22 -dswi 62541
	OpcCmd uaSubscriber subscribeDataSet -sts 01:00 -cru opc.udp://239.0.0.1:4840
	OpcCmd uaSubscriber subscribeDataSet -cru opc.udp://239.0.0.1:4840 -pin 20

Subscribe to a dataset, specifying logical parameters (and resolving them first):
	OpcCmd uaSubscriber subscribeDataSet -rpeu opc.tcp://192.168.0.85:4840 -cn UDP1 -wgn WriterGroupStatic -dswn WriterSimple
	OpcCmd uaSubscriber subscribeDataSet -rpeu opc.tcp://192.168.0.50:4842 -pdsn "PublishedDataSet #1"
	OpcCmd uaSubscriber subscribeDataSet -rfru unified_automation_cpp.bin -cn UDP1 -wgn WriterGroupDynamic -dswn WriterAllTypes

Help text for the OpcCmd utility itself can by displayed using OpcCmd --help. Help text for the OpcCmd uaSubscriber command can be displayed using OpcCmd uaSubscriber --help.

Examples

(TBD)

OpcCmd uaSubscriber subscribeDataSet -cru opc.udp://239.0.0.1

Or, for a specific publisher ID (31, in 64 bits) and dataset writer ID (4):

OpcCmd uaSubscriber subscribeDataSet -cru opc.udp://239.0.0.1 -pin64 31 -dswi 4

(TBD)

Sample Output

(TBD)

Testing

(TBD)