Hello,
How can I generate an Alarm within a QAction? I used this documentation (https://docs.dataminer.services/develop/devguide/Connector/LogicQActionsExamples.html#creating-an-alarm-in-a-qaction), but I did not find the SLProtocolScripts.dll library.
Thanks in advance
Hi Maximiliano
I've moved the code from the SLProtocolScripts DLL into a NuGet that can act as a replacement. SLProtocolScripts DLL is quite old and currently to be able to use this in DIS, you need to have a DM locally installed.
As such I've moved the code and created a v0.0.0 as more improvements can be made later on to the NuGet: NuGet Gallery | Skyline.DataMiner.Utils.Alarms.Protocol 0.0.0
The namespace will be 'using Skyline.DataMiner.Utils.Alarms.Protocol', but the class name I've kept the same.
Hi Tom,
I added the library "SLProtocolScripts.dll" reference in the QAction, but the "using Skyline.DataMiner.ProtocolScripts" directive gives an error.
Probably it’s not working because you don’t have an installation of DataMiner on your development machine. Could you please try copying the file from a DMA into ‘C:Skyline DataMinerProtocolScriptsSLProtocolScripts.dll’? Maybe also verify if you can find the reference in the C# project in Visual Studio itself. And in the csproj file you should find something like this:
Hi Maximiliano,
Would like to understand the use case for this approach a bit better. Could you maybe quickly describe why you want to create an alarm that way in code? The method you are linking to is only being used in very specific cases.
Typically alarms are being created by specifying in the alarm template that an alarm should be raised when the parameter has a value in a certain range. So I'm wondering if you cannot create a parameter in the connector that indicates if the alarm should be active or not?
If you want to generate an information event, you could use the following method: https://gist.github.com/TomW-Skyline/42522f8a35626ab13fe6359744cfa356.
Hi Tom,
I just want to generate an information event to report the data processing flow within the protocol
To generate an information event you could indeed use that call. Here you can find an example method: https://gist.github.com/TomW-Skyline/42522f8a35626ab13fe6359744cfa356 .
I’ve found something similar, but where can I find this SLProtocolScripts.dll?
Next to the QAction in the xml there is a small arrow that opens a menu. I believe it can be added from there.
Opened a new answer to insert screenshots
https://community.dataminer.services/question/creating-an-alarm-in-a-qaction/answer/124164/
Hi Maximilano,
trying to add the ProtocolScripts dll seems to work for me. Maybe you can try rebuilding the qaction to make sure that the dll is there.