Generating Multi Instance alarms from the C# API

Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
mhargreaves
Posts:84
Joined: Thu Nov 11, 2010 12:31 pm

Generating Multi Instance alarms from the C# API

Post by mhargreaves »

Does anyone have any advice on how to generate alarms from the C# API?

I am using the following but getting an exception.

Code: Select all

var alerts = myManager.Alerts;
alerts.SetAlertValue("ExampleDP_Arg2.", DateTime.Now, 1, "test");

I wasn't sure what value I should put as the value (the example shows "test" but I don't know what is valid to use - do I write the text I want or the value of the point?).

Also I'm not sure how to set up the ExampleDP_Arg2 (which is a float type) so it can accept alerts. Maybe using an ExampleDP_Float is a wrong idea - I just don't know what to do?

Our API manager may need to generate and clear some status alerts.

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Generating Multi Instance alarms from the C# API

Post by leoknipp »

At the datapoint ExampleDP_Arg1 a continuous alert handling is configured by default.
If you want to set a multiinstance alert for this dp element first you have change the settings of the _alert_hdl config.

You can use the example datapoints for your tests if the _alert_hdl config is configured correctly.

Best Regards
Leopold Knipp
Senior Support Specialist

mhargreaves
Posts:84
Joined: Thu Nov 11, 2010 12:31 pm

Re: Generating Multi Instance alarms from the C# API

Post by mhargreaves »

Thanks Leopold for that information.

Once I have configured the alert_hdl config as a multiinstance alert, do you know what values I can use in the call to SetAlertValue? Are there any examples I can get hold of?

Thanks
Mark

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Generating Multi Instance alarms from the C# API

Post by leoknipp »

How it works to generate a multi instance alert in API I do not know.
When using a CTRL script you have to set the config + attribute _alert_hdl.._event with the value DPATTR_ALERTEVENT_CAME.
DPATTR_ALERTEVENT_CAME is a constant value which represents the integer value 0.
The values for the constants you find in the WinCC OA documentation: Reference tables --> Data point configs --> _alert_hdl

Best Regards
Leopold Knipp
Senior Support Specialist

4 posts • Page 1 of 1