- Posts: 106
- Thank you received: 0
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.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- Reading Kepware Tag with wrong value
Reading Kepware Tag with wrong value
- adid@contel.co.il
- Topic Author
- Offline
- Platinum Member
ok i will check it with the vendor Kepware and will update as soon as possible.
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
That would not explain, however, why the behavior is different with different data types.
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Topic Author
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
thank you for your answer.
i will contact with kepware provider about this problem.
i am thinking it's rellevant to Simulate device checkbox on the device, because in production it's working with same device throgh opcLabs.
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
Therefore my suggestion with synchronous reads cannot be applied.
To me this looks like a problem in the server. But we need some data to reliably determine the cause.
OPC Analyzer mentioned above is for OPC Classic only. A similar tool would be the Compliance Test Tool for OPC UA, or a Wireshark with OPC UA plugin. I will have to check whether I can provide the test tool to the outside of OPC Foundation membership for this purpose. But the Wireshark analysis (which I have only used little in the past) may be an option.
Will you be willing to use one of these tools? Better, can you speak to the server vendor (is it Kepware?) first, whether they are not aware of anything that could cause the issue?
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Topic Author
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
how can i switch to OPC reads from Device ?
i am doing the test in my code ( in my service ) and i can change it.
the function that read multiple tags is attached below. as you can see the read is executed in line :
valueResults = m_EasyUAClient.ReadMultipleValues(uaReadArguments.ToArray());
before this line i try to write value to the same tag ant it return succeed but the value wasn't changed.
if you want me to deploy an OPC Analyzer i would be glad if you put instructions to this route.
thank you,
Adi Damty
here is the code :
public void ReadMultipleTags(List<TagInfo> i_Tags, bool i_ThrowExceptionIfPartOfReadingFailed)
{
List<UAReadArguments> uaReadArguments = new List<UAReadArguments>();
UAReadArguments uaReadArgument = null;
StringBuilder tagsNames = new StringBuilder("");
ValueResult[] valueResults = null;
string nodeId = null;
string messageToUser = null;
int numOfReadingTagsFailed = 0;
foreach (TagInfo taginfo in i_Tags)
{
nodeId = GetNodeId(taginfo.UAEndpointDescriptor, taginfo.TagName);
if (taginfo.UAEndpointDescriptor == null)
{
throw new Exception("UAEndpointDescriptor is null");
}
if (nodeId == null)
{
throw new Exception(string.Format("tag wasnt found for UAEndpointDescriptor [{0}] tag name [{1}]", taginfo.UAEndpointDescriptor, taginfo.TagName));
}
tagsNames.AppendFormat(@"[{0}] , ", taginfo.TagName);
uaReadArgument = new UAReadArguments();
uaReadArgument.EndpointDescriptor = taginfo.UAEndpointDescriptor;
uaReadArgument.NodeDescriptor = nodeId;
uaReadArguments.Add(uaReadArgument);
}
if (uaReadArguments.Count > 0)
{
valueResults = m_EasyUAClient.ReadMultipleValues(uaReadArguments.ToArray());
}
if (valueResults != null)
{
for (int i = 0; i < valueResults.Length; i++)
{
if (valueResults[i].Succeeded)
{
i_Tags[i].Value = valueResults[i].Value;
}
else
{
numOfReadingTagsFailed++;
messageToUser = string.Format("Error reading from opc server [{0}] tag [{1}] : {2}", uaReadArguments[i].EndpointDescriptor, uaReadArguments[i].NodeDescriptor, valueResults[i].Exception.Message);
m_Logger.LogErrorAndWriteToDB(m_ServiceName, messageToUser);
}
}
}
if (valueResults == null ||
numOfReadingTagsFailed == uaReadArguments.Count ||
(i_ThrowExceptionIfPartOfReadingFailed == true &&
numOfReadingTagsFailed >= 1))
{
throw new Exception(string.Format("ReadMultipleTags Error : Failed to read tags {0}", tagsNames.ToString().Substring(0, tagsNames.ToString().Length - 3)));
}
}
Please Log in or Create an account to join the conversation.
If you cannot modify the code or the switch to sync reads does not help, I suggest that you deploy an OPC Analyzer and we take the logs of what happens between the client and the server. This will then allow to determine which part is responsible for the behavior. Again, I can give instructions to this route.
Best regards
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Topic Author
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
something is strange.
i try to write value 100 to this tag using opcLabs - i didn't get any exception thrown, than i go to the kepware client and saw that the tag value wasn't changed and it still 200.
than i wait 10 seconds and try to read this tag using opcLabs - i get value 0 with result success.
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Topic Author
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
i write value 100 through kepware client ( through async write ) and it takes 1-2 seconds.
after i saw the tag value was changed than i also wait 10 seconds and than try to read it thourgh the opcLabs - and it returns value 0 with result success. it's not happend for word tag under simulator device, and it not happened for boolean tag under the same Simense device.
i hope it's helping to understand the problem.
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Topic Author
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
i am using opcLabs version 5.30.1114.1.
i create tag with device driver simulator and operate opc client and change the tag value to 100, and than read the tag value with opcLabs function Read - the tag values was read successfully.
i create another device driver : Siemens TCP/IP Ethernet, define device property S7-300, create word tag inside the device, operate opc client and change the tag value to 100, and than trying to read the value with opcLabs function read - than the function return success but return value 0 and not value 100.
i also saw that under the same Simens device driver if i define boolean tag than the opcLabs read it's value successfully - so the problem occurs only with tag from type short and word.
what is the problem ?
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- Reading Kepware Tag with wrong value