NAME

OPCUA::Open62541::Client - High level functions for open62541 OPC UA client

SYNOPSIS

my @namespaces = $client->get_namespaces()

my @attributes = $client->get_attributes($nodeid, @attributes);

my @references = $client->getReferences($nodeid);

DESCRIPTION

This is the documentation for high level client functionality. For the fucntions directly wrapped around open62541 see OPCUA::Open62541.

METHODS

These methods require a OPCUA::Open62541::Client and will fail if the client is not already connected to an OPC UA server.

By default these methods will check the service results of responses and will DIE if the status code is not Good.

@namespaces = $client->get_namespaces()

Reads the SERVER_NAMESPACEARRAY node from namespace 0 and returns the namespace names as a list.

@attributes = $client->get_attributes($nodeid, @attributeids)

Makes a read requests for the specified node ID and attributes. Attributes can be either ATTRIBUTEID constants or the short names (see "get_mapping_attributeid_names" in OPCUA::Open62541::Constant.

Returns the results as DataValues.

@references = $client->get_references($nodeid, %request_args)

Makes a browse request for the specified node ID. If the server returns continuation points, this method will use browseNext requests until no more continuation points are returned.

The %request_args correspond to the BrowseDescription parameters and allows to set the following keys in the browse request:

browse_direction

Default is 2 (BOTH).

include_subtypes

Default is 1.

reference_type_id

Default is the REFERENCES node from namespace 0.

result_mask

Default is BROWSERESULTMASK_NONE.

Returns all results as ReferenceDescriptions.

UTILITY FUNCTIONS

These functions are for convenience and do not require a OPCUA::Open62541::Client object.

%hash = get_mapping_nodeclass_attributeid()

Returns a hash which maps nodeclasses to their available attribute IDs. The value indicates if the attribute is mandatory (m) or optional (o).

SEE ALSO

OPC UA library, https://open62541.org/

OPC Foundation, https://opcfoundation.org/

OPCUA::Open62541

AUTHORS

Alexander Bluhm <bluhm@genua.de>, Anton Borowka,

COPYRIGHT AND LICENSE

Copyright (c) 2025 Alexander Bluhm

Copyright (c) 2025 Anton Borowka

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Thanks to genua GmbH, https://www.genua.de/ for sponsoring this work.