Windows HMI

 

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 Windows HMI.NET.

View the following video for a quick introduction to Windows HMI.NET.

https://www.opcsystems.com/opc_controls_netfast_video.htm

View the following video for detailed steps on using Windows HMI.NET.

https://www.opcsystems.com/opc_controls_net_video.htm

 

If you are new to Visual Studio and want to implement HMI Quick Start Templates view the following videos.

WinForm Multi-Document Interface: https://www.opcsystems.com/vs2010templateswinformmdi_video.htm

WinForm Tabbed Interface: https://www.opcsystems.com/vs2010templates_video.htm

 

The following steps can be used to add visualization to a C#, C++, or Visual Basic.NET application.  Refer to the VB.NET example for programmatic interface of using the OPC Controls components.  All properties are programmatically accessible.  The following example demonstrates the use of OPC Windows HMI.NET with no code required.  The components can also be used with Visual Studio 2003. but you will need to download the older 1.1 Framework version of OPC Systems.NET.

Step

Task

1

Load the default DemoTags Tag configuration if you have replaced your tag configuration with your own tags.

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

2

Select Windows Application as the project type.

3

From the Toolbox if OPCControls components are not available right click in the Toolbox and select Choose Items.  If it is available to step 4.

From the .NET Framework Components select all of the OPC Controls components and then select OK.

4

Add an OPCControlsLabel component onto the Form.

Right click on the OPCControlsLabel window and select Properties.

Select the TextOPCSystems_Tag property and use the browse button at the right to set the OPC Systems.NET Tag to Ramp.Value.

Note: If you wish to run this application on remote PCs make sure to include the Network Node or IP Address of the OPC Systems Service source.

Note: All Tag names are case sensitive.  Ramp.Value is valid, ramp.value is not.

Note: You can use the DirectOPC interface to connect directly to OPC Server Items is you just need to gain access to the server items without having to create OPC Systems.NET Tags.

5

Add an OPCControlsButton to the Form.

Set the TextOPCSystems_Tag to Pump.Value.  If the Pump Tag does not exist create a Boolean Tag using Configure-Tags with the name Pump.

Set the Format fields as defined below..

Set the BackColorOPCSystems_Tag to Pump.Value.

Set the SetValueOPCSystems_Tag to Pump.Value. and the SetValueOPCSystems property to True.

6

Add an OPCControlsTextBox to the Form.

Set the TextOPCSystems_Tag property to Pump.Value.  The Format properties for Boolean to Off and On.

.

7

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

8

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

9

Use Windows Explorer to browse for the application located in the bin\Release directory and run the application.

10

To deploy the application to remote nodes first make sure the Tags as described in steps 4, 5, and 6 are 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.

Note: You can also use the OPCControlsNetworkNodes component and assign a network node alias to change all “localhost” tags to the desired remote node.  This is done with the AddNetworkNodeAlias method.  Refer to the VB.NET Example on the exact syntax of how to use this method.  Notice how all OPC Controls data sources for a particular node can be reassigned to a remote node with one simple call.

11

There are many different properties to each control.  ImageIndex is available in many of the controls to display different images based on analog or discrete data.

The OPC Controls Data component can be used to access data via code with very simple methods.  Refer to the Forms FormReadValues and FormWriteValues in the VB.NET Example.

Refer to the VB.NET example for demonstration example of all properties of all components.

Continue: WPF HMI using Visual Studio