Store/Retrieve PLCdata to/from database

wanher3

Member
Join Date
Feb 2018
Location
USA
Posts
65
How should you store and retrieve PLC data to and from a database. For instance, do you interface PLC directly with the database or you have to use an HMI?

For example, say you were using Factotytalk to store and retrieve recipe data for a batch. How would that be accomplished?

Or maybe you wanted to log PLC device data (sensor data).

Thank you
 
The short answer is it depends, the long answer depend on whatever constraint you are working with. Sometime, all you need are some PLC register space or HMI memory register, sometime, you need to interface with an external relational database.

Give us some background.
 
Agree with the "it depends" answer.

If storing analog data for later trending, I'd use FactoryTalk Historian, since it's made to work with FT View trends (and assuming SE, not ME).

As for batch, that's a "really depends". How complex are the recipes? Merely parameter changes, or sequence changes too? How flexible is the physical model: can the product be made in more than one stream, or is everything hardpiped and dedicated? How strict are the historical requirements (Part 11)? These sorts of questions tell if FTBatch is a good fit or not as a supplement to FTView.
 
I'm really trying to understand how storing to database and retrieving from database is implemented. There is no background to it. Maybe any links or tutorials you may know of will do.

Thanks
 
It's not a particularly easy topic, which is why most people use canned packages (Historian; Batch).

If you have your heart set on rolling your own, then you need to understand how the database engines (SQL Server, et al) work and interface with other systems (typically ODBC). You'll be writing VBA scripts in FT View SE (not ME) to open ODBC connections, and make SQL calls ("Select * from X where ...." and "Append....") to read/write to the DB. Although it's also possible to have Stored Procedures in the DB to do some of the heavy lifting.

Perhaps a SQL Server for Dummies type book may get you started.
 
Why FT View SE only and not ME ? Is there no database functionality in ME ?

No, it's that the scripting capabilities of ME are limited. And access to configuring ODBC is going to depend on the platform that is running ME.

If you're trying to run a "skinny" batch system, then consider using the PLC as your "database". Indirect addressing of UDT arrays can work well, if you're mostly concerned with parameter loading "recipes".

But if you are trying to store historical batch records, then you need a stand-alone PC (preferably server-class) to host the database. That database needs to be able to talk to the PLC, or talk to a computer that's talking to the PLC. While a PanelView plus is talking to the PLC, it's not easy to get it to talk to another PC.

That's why the first answer to your question was and is "it depends".
 
Ok, assuming you are talking about a relational database. Keep in mind that's a huge stated assumption. You will then need some kind of interface software to do that.

Some HMI package got build-in command set and some you will need to use VBA to roll-your-own. You can also buy specialized software interface like FTTalk connection mamager or SQL Bridge from Inductive Automation software to do that.


I highly suggest a basic SQL class either in a local CC or online to get you started to understand relational database. I took a SQL class, even though I don't remember much of the command anymore, it helped me in understanding how database interfaces with the rest of the world.
 
I've set up a few recipe systems using Factory Talk Transaction Manager. The most complex was for one of the fortune 500 baking companies. Operators on the line could type a recipe number into an HMI running ME software, hit a button, the information would be sent to a SQL query, and the ingredients and weights required were routed to the panelview screen. It included string based special instructions, and was interlocked with the load sensors on the line for quality control to make sure they were adding the correct amounts at each step.
 

Similar Topics

I'm running into a problem when trying to use the RSLinx Backup Restore Utility where it throws an error when it tries to restore a backup. The...
Replies
6
Views
453
Hi y'all I have a KTP400 connected to a s7-1200. Now i have on my screen the encoder value which comes from my SEW movitrac. under there I have...
Replies
2
Views
368
This was asked in another forum and taken down due to being a 'backdoor', but this has useful info that might be useful to someone in a pinch. I'm...
Replies
6
Views
568
Hello all, I'm using a 5069-L330ER in a project and I need to essentially capture some data that will be shown as a trend on a screen. The data...
Replies
9
Views
942
Hi all, I am working with an IO link sensor (measuring current across motor)and need to read in and store the sensor values for 5 seconds, then...
Replies
13
Views
1,189
Back
Top Bottom