Open Automation Software
Moving Data From Anywhere to Anywhere
1-303-679-0898

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 Basic Express 2010 or C# Express 2010 from www.microsoft.com/express.  If you have no experience with either Visual Basic or C# choose Visual Basic.  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 2005, 2008, or 2010 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.

If you are using WPF choose the OPCWPFDashboard assembly with the Target Framework set to the full 4.0 (not Client Profile) to then use the OPCWPFAlarm control.

.NET Alarm 401

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

Direct link: http://www.opcsystems.com/vs2010_video.htm

 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.

.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 Service source. Refer to the VB.NET Example on how to programmatically assign the Alarm Network Nodes.

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 binRelease directory to the target systems or follow the Smart Client deployment section in this help file to deploy your application using Click Once Deployment.