Create OPC Information Logger with COPC32 and also Visual Workshop 2015 Express

by in ! Без рубрики December 2, 2020

COPC32 activeX control utilized for SCADA development as well as growth. You can develop SCADA system (Graphic checking & & control, Trending, Alarm, and more. )within your preferred programming IDE such as Visual Standard 6.0, Visual Studio.Net (VB.Net, C#),

and also VBA (MS Excel, Word, & hellip;-RRB-. COPC32 1.7 full summary COPC32 activeX control made use of for SCADA production and advancement. You can produce SCADA system (Graphic keeping an eye on & & control, Trending, Alarm, and also more.) within your favored shows IDE such as Visual Basic 6.0, Aesthetic Studio.Net (VB.Net, C#), and VBA (MS Excel, Word, & hellip;-RRB-. COPC32 Path variation will stop working after a hr. You have to reboot program to run it once again.

This example demonstrates how to logging OPC information in to MS SQL Server 2014 Express utilizing COPC32 and also Visual Workshop 2015 Express.


  • MS SQL Web Server/ MS SQL Server Express
  • Aesthetic Workshop 2015 Express (download below)
  • COPC32 (it is not complimentary, download test below). And also you need to setting up COPC32.
  • OPC Web server

My database name and table’& rsquo; s column shown “below. & ldquo; id & rdquo; column is vehicle increment.Read more COPC32 Download for Windows At website Articles

MS SQL Server, circumstances name shown. It is MS SQL Web Server on same COMPUTER of my Visual Studio. After that I can make use of “& ldquo; (local)& rdquo; as referral name in manuscript. If your circumstances name is something like “& ldquo; ACER \ SQLEXPRESS & rdquo;, then you might use & ldquo;(

regional)\ SQLEXPRESS & rdquo;. Download and install OPC Data logging example

task(135kb)Open up downloaded task and make sure you have insert COPC32 control on Toolbox of Visual Studio.

Three tag used to show OPC tags value with Timer2 every 1 sec. Timer1 has logging script working every 5 sec.

Specify OPC Server on COPC32 ‘& lsquo; s home web page.

As well as OPC tags.

In Timer2’& rsquo; s code, obtaining OPC data into worldwide variable v( 0) to v( 2) (see downloaded instance code, will certainly see international variable proclaimed). As well as likewise show data on tags.

Personal Sub Timer2_Tick(sender As Object, e As EventArgs) Deals With Timer2.Tick
For i = 0 To 2
v(i) = Axcopc1.GetVl(i)

Label1.Text = v( 0 ). ToString()
Label2.Text = v( 1 ). ToString()
Label3.Text = v( 2 ). ToString()
End Sub

I have use shell to call SQLCMD.exe with SQL command to insert OPC data in to MS SQL table.

Personal Sub Timer1_Tick(sender As Item, e As EventArgs) Manages Timer1.Tick
Shell(“& ldquo; C: \ Program Data \ Microsoft SQL Web Server \ Client SDK \ ODBC \ 110 \ Tools \ Binn \ SQLCMD.exe -S (local) -d test -Q “”& ldquo; & rdquo; insert into t1(v1, v2, v3, Time_Date) worths (” & & rdquo; & & v(0) “& & ldquo; “, & rdquo;””& v(1)& & ldquo;, & rdquo; &

v(2) & & ldquo;, getdate ())& rdquo; & rdquo; & rdquo;-RRB- End Sub When argumment– S=Server Name “(Please keep in mind that if your SQL Server has & ldquo; \ SQLEXPRESS & rdquo; after computer system name after that you require to use (local)\ SQLEXPRESS ), –– d = Database Name, –– Q = SQL query/command. Instance above usage SQL Insert command to place v( 0 ), v( 1 ), v( 2) and present date time right into table t1 at relevant column.

You have to inspecting course of SQLCMD.exe in your system and replace to above script.

After running task, OPC information logged right into MS sQL Server.