This tutorial will certainly assist you exactly how to use COPC32 on Visual Basic.NET. You have to mount COPC32 on your system prior to develop SCADA with Visual.NET and also COPC32 ActiveX control. As well as we intend that you have OPC Web server on your regional system currently.

We will certainly develop the simple form to review and contact OPC server on neighborhood systems. However you would, like to connect to remote OPC server. Please configure DCOM on both web server as well as customer side by describe tutorial of KEPWare at http://www.kepware.com/Support_Center/Viewlets/XP_sp2_viewlet_swf.html

The kind we will certainly produce is received Number 1.

Number 1

When customer insert numeric value in textbox as well as click switch ‘& lsquo; Create ‘, COPC32 will certainly write to OPC tag as well as reveal its value on ‘& lsquo

  1. ; Label1 ‘. Open Up Visual Studio.NET and also crate new job with VB.NET

Figure 2

Kind the name of this project as “& ldquo; TestCOPC32VBNET &

rdquo;. 2. Include COPC32 ActiveX control right into tool kit by choose food selection Devices > > Add/Remove Tool kit Items & hellip;

Figure 3

Then choose COPC32 received Number 4.

Figure 4

Then click “& ldquo;

OK & rdquo; 3.Read more freewindows10download.com At website Articles Crate a switch, a textbox as well as label on type like displayed in Figure 1

. 4. Select in tool kit and drag out the form.

5. Right click on COPC32 control on the form as well as choose ActiveX properties.

Figure 5

Establish upgrade price to 100 msec. And pick OPC Web server name to preferred OPC Server. You need to enter IP address or equipment name in ‘& lsquo; nodname ‘ textbox if you would love to link to remote OPC web server over the network.

Number 6

6. Select OPC Tag you would love to attach to.

Number 7

Click OK.

This OPC Tag could be Legible and Writable. You can examine your OPC Server like shown in Number 8.

Figure 8 OPC Tag residential or commercial properties.

Number 9 Configure OPC tag index number = 0

And click OK to leave property web pages.

Keep in mind: You can set up linked OPC tags by import OPC tag list from CSV file which export from OPC Server. Please describe

http://www.scadathai.com/COPC/COPCEng/tutorials.htm

As well as see “& ldquo; Exactly how to load OPC tags from CSV documents”&

rdquo;. 7. Dual click on the kind to get in to Form_Load event code sight.

8. Produce the code to link to OPC web server and get value of OPC tag index 0 to show on Label1.

Exclusive Below Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase. Tons

Axcopc1.cnnec()

Label1.Text = Convert.ToString(Axcopc1.GetVl( 0 ))

End Sub

Keep in mind: If you have configure various other OPC tag such as OPC tag index number = 1. You can obtain its worth using ‘& lsquo

; GetVl( “1)’”. 9. Select & ldquo; Closing & rdquo;

occasion name from

dropdown. Number 10 And develop the code like adhering to

Personal Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase. Closing

Application.DoEvents()

Axcopc1.discnn()

End Below

Keep in mind: We make use of “& ldquo; Application.DoEvents()” & rdquo; to waiting other task to finish prior to separate from OPC Server.

10. Back to make view. Dual click on COPC32 control on the type to go into to “& ldquo; datChange & rdquo; occasion code sight. After that produce the code to present OPC tag worth on Label1 when the vale of OPC tag we are linked has actually transformed.

Private Below Axcopc1_datChange(ByVal sender As Object, ByVal e As System.EventArgs) Manages Axcopc1.datChange

Label1.Text = Convert.ToString(Axcopc1.GetVl( 0 ))

End Below

11. Back to develop design sight. Dual click switch ‘& lsquo; Write ‘. After that produce code to write vale to OPC tag which has index number = 0.

Private Below Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Manages Button1.Click

Axcopc1.opcWrt(0, Convert.ToDouble(TextBox1.Text))

End Sub

12. Examination program by click F5. Put the number right into textbox and click ‘& lsquo; Compose ‘. You can see the vale received label is equal to your go into number.

Number 11

The complete relevant code is shown in Figure 12.