A really cool solution

Archie

Member
Join Date
May 2002
Location
Orangeburg, SC
Posts
1,944
After months of tossing around the idea and looking at ways to do acheive it, this week I put in production a PLC that stores its hostorical data directly to a SQL server. And when I say directly I mean directly, no SCADA, no HMI, no PC. Just the PLC and a back office SQL server. And it was done with a PLC that cost less than $1500 including the IO. The PLC is a Beckhoff CX1000.

The CX1000 is based on windows CE operating, which allows a VB.NET application to be put on the controller and the control program has a function block that can launch the application.

I accomplished the data trander by having the control logic launch the VB app on the controller when the batch is done. The VB app then reads all the data, writes it to the SQL server, sets a bit in the control logic to indicate data is stored, and then the app closes itself.

The VB app is only about 20 lines of code, which took me less than an hour to write.

Has anyone else found other ways to acheive a direct transfer of data from the PLC to a database?

The only other solution I have found so far, is based on the AB Control Logix platform. It is a card dedicated to writing data to a SQL server. The card by itself is a $10,000 item!
 
Archie,


Thanks for sharing,

I've never used Beckoff, altough, there were some talks a year earlier to introduce it. But, no buy-in from the customers due to unfamiliar system.
 
Logging Rate

Archie,

  1. How fast are/can you able to log / commit (write) the data into SQL server ?
  2. Is the SQL also housed / Loaded in CX1000?
  3. What Link have u used between CX1000 and External PC with SQL, Windows TCP/IP or any other protocol ?
  4. Did not understand the Control Logix network diagram along with CX1000 , what was the basic configuration and how was this system connected to control logix ?
  5. What Kind of I/O were used in CX1000 ? PCMCI Based ? Can you provide more detail if possible.
Thanks for the information.
 
Archie

The CX100 is PC not PLC(– 2002:CX1000 – modular Embedded PCs for DIN rail mounting)


That a quote from theire web site.

I was involved in a project that require a same, PLC who talking directly to SQL server.
I was the machine programmer but the guys there pulled the info from the PLC to the server without any problems,I just prepared the info for him.
I dont know how he did it, I just add E-Com to my DL-06 PLC.
The guy who did that is extremely talent.
He catch the idea in a second and it work after a few minuts.
I must say the info was not so much.
In another app my brother connected PLC to MS Access very easy.
You need the right driver for that.
I guess you have another consideration when you came to use Beckhoff and of course it cheaper then AB.
 
search_automation said:
  1. How fast are/can you able to log / commit (write) the data into SQL server ?
  2. Is the SQL also housed / Loaded in CX1000?
  3. What Link have u used between CX1000 and External PC with SQL, Windows TCP/IP or any other protocol ?
  4. Did not understand the Control Logix network diagram along with CX1000 , what was the basic configuration and how was this system connected to control logix ?
  5. What Kind of I/O were used in CX1000 ? PCMCI Based ? Can you provide more detail if possible.
1. With the technique I used, from start to finish it transfers 150 records, each containing 5 values in a total of 15 seconds (5 of which are taken to launch the VB app)

2. The SQL server is on a server that is part of the IT infrastructure. Only the .NET SQL client, which is part of the VB assembly, is on the CX.

3. The link is TCP/IP over ethernet (100mb)

4. I may have caused confusion using the term "control logic". I meant to refer to the logic within the CX1000, which is Beckhoff TwinCAT.

5. The IO is the bus terminals (KL series) that attach directly to the CX when using the K-Bus power supply.
 
ArikBY said:
The CX100 is PC not PLC(– 2002:CX1000 – modular Embedded PCs for DIN rail mounting)

A CX1000 with windows CE and a K-Bus power supply has a real time embedded operating system, has IO cards directly attached, runs IEC61131 control programs(with online monitoring and online editing), is industrial rated, and mounts on DIN rail. It looks like and performs all the functions of a PLC.

It kind of opens a subjective question. What is the actual definition of a PLC?
 
Online Data Transfer

1. With the technique I used, from start to finish it transfers 150 records, each containing 5 values in a total of 15 seconds (5 of which are taken to launch the VB app)

  1. Is it not possible to transfer online and are u having a FIFO Built inside your PLC program ?
  2. www.iba.de, (It has a PC based AI card, Profibus Card or other interface, which dumps data (Values ) directly into SQL data base for analysis) a company in Germany are able to transfer faster in SQL server (less than 1ms also) any Idea if there is a way out in CX1000 ?
I would be interested to have a faster data rate stored in the SQL data base in every ms or so. Would it be possible to do this with CX1000.

Regards
 
