- 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
- SubscribeMultipleItems - deadband C#
SubscribeMultipleItems - deadband C#
I correct "problematic" line. Now it works pefectly!
My critical code before:
short dataType = VarType.Empty;
for (int u = 0; u < Tag.Length; u++)
{
opcGroup2 = new OpcLabs.EasyOpc.DataAccess.DAItemGroupArguments(
Properties.Settings.Default.OPCmachineName,
Properties.Settings.Default.OPCserverClass,
Tag.TagID,
dataType,
Convert.ToInt32(Tag.UpdateRate), //Tag.UpdateRate = string
Tag.DeadBand); //Tag.UpdateRate = string
}
Code after correcting:
for (int u = 0; u < Tag.Length; u++)
{
opcGroup2 = new OpcLabs.EasyOpc.DataAccess.DAItemGroupArguments(
Properties.Settings.Default.OPCmachineName,
Properties.Settings.Default.OPCserverClass,
Tag.TagID,
dataType,
Convert.ToInt32(Tag.UpdateRate),
float.Parse(Tag.DeadBand), //corrected
null); //added
}
Thank You for Your quick answer!
Best regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
partial class ChangeItemSubscription
{
public static void PercentDeadband()
{
using (var easyDAClient = new EasyDAClient())
{
var eventHandler = new EventHandler<EasyDAItemChangedEventArgs>(easyDAClient_ItemChanged_PercentDeadband);
easyDAClient.ItemChanged += eventHandler;
Console.WriteLine("Subscribing with 10% deadband...");
int handle = easyDAClient.SubscribeItem("", "OPCLabs.KitServer.2", "Simulation.Ramp 0-100 (10 s)",
VarType.Empty, 100, 10.0f, null);
Console.WriteLine("Waiting for 10 seconds...");
Thread.Sleep(10 * 1000);
Console.WriteLine("Changing subscription to 0% deadband...");
easyDAClient.ChangeItemSubscription(handle, new DAGroupParameters(100, 0.0f));
Console.WriteLine("Waiting for 10 seconds...");
Thread.Sleep(10 * 1000);
Console.WriteLine("Unsubscribing...");
easyDAClient.UnsubscribeAllItems();
Console.WriteLine("Waiting for 10 seconds...");
Thread.Sleep(10 * 1000);
}
}
// Item changed event handler
static void easyDAClient_ItemChanged_PercentDeadband(object sender, EasyDAItemChangedEventArgs e)
{
Console.WriteLine(e.Vtq);
}
}
If you do not find a solution in the above code, can you please send me relevant parts of your program so that I can look at it?
Thank you
Zbynek Zahradnik
Please Log in or Create an account to join the conversation.
Best regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Can you try with latest QuickOPC from our Web site?
Thank you for your advice.
I have tried it with the latest Quick OPC Classic 5.1. Unfortunaly there is still the same problem.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
"easyDAClient1_ItemChanged" is working normal (it return results at requestedUpdateRate).
Yes, i think the parameter "deadband" is ignored.
OPC .net client (ver. 5.1) is reading from OPC Server simulator - Graybox (www.gray-box.net/).
Tags:
- numeric.sin.int16 (server data type: Short Integer)
- numeric.triangle.int16 (server data type: Short Integer)
It's possible the problem is in server data type...
Thanks & Best regards
Please Log in or Create an account to join the conversation.
I do not quite understand the nature of your problem. Can you please describe in more details?
Re "easyDAClient1_ItemChanged" return results at every "requestedUpdateRate". : Not sure what this means. The ItemChanged notifications should be called roughly in a rate given by the requestedUpdateRate (or slower, if there are no changes). Are you saying that this is not happening?
Re "Parameter "deadband" is not to take into.": Do you mean that it appears that this parameters is ignored? if so, can you please tell us: 1) Which OPC server are you connecting to, and 2) What type is the data item you are conecting to? (only items with "Analog" kind are subject to deadband filtering; other kinds of items DO ignore the deadband, this is per OPC specification, and 3) what is the precise version and build number of QuickOPC you are using? (there might have been builds with a bug with that effect; but the recent release should work well).
Best regards,
Zbynek Zahradnik
Please Log in or Create an account to join the conversation.
www.opclabs.com/Support/Online...
support.softwaretoolbox.com/ap...
"easyDAClient1_ItemChanged" return results at every "requestedUpdateRate".
Parameter "deadband" is not to take into.
Do everybodey know where is the problem?
Thanks & Best regards
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- SubscribeMultipleItems - deadband C#