Solved

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

Posted on 2011-09-05
6
297 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
ID: 36483468
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
ID: 36485688
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
ID: 36487957
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:kavvis
ID: 36488075
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
ID: 36535661
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
ID: 36535879
Thank you for yopu took your time.. I do as have done before... thank  you
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

813 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

16 Experts available now in Live!

Get 1:1 Help Now