2 de dezembro de 2020
COPC32 activeX control utilized for SCADA creation as well as development. You can produce SCADA system (Graphic monitoring & & control, Trending, Alarm system, as well as extra. )within your preferred shows IDE such as Aesthetic Fundamental 6.0, Visual Studio.Net (VB.Net, C#),
This instance demonstrates how to logging OPC information in to MS SQL Server 2014 Express making use of COPC32 and Visual Studio 2015 Express.
My database name as well as table’& rsquo; s column shown “listed below. & ldquo; id & rdquo; column is automobile increment.Read here COPC32 Download At our site
MS SQL Web server, instance name shown. It is MS SQL Server on exact same PC of my Visual Workshop. After that I can use “& ldquo; (neighborhood)& rdquo; as referral name in script. If your instance name is something like “& ldquo; ACER \ SQLEXPRESS & rdquo;, after that you can use & ldquo;(
regional)\ SQLEXPRESS & rdquo;. Download and install OPC Information logging instance
task(135kb)Open downloaded and install task and see to it you have insert COPC32 control on Toolbox of Visual Workshop.
Three tag used to reveal OPC tags worth with Timer2 every 1 sec. Timer1 has logging manuscript working every 5 sec.
Specify OPC Web Server on COPC32 ‘& lsquo; s residential property web page.
In addition to OPC tags.
In Timer2’& rsquo; s code, getting OPC information right into worldwide variable v( 0) to v( 2) (see downloaded example code, will certainly see global variable stated). As well as additionally reveal data on labels.
Private Below Timer2_Tick(sender As Item, e As EventArgs) Takes Care Of 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 usage shell to call SQLCMD.exe with SQL command to place OPC data in to MS SQL table.
Private Below Timer1_Tick(sender As Item, e As EventArgs) Deals With Timer1.Tick
Shell(“& ldquo; C: \ Program Files \ Microsoft SQL Web Server \ Customer SDK \ ODBC \ 110 \ Devices \ 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 Sub When argumment– S=Web Server Name “(Please note that if your SQL Server has & ldquo; \ SQLEXPRESS & rdquo; after computer system name then you require to use (local)\ SQLEXPRESS ), –– d = Data source Call, –– Q = SQL query/command. Example above usage SQL Insert command to put v( 0 ), v( 1 ), v( 2) and present date time right into table t1 at associated column.
You need to inspecting course of SQLCMD.exe in your system as well as replace to above manuscript.
After running job, OPC data logged into MS sQL Server.