Home ! Без рубрики Use COPC32 on Visual Basic.NET

Use COPC32 on Visual Basic.NET

This tutorial will certainly direct you how to utilize COPC32 on Aesthetic Basic.NET. You have to install COPC32 on your system prior to create SCADA with Visual.NET as well as COPC32 ActiveX control. And we suppose that you have OPC Server on your regional system currently.

We will produce the easy type to review as well as contact OPC server on local systems. But you would, like to connect to remote OPC web server. Please set up DCOM on both web server as well as client side by refer to tutorial of KEPWare at http://www.kepware.com/Support_Center/Viewlets/XP_sp2_viewlet_swf.html

The type we will certainly develop is displayed in Figure 1.

Figure 1

When individual insert numeric worth in textbox as well as click switch ‘& lsquo; Compose ‘, COPC32 will contact OPC tag and also show its worth on ‘& lsquo

  1. ; Label1 ‘. Open Visual Studio.NET and crate brand-new project with VB.NET

Figure 2

Type the name of this job as “& ldquo; TestCOPC32VBNET &

rdquo;. 2. Add COPC32 ActiveX control right into toolbox by choose menu Tools > > Add/Remove Toolbox Products & hellip;

Number 3

After that pick COPC32 shown in Figure 4.

Number 4

After that click “& ldquo;

OK & rdquo; 3. Crate a button, a textbox and tag on type like received Figure 1
More Here free COPC32 download At our site

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

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

Number 5

Set upgrade rate to 100 msec. As well as choose OPC Web server name to desired OPC Web 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 connect to.

Figure 7

Click OK.

This OPC Tag could be Understandable as well as Writable. You can look at your OPC Web server like received Number 8.

Number 8 OPC Tag residential or commercial properties.

Figure 9 Configure OPC tag index number = 0

And click OK to leave home pages.

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


And see “& ldquo; How to pack OPC tags from CSV documents”&

rdquo;. 7. Double click the kind to enter to Form_Load event code view.

8. Develop the code to connect to OPC web server and also obtain value of OPC tag index 0 to show on Label1.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Deals with MyBase. Lots


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

End Sub

Note: If you have set up various other OPC tag such as OPC tag index number = 1. You can obtain its value utilizing ‘& lsquo

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

occasion name from

dropdown. Figure 10 And also produce the code like complying with

Exclusive Below Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Deals with MyBase. Closing



End Sub

Keep in mind: We use “& ldquo; Application.DoEvents()” & rdquo; to waiting various other task to end up prior to separate from OPC Web server.

10. Back to make view. Double click on COPC32 control on the type to get in to “& ldquo; datChange & rdquo; occasion code sight. After that create the code to present OPC tag value on Label1 when the vale of OPC tag we are connected has actually changed.

Personal Below Axcopc1_datChange(ByVal sender As Object, ByVal e As System.EventArgs) Handles Axcopc1.datChange

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

End Below

11. Back to form style sight. Double click on button ‘& lsquo; Compose ‘. After that create 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) Handles Button1.Click

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

End Below

12. Test program by click F5. Insert the number right into textbox as well as click ‘& lsquo; Compose ‘. You might see the vale received label amounts to your enter number.

Figure 11

The overall associated code is received Number 12.

Post Navigation

Leave a Reply

Related Articles

Satisfying individuals online is most likely the biggest change that s happened considering that the last time you dated. However, for the majority of people over 50, online dating is where it s at, claims Dorin, that suggests utilizing finest dating websites for over 50 that users need to spend for. That indicates the company has their credit card, as well as if they are a criminal at all, you can inform the firm, as well as they can disallow them from the site, ; she clarifies. Dorin advises servicing your online profile with a buddy as well as having…

At dating site for over 50, with our special insight right into older dating, we share our best dating over 50 advice to get you back on the road to a pleased partnership. Below we break down the leading 9 nuggets of wisdom, including a few suggestions and also truths, when it concerns dating over 50. Over 50 dating website: Suggestions to Place You in Lead 1. Leave Your Baggage Behind A hard truth to face but a problem that can be prevented is emotional luggage in a new connection. With life experiences, busted partnerships and also loss, you inevitably…

The Office for National Data launched some intriguing info in 2017 relating to marital relationship as well as separation among the over-65s. In an unusual twist, it was discovered that divorce prices in this age group between 2005 as well as 2015 continued to be extensively consistent, while marriage rates really enhanced in the exact same duration. The takeaway message? British infant boomers are feeling even more liked up than ever before. Naturally, for single males and females looking for love in later life, it can be tricky to recognize where to start especially if you’ ve recently appeared of…