×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to send PLC data directly into a database

How to send PLC data directly into a database

How to send PLC data directly into a database

(OP)
Hi,I would like to know what software/hardware do i need and the procedure to store data from a PLC to a database (SQL server for example)

Thanx

RE: How to send PLC data directly into a database

I have no experience with SQL servers, however many PLC manufacturers now provide DDE drivers.
Data may be read from or written to PLC devices, using simple VBA macros (typically in Excel environment).

RE: How to send PLC data directly into a database

Look at GE's Cimplicity HMI, Stepelchase, Wonderware, AB's RS Logix/Works/HMI (what ever it is called).

RE: How to send PLC data directly into a database

Hi ELEphilippe,

Last week I've finished a project where I used a plc-SQL connection. The configuration was the following. The Plc was a S7-400 (Siemens)which was connected via a ethernetcard (CP443-5)towards a HMI. In my case I've tried two HMI's, WinCC rev 6 (siemens)and Intouch rev 8 (Wonderware). Those two HMI packages were able to connect directly (scripting build in) to a MSSQL-server. Simple using standaard SQL-code (Open, select, table ...). Keep in mind that it only works with WinCC rev 6! If you need more information don't hessitate to contact me.
best regards Rudi Frederix

RE: How to send PLC data directly into a database

Hi there,

I've made a small mistake it's not a CP443-5 but a CP443-1 card. The CP443-5 is a profibus connection.

sorry

RE: How to send PLC data directly into a database

If you want to do SQL, I recommend purchasing someone's OPC package like automatedsolution or something like that. Save yourself a ton of time.

Another good OPC package is Omni Server for Allen Bradley etc....

http://www.softwaretoolbox.com/store/item_pages/itempage_950.asp

Chris Elston
Automation & Controls Engineer
http://www.mrplc.com
Download Sample PLC Ladder Logic Code
at MrPLC.com

RE: How to send PLC data directly into a database

You could drag the data into a vbapp using dde depending on the speed you require then write form vb into your database.I have some test code i done for access, if you e-mail me i will send it to you.

RE: How to send PLC data directly into a database

Is it possible to use VB as a front end and communicate with a Siemens S7-400 (CP443-1?)?
At our plant we are using WinCC for visualisation, now for a new application I should need about 8 new licenses of WinCC which is very expensive. That why I thought off VB.
The only thing we have to do, when a certain production line comes in stop mode, I need to send the date and Timestamp to a SQL-server and (were the plc connection comes in) let a light flashing.

Thanks in advance

RE: How to send PLC data directly into a database

Hi Fred,

I have used vb for front end but only with allen bradley but i do know that you can use it also for siemens S7,it would just be a different server (probably mpi).
I have used the vb to drag data from a plc-5 and dump it into an access 2000 db.

RE: How to send PLC data directly into a database

Garry,

Thanks foor helping me out, I still got some small questions. What kind of configuration did you use, What kind of networkcard did you use in your PC to communicate with the siemens PLC? Did you use an OPC-connection?

bye

RE: How to send PLC data directly into a database

Hi, how are you,
I recommend to you using Rssql these software is from Rockwell Software, and permit insert data to database in SQL.
If you want, have a major control over the datas, i recommend, using RSlinx Professional, and one Software of control, something like Factory Link.

I hope can help you, Bye bye

RE: How to send PLC data directly into a database

Hi you can use a lot of solutions, but first which plc you will use?

Send me the model, and i can help you.

Best Regards

Paulo Afonso
Integration Eng.
EINAUS Eng. Lda

RE: How to send PLC data directly into a database

Fritzfrederix wrote: "At our plant we are using WinCC for visualisation, now for a new application I should need about 8 new licenses of WinCC which is very expensive. That why I thought off VB."

Fritzfrederix , it may be too late now but if you have a similar requirement again, it looks like our software OPCWare Client Developer (http://www.opcware.com/Products.htm) is just what you need. You can use it in Visual Basic, and it works with any of the compliant OPC servers that are available for the Siemens S7-400 connected via an ethernet card (CP443-5) - if you need a list of the ones we recommend, please contact us via our website. In most cases, you would only need a single OPC server license and installation, typically these cost less than US$1,000, though some cost much less (as little as $120) and some are more expensive.

The OPCWare Client Developer installation includes two examples for storing data to a database - one of these uses a DSN connection, which is the normal method of connecting to remote databases such as SQL Server. Both examples log the item value, timestamp and quality to the database.

Now in addition to your data logging application, producing multiple HMI's with Visual Basic 6 is no problem using OPCWare Client Developer. The licensing options include Standard or Professional, both of which allow you to distribute your applications runtime free.

You could have your OPC server, 8 HMI's plus a data logging application all for less than $1,500, and with only limited programming required, keeping the costs down.

Best Regards,
Neil Kingston
Data Layers
http://www.opcware.com

RE: How to send PLC data directly into a database

You really have a lot of choices here, I believe that most SCADA/HMI packages will do SQL. Most of my experience is with National Instruments Lookout, and they have an SQLExec command, which allows you to write an SQL statement, and have variables in it.

I typicly write a stored procedure and call it with the SQLExec command, and insert the data that I want collected.

All you really need to do, is get the data you want to record into a register(s) in the plc. Get a SCADA/MMI package that will talk to the PLC, and also talk to your database.

Another way is to use a 'flat file", you can write the data you have in your PLC to a .csv file. You can trigger the write by a timed interval, or an event, or both.

Good luck,

Reandy

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now