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.

Alarm Hi/Lo Attribute

More
05 Oct 2020 14:50 #8969 by support
Replied by support on topic Alarm Hi/Lo Attribute
Hello,
there are multiple ways to do that. For one of them, see the example below. Does that help?
// This example shows how to read a Low state of a limit alarm. Note that you should not normally read a state of an alarm
// from inside its event notification, because the state might have already changed. Instead, include the information you
// need in the Select clauses when subscribing for the event.
 
using System;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.AddressSpace;
using OpcLabs.EasyOpc.UA.Navigation;
 
namespace UADocExamples.AlarmsAndConditions
{
    class ReadAlarmState
    {
        public static void Main1()
        {
            UAEndpointDescriptor endpointDescriptor =
                "opc.tcp://opcua.demo-this.com:62544/Quickstarts/AlarmConditionServer";
 
            UANodeDescriptor alarmNodeDescriptor = new UANodeId(
                namespaceUriString:"http://opcfoundation.org/Quickstarts/AlarmCondition", 
                identifier:"1:Colours/EastTank?Yellow");
 
            // Knowing the alarm node, and the fact that is an instance of NonExclusiveLevelAlarmType (or its subtype),
            // determine what is its LowState/Id node.
            UANodeDescriptor lowStateIdNodeDescriptor = new UABrowsePath(alarmNodeDescriptor,
                new []
                {
                    UABrowsePathElement.CreateSimple("ns=0;s=LowState"),
                    UABrowsePathElement.CreateSimple("ns=0;s=Id")
                });
 
            // Instantiate the client object.
            var client = new EasyUAClient();
 
            Console.WriteLine("Reading alarm state...");
            var lowStateId = (bool)client.ReadValue(endpointDescriptor, lowStateIdNodeDescriptor);
 
            Console.WriteLine($"Id of LowState: {lowStateId}");
        }
    }
}
Best regards

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

More
05 Oct 2020 10:23 #8966 by grimas
Alarm Hi/Lo Attribute was created by grimas
Hi,

I am trying to find out how I can know if an analogue alarm is High or Low using the UA .net library.

Using the OPC AE library I was using eventData.SubConditionName for this information, but I cannot find anything similar.

Can you please help?

Thanks!

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

Moderators: support
Time to create page: 0.044 seconds