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.
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.
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.
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.
Step 4
Add the OPCAlarmControl or OPCWPFAlarm component onto the Form or Window.
Resize both the form and alarm window to the desired size.
Step 5
Right click on the alarm window and select Properties.
Step 6
Set the Anchor property to Top, Bottom, Left, Right.
Step 7
Expand the AlarmFilter property and set the desired filter settings for the alarm window.
Step 8
Select the AlarmNetworkNodes property and click on the small grey square with the 3 dots at the right.
Step 9
Select all network nodes you wish to receive alarms from to this alarm window.
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.
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.
Step 12
Select Build from the VS menu and select to Build the application.
Step 13
Use Windows Explorer to browse for the application located in the binRelease directory and run the application.
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.