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
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:
- Analyzing OPC UA Communications with Wireshark: opcconnect.opcfoundation.org/2017/02/analyzing-opc-ua-communications-with-wireshark/
- OPC UA & Wireshark: www.prosysopc.com/blog/opc-ua-wireshark/
Best regards
Please Log in or Create an account to join the conversation.
- Scattolaro
-
Topic Author
- Offline
- Platinum Member
-
- Posts: 38
- Thank you received: 1
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.
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.
- Scattolaro
-
Topic Author
- Offline
- Platinum Member
-
- Posts: 38
- Thank you received: 1
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
Please Log in or Create an account to join the conversation.
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.
- Scattolaro
-
Topic Author
- Offline
- Platinum Member
-
- Posts: 38
- Thank you received: 1
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.