Server doesn't check if pWriteValue->Value.Value is empty

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
huazhang
Hero Member
Hero Member
Posts: 24
Joined: 09 Sep 2016, 04:39

Server doesn't check if pWriteValue->Value.Value is empty

Post by huazhang »

Hi support team,

I fail to write a empty variant to an variable node whose AccessLevel is Read-Only, StatusWrite and SourceTimestampWrite.
After reading SDK1.5.2, I find the function IOManagerUaNode::beginWrite (...) doesn't check if pWriteValue->Value.Value is empty.
This logic is different from pWriteValue->Value.SourceTimestamp and pWriteValue->Value.StatusCode.
Is it a bug?
I will appreciate it if you could give me some guides.

Thanks!

User avatar
Support Team
Hero Member
Hero Member
Posts: 3068
Joined: 18 Mar 2011, 15:09

Re: Server doesn't check if pWriteValue->Value.Value is empt

Post by Support Team »

Hello huazhang,

in the write service you always pass in a DataValue including value, statuscode and timestamp.
The status and timestamp part is optional and can be ommited if you don't want to write status or timestamp.

In other words: You can not write just the timestamp or status without writing the value.
- If the status is Bad you pass in a null variant
- If the status is good or uncertain you write a valid variant value
Best regards
Unified Automation Support Team

huazhang
Hero Member
Hero Member
Posts: 24
Joined: 09 Sep 2016, 04:39

Re: Server doesn't check if pWriteValue->Value.Value is empt

Post by huazhang »

Thanks a lot!

Post Reply