Getting Started – .NET Alarm

The following resources will provide you information to get your alarming application put together quickly.

If you do not have a copy of Visual Studio you can download a free version of Visual Studio Community (formerly Visual Basic Express or C# Express) from visualstudio.microsoft.com/vs/community.  You can choose whether to use Visual Basic or C#, but if you have no experience with either language, Visual Basic is easier for new developers.  No programming is required to use OPC .NET WinForm HMI .NET.

The following steps can be used to add an alarm window to a C#, C++, or Visual Basic.NET application. All properties are programmatically accessible.

The following example demonstrates the alarm window with no code required. You can use Visual Studio 2005, 2008, 2010, 2012 or 2013. The alarm window can also be used with Visual Studio 2003 with the older .NET Framework 1.1 version of OPC Systems.NET.

Alarm Properties

The descriptions of each property of the alarm control can be viewed when selecting the property.

Step 1

Start Visual Studio and select File->New->Project to create a new C#, C++, or VB.

.NET WinForm HMI 292

Step 2

Select Windows Application or WPF Application as the project type.

WPF: If you are using WPF choose the OPCWPFDashboard assembly then use the OPCWPFAlarm control.

WinForm: If you are using WinForm choose OPCAlarmControl assembly.

.NET Alarm 401

Note: If using Visual Studio 2010 set the Target Framework to the full version not the Client Profile.

 Step 3

From the Toolbox if OPCAlarmControl is not available right click in the Toolbox and select Choose Items.

.NET WinForm HMI 294

From the .NET Framework Components select OPCAlarmControl and then select OK.

For WPF applications from the Toolbox right click to select all OPCWPFDashboard assembly controls including the OPCWPFAlarm control.

Note: If you have installed Visual Studio after Open Automation Software you can either Browse and include the OPCWPFDashboard.dll assembly from C:\Program Files\Open Automation Software\OAS\ or uninstall Open Automation Software and reinstall to register the OPCWPFDashboard.dll assembly with Visual Studio.

.NET Alarm 402

Step 4

Add the OPCAlarmControl or OPCWPFAlarm component onto the Form or Window.

.NET Alarm 403

Resize both the form and alarm window to the desired size.

.NET Alarm 404

Step 5

Right click on the alarm window and select Properties.

.NET WinForm HMI 297

Step 6

Set the Anchor property to Top, Bottom, Left, Right.

.Net Trend 363

Step 7

Expand the AlarmFilter property and set the desired filter settings for the alarm window.

.NET Alarm 405

Step 8

Select the AlarmNetworkNodes property and click on the small grey square with the 3 dots at the right.

.NET Alarm 406

Step 9

Select all network nodes you wish to receive alarms from to this alarm window.

.NET Alarm 407

Note: If you want the application to be deployed across a network to remote PCs select the Network Node or enter an IP Address in the NetworkNode field and use the Select button to include the network node or IP Address of the OAS Engine source.

Step 10

If you desire for the operator’s changes to the alarm window during runtime to remain set the ConfgiurationFile property to a valid file path. Make sure each system the application will run on that the directory path is valid.

.Net Trend 371

Note: If you set this property to a file make sure you deploy the file with the application in the directory you specify.

Leave this property blank if you wish to have the default properties set during configuration remain on the application restarting.

Step 11

Set the compile mode on the Visual Studio toolbar to Release.

.NET WinForm HMI 305

Step 12

Select Build from the VS menu and select to Build the application.

.NET WinForm HMI 306

Step 13

Use Windows Explorer to browse for the application located in the binRelease directory and run the application.

.NET Alarm 408

Step 14

To deploy the application to remote nodes first make sure the AlarmNetworkNodes selection as described in Step 9 is set to a Network Node or IP Address. Then simply copy the files in the bin\Release directory to the target systems or follow the Smart Client deployment section in this help file to deploy your application using Click Once Deployment.