- Posts: 21
- Thank you received: 1
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 or issues. You do not have to own a commercial license in order to use the OPC Labs support. Our team is actively monitoring the forums, and provides replies as soon as possible.
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 AE CustomAttributes
- rabbi.mathake
-
Topic Author
- Offline
- Elite Member
-
Please Log in or Create an account to join the conversation.
There is built-in trial license that delivers valid data for 30 minutes each time the process is run.
Separate evaluation key is only needed if, for your evaluation, the above time is not sufficient.
Regards
Please Log in or Create an account to join the conversation.
- rabbi.mathake
-
Topic Author
- Offline
- Elite Member
-
- Posts: 21
- Thank you received: 1
Please Log in or Create an account to join the conversation.
Test the same with the recent version. If ti works, purchase a version upgrade.
Best regards
Please Log in or Create an account to join the conversation.
- rabbi.mathake
-
Topic Author
- Offline
- Elite Member
-
- Posts: 21
- Thank you received: 1
################################ I have this in my project. ######################################################
public void Initialize()
{
_logger.LogInformation("AE Client: Initializing AE Client...");
_fileLogger.Log("AE Client: Initialize()", false, "AE Client");
_client = new EasyAEClient();
try
{
if (Server != null)
{
_hostName = NormalizeHostForOpc(Server.SPrimHostname);
_nodeName = Server.SPrimHostNodeName;
_backupHostName = NormalizeHostForOpc(Server.SSecHostname);
_backupNodeName = Server.SSecHostNodeName;
failoverMode = Server.FailoverMode;
AECategoryElementCollection categoryElements;
try
{
categoryElements = _client.QueryEventCategories(_hostName, _nodeName); // ******************************* I get error on this line ***********************************
}
catch (OpcException opcException)
{
Console.WriteLine("*** Failure: {0}", opcException.GetBaseException().Message);
return;
}
foreach (AECategoryElement categoryElement in categoryElements)
{
Debug.Assert(categoryElement != null);
Console.WriteLine("Category {0}:", categoryElement);
foreach (AEAttributeElement attributeElement in categoryElement.AttributeElements)
{
Debug.Assert(attributeElement != null);
Console.WriteLine(" Information about attribute {0}:", attributeElement);
Console.WriteLine(" .AttributeId: {0}", attributeElement.AttributeId);
Console.WriteLine(" .Description: {0}", attributeElement.Description);
Console.WriteLine(" .DataType: {0}", attributeElement.DataType);
}
}
}
}
catch (Exception ex)
{
_logger.LogError(ex, "AE Client: Failed to initialize host/node settings.");
throw;
}
}
############################## He is the error i get. ##############################################################
System.InvalidOperationException: An item with the same key has already been added. Key: Underflow
---> System.ArgumentException: An item with the same key has already been added. Key: Underflow
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem item)
at OpcLabs.EasyOpc.Implementation.NetApi.AlarmsAndEvents.NetApiEasyToOpcNetApiAe.QueryEventCategories(ServerDescriptor serverDescriptor, AEEventType eventTypes)
--- End of inner exception stack trace ---
at OpcLabs.EasyOpc.Implementation.NetApi.INetApiEasyClientExtension.CheckException(INetApiEasyClient netApiEasyClient, Exception exception, Boolean isOtherMethod)
at OpcLabs.EasyOpc.Implementation.NetApi.AlarmsAndEvents.NetApiEasyToOpcNetApiAe.QueryEventCategories(ServerDescriptor serverDescriptor, AEEventType eventTypes)
at OpcLabs.EasyOpc.AlarmsAndEvents.Implementation.TimeoutImposingEasyAEClient.<>c__DisplayClass12_0`1.<ImposeTimeout>b__0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at OpcLabs.BaseLib.Extensions.Internal.ExceptionExtension.Rethrow(Exception exception)
at OpcLabs.BaseLib.Threading.TaskParallelism.Wait(IAsyncResult asyncResult)
at OpcLabs.BaseLib.Extensions.Internal.ActionExtension.Perform(Action action, Int32 millisecondsTimeout)
at OpcLabs.EasyOpc.AlarmsAndEvents.Implementation.TimeoutImposingEasyAEClient.ImposeTimeout[TResult](Func`1 operationFunction, Int32 millisecondsTimeout)
at OpcLabs.EasyOpc.AlarmsAndEvents.Implementation.ErrorTransformingEasyAEClient.QueryEventCategories(ServerDescriptor serverDescriptor, AEEventType eventTypes)
at OpcLabs.EasyOpc.AlarmsAndEvents.Implementation.ErrorTransformingEasyAEClient.QueryEventCategories(ServerDescriptor serverDescriptor, AEEventType eventTypes)
Please Log in or Create an account to join the conversation.
version 5.61 is no longer supported. If you get the same error with the current version, report it here and we will diagnose it.
The information about the attributes is already contained in the result of QueryEventCategories, so the call to QueryCategoryAttributes is not needed. See this example:
opclabs.doc-that.com/files/onlinedocs/OPCLabs-ConnectivitySt...%20an%20event%20attribute.html
Best regards
Please Log in or Create an account to join the conversation.
- rabbi.mathake
-
Topic Author
- Offline
- Elite Member
-
- Posts: 21
- Thank you received: 1
Please Log in or Create an account to join the conversation.
This example shows how to specify which custom attributes should be delivered with each event category:
opclabs.doc-that.com/files/onlinedocs/OPCLabs-ConnectivitySt...ieve%20attribute%20values.html
I hope it helps.
Best regards
Please Log in or Create an account to join the conversation.
- rabbi.mathake
-
Topic Author
- Offline
- Elite Member
-
- Posts: 21
- Thank you received: 1
Please Log in or Create an account to join the conversation.
