Create OPC Data Logger with COPC32 as well as Visual Workshop 2015 Express

COPC32 activeX control utilized for SCADA development and development. You can develop SCADA system (Graphic monitoring & & control, Trending, Alarm, as well as extra. )within your favored programming IDE such as Aesthetic Basic 6.0, Visual Studio.Net (VB.Net, C#),

and VBA (MS Excel, Word, & hellip;-RRB-. COPC32 1.7 full description COPC32 activeX control made use of for SCADA development and growth. You can produce SCADA system (Graphic monitoring & & control, Trending, Alarm system, and also a lot more.) within your favored shows IDE such as Visual Standard 6.0, Aesthetic Studio.Net (VB.Net, C#), and VBA (MS Excel, Word, & hellip;-RRB-. COPC32 Trail version will certainly stop working after a hr. You need to reactivate program to run it once more.

This example demonstrates how to logging OPC data in to MS SQL Server 2014 Express using COPC32 as well as Visual Workshop 2015 Express.

Needs

  • MS SQL Server/ MS SQL Server Express
  • Visual Workshop 2015 Express (download right here)
  • COPC32 (it is not cost-free, download and install trial here). And also you need to mounting COPC32.
  • OPC Web server

My database name and also table’& rsquo; s column revealed “below. & ldquo; id & rdquo; column is vehicle increment.you can find more here COPC32 Free from Our Articles

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

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

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

Three tag made use of to reveal OPC tags value with Timer2 every 1 sec. Timer1 has logging script working every 5 sec.

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

As well as OPC tags.

In Timer2’& rsquo; s code, obtaining OPC data right into global variable v( 0) to v( 2) (see downloaded and install example code, will see worldwide variable stated). And additionally reveal data on tags.

Personal Sub Timer2_Tick(sender As Item, e As EventArgs) Handles Timer2.Tick
For i = 0 To 2
v(i) = Axcopc1.GetVl(i)
Following

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

I have usage covering to call SQLCMD.exe with SQL command to place OPC data in to MS SQL table.

Exclusive Sub Timer1_Tick(sender As Things, e As EventArgs) Manages Timer1.Tick
Covering(“& ldquo; C: \ Program Documents \ Microsoft SQL Server \ Customer 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 Below When argumment– S=Web Server Call “(Please keep in mind that if your SQL Server has & ldquo; \ SQLEXPRESS & rdquo; after computer name after that you need to utilize (local)\ SQLEXPRESS ), –– d = Data source Call, –– Q = SQL query/command. Example over usage SQL Insert command to place v( 0 ), v( 1 ), v( 2) and also existing day time right into table t1 at relevant column.

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

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

Leave a Reply

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