Rockwell Allen Bradley

For Allen Bradley and Rockwell Automation controllers, SQL4automation provides the SQL4RSLogix Add-On Instruction and sample projects for ControlLogix and CompactLogix systems. Communication is via Ethernet/IP socket. Sample projects are available in both Ladder and Structured Text.

Connecting Rockwell Allen Bradley PLC to SQL Databases, MES, ERP

SQL4RSLogix  uses an Ethernet/IP socket connection to the SQL4automation Connector.  Supported Ethernet communication modules include 1756-EWEB, 1756-EN2Txx, and  1768-EWEB (CompactLogix). Controllers with integrated Ethernet/IP interfaces  on the CPU are also supported. Sample projects are provided for ControlLogix  (1756-L63) and CompactLogix (1769-L18ER-BB1B) and can be adapted to other  controller types by changing the controller settings.

The  SQL4RSLogix Add-On is imported via Import Add-On Instruction in the  Controller Organizer. Tags are imported separately via Tool > Import >  Tags and Comments. Data types (REQUEST, COLUMN, VALUE, PARAMETER) are  configured under Controller Organizer > Data Types and can be resized  based on the expected data volume. Note: CompactLogix controllers support  only Unconnected connections; ControlLogix controllers also support Connected  and Large Connection types.

The following Rockwell Allen-Bradley PLC controllers and communication modules can establish TCP socket connections and are therefore compatible with SQL4automation:

Project-Specific Adjustments

The following project-specific adjustments must be made to the SQL4automation function block:

SQL4automation Link Settings

The  SQL4automation Connector is operated with the target setting  "Standard" for Allen Bradley / Rockwell controllers. The  destination is passed as a string: e.g., '192.168.1.202 ?port=11001'. The  configuration is completed in just a few clicks.

FAQ’s

Frequently Asked Questions to Rockwell Allen Bradley

Which Allen Bradley controllers are compatible with SQL4automation?

SQL4automation supports ControlLogix and CompactLogix controllers equipped with Ethernet/IP socket-capable modules (1756-EWEB, 1756-EN2Txx, 1768-EWEB) or an integrated Ethernet/IP CPU interface. Sample projects are provided for the 1756-L63 ControlLogix5563 and 1769-L18ER-BB1B CompactLogix, and can be easily adapted to other models by changing the controller settings.

What is the difference between ControlLogix and CompactLogix integration?

CompactLogix controllers support only Unconnected connections. ControlLogix controllers also support Connected connections and Large Connections (on 1756-EN2xx modules with RSLogix 5000 v20+). For CompactLogix, select the CompactLogix sample project; for ControlLogix, use the ControlLogix sample project. Both are available in Ladder and Structured Text.

How is the SQL query assembled and sent from an Allen Bradley PLC?

The SQL query is built as a string and placed in the saRequest REQUEST array. The function block is called with the destination string ('192.168.1.202 ?port=11001') and the Ethernet module path (EWEB_PATH). Setting xExecute to 1 triggers the request; xStart can be used for automated repeated execution. Results are stored in saTableValue (VALUES array).

What programming languages are supported in the sample projects?

Sample projects are provided in both Ladder Diagram and Structured Text for both ControlLogix and CompactLogix. There are four sample files in total: Sample_S4A_CompactLogix_Ladder.ACD, Sample_S4A_CompactLogix_ST.ACD, Sample_S4A_ControlLogix_Ladder.ACD, and Sample_S4A_ControlLogix_ST.ACD.

Which SQL databases can be connected to an Allen Bradley PLC via SQL4automation?

All ODBC-compatible databases are supported, including Microsoft SQL Server, MySQL, MariaDB, PostgreSQL, Oracle, and SQLite. The database is configured in the SQL4automation Connector on the Windows PC. No changes to the RSLogix project are required when switching databases.

Which Allen Bradley / Rockwell controllers has SQL4automation been tested on?

SQL4automation has been tested on the Allen Bradley ControlLogix 1756-L63 (ControlLogix5563) and the CompactLogix 1769-L18ER-BB1B (CompactLogix5318ERM-BB1B). Both Ladder and Structured Text sample projects are verified for each platform. Any ControlLogix or CompactLogix controller with a compatible Ethernet module (1756-EWEB, 1756-EN2Txx, 1768-EWEB) or an integrated Ethernet/IP CPU interface can be used.

Technical Data

REQUIREMENTS & VERSION INFO
TCP/IP support All Sigmatek controllers with open TCP/IP communication are supported
Tested on SoftSPS Lars and C-IPC hardware
Encoding UTF-8 class (SQL4LASALASCII) uses Standard target; UTF-16 class (SQL4LASALUCS2) uses UTF-16 target
REQUIRED BLOCKS / LIBRARIES FUNCTION BLOCK PARAMETERS
Parameter Type Description
xAbort DINT Reset
xBusy DINT Database query is running
xDone DINT Database query completed
xError DINT Database query ended with an error
xHoldConnection DINT Keeps the socket connection open after a database query
ErrorCode_Sigmatek DINT Sigmatek-specific error code
diResultState DINT Status / error code of database query
diResultRows DINT Number of rows received from the database query
diResultColumns DINT Number of columns received from the database query
C_IP_Adr_1..4 UDINT IP address of the SQL4automation Connector (4 octets)
C_iPort UDINT Port number of the SQL4automation Connector
C_TimeOut UDINT Timeout
ERROR CODES (diResultState)
Error Code Description
See diResultState Standard SQL4automation error codes apply (see CODESYS V2 error code table for reference). Additional Sigmatek-specific error codes are available in ErrorCode_Sigmatek.

Switch to SQL4automation Now.

Connect industrial controllers directly with SQL databases. Field-proven since 2007 for maximum performance and security, completely without middleware.

Rockwell Allen Bradley
by Industry.