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

COPC32 activeX control used for SCADA production as well as advancement. You can develop SCADA system (Graphic keeping track of & & control, Trending, Alarm, and a lot more. )within your favorite programs IDE such as Visual Basic 6.0, Visual Studio.Net (VB.Net, C#),

as well as VBA (MS Excel, Word, & hellip;-RRB-. COPC32 1.7 full summary COPC32 activeX control utilized for SCADA production and development. You can produce SCADA system (Graphic checking & & control, Trending, Alarm, and also a lot more.) within your preferred programming IDE such as Aesthetic Standard 6.0, Aesthetic Studio.Net (VB.Net, C#), and also VBA (MS Excel, Word, & hellip;-RRB-. COPC32 Path variation will quit working after an hour. You have to restart program to run it once more.

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

Requirements

  • MS SQL Web Server/ MS SQL Web Server Express
  • Visual Studio 2015 Express (download right here)
  • COPC32 (it is not complimentary, download trial below). As well as you need to setting up COPC32.
  • OPC Web server

My data source name and table’& rsquo; s column shown “below. & ldquo; id & rdquo; column is vehicle increment.Join Us COPC32 website

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

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

task(135kb)Open up downloaded job as well as see to it you have insert COPC32 control on Toolbox of Visual Workshop.

3 label used to reveal OPC tags value with Timer2 every 1 sec. Timer1 has logging script working every 5 sec.

Specify OPC Web Server on COPC32 ‘& lsquo; s residential property page.

Along with OPC tags.

In Timer2’& rsquo; s code, getting OPC information into global variable v( 0) to v( 2) (see downloaded instance code, will certainly see international variable stated). And also reveal information on labels.

Exclusive Sub Timer2_Tick(sender As Object, e As EventArgs) Deals With 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 put OPC data in to MS SQL table.

Exclusive Below Timer1_Tick(sender As Object, e As EventArgs) Takes Care Of Timer1.Tick
Covering(“& ldquo; C: \ Program Documents \ Microsoft SQL Server \ Customer SDK \ ODBC \ 110 \ Devices \ Binn \ SQLCMD.exe -S (regional) -d examination -Q “”& ldquo; & rdquo; insert right 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 Sub When argumment– S=Server Call “(Please note that if your SQL Server has & ldquo; \ SQLEXPRESS & rdquo; after computer system name after that you need to use (neighborhood)\ SQLEXPRESS ), –– d = Database Name, –– Q = SQL query/command. Instance above use SQL Insert command to place v( 0 ), v( 1 ), v( 2) as well as existing day time right into table t1 at related column.

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

After running project, OPC information logged right into MS sQL Web server.

Leave a Reply

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