Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
Value of empty string nodes in UA
But, you can see already on the 2nd line, that it has turned the empty string to null, while the sample server keeps it as an empty string.
Note: My version displays "null" for a null value, your version displays "(none)", but this is because we have changed the output format in newer versions, but it is the same thing.
Best regards
Please Log in or Create an account to join the conversation.
when running your sample against KEPServerEX I get:
ABC {System.String} @2022-03-24T12:59:14.645 @@2022-03-24T12:59:14.645; Good
(none) {} @2022-03-24T12:59:14.707 @@2022-03-24T12:59:14.707; Good
Then an exception is thrown:
{"An OPC-UA operation failure with error ID 'Opc.UA.ServiceResult=0x80740000' occurred, originating from 'OpcLabs.EasyOpcUA' and with depth of 1. The inner OPC-UA service exception with service result 'BadTypeMismatch' contains details about the problem."}
Does this mean the OPC server has refused the value of null?
Kind regards
Peter
Please Log in or Create an account to join the conversation.
Yes, QuickOPC does not change values it reads or writes (leaving aside types conversions if necessary to resolve between UA and .NET, but this is not our case here).
Here is a test program I wrote that writes "ABC", "", and null to a string variable, and reads it back, with the sample OPC server by OPC Foundation:
and here is its output:
As you can see, the values we get back are the same as those we have passed in.
So I believe the KEPServerEX is doing this. In general there is nothing that forces the server to return back in Read) the same value that was written.
Best regards
Please Log in or Create an account to join the conversation.
thank you for your answer. Yes, my question is about UA.
I am using KEPServerEX in simulation mode and my client is using C#.
For the moment I have no access to other servers.
Just for my understanding:
QuickOPC is not changing the value, null and/or empty values are passed without changes. Correct?
But the OPC server may interfer and transform an empty value into null?
Kind regards
Peter
Please Log in or Create an account to join the conversation.
For my reply, I assume that this question is really about OPC UA (as the title suggests), and not about OPC Classic (as the forum category suggests).
I think that the null string and an empty string should be different in OPC UA. The difference may get blurred when some tools (such as Delphi) are used, but should work in C#, VB.NET etc.
This may be a server issue too.
Some questions:
1. Which OPC server are you using?
2. Have you tried the same operation with some other server?
3. Have you tried the same operations to your server with some other OPC client?
Best regards
Please Log in or Create an account to join the conversation.
Is there a difference between empty string and null for OPC nodes of type 'String'?
After setting the value to an empty string, null is returned for reading the node.
What is the reason for this?
Kind regards
Peter
Please Log in or Create an account to join the conversation.