Stäubli

For Stäubli CS8C and CS9 robot controllers running VAL3, SQL4automation provides the SQL4Val3 library and a sample project. SQL4Val3 can be directly integrated as a library and runs on all Stäubli CS8 and Stäubli CS9 controllers with firmware version V7 or higher. In addition, the library can be tested directly on the Stäubli Emulator.

Connecting Stäubli Robots to SQL Databases, MES, ERP

For  Stäubli robots, SQL4automation provides a sample project and a library.  SQL4Val3 can be directly integrated as a library and runs on all Stäubli CS8  and Stäubli CS9 controllers with firmware version V7 or higher. In addition,  the library can be tested directly on the Stäubli Emulator. The library  receives parameters such as the socket connection, a structure for the SQL  request, and a structure for the SQL response. The return values of the SQL  query are written to the two-dimensional string array S4AResultMain.sValues.

Integration of the SQL4Val3 Library

SQL4Val3  consists of a library module and user-defined data types (S4ARequest for the  request, S4AResult for the response). These are added to the VAL3 project via  the References tab in Stäubli Robotics Studio. The socket is defined as a  client with configurable IP address, port, and timeout. A database request is  executed by calling SQL4Val3(sioSocket, S4ARequest, S4AResult).

SQL4automation Link Settings

The  SQL4automation Connector is operated with the target setting "Staeubli  Val3" for Stäubli CS8C & CS9 controllers. The IP address and port of the  Connector are configured in the socket settings within the VAL3 project.

Tested Stäubli Controllers

The SQL4Val3 library has been tested on the following Stäubli robot controllers:

  • Stäubli CS8C V7 and higher
  • Stäubli SC9
  • Stäubli Emulator V7 and higher

FAQ’s

Frequently Asked Questions to Stäubli

Which Stäubli robot controllers are compatible with SQL4automation?

SQL4automation supports Stäubli CS8C and CS9 control systems running VAL3 Version 7.0 or above. The integration uses the TCP interface of the CS8/CS9. The sample project can be tested in the Stäubli Robotics Studio emulator (use 127.0.0.1 as Connector IP) before deploying to physical hardware.

SQL4automation supports Stäubli CS8C and CS9 control systems running VAL3 Version 7.0 or above. The integration uses the TCP interface of the CS8/CS9. The sample project can be tested in the Stäubli Robotics Studio emulator (use 127.0.0.1 as Connector IP) before deploying to physical hardware.

The SQL request is assembled in the S4ARequest.sRequest string array and passed to the SQL4Val3 function. The response is returned in the S4AResult structure: nState contains the status code (0 = success), nRows and nColumns report the result dimensions, sHeaders contains column names, and sValues is a 2D string array with the query result data. The SQL request is assembled in the S4ARequest.sRequest string array and passed to the SQL4Val3 function. The response is returned in the S4AResult structure: nState contains the status code (0 = success), nRows and nColumns report the result dimensions, sHeaders contains column names, and sValues is a 2D string array with the query result data.

What target setting must be used in the SQL4automation Connector for Stäubli?

The dedicated target setting "Staeubli Val3" must be selected in the SQL4automation Connector. This is different from the "Standard" target used for most other controllers. Using the wrong target will prevent communication.

Can the SQL4Val3 library be tested without a physical CS8C/CS9 controller?

Yes. The sample project can be executed in the Stäubli Robotics Studio emulator. When testing in the emulator, use 127.0.0.1 as the Connector IP address since the emulator and Connector run on the same PC.

Which SQL databases can a Stäubli VAL3 controller connect to via SQL4automation?

All ODBC-compatible databases are supported, including Microsoft SQL Server, MySQL, MariaDB, PostgreSQL, Oracle, and SQLite. The database selection is made exclusively in the SQL4automation Connector. No changes to the VAL3 project are required when switching databases.

Which Stäubli robot systems has SQL4automation been tested on?

SQL4automation has been tested on the Stäubli CS8C control system running Val3 Version 7.0 and above. Testing was performed both in the Stäubli Robotics Studio emulator (using 127.0.0.1 as the Connector IP) and on a physical CS8C controller. Other Stäubli CS8C-based systems running Val3 7.0+ should be compatible.

Technical Data

REQUIREMENTS & VERSION INFO
Controller Stäubli CS8C control system
VAL3 version Val3 Version 7.0 or newer
Target setting Staeubli Val3 (dedicated target in SQL4automation Connector, not Standard)
Testing Sample project can be tested in Stäubli Robotics Studio emulator; use 127.0.0.1 as Connector IP when testing in emulator.
REQUIRED BLOCKS / LIBRARIES
  • SQL4Val3 library module
  • main1 sample program (demonstrates integration)
  • S4ARequest user-defined data type (SQL request structure)
  • S4AResult user-defined data type (SQL result structure)
  • sioSocket: sioSocket (socket for the connection)
FUNCTION BLOCK PARAMETERS
Parameter Type Description
sioSocket sioSocket Socket object for the TCP/IP connection
S4ARequest struct Input data structure containing sRequest (string array with SQL query)
S4AResult struct Output data structure containing nRows, nColumns, nState, sHeaders (column names), sValues (2D result array)
Server address STRING IP address of the SQL4automation Connector computer
Port INT Port number (default: 11001 and up)
Time Out INT Timeout in seconds before exception is raised
End of String INT End-of-string character (default: 13)
ERROR CODES (diResultState)
Error Code Description
1 Unknown SQL command
2 Query returns more records than available rows in S4AResult.sValues. Increase S4AResult.sValues rows.
3 Query returns more columns than available columns in S4AResult.sValues. Increase S4AResult.sValues columns.
5 Query returns at least one value larger than MaxStringLength. Adjust query or increase MaxStringLength.
10 Internal Connector error
11 Internal Connector error; database cannot be opened
23 Request string is empty
24 MaxRows not defined
25 MaxColumns not defined
29 MaxStringLength not defined
>100 ODBC database connection error codes

Switch to SQL4automation Now.

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

Stäubli
by Industry.