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.
OPCUA read value issue
Please Log in or Create an account to join the conversation.
I am now using the precise same version of the TOP Server, and your configuration of the server. And, I cannot reproduce the issue. Here is the code I am running:
static void Main(string[] args)
{
EasyUAClient client = new EasyUAClient();
var nodes = client.BrowseDataNodes("opc.tcp://localhost:49320", "nsu=TOP Server;s=TESTPLC1.TESTPLC1");
foreach (var node in nodes)
{
Console.WriteLine(node);
}
Console.WriteLine();
try
{
object value = client.ReadValue("opc.tcp://localhost:49320", "nsu=TOP Server;ns=2;s=TESTPLC1.TESTPLC1.BodyStyle");
Console.WriteLine(value);
}
catch (UAException uaException)
{
Console.WriteLine($"*** Failure: {uaException.GetBaseException().Message}");
}
Console.ReadLine();
}
The program outputs the list of nodes. The ReadValue call then takes several seconds, and I get this error:
*** Failure: Status is not good: {Bad}.
+ The client method called (or event/callback invoked) was 'ReadMultiple[1]'.
I suppose this is the correct behavior, because I have no PLC connected. Notice that I do *not* get the BadNodeIdUnknown status.
Unfortunately, without a reproducible scenario it is difficult to help you further.
Best regards
Please Log in or Create an account to join the conversation.
- brandon.skiles@subaru-sia.com
- Topic Author
- Offline
- Premium Member
- Posts: 10
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Which version of the TOP Server are you using please? (in TOP Server Configuration program, do Help -> Support Information).
Best regards
Please Log in or Create an account to join the conversation.
- brandon.skiles@subaru-sia.com
- Topic Author
- Offline
- Premium Member
- Posts: 10
- Thank you received: 0
Please Log in or Create an account to join the conversation.
thank you for the additional information. I understand it perfectly now. And, I do not see anything wrong in what you are doing (the space characters were probably due to some copy/paste issue in the first post).
So, in under to resolve this, I am really missing the TOP Server configuration. It should not be complicated to provide it; something like:
1. Start TOP Server Configuration program.
2. Choose File -> Save As from the menu.
3. If asked about encryption settings, select "No encryption..." (I am assuming you have nothing secret or confidential in the configuration), and press OK.
4. Select where the file (with .OPF extension) should be stored, press Save.
5. Attach the file to a new forum post here (it only has to be zipped if it is extremely big). OR, send it by email to support09 (at) opclabs.com.
Many thanks
Please Log in or Create an account to join the conversation.
- brandon.skiles@subaru-sia.com
- Topic Author
- Offline
- Premium Member
- Posts: 10
- Thank you received: 0
public void OPCRead()
{
EasyUAClient easyUAClient = new EasyUAClient();
var nodes = easyUAClient.BrowseDataNodes("opc.tcp://DevSSS.ccrtest.ccr:49380", "nsu=TOP Server;s=TESTPLC1.TESTPLC1");
foreach (var node in nodes)
{
Console.WriteLine(node);
}
I
}
The output of this is the following:
_System -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1._System (Object)
_Statistics -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1._Statistics (Object)
BodyStyle -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.BodyStyle (Variable)
CarrierNumber -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.CarrierNumber (Variable)
I then run the following code:
public void OPCRead()
{
EasyUAClient easyUAClient = new EasyUAClient();
easyUAClient.ReadValue("opc.tcp://DevSSS.ccrtest.ccr:49380", "nsu=TOP Server;ns=2;s=TESTPLC1.TESTPLC1.BodyStyle");
}
I get the following error:
OpcLabs.EasyOpc.UA.OperationModel.UAException: An OPC-UA operation failure with error ID 'Opc.UA.StatusCode=0x80340000' occurred, originating from '' and with depth of 1. The inner exception, of type "OpcLabs.EasyOpc.UA.UAStatusCodeException", contains details about the problem.
---> OpcLabs.EasyOpc.UA.UAStatusCodeException: Status is not good: {BadNodeIdUnknown}. The node id refers to a node that does not exist in the server address space.
+ The node descriptor used was: NodeId="nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.BodyStyle".
+ The client method called (or event/callback invoked) was 'ReadMultiple'.
The QuickOPC version is 5.61.343
Please Log in or Create an account to join the conversation.
I see some weird usage of space characters (and its transformation to %20), maybe it is related to the issue.
For example, in "nsu =TOP Server;s=TESTPLC1.TESTPLC1", the space after "nsu" (and before "=") should not normally be there.
The other unusual thing is the space in the namespace ("TOP Server"); this is not normal because the namespace is a URI, and URIs cannot contain unescaped spaces either.
But, I cannot tell with certainty what is happening, I will need a reproducible scenario.
Can you please
1) Post here the TOP Server configuration (possibly zipped), and
2) Post here a full code that shows the problem (the parts you posted so far do not fit together - for example, I cannot tell how you obtained the tagName in the second snippet).
3) Indicate which QuickOPC version you are using
Thank you
Please Log in or Create an account to join the conversation.
- brandon.skiles@subaru-sia.com
- Topic Author
- Offline
- Premium Member
- Posts: 10
- Thank you received: 0
EasyUAClient easyUAClient = new EasyUAClient();
var nodes = easyUAClient.BrowseDataNodes("opc.tcp://DevSSS.ccrtest.ccr:49380", "nsu =TOP Server;s=TESTPLC1.TESTPLC1");
foreach (var node in nodes)
{
Console.WriteLine(node);
}
The output of this code:
BodyStyle -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.BodyStyle (Variable)
CarrierNumber -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.CarrierNumber (Variable)
ColorCode -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.ColorCode (Variable)
D0004520 -> nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.D0004520 (Variable)
I am then trying to read a value from one of the nodes that was found using the following code:
easyUAClient.ReadValue("opc.tcp://" + serverName, tagName);
I get the following error:
OpcLabs.EasyOpc.UA.UAStatusCodeException: Status is not good: {BadNodeIdUnknown}. The node id refers to a node that does not exist in the server address space.
+ The node descriptor used was: NodeId="nsu=TOP%20Server ;ns=2;s=TESTPLC1.TESTPLC1.CarrierNumber".
+ The client method called (or event/callback invoked) was 'ReadMultiple'.
I do not understand this because I know the node I am trying to read exists
Please Log in or Create an account to join the conversation.