Create OPC Information Logger with COPC32 as well as Visual Studio 2015 Express
COPC32 activeX control made use of for SCADA development as well as growth. You can create SCADA system (Graphic monitoring & & control, Trending, Alarm, and also more. )within your preferred programming IDE such as Aesthetic Basic 6.0, Aesthetic Studio.Net (VB.Net, C#),
and also VBA (MS Excel, Word, & hellip;-RRB-. COPC32 1.7 complete summary COPC32 activeX control made use of for SCADA development as well as growth. You can develop SCADA system (Graphic monitoring & & control, Trending, Alarm, as well as much more.) within your favored programs IDE such as Visual Fundamental 6.0, Aesthetic Studio.Net (VB.Net, C#), and VBA (MS Excel, Word, & hellip;-RRB-. COPC32 Path variation will certainly quit working after a hr. You need to reboot program to run it once again.
This instance demonstrates how to logging OPC information in to MS SQL Server 2014 Express making use of COPC32 and Aesthetic Studio 2015 Express.
- MS SQL Server/ MS SQL Server Express
- Aesthetic Workshop 2015 Express (download here)
- COPC32 (it is not cost-free, download and install test here). As well as you need to installing COPC32.
- OPC Server
My data source name and table’& rsquo; s column revealed “below. & ldquo; id & rdquo; column is automobile increment.Read more COPC32 free download At website Articles
MS SQL Web server, circumstances name shown. It is MS SQL Web Server on exact same PC of my Visual Studio. Then I can utilize “& ldquo; (local)& rdquo; as recommendation name in script. If your instance name is something like “& ldquo; ACER \ SQLEXPRESS & rdquo;, then you could make use of & ldquo;(
local)\ SQLEXPRESS & rdquo;. Download and install OPC Data logging instance
project(135kb)Open up downloaded job and ensure you have insert COPC32 control on Toolbox of Visual Workshop.
Three label utilized to reveal OPC tags worth with Timer2 every 1 sec. Timer1 has logging script working every 5 sec.
Specify OPC Server on COPC32 ‘& lsquo; s home page.
As well as OPC tags.
In Timer2’& rsquo; s code, obtaining OPC information into global variable v( 0) to v( 2) (see downloaded and install instance code, will see worldwide variable stated). As well as also reveal information on tags.
Exclusive Sub Timer2_Tick(sender As Things, e As EventArgs) Handles 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()
I have use shell to call SQLCMD.exe with SQL command to place OPC information in to MS SQL table.
Personal Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Shell(“& ldquo; C: \ Program Data \ Microsoft SQL Web Server \ Client SDK \ ODBC \ 110 \ Devices \ Binn \ SQLCMD.exe -S (regional) -d examination -Q “”& ldquo; & rdquo; insert right 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=Web Server Name “(Please note that if your SQL Server has & ldquo; \ SQLEXPRESS & rdquo; after computer name then you need to make use of (neighborhood)\ SQLEXPRESS ), –– d = Data source Name, –– Q = SQL query/command. Example over use SQL Insert command to place v( 0 ), v( 1 ), v( 2) and also present day time right into table t1 at related column.
You have to inspecting path of SQLCMD.exe in your system and also change to over script.
After running job, OPC information logged into MS sQL Web server.