Solved

VB.NET - MSSQL EXPRESS... save data on trigg..

Posted on 2011-09-05
6
293 Views
Last Modified: 2012-05-12
Hello.
I have done a application that´s saves data from PLC to MSSQL whit a PC-VB.NET solution.

What I have done is that I have made some tags in a OPC-Server and then on trigg I just save the actual value in the tag(PLC-tag OPC-Server) and then save it into a database. ex. MSSQL with my vb.net application...

This application works verry well. I save one value every 5 min... for ex 8 hours... (workday)

Now to my question.

I would like to save data every 5 sec from PLC into the database...
Now I want some tips in wich way I do this best.
Should I stll read the tags every 5 sec and then direcly write to the database or should I read the values in a dataset in VB and then do a big send after a time?

I pretty new at this so thats why I want some tips...

I hope someone understand my question...


0
Comment
Question by:kavvis
  • 3
  • 2
6 Comments
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 167 total points
Comment Utility
Create a windows service application. In that use Timer and set the interval of 5 sec. Refer the links.

http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx.
http://www.developer.com/net/net/article.php/3335731/Using-Timers-in-a-Windows-Service.htm

0
 

Author Comment

by:kavvis
Comment Utility
hi! think I didn't explain My task correct, I still would like to use vb.net applikation that I have already, what I would like to know is.
Should I write a whole  query to MSSQL every 5 sec or should I Save in for example The values in à data set and then send many values at The same time!!?
0
 

Accepted Solution

by:
michael_krell earned 333 total points
Comment Utility
With the PLC Data Collection Apps that i have created that is the approach i have taken. I am not sure what data you are grabbing, but last time i did this i had data in the PLC organized by an array of a user defined datatype. I had arrays in the plc i called buffers. when they filled up with data the vb service would be triggered to grab that batch of data and insert that entire batch of data into SQL.

This works well because if communication is lost, the PLC will store the data until communication is regained.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:kavvis
Comment Utility
Yes, that´s a god way to do this task. But in my case I have no change to change the PLC software, I only can read some tags from a OPC-Server.

The read it´s selves is no problem.. I just wunder with ways is the best...

It´s about 40 diffrent tags I would like to read every 5 sec, I can do like I already does but I´m not sure that thats the best way...

Now I read 40 tags and then direcly save these tags in the MSSQL.... maybe I should still do like this..
or should I save the values in a dataset and then send it after tex. 10min instead....  
0
 

Assisted Solution

by:michael_krell
michael_krell earned 333 total points
Comment Utility
if you have no method of writing back to let the data source know you already have the data you are better of doing it the way you are doing it. ideally it would be good to have 2 way communication. it will open up other opportunities.

i can elaborate further if you want.
0
 

Author Closing Comment

by:kavvis
Comment Utility
Thank you for yopu took your time.. I do as have done before... thank  you
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now