Professional OPC
Development Tools

logos

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.

OPC-UA Call with particular data type

More
21 Mar 2025 22:30 #13506 by support
Hello.

Can you please collect network communication using WireShark and provide it to us for analysis? One run with successful method call (UaExpert), other run with the failure (QuickOPC). 

Some helpful links:
Best regards

 

Please Log in or Create an account to join the conversation.

More
21 Mar 2025 15:07 #13505 by Scattolaro
Hi,
Yes correct, we also tried with Double but the result is the same.
See attached log.
  • Please Log in or Create an account to join the conversation.

    More
    13 Mar 2025 10:21 #13462 by support
    Hello.

    In OPC UA, "Duration" data type derives from Double. Therefore, the type you set for ExpectedCycleTime should be Double, not Int16.

    Best regards
     

    Please Log in or Create an account to join the conversation.

    More
    13 Mar 2025 08:28 #13461 by Scattolaro
    Hi,
    Yes if I send the call from UAExpert as per the screenshot it goes through successfully.
    Instead if I send the call using the "CallMethod" of the OPC-UA client it doesn't work.
    Below is the code:

     List<o-bject> inputList = new List<o-bject>;();
     List<TypeCode> typeList = new List<TypeCode>;();
     int i = 1;
     foreach (RunVariableVM item in _devModel.RunVariableList.FindAll(x => x.nodeCall == rVarTMP.nodeCall && x.structuredDataType == StructType.INPUTARGUMENTS))
     {
         typeList.Add(item.GetTypeCode);
         inputList.Add(item.Value);
         Program.LOG.Verbose("OPCSCH", "Add input argument[" + i + "] with name:" + item.Name + "|value:" + item.Value + "|type:" + item.GetTypeCode);
         i++;
     }
     object output = null;
     if (inputList.Count == 0)
     {
         Program.LOG.Verbose("OPCSCH", "Send call:" + rVarTMP.Name + " without input arguments");
         output = clientOPCUA.CallMethod(_devModel.UAEndpointDesc, rVarTMP.node, rVarTMP.nodeCall);
     }
     else
     {
         Program.LOG.Verbose("OPCSCH", "Send call:" + rVarTMP.Name + " with input arguments");
         output = clientOPCUA.CallMethod(_devModel.UAEndpointDesc, rVarTMP.node, rVarTMP.nodeCall, inputList.ToArray(),typeList.ToArray());
     }
     int outIndex = 0;
     foreach (var item in output)
     {
         Program.LOG.Verbose("OPCSCH", "Send call:" + rVarTMP.Name + " output(" + outIndex + "):" + item.ToString());
         string nameVar = String.Format("{0}_OUT{1:0000}", rVarTMP.Name, outIndex);
         StructuredDataAdd(nameVar, item, VarType.CALL);
         outIndex += 1;
     }
     Program.LOG.Verbose("OPCSCH", "Send call:" + rVarTMP.Name + " successfull!");

    I have also attached the log.

    Do you have any ideas?

    Thanks
    Attachments:

    Please Log in or Create an account to join the conversation.

    More
    11 Mar 2025 09:12 #13457 by support
    Hello,
    it might be a different argument that is causing this, not the one with Duration. I need some more information from you:

    1. Do you succeed when calling the method from UaExpert?
    2. Please post here the piece of code that calls the method, together with enough context that allows to determine which data types are the values that you pass in.

    Best regards
     

    Please Log in or Create an account to join the conversation.

    More
    11 Mar 2025 08:13 #13456 by Scattolaro
    I developed an application in C# with the OPC-UA Client following what is described in the online guide at this link:

    opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Late...all%20a%20single%20method.html

    Also I tried with the OPC-UA demo server and it works correctly.
    However, I have a customer with a machine that implement Euromap77 (OPC-UA) with the following call(see image below)

     

    Here it does not work(CallMethod) because I always get the BadInvalidArgument exception.
    I think the cause is because I do not pass the "ExpectedCycleTime" argument with the correct data type (Duration).
    "Duration" is not a standard data type but a special data type defined in OPC-UA server (see image below)

     

    How can I pass this data type in a call (CallMethod)? Is it possible? Can you help me?
    Thanks
  • Please Log in or Create an account to join the conversation.

    Moderators: supportvaclav.zaloudek
    Time to create page: 0.164 seconds