search_automation said:
  1. Is it not possible to transfer online and are u having a FIFO Built inside your PLC program ?
Regards
I'm sure it could be transferred at a much faster rate if the VB app stays open. This particular application is a batch process and the PLC program stores all of the data in an array during the batching. After batching is complete, it launches the VB app to do the transfer. The launching of the VB app for each data store definitely slows down the transfer, but my objective was to have the PLC program initiate the transfer without the need for an external program to be continuously polling.

The Beckhoff communication driver allows a VB app to link to a variable, then go idle while waiting for the PLC to call back the program when the value changes. Using this technique, the VB app can stay running and I'm sure the transfer of all 750 values could probably happen in less than 5 seconds.
 
ArikBY said:
I just wondering, did you thought use one of those OPC drivers who can talk with PLC and SQL servers.?

Is there an OPC driver that can run directly on the PLC? All of the OPC solutions that I have seen require some type of PC to run on or would require software on the server hosting the SQL server, which would continously poll the PLC.

My goals were to not have to add a PC to the system that would poll the PLC or have to load any extra software on the SQL host. I know IT would not even consider loading a special purpose program on their server and anything that polls will create continuous network traffic which in turn slows down the entire network.
 
Alternative

There is another solution. Many manufacturers have the option to use his communication card as an FTP client. So when you need to communicate something to a server (FTP server comes with MS server and other OS) establish a connection to the FTP change the data. In the server you only need to check if the file has been modified, every second, when it changes you can launch a simple script that writes data to the database.

Kelkoon
 
Strictly speaking you have a soft-PLC running on a CE based platform. You may have put the finger on one of the points where a soft-PLC outsmarts a "regular" PLC.
Archie said:
Is there an OPC driver that can run directly on the PLC? All of the OPC solutions that I have seen require some type of PC to run on or would require software on the server hosting the SQL server, which would continously poll the PLC.
In your case, there are OPC servers for CE. I dont know so much about it, but I think they use OPC XML as opposed to OPC DA which is the "normal" way of communicating data via OPC.
OPC XML should be the way of the future, but I hear confusing rumors about this. Siemens for example states the OPC XML should "not be used for large data volumes", in other words it is slower than OPC DA.
 
Just curious

What is the difference between a device that uses a version of windows to transfer info to a SQL server then a PLC that transfers info to a SQL server? Does it really matter if the PLC "sends" the info or the PC "requests" the info? IF using a PC for a server then what is the difference?

I am lost on what is being done. I have used an SLC, FANUC, and other products to send data to other programs, depending on what was needed. I have done many situations under $500 depending on what was needed. NOTE: for me VB was not an option.
 
rsdoran said:
What is the difference between a device that uses a version of windows to transfer info to a SQL server then a PLC that transfers info to a SQL server? Does it really matter if the PLC "sends" the info or the PC "requests" the info? IF using a PC for a server then what is the difference?
Its really the scenario and strict criteria that makes it necessary to have the PLC write directly. In many companies, the IT department owns and controls the SQL server from the hardware and software perspective meaning that the controls engineer will not be allowed to touch or modify their critical servers. Have you ever asked the IT department of a large company if you could load your own special software on their mission critical server? I won't even go there.
Also when a company has a very strict policy about PC's that go on their network, it can be a battle for months to add a PC to the netork that is not one of their pre-loaded office PC's. I find that a CE based device is not considered a PC or a threat because it cannot freely be loaded with software and typically not prone to viruses.

So therefore, by having the PLC directly reading from and writing to the "IT controlled" SQL server, you have satisfied IT by not adding an outside PC to the network, still gave management their requested historical data, decreased total system cost, eliminated all of the excess network traffic (if PLC was being polled over the same network), and increased system reliability by taking the weak link of a windows XP computer out of the mix.
 

Similar Topics

Local Rockwell distributor was in today. He says that the MicroLogix 1400 will likely be unavailable to purchase sometime around the end of this...
Replies
58
Views
16,642
Good Morning , I've taken on a job that is truly over my head with a engineering group. The standards of Rockwell programming is much more...
Replies
15
Views
7,035
I’ve been looking at buying a quantity of signal converters to take a type J or k thermocouple or RTD and convert it to a 4-20mA signal. In...
Replies
10
Views
2,994
Doing some consulting work using factorytalk view studio and RSLogix5000. We set up alarms for the system a while ago and they work fine, as do...
Replies
5
Views
3,629
I spent the entire day trying and failing to setup my 1783-NATR. It appeared, time and again, to be correct and happy but no matter what I did...
Replies
11
Views
5,027
Back
Top Bottom