Produce OPC Information Logger with COPC32 as well as Visual Studio 2015 Express

COPC32 activeX control used for SCADA production as well as advancement. You can produce SCADA system (Graphic keeping track of & & control, Trending, Alarm system, as well as a lot more. )within your preferred programming IDE such as Aesthetic Standard 6.0, Visual Studio.Net (VB.Net, C#),

and VBA (MS Excel, Word, & hellip;-RRB-. COPC32 1.7 complete summary COPC32 activeX control utilized for SCADA creation as well as growth. You can produce SCADA system (Graphic keeping an eye on & & control, Trending, Alarm system, as well as extra.) within your favored programming IDE such as Visual Standard 6.0, Visual Studio.Net (VB.Net, C#), and also VBA (MS Excel, Word, & hellip;-RRB-. COPC32 Route variation will certainly quit working after an hour. You have to reboot program to run it again.

This instance shows how to logging OPC information in to MS SQL Server 2014 Express using COPC32 as well as Visual Workshop 2015 Express.

Demands

  • MS SQL Web Server/ MS SQL Server Express
  • Aesthetic Studio 2015 Express (download below)
  • COPC32 (it is not free, download and install trial right here). And you need to mounting COPC32.
  • OPC Server

My data source name as well as table’& rsquo; s column shown “below. & ldquo; id & rdquo; column is automobile increment.At site COPC32 Download from Our Articles

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

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

job(135kb)Open up downloaded and install task as well as see to it you have insert COPC32 control on Tool kit of Visual Studio.

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

Define OPC Server on COPC32 ‘& lsquo; s property web page.

In addition to OPC tags.

In Timer2’& rsquo; s code, getting OPC data into global variable v( 0) to v( 2) (see downloaded and install instance code, will certainly see worldwide variable proclaimed). As well as also reveal data on labels.

Private Sub Timer2_Tick(sender As Item, e As EventArgs) Manages Timer2.Tick
For i = 0 To 2
v(i) = Axcopc1.GetVl(i)
Next

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 put OPC information in to MS SQL table.

Private Sub Timer1_Tick(sender As Things, e As EventArgs) Takes Care Of Timer1.Tick
Covering(“& ldquo; C: \ Program Files \ Microsoft SQL Web Server \ Customer SDK \ ODBC \ 110 \ Tools \ Binn \ SQLCMD.exe -S (local) -d test -Q “”& ldquo; & rdquo; insert into t1(v1, v2, v3, Time_Date) values (” & & rdquo; & & v(0) “& & ldquo; “, & rdquo;””& v(1)& & ldquo;, & rdquo; &

v(2) & & ldquo;, getdate ())& rdquo; & rdquo; & rdquo;-RRB- End Below When argumment– S=Web Server Call “(Please keep in mind that if your SQL Server has & ldquo; \ SQLEXPRESS & rdquo; after computer system name then you require to utilize (regional)\ SQLEXPRESS ), –– d = Data source Name, –– Q = SQL query/command. Example above use SQL Insert command to put v( 0 ), v( 1 ), v( 2) and also existing day time into table t1 at associated column.

You have to examining course of SQLCMD.exe in your system as well as change to above manuscript.

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

Leave a Comment

Your email address will not be published. Required fields are marked *