Skip to content

Instantly share code, notes, and snippets.

@TomW-Skyline
Created April 15, 2024 16:28
Show Gist options
  • Save TomW-Skyline/42522f8a35626ab13fe6359744cfa356 to your computer and use it in GitHub Desktop.
Save TomW-Skyline/42522f8a35626ab13fe6359744cfa356 to your computer and use it in GitHub Desktop.
Generate DataMiner information event
/// <summary>
/// Generate an information event. (SLProtocolScripts.dll needs to be imported) ("using Skyline.DataMiner.ProtocolScripts;" is needed)
/// </summary>
/// <param name="protocol">Link with Skyline DataMiner</param>
/// <param name="sValue">Value of the event</param>
/// <param name="iPid">ID of the concerned parameter</param>
/// <returns>A boolean indicating if the event creation is a success or not.</returns>
public static bool CreateInformationEvent(SLProtocol protocol, string sValue, int iPid)
{
Alarm oAl = new Alarm();
try
{
int iEid = Convert.ToInt32(protocol.GetParameter(65026));
string[] arrAlarm = oAl.NewAlarm(iEid, iPid, sValue, "INFORMATION");
protocol.NotifyDataMiner(106, 0, arrAlarm);
return true;
}
catch
{
protocol.Log(8, 5, "Exception creating the information event:");
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment