pyuaf.client.requests¶
class AsyncCreateMonitoredDataRequest¶
-
class
pyuaf.client.requests.AsyncCreateMonitoredDataRequest(targets=0, **kwargs)¶ An
AsyncCreateMonitoredDataRequestis an asynchronous request to create one or more monitored data items.This class has the exact same methods and attributes as a
CreateMonitoredDataRequest, so see the documentation of the latter.
class AsyncCreateMonitoredEventsRequest¶
-
class
pyuaf.client.requests.AsyncCreateMonitoredEventsRequest(targets=0, **kwargs)¶ An
AsyncCreateMonitoredEventsRequestis an asynchronous request to create one or more monitored event items.This class has the exact same methods and attributes as a
CreateMonitoredEventsRequest, so see the documentation of the latter.
class AsyncMethodCallRequest¶
-
class
pyuaf.client.requests.AsyncMethodCallRequest(targets=0, **kwargs)¶ An
AsyncMethodCallRequestis an asynchronous request to call one or more methods.This class has the exact same methods and attributes as a
MethodCallRequest, so see the documentation of the latter.
class AsyncReadRequest¶
-
class
pyuaf.client.requests.AsyncReadRequest(targets=0, **kwargs)¶ An
AsyncReadRequestis an asynchronous request to read an attribute of one or more nodes.This class has the exact same methods and attributes as a
ReadRequest, so see the documentation of the latter.
class AsyncWriteRequest¶
-
class
pyuaf.client.requests.AsyncWriteRequest(targets=0, **kwargs)¶ An
AsyncWriteRequestis an asynchronous request to write an attribute of one or more nodes.This class has the exact same methods and attributes as a
WriteRequest, so see the documentation of the latter.
class BrowseNextRequest¶
-
class
pyuaf.client.requests.BrowseNextRequest(targets=0, **kwargs)¶ A
BrowseNextRequestis a synchronous request to continue a previous browsing of one or more nodes.You only need to use this BrowseNext request if you have put maxAutoBrowseNext to 0 in the previous Browse request (or if the automatic BrowseNext calls still resulted in continuationPoints). For your convenience, it’s much easier to simply use the BrowseRequest, and let the UAF do the BrowseNext calls automatically for you!
Methods:
-
__init__(targets=0, **kwargs)¶ Create a new BrowseNextRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
BrowseNextRequestTarget) - a vector of targets (a
BrowseNextRequestTargetVector)
- an
-
__str__(*args)¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
BrowseNextRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
BrowseNextSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
class BrowseNextRequestTarget¶
-
class
pyuaf.client.requests.BrowseNextRequestTarget(*args)¶ A
BrowseNextRequestTargetis the part of aBrowseNextRequestthat specifies the target that we were browsing and the corresponding continuation point.You only need to use the BrowseNext request if you have put maxAutoBrowseNext to 0 in the previous Browse request (or if the automatic BrowseNext calls still resulted in continuationPoints). For your convenience, it’s much easier to simply use the BrowseRequest, and let the UAF do the BrowseNext calls automatically for you!
Methods:
Attributes
-
address¶ The address of the node that was already being browsed, as an
Address. So you can copy the address of the original BrowseRequest to here, so that the UAF can use this address to find out to which server the BrowseNext call should be sent.
-
continuationPoint¶ The continuation point, as received by the previous Browse or BrowseNext call. This attribute is of the Python built-in type
bytearray.
-
class BrowseNextRequestTargetVector¶
-
class
pyuaf.client.requests.BrowseNextRequestTargetVector¶ An BrowseNextRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.BrowseNextRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofBrowseNextRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import BrowseRequest, BrowseNextRequestTarget, BrowseNextRequestTargetVector >>> from pyuaf.client.results import BrowseResult >>> from pyuaf.util import Address, ExpandedNodeId, NodeId >>> # we simulate the request and result of a previous Browse call with two targets >>> # (i.e. two nodes that were being browsed simultaneously) >>> originalRequest = BrowseRequest(2) >>> originalResult = BrowseResult() >>> originalResult.targets.resize(2) >>> # construct a vector without elements: >>> vec = BrowseNextRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(BrowseNextRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].address = originalRequest.targets[0].address >>> vec[0].continuationPoint = originalResult.targets[0].continuationPoint >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = BrowseNextRequestTargetVector( ... [ BrowseNextRequestTarget(Address(NodeId("myId0", "myNs"), "myServerUri"), bytearray("abcd")), ... BrowseNextRequestTarget(Address(NodeId("myId1", "myNs"), "myServerUri"), bytearray()) ] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = BrowseNextRequestTargetVector(3) >>> yetAnotherVec[0].address = Address(ExpandedNodeId("SomeId0", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[1].address = Address(ExpandedNodeId("SomeId1", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[2].address = Address(ExpandedNodeId("SomeId2", "SomeNs", "SomeServerUri"))
class BrowseRequest¶
-
class
pyuaf.client.requests.BrowseRequest(targets=0, **kwargs)¶ A
BrowseRequestis a synchronous request to browse the references of one or more nodes.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new BrowseRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
BrowseRequestTarget) - a vector of targets (a
BrowseRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
BrowseRequestTargetVector.
-
BrowseNextRequest.clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
BrowseSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
class BrowseRequestTarget¶
-
class
pyuaf.client.requests.BrowseRequestTarget(*args)¶ A
BrowseRequestTargetis the part of aBrowseRequestthat specifies the target to be browsed.Methods:
-
__init__(args*)¶ Create a new BrowseRequestTarget object.
You can specify a BrowseRequestTarget in two ways:
>>> import pyuaf >>> from pyuaf.util import Address, ExpandedNodeId >>> from pyuaf.client.requests import BrowseRequestTarget >>> addressOfNodeToBeBrowsed = Address(ExpandedNodeId("someId", "someNs", "someServerUri")) >>> # there are 2 ways to define a target: >>> target0 = BrowseRequestTarget() >>> target1 = BrowseRequestTarget(addressOfNodeToBeBrowsed) >>> # in case of the first target, you still need to specify an Address: >>> target0.address = addressOfNodeToBeBrowsed
-
__str__()¶ Get a formatted string representation of the target.
-
Attributes
-
browseDirection¶ Direction to follow when browsing the nodes, as an
intdefined in thebrowsedirectionsmodule.Forwardby default.
-
referenceTypeId¶ The ExpandedNodeId of the type of references (i.e. the ReferenceType) to follow (or its subtypes if the
includeSubtypesflag isTrue). The type of this attribute is anExpandedNodeId. By default, the nodeId is not initialized with contents (i.e. nodeId.isNull() returnsTrue), so that all references will be followed.
-
includeSubtypes¶ A
boolindicating that, if thereferenceTypeIdpoints to a valid node, also the subtypes of thereferenceTypeIdshould be followed.
-
nodeClassMask¶ A 32-bit
intrepresenting a mask that specifies the node classes that should be returned. The mask has the following bits assigned:- 0: Object
- 1: Variable
- 2: Method
- 3: ObjectType
- 4: VariableType
- 5: ReferenceType
- 6: DataType
- 7: View
Leave the mask 0 (=default!) to return all node classes.
-
resultMask¶ A 32-bit
intrepresenting a mask that specifies the fields in the reference description to be returned. The mask has the following bits assigned:- 0: ReferenceType
- 1: IsForward
- 2: NodeClass
- 3: BrowseName
- 4: DisplayName
- 5: TypeDefinition
By default, this mask is 63 (so 0b111111).
-
class BrowseRequestTargetVector¶
-
class
pyuaf.client.requests.BrowseRequestTargetVector¶ An BrowseRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.BrowseRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofBrowseRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import BrowseRequestTarget, BrowseRequestTargetVector >>> from pyuaf.util import Address, ExpandedNodeId, NodeId >>> # construct a vector without elements: >>> vec = BrowseRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(BrowseRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].address = Address(NodeId("SomeId", "SomeNs"), "SomeServerUri") >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = BrowseRequestTargetVector( ... [ BrowseRequestTarget(Address(NodeId("myId0", "myNs"), "myServerUri")), ... BrowseRequestTarget(Address(NodeId("myId1", "myNs"), "myServerUri")) ] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = BrowseRequestTargetVector(3) >>> yetAnotherVec[0].address = Address(ExpandedNodeId("SomeId0", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[1].address = Address(ExpandedNodeId("SomeId1", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[2].address = Address(ExpandedNodeId("SomeId2", "SomeNs", "SomeServerUri"))
class CreateMonitoredDataRequest¶
-
class
pyuaf.client.requests.CreateMonitoredDataRequest(targets=0, **kwargs)¶ A
CreateMonitoredDataRequestis a synchronous request to create one or more monitored data items.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new CreateMonitoredDataRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
CreateMonitoredDataRequestTarget) - a vector of targets (a
CreateMonitoredDataRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
CreateMonitoredDataRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
CreateMonitoredEventsSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
clientSubscriptionHandleGiven¶ True if the clientSubscriptionHandle attribute will be used, False if not. Type is
bool.
-
clientSubscriptionHandle¶ If clientSubscriptionHandleGiven is True, then this clientSubscriptionHandle should point to an existing subscription, which will be used to process the request.
-
subscriptionSettingsGiven¶ True if the subscriptionSettings attribute will be used, False if not. Type is
bool.
-
subscriptionSettings¶ If subscriptionSettingsGiven is True (and clientSubscriptionHandleGiven is False) then this subscriptionSettings will be used to create or reuse a subscription. Type is
SubscriptionSettings.
-
class CreateMonitoredDataRequestTarget¶
-
class
pyuaf.client.requests.CreateMonitoredDataRequestTarget(*args)¶ A
CreateMonitoredDataRequestTargetis the part of aCreateMonitoredDataRequestthat specifies the target to be monitored.Methods:
Attributes
-
attributeId¶ The attribute id to be monitored, as an
intdefined inattributeids.
-
indexRange¶ The index range (as a
str), in case you want to partially monitor an array.
-
monitoringMode¶ The monitoring mode, as an
intdefined inmonitoringmodes.
-
samplingIntervalSec¶ The rate, in seconds (as a
float), at which the monitored item should be sampled by the server. 0.0 means as fast as possible.
-
queueSize¶ The size of the queue at the server side, as an
int.
-
discardOldest¶ bool: Discard the oldest item in the queue, or not.
-
dataChangeFilter¶ The data change filter settings, as a
DataChangeFilter.
-
class CreateMonitoredDataRequestTargetVector¶
-
class
pyuaf.client.requests.CreateMonitoredDataRequestTargetVector¶ An CreateMonitoredDataRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.CreateMonitoredDataRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofCreateMonitoredDataRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import CreateMonitoredDataRequestTarget, CreateMonitoredDataRequestTargetVector >>> from pyuaf.util import Address, ExpandedNodeId >>> # construct a vector without elements: >>> vec = CreateMonitoredDataRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(CreateMonitoredDataRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].address = Address(ExpandedNodeId("SomeId", "SomeNs", "SomeServerUri")) >>> vec[0].queueSize = 5 >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = CreateMonitoredDataRequestTargetVector( [CreateMonitoredDataRequestTarget(), CreateMonitoredDataRequestTarget()] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = CreateMonitoredDataRequestTargetVector(3) >>> yetAnotherVec[0].queueSize = 10 >>> yetAnotherVec[1].queueSize = 10 >>> yetAnotherVec[2].queueSize = 10
class CreateMonitoredEventsRequest¶
-
class
pyuaf.client.requests.CreateMonitoredEventsRequest(targets=0, **kwargs)¶ A
CreateMonitoredEventsRequestis a synchronous request to create one or more monitored event items.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new CreateMonitoredEventsRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
CreateMonitoredEventsRequestTarget) - a vector of targets (a
CreateMonitoredEventsRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
CreateMonitoredEventsRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
CreateMonitoredEventsSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
clientSubscriptionHandleGiven¶ True if the clientSubscriptionHandle attribute will be used, False if not. Type is
bool.
-
clientSubscriptionHandle¶ If clientSubscriptionHandleGiven is True, then this clientSubscriptionHandle should point to an existing subscription, which will be used to process the request.
-
subscriptionSettingsGiven¶ True if the subscriptionSettings attribute will be used, False if not. Type is
bool.
-
subscriptionSettings¶ If subscriptionSettingsGiven is True (and clientSubscriptionHandleGiven is False) then this subscriptionSettings will be used to create or reuse a subscription. Type is
SubscriptionSettings.
-
class CreateMonitoredEventsRequestTarget¶
-
class
pyuaf.client.requests.CreateMonitoredEventsRequestTarget(*args)¶ A
CreateMonitoredEventsRequestTargetis the part of aCreateMonitoredEventsRequestthat specifies the target to be monitored.Methods:
Attributes
-
monitoringMode¶ The monitoring mode, as an
intdefined inmonitoringmodes.
-
samplingIntervalSec¶ The rate, in seconds (as a
float), at which the monitored item should be sampled by the server. 0.0 means as fast as possible.
-
queueSize¶ The size of the queue at the server side, as an
int.
-
discardOldest¶ bool: Discard the oldest item in the queue, or not.
-
eventFilter¶ The event filter settings, as an
EventFilter.
-
class CreateMonitoredEventsRequestTargetVector¶
-
class
pyuaf.client.requests.CreateMonitoredEventsRequestTargetVector¶ An CreateMonitoredEventsRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.CreateMonitoredEventsRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofCreateMonitoredEventsRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import CreateMonitoredEventsRequestTarget, CreateMonitoredEventsRequestTargetVector >>> from pyuaf.util import Address, ExpandedNodeId >>> # construct a vector without elements: >>> vec = CreateMonitoredEventsRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(CreateMonitoredEventsRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].address = Address(ExpandedNodeId("SomeId", "SomeNs", "SomeServerUri")) >>> vec[0].queueSize = 5 >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = CreateMonitoredEventsRequestTargetVector( [CreateMonitoredEventsRequestTarget(), CreateMonitoredEventsRequestTarget()] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = CreateMonitoredEventsRequestTargetVector(3) >>> yetAnotherVec[0].queueSize = 10 >>> yetAnotherVec[1].queueSize = 10 >>> yetAnotherVec[2].queueSize = 10
class HistoryReadRawModifiedRequest¶
-
class
pyuaf.client.requests.HistoryReadRawModifiedRequest(targets=0, **kwargs)¶ A
HistoryReadRawModifiedRequestis a synchronous request to read historical data within a given time interval.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new HistoryReadRawModifiedRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
HistoryReadRawModifiedRequestTarget) - a vector of targets (a
HistoryReadRawModifiedRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
HistoryReadRawModifiedRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
HistoryReadRawModifiedSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
BrowseSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
class HistoryReadRawModifiedRequestTarget¶
-
class
pyuaf.client.requests.HistoryReadRawModifiedRequestTarget(*args)¶ A
HistoryReadRawModifiedRequestTargetis the part of aHistoryReadRawModifiedRequestthat specifies the node that provides the historical information, the continuation point in case you want to manually continue a history reading, etc.Methods:
-
__init__(args*)¶ Create a new HistoryReadRawModifiedRequestTarget object.
You can specify a HistoryReadRawModifiedRequestTarget in three ways:
>>> import pyuaf >>> from pyuaf.util import Address, ExpandedNodeId >>> from pyuaf.client.requests import HistoryReadRawModifiedRequestTarget >>> addressOfNodeToBeRead = Address(ExpandedNodeId("someId", "someNs", "someServerUri")) >>> somePreviousContinuationPoint = bytearray() # normally you would copy the bytearray >>> # from a previous HistoryReadRawModifiedResult >>> # there are 3 ways to define a target: >>> target0 = HistoryReadRawModifiedRequestTarget() >>> target1 = HistoryReadRawModifiedRequestTarget(addressOfNodeToBeRead) >>> target2 = HistoryReadRawModifiedRequestTarget(addressOfNodeToBeRead, somePreviousContinuationPoint) >>> # in case of the first target, you still need to specify an Address: >>> target0.address = addressOfNodeToBeBrowsed
-
__str__()¶ Get a formatted string representation of the target.
-
Attributes
-
continuationPoint¶ The continuation point of a previous HistoryRead service call, as a built-in Python
bytearray. The UAF can automatically handle continuation points, for more info take a look at the documentation ofpyuaf.client.settings.HistoryReadRawModifiedSettings.maxAutoReadMore. If you decide to use the continuation points manually, you can still do so of course by copying the continuation point of a previous result (pyuaf.client.results.HistoryReadRawModifiedResultTarget.continuationPoint) to here.
-
indexRange¶ The index range in case the node is an array, as a
str.
-
dataEncoding¶ The data encoding, as a
QualifiedName. Leave NULL (i.e. don’t touch) if you want to use the default encoding.
-
class HistoryReadRawModifiedRequestTargetVector¶
-
class
pyuaf.client.requests.HistoryReadRawModifiedRequestTargetVector¶ An HistoryReadRawModifiedRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.HistoryReadRawModifiedRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofHistoryReadRawModifiedRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import HistoryReadRawModifiedRequestTarget, HistoryReadRawModifiedRequestTargetVector >>> from pyuaf.util import Address, ExpandedNodeId, NodeId >>> # construct a vector without elements: >>> vec = HistoryReadRawModifiedRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(HistoryReadRawModifiedRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].address = Address(NodeId("SomeId", "SomeNs"), "SomeServerUri") >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = HistoryReadRawModifiedRequestTargetVector( ... [ HistoryReadRawModifiedRequestTarget(Address(NodeId("myId0", "myNs"), "myServerUri")), ... HistoryReadRawModifiedRequestTarget(Address(NodeId("myId1", "myNs"), "myServerUri")) ] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = HistoryReadRawModifiedRequestTargetVector(3) >>> yetAnotherVec[0].address = Address(ExpandedNodeId("SomeId0", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[1].address = Address(ExpandedNodeId("SomeId1", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[2].address = Address(ExpandedNodeId("SomeId2", "SomeNs", "SomeServerUri"))
class MethodCallRequest¶
-
class
pyuaf.client.requests.MethodCallRequest(targets=0, **kwargs)¶ A
MethodCallRequestis a synchronous request to call one or more methods.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new MethodCallRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
MethodCallRequestTarget) - a vector of targets (a
MethodCallRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
MethodCallRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
MethodCallSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
class MethodCallRequestTarget¶
-
class
pyuaf.client.requests.MethodCallRequestTarget(*args)¶ A
MethodCallRequestTargetis the part of aMethodCallRequestthat specifies the target to be called.Methods:
-
__init__(args*)¶ Create a new MethodCallRequestTarget object.
You can specify a MethodCallRequestTarget in two ways:
>>> import pyuaf >>> from pyuaf.util import Address, ExpandedNodeId, VariantVector >>> from pyuaf.util.primitives import UInt32, Double >>> from pyuaf.client.requests import MethodCallRequestTarget >>> objectAddress = Address(ExpandedNodeId("someId", "someNs", "someServerUri")) >>> methodAddress = Address(ExpandedNodeId("someOtherId", "someNs", "someServerUri")) >>> inputArguments = VariantVector() >>> inputArguments.append(UInt32(123)) >>> inputArguments.append("some string") >>> inputArguments.append(Double(-3.14)) >>> # there are 2 ways to define a target: >>> target0 = MethodCallRequestTarget() >>> target1 = MethodCallRequestTarget(objectAddress, methodAddress, inputArguments) >>> # in case of the first target, you still need to specify the addresses and arguments: >>> target0.objectAddress = objectAddress >>> target0.methodAddress = methodAddress >>> target0.inputArguments = inputArguments
-
__str__()¶ Get a formatted string representation of the target.
-
Attributes
class MethodCallRequestTargetVector¶
-
class
pyuaf.client.requests.MethodCallRequestTargetVector¶ An MethodCallRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.MethodCallRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofMethodCallRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import MethodCallRequestTarget, MethodCallRequestTargetVector >>> from pyuaf.util import Address, ExpandedNodeId >>> # construct a vector without elements: >>> vec = MethodCallRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(MethodCallRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].objectAddress = Address(ExpandedNodeId("SomeId" , "SomeNs", "SomeServerUri")) >>> vec[0].methodAddress = Address(ExpandedNodeId("SomeOtherId", "SomeNs", "SomeServerUri")) >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = MethodCallRequestTargetVector( [MethodCallRequestTarget(), MethodCallRequestTarget()] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = MethodCallRequestTargetVector(3) >>> yetAnotherVec[0].objectAddress = Address(ExpandedNodeId("SomeId" , "SomeNs", "SomeServerUri")) >>> yetAnotherVec[0].methodAddress = Address(ExpandedNodeId("SomeOtherId", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[1].objectAddress = Address(ExpandedNodeId("SomeId" , "SomeNs", "SomeServerUri")) >>> yetAnotherVec[1].methodAddress = Address(ExpandedNodeId("SomeOtherId", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[2].objectAddress = Address(ExpandedNodeId("SomeId" , "SomeNs", "SomeServerUri")) >>> yetAnotherVec[2].methodAddress = Address(ExpandedNodeId("SomeOtherId", "SomeNs", "SomeServerUri"))
class ReadRequest¶
-
class
pyuaf.client.requests.ReadRequest(targets=0, **kwargs)¶ A
ReadRequestis a synchronous request to read an attribute of one or more nodes.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new ReadRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
ReadRequestTarget) - a vector of targets (a
ReadRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
ReadRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
ReadSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
class ReadRequestTarget¶
-
class
pyuaf.client.requests.ReadRequestTarget(*args)¶ A
ReadRequestTargetis the part of aReadRequestthat specifies the target to be read.Methods:
-
__init__(args*)¶ Create a new ReadRequestTarget object.
The default attributeId is
Value.You can specify a ReadRequestTarget in three ways:
>>> import pyuaf >>> from pyuaf.util import Address, ExpandedNodeId >>> from pyuaf.util.attributeids import DisplayName >>> from pyuaf.client.requests import ReadRequestTarget >>> addressOfNodeToBeRead = Address(ExpandedNodeId("someId", "someNs", "someServerUri")) >>> # there are 3 ways to define a target: >>> target0 = ReadRequestTarget() >>> target1 = ReadRequestTarget(addressOfNodeToBeRead) # attribute id = Value >>> target2 = ReadRequestTarget(addressOfNodeToBeRead, DisplayName) # attribute id = DisplayName >>> # in case of the first target, you still need to specify an Address: >>> target0.address = addressOfNodeToBeRead
-
__str__()¶ Get a formatted string representation of the target.
-
Attributes
-
attributeId¶ The id of the attribute to be read, as an
intdefined inattributeids.
-
indexRange¶ The index range (as a
str), in case you want to partially read an array.
-
class ReadRequestTargetVector¶
-
class
pyuaf.client.requests.ReadRequestTargetVector¶ An ReadRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.ReadRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofReadRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import ReadRequestTarget, ReadRequestTargetVector >>> from pyuaf.util import Address, ExpandedNodeId >>> # construct a vector without elements: >>> vec = ReadRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(ReadRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].address = Address(ExpandedNodeId("SomeId", "SomeNs", "SomeServerUri")) >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = ReadRequestTargetVector( [ReadRequestTarget(), ReadRequestTarget()] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = ReadRequestTargetVector(3) >>> yetAnotherVec[0].address = Address(ExpandedNodeId("SomeId0", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[1].address = Address(ExpandedNodeId("SomeId1", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[2].address = Address(ExpandedNodeId("SomeId2", "SomeNs", "SomeServerUri"))
class TranslateBrowsePathsToNodeIdsRequest¶
-
class
pyuaf.client.requests.TranslateBrowsePathsToNodeIdsRequest(targets=0, **kwargs)¶ A
TranslateBrowsePathsToNodeIdsRequestis a synchronous request to translate one or more browse paths to NodeIds.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new TranslateBrowsePathsToNodeIdsRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
TranslateBrowsePathsToNodeIdsRequestTarget) - a vector of targets (a
TranslateBrowsePathsToNodeIdsRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
TranslateBrowsePathsToNodeIdsRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
class TranslateBrowsePathsToNodeIdsRequestTarget¶
-
class
pyuaf.client.requests.TranslateBrowsePathsToNodeIdsRequestTarget(*args)¶ A
TranslateBrowsePathsToNodeIdsRequestTargetis the part of aTranslateBrowsePathsToNodeIdsRequestthat specifies the target to be translated.Methods:
-
__init__(args*)¶ Create a new TranslateBrowsePathsToNodeIdsRequestTarget object.
You can specify a TranslateBrowsePathsToNodeIdsRequestTarget in two ways:
>>> import pyuaf >>> from pyuaf.util import BrowsePath >>> from pyuaf.client.requests import TranslateBrowsePathsToNodeIdsRequestTarget >>> browsePathToBeTranslated = BrowsePath() >>> # there are 2 ways to define a target: >>> target0 = TranslateBrowsePathsToNodeIdsRequestTarget() >>> target1 = TranslateBrowsePathsToNodeIdsRequestTarget(browsePathToBeTranslated) >>> # in case of the first target, you still need to specify a node and some data: >>> target0.browsePath = browsePathToBeTranslated
-
__str__()¶ Get a formatted string representation of the target.
-
Attributes
-
browsePath¶ The browse path to be translated, as a
BrowsePath.
-
class TranslateBrowsePathsToNodeIdsRequestTargetVector¶
-
class
pyuaf.client.requests.TranslateBrowsePathsToNodeIdsRequestTargetVector¶ An TranslateBrowsePathsToNodeIdsRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.TranslateBrowsePathsToNodeIdsRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofTranslateBrowsePathsToNodeIdsRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import TranslateBrowsePathsToNodeIdsRequestTarget, \ ... TranslateBrowsePathsToNodeIdsRequestTargetVector >>> from pyuaf.util import BrowsePath, ExpandedNodeId, RelativePathElement, QualifiedName >>> # construct a vector without elements: >>> vec = TranslateBrowsePathsToNodeIdsRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> # define a starting ExpandedNodeId for the browse path >>> startOfBrowsePath = ExpandedNodeId("SomeId", "SomeNs", "SomeServerUri") >>> vec.append(TranslateBrowsePathsToNodeIdsRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].browsePath = BrowsePath(startOfBrowsePath, [RelativePathElement(QualifiedName("SomeName", "SomeNs"))] ) >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = TranslateBrowsePathsToNodeIdsRequestTargetVector( ... [TranslateBrowsePathsToNodeIdsRequestTarget(), ... TranslateBrowsePathsToNodeIdsRequestTarget()] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = TranslateBrowsePathsToNodeIdsRequestTargetVector(3) >>> yetAnotherVec[0].browsePath = BrowsePath(startOfBrowsePath, [RelativePathElement(QualifiedName("SomeName0", "SomeNs"))] ) >>> yetAnotherVec[1].browsePath = BrowsePath(startOfBrowsePath, [RelativePathElement(QualifiedName("SomeName1", "SomeNs"))] ) >>> yetAnotherVec[2].browsePath = BrowsePath(startOfBrowsePath, [RelativePathElement(QualifiedName("SomeName2", "SomeNs"))] )
class WriteRequest¶
-
class
pyuaf.client.requests.WriteRequest(targets=0, **kwargs)¶ A
WriteRequestis a synchronous request to write an attribute of one or more nodes.Methods:
-
__init__(targets=0, **kwargs)¶ Create a new WriteRequest object.
Parameters: targets – The targets of the request, either as:
- an
int, specifying the number of targets (0 by default) - a single target (a
WriteRequestTarget) - a vector of targets (a
WriteRequestTargetVector)
- an
-
__str__()¶ Get a formatted string representation of the request.
-
Attributes
-
targets¶ The targets, as a
WriteRequestTargetVector.
-
clientConnectionIdGiven¶ True if the clientConnectionId attribute will be used, False if not. Type is
bool.
-
clientConnectionId¶ If clientConnectionIdGiven is True, then this clientConnectionId should point to an existing session, which will be used to process the request.
-
sessionSettingsGiven¶ True if the sessionSettings attribute will be used, False if not. Type is
bool.
-
sessionSettings¶ If sessionSettingsGiven is True (and clientConnectionIdGiven is False) then this sessionSettings will be used to create or reuse a session. Type is
SessionSettings.
-
serviceSettingsGiven¶ True if the serviceSettings attribute will be used, False if not. Type is
bool.
-
serviceSettings¶ If serviceSettingsGiven is True then this serviceSettings will be used to process the request. Type is
WriteSettings.
-
translateSettingsGiven¶ True if the translateSettings attribute will be used, False if not. Type is
bool.
-
translateSettings¶ If translateSettingsGiven is True then this translateSettings will be used to translate any browsepaths. Type is
TranslateBrowsePathsToNodeIdsSettings.
-
class WriteRequestTarget¶
-
class
pyuaf.client.requests.WriteRequestTarget(*args)¶ A
WriteRequestTargetis the part of aWriteRequestthat specifies the target to be written.Methods:
-
__init__(args*)¶ Create a new WriteRequestTarget object.
The default attributeId is
Value.You can specify a WriteRequestTarget in three ways:
>>> import pyuaf >>> from pyuaf.util import Address, ExpandedNodeId, LocalizedText >>> from pyuaf.util.attributeids import DisplayName >>> from pyuaf.util.primitives import UInt32 >>> from pyuaf.client.requests import WriteRequestTarget >>> addressOfNodeToBeWritten = Address(ExpandedNodeId("someId", "someNs", "someServerUri")) >>> # there are 3 ways to define a target: >>> target0 = WriteRequestTarget() >>> target1 = WriteRequestTarget(addressOfNodeToBeWritten, UInt32(332)) # attribute id = Value >>> target2 = WriteRequestTarget(addressOfNodeToBeWritten, LocalizedText("en", "Some name"), DisplayName) # attribute id = DisplayName >>> # in case of the first target, you still need to specify an address and some data: >>> target0.address = addressOfNodeToBeWritten >>> target0.data = UInt32(332)
-
__str__()¶ Get a formatted string representation of the target.
-
Attributes
-
attributeId¶ The attribute id to be written, as an
intdefined inattributeids.
-
indexRange¶ The index range (as a
str), in case you want to partially write an array.
-
Attributes inherited from
pyuaf.util.DataValue-
opcUaStatusCode¶ The OPC UA statuscode of the data, as an
intdefined inopcuastatuscodes.
-
data¶ The data to be written, as one of the data types described in A note on dynamic data types.
-
sourcePicoseconds¶ The number of 10 picosecond intervals that need to be added to the source timestamp (to get a higher time resolution), as an
int.
-
serverPicoseconds¶ The number of 10 picosecond intervals that need to be added to the server timestamp (to get a higher time resolution), as an
int.
-
class WriteRequestTargetVector¶
-
class
pyuaf.client.requests.WriteRequestTargetVector(*args)¶ An WriteRequestTargetVector is a container that holds elements of type
pyuaf.client.requests.WriteRequestTarget. It is an artifact automatically generated from the C++ UAF code, and has the same functionality as alistofWriteRequestTarget.Usage example:
>>> import pyuaf >>> from pyuaf.client.requests import WriteRequestTarget, WriteRequestTargetVector >>> from pyuaf.util import Address, ExpandedNodeId >>> from pyuaf.util.primitives import UInt32, Float >>> # construct a vector without elements: >>> vec = WriteRequestTargetVector() >>> noOfElements = len(vec) # will be 0 >>> vec.append(WriteRequestTarget()) >>> noOfElements = len(vec) # will be 1 >>> vec[0].address = Address(ExpandedNodeId("SomeId", "SomeNs", "SomeServerUri")) >>> vec[0].data = UInt32(1234) >>> vec.resize(4) >>> noOfElements = len(vec) # will be 4 >>> # you may construct a vector from a regular Python list: >>> otherVec = WriteRequestTargetVector( [WriteRequestTarget(), WriteRequestTarget()] ) >>> # or you may specify a number of targets directly >>> yetAnotherVec = WriteRequestTargetVector(3) >>> yetAnotherVec[0].address = Address(ExpandedNodeId("SomeId0", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[0].data = UInt32(1234) >>> yetAnotherVec[1].address = Address(ExpandedNodeId("SomeId1", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[1].data = Float(0.1234) >>> yetAnotherVec[2].address = Address(ExpandedNodeId("SomeId2", "SomeNs", "SomeServerUri")) >>> yetAnotherVec[2].data = "test"