TLP — Target-Link-Protocol — Standard Protocol
With each SQL request to the database, the Connector is provided with information prior to execution.
Request to the Connector
| Attribute | Data Type | Description | Default |
|---|---|---|---|
| MRP | Nullterminierter String | Max Return Parameter | |
| <MRP Value> | Nullterminierter String | Minimum 1 | Nicht optional |
| MR | Null-terminated String | Max Rows | |
| <MR Value> | Null-terminated String | Minimum 1 | Not optional |
| MC | Null-terminated String | Max Columns | |
| <MC Value> | Null-terminated String | Minimum 1 | Not optional |
| MS | Null-terminated String | Max String | |
| <MS Value> | Null-terminated String | Minimum 1 | Not optional |
| CT | Null-terminated String | Connector Timeout | |
| <CT Value> | Null-terminated String | 0 = no Timeout, Connection remains open, >0 = Timeout in seconds | Not active |
| CN | Null-terminated String | Column Names | |
| <CN Value> | Null-terminated String | 0 = no Column names, 1 = Column names (default 1) | 1 |
| CS | Null-terminated String | Cut String | |
| <CS Value> | Null-terminated String | String of each value is shortened to length CS | Not active |
| S | Null-terminated String | String (SQL Request) | |
| <S Value> | Null-terminated String | Minimum 1 character | Not optional |
| T | Null-terminated String | Transmit Request |
<MRP><<sub>NUL</sub>><MRP Value><<sub>NUL</sub>> Maximum number of return parameter which can be stored in the control system
<MR><<sub>NUL</sub>><MR Value><<sub>NUL</sub>> Maximum number of datasets which can be stored in the control system
<MC><<sub>NUL</sub>><MC Value><<sub>NUL</sub>> Maximum number of columns which can be stored in the control system
<MS><<sub>NUL</sub>><MS Value><<sub>NUL</sub>> Length of the string variable in the control system
<CT><<sub>NUL</sub>><CT Value><<sub>NUL</sub>> Timeout Connector (optional)
<CN><<sub>NUL</sub>><CN Value><<sub>NUL</sub>> A database request also returns the column names in addition to the data, or not. (optional)
<CS><<sub>NUL</sub>><CS Value><<sub>NUL</sub>> A database request also returns data if the size of the database value exceeds the defined maximum string length (MS). The value will be cut off after the CS value, and the error is ignored. (optional)
<S><<sub>NUL</sub>><S Value><<sub>NUL</sub>> SQL request string
<S><<sub>NUL</sub>><S Value><<sub>NUL</sub>> If the SQL request string is too large for the control system, it can be sent to the connector in a dissected form. (optional)
<T><<sub>NUL</sub>> Start command to send the SQL request string to the database
Examples:
MRP<sub>NUL</sub>15<sub>NUL</sub>MR<sub>NUL</sub>80<sub>NUL</sub>MC<sub>NUL</sub>40<sub>NUL</sub>MS<sub>NUL</sub>255<sub>NUL</sub>S<sub>NUL</sub>SELECT id, iParam1, fParam2, sText1 FROM tTable1<sub>NUL</sub>T<sub>NUL</sub>
MRP<sub>NUL</sub>15<sub>NUL</sub>MR<sub>NUL</sub>80<sub>NUL</sub>MC<sub>NUL</sub>40<sub>NUL</sub>MS<sub>NUL</sub>255<sub>NUL</sub>CS <sub>NUL</sub>80<sub>NUL</sub>CN<sub>NUL</sub>0<sub>NUL</sub>
S<sub>NUL</sub>SELECT id, iParam1, fParam2, sText1 FROM tTable1<sub>NUL</sub>
S<sub>NUL</sub>WHERE id < 4<sub>NUL</sub>
T<sub>NUL </sub>
Response from the Connector
| Attribute | Data Type | Description |
|---|---|---|
| RS | Null-terminated String | Return State |
| <RS Value> | Null-terminated String | |
| RP | Nullterminierter String | Return Parameter |
| <RP Value> | Nullterminierter String | |
| RR | Null-terminated String | Result Rows |
| < RR Value> | Null-terminated String | |
| RC | Null-terminated String | Result Columns |
| < RC Value> | Null-terminated String | |
| RN | Null-terminated String | Result Column names |
| < RN Values> | Null-terminated String | |
| RD | Null-terminated String | Result Data |
| < RD Values> | Null-terminated String |
<RS><<sub>NUL</sub>><RS Value><<sub>NUL</sub>> RS Value = 0 Okay, data will follow
RS Value > 0 Error code, no data will follow
Bei RS Value = 0
<RR><<sub>NUL</sub>><RR Value><<sub>NUL</sub>> RR Value Number datasets
<RC><<sub>NUL</sub>><RC Value><<sub>NUL</sub>> RC Value Number columns
Only if RP Value > 0 return parameter will follow (RPD)
RPD<sub>NUL </sub>123<sub>NUL</sub>321<sub>NUL</sub>abc<sub>NUL</sub>
If RC Value > 0 data will follow, else RR Value contains the number of the processed datasets (Update, Delete…)
<RN><<sub>NUL</sub>> RN followed by all column names
For iC = 1 to RC
<RN Value[iC]> <<sub>NUL</sub>>
Next iC
<RD><<sub>NUL</sub>> RD followed by all data
For iR = 1 to RR
For iC = 1 to RC
<RD Value[iR, iC]> <<sub>NUL</sub>>
Next iC
Next iR
Example:
RS
<sub>NUL</sub>0<sub>NUL</sub>RP<sub>NUL</sub>3<sub>NUL</sub>RR<sub>NUL</sub>3<sub>NUL</sub>RC<sub>NUL</sub>4<sub>NUL </sub>RPD<sub>NUL </sub>123<sub>NUL</sub>321<sub>NUL</sub>abc<sub>NUL </sub>RN<sub>NUL </sub>id<sub>NUL</sub>iParam1<sub>NUL</sub>fParam2<sub>NUL</sub>sText1<sub>NUL </sub>RD<sub>NUL </sub>1<sub>NUL</sub>501<sub>NUL</sub>10.1<sub>NUL</sub>Text Example 1<sub>NUL</sub>2
<sub>NUL</sub>502<sub>NUL</sub>10.2<sub>NUL</sub>Text Example 2<sub>NUL</sub>3
<sub>NUL</sub>503<sub>NUL</sub>10.3<sub>NUL</sub>Text Example 3<sub>NUL</sub>
Error Codes Return-Value
| Error Number | Error Description |
|---|---|
| 0 | No error, request data to follow |
| 1 | Unknown SQL Command |
| 2 | Request returns more datasets than defined by MaxRows, modify request or increase MaxRows |
| 3 | Request returns more columns than defined by MaxColumns, modify request or increase MaxColumns |
| 4 | Request returns more data than defined by buffer size (only with target type Siemens) Modify request or increase Buf. Size in the Connector and in the application. |
| 5 | Request returns minimal one value that is bigger than defined by MaxStringLength, modify request or increase MaxStringLength |
| 10 | Internal Connector error |
| 11 | Internal Connector error, cannot open database |
| 23 | Request string is empty |
| 24 | Number MaxRows not defined |
| 25 | Number MaxColumns not defined |
| 29 | Size MaxStringLength not defined |
| >100 | Error numbers of the ODBC database connection (some known error numbers are attached) |
| 40002 | General error during SQL request, request string is invalid |
Handshake
Error-free Request
Abortion during Request
Error during Request