Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeId seems not to be set for MonitoredItemCreateResult #226

Open
nachtmam opened this issue Aug 18, 2022 · 1 comment
Open

NodeId seems not to be set for MonitoredItemCreateResult #226

nachtmam opened this issue Aug 18, 2022 · 1 comment

Comments

@nachtmam
Copy link

nachtmam commented Aug 18, 2022

I tried to create some monitored items for a subscription. Code snipped attached, but it looks like the MonitoredItemCreateResult containing the result does not contain the NodeId.

Code:

let node_ids = vec![1007, 1002];

let items_to_create: Vec<MonitoredItemCreateRequest> = node_ids
            .iter()
            .map(|v| NodeId::new(ns, *v).into())
            .collect();

let results = session
            .create_monitored_items(id, TimestampsToReturn::Both, &items_to_create)
            .unwrap();
debug!("status_code {:?}", results);

Output :

status_code [
MonitoredItemCreateResult { 
status_code: HISTORICAL_RAW | Good, monitored_item_id: 1, revised_sampling_interval: 100.0, revised_queue_size: 1, filter_result: ExtensionObject { 
node_id: NodeId { namespace: 0, identifier: Numeric(0) }, body: None } }, 

MonitoredItemCreateResult { 
status_code: HISTORICAL_RAW | Good, monitored_item_id: 2, revised_sampling_interval: 100.0, revised_queue_size: 1, filter_result: ExtensionObject {
node_id: NodeId { namespace: 0, identifier: Numeric(0) }, body: None } }
]

Has anyone seen a similar issue ?

@milgner
Copy link
Contributor

milgner commented Sep 13, 2022

The node_id you're looking at is part of the filter_result. But since you don't have any filters, it's empty.
The message itself doesn't contain any node id. Often in OPC UA, one is expected to keep state from the invocation in order to interpret the response: the Read service response can only be interpreted if you know what ReadValueIds you used to invoke it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants