Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

How to send PLC data directly into a database 1

Status
Not open for further replies.

ELEphilippe

Electrical
May 5, 2003
12
0
0
CA
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
 
Replies continue below

Recommended for you

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).
 
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
 
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.
 
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
 
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.
 
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
 
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
 
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



 
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 ( 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
 
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
 
Status
Not open for further replies.
Back
Top