SQL Query From Rockwell Control / CompactLogix CPU

AF52

Member
Join Date
Apr 2010
Location
Lancashire
Posts
8
Good Evening,

I'm loading a recipe into a Rockwell ControlLogix or CompactLogix CPU via Excel, this is all working fine. Is there anyway I can check the "Batch_Number" tag against a SQL database to see if its been used previously?
So, in summary, can I query a SQL database direct from my CPU? and if so please can you assist me.

Thanks in advance,
AF52.
 
I don't know of a way to use a compact logix to query a DB, not unless it has some form of PC card with one of the most popular laguages on it.
Can you not use Excel to do the query, for example if you are sending a recipe via Excel is the batch number in Excel before you send it. Excel VBa can query SQL databases.
 
Thanks for the quick reply.
Yes I can do that with the initial query in Excel. The only drawback to that is if the same recipe is selected to run again at the end of the batch. I have code in place to increment the batch number, but I want to check it against the database for a secondary check.
 
I see your problem, all our batch numbers were uniqueue for example we took the recipe name then the date & then an incremental number i.e. BSB22C
050922 001 (without spaces) so until 050922 (Year 2122) it would not repeat, midnight every day the incremental number was zeroed so would never repeat.
 
What type of SQL (MSSQL, MySQL, Postgres, etc.).

It would be involved, but fairly straightforward, to set up an API to wrap the details of the SQL call, so the CompactLogix would use a very simple and limited query/response interface (e.g. Modbus, for which there is an existing Logix AOI, IIRC, or a web API, or OPC, or even E/IP).

The details would depend on your network configuration, but someone with experience could gin up a Python prototype in a couple of hours or so.

But I would wait for more members to see this thread before generating a bespoke solution; this sounds like a problem that has been solved before.
 
The simple way to do this would be with a tManager module from Softing. They're a Rockwell encompass partner - I've used their Control Logix variant before and it was very straightforward.

Not exactly what you were asking, of course, and they're not cheap - but it would definitely get the job done.
 

Similar Topics

Hi, I have a question about SQL. This question is a little to much on the IT side I suppose, but I will give it a try anyway as I do not have an...
Replies
6
Views
2,522
Hi there, I use Indusoft IWS8.0 & I have created a sample Production data Date&time, MachineNo,Production Data with SQL Server 2008 DB. Need to...
Replies
1
Views
1,879
Hello, For my general information and knowledge, how is querying and storing data from a AB PLC (Compact or Control Logix) typically...
Replies
15
Views
7,383
Goodevening all... I have a Redlion PTV and Graphite with built in webserver... I can create the simple default.htm page... drag in tags to...
Replies
1
Views
1,907
Hi all, Having a little trouble getting the result I require, I'm close but no cigar. Basically, I am wanting to display a table within the...
Replies
2
Views
3,932
Back
Top Bottom