This function initializes and controls the communication between the S7 controller, ibaPDA and the ibaBM-DP device.
The ibaDP_Req has to be called once for each slave in the cyclic program.
The used blocks are part of the iba S7 library, see iba S7 library.
Note |
|
|---|---|
|
Only use Request blocks from the latest iba S7 library! Request blocks in application examples can be outdated and, thus, cause errors. |
|
Description of the formal parameters of the ibaDP_Req (FC122)
|
Name |
Type |
Data Type |
Description |
|---|---|---|---|
|
DB_PDA |
IN |
BLOCK_DB |
DB of the ibaPDA communication interface ibaDP_DB_PDA (2064 Byte) |
|
DB_INTERN |
IN |
BLOCK_DB |
DB of the internal data interface ibaDP_DB_work (1900 Byte) |
|
OUTPUT_ADR_SLAVE |
IN |
INT |
Start address of the peripheral output range, continuous and 244 Bytes long |
|
INIT_FC |
IN |
BOOL |
TRUE: Initialize |
|
INP_RANGE |
IN |
INT |
Number of output bytes (evaluation only during initialization),0: automatic detection (recommended) |
|
OUT_RANGE |
IN |
INT |
Number of output bytes (evaluation only during initialization),0: automatic detection (recommended) |
|
MARKER_RANGE |
IN |
INT |
Number of marker bytes (evaluation only during initialization),0: automatic detection (recommended) |
|
ERROR_STATUS_INIT |
OUT |
BYTE |
Initialization error |
|
ERROR_STATUS_COM |
OUT |
BYTE |
Communication error |
The following SFCs are used internally:
-
SFC 13 (DPNRM_DG)
-
SFC 15 (DPRD_DAT)
-
SFC 20 (BLKMOV)
-
SFC 21 (FILL)
-
SFC 24 (TEST_DB)
-
SFC 49 (LGC_GADR)
-
SFC 50 (RD_LGADR)
-
SFC 51 (RDSYSST)
Detailed description
DB_PDA
DB in the range of 1 to n (see technical data of the CPU). The DB handles the data exchange with ibaPDA. Length at least 2064 Bytes.
DB_INTERN
DB in the range of 1 to n (see technical data of the CPU). Length at least 1900 Bytes.
The following data are stored in this DB:
-
Technical data of CPU which are determined during initialization
-
S7 pointers requested by ibaPDA
-
binary and analog transmission data
OUTPUT_ADR_SLAVE
DP start address of the ibaBM-DP in the peripheral output range for sending data. Length 244 Bytes, continuous (without gaps!).
INIT_FC
Used for initializing the Request block. The Request block is initialized automatically internally. Additionally, the initialization can be performed manually by an external logic via the input INIT_FC = TRUE.
INP_RANGE
Limits the number of input bytes to be measured. If INP_RANGE = 0, the size of the available processor image of the inputs is determined by the Request FB itself (recommended). Evaluation is done only during the initialization phase of the module.
OUT_RANGE
Limits the number of output bytes to be measured. With OUT_RANGE = 0, the size of the available processor image of the outputs is determined by the Request FB itself (recommended). Evaluation is done only during the initialization phase of the module
MARKER_RANGE
Limits the number of marker bytes to be measured. With MARKER_RANGE = 0, the number of available markers is determined by the Request FB itself (recommended). Evaluation is done only during the initialization phase of the module.
ERROR_STATUS_INIT
Shows error code of initialization errors.
ERROR_STATUS_COM
Shows error code of communication errors.
Error codes
|
Decimal value ERROR_STATUS_INIT |
Description |
|---|---|
|
1 |
DB_PDA is read-only. |
|
2 |
DB_PDA-No = 0 or higher than the max. permissible DB number of this CPU |
|
3 |
DB_PDA with the specified number is not available. |
|
5 |
DB_PDA is too short. |
|
11 |
DB_INTERN is read-only |
|
12 |
DB_INTERN-No = 0 or higher than the max. permissible DB number of this CPU |
|
13 |
DB_INTERN with the specified number is not available. |
|
15 |
DB_INTERN is too short. |
|
16 |
Error when reading the identification data of the CPU |
|
19 |
Initialization not finished |
|
21 |
Not enough memory space for the data set |
|
22 |
SZL_ID is wrong or not known in this CPU. |
|
23 |
The index of the SZL is wrong or not permitted. |
|
30 |
OUT_ADR_SLAVE is no peripheral output range. |
|
31 |
OUT_ADR_SLAVE is not assigned to a PROFIBUS. |
|
32 |
Redundancy mode (RM): The configured "OUTPUT_ADR_SLAVE_BUS_0" is incorrect. |
|
33 |
RM: The configured "OUTPUT_ADR_SLAVE_BUS_0" is not assigned to a PROFIBUS DP Slave. |
|
34 |
RM: The configured "OUTPUT_ADR_SLAVE_BUS_1" is incorrect. |
|
35 |
RM: The configured "OUTPUT_ADR_SLAVE_BUS_1" is not assigned to a PROFIBUS DP Slave. |
|
36 |
RM: SLAVE BUS0 and SLAVE BUS1 do not have the same DP address. |
|
Decimal value ERROR_STATUS_COM |
Description |
|---|---|
|
100 |
Bit number not 0 |
|
101 |
Bit number not 0–7 |
|
103 |
The operand range is not defined. |
|
104 |
The data type is not defined. |
|
105 |
DB0 has been requested as data source. |
|
106 |
DB number is higher than the max. permitted number of DBs for this CPU. |
|
107 |
DB with the specified number is not available. |
|
109 |
DB is too short for the accessed operand. |
|
110 |
Specified data address does not exist. |
|
111 |
Initialization aborted with error (error cause can be seen in ERROR_STATUS_INIT) |
|
112 |
Initialization not carried out (error cause can be seen in ERROR_STATUS_INIT) |
|
150 |
Order fragmentation is not supported. |
|
151 |
Order Request: Total number of values does not match values in the order. |
|
152 |
Order Request: Up to 64 binary values permitted |
|
153 |
Order Request: Up to 64 analog values permitted |
|
200 |
DP station is not available. |
|
201 |
Redundancy mode (RM): Slave Bus 0 not available |
|
202 |
RM: Slave Bus 1 not available |
|
203 |
RM: Slaves Bus 0 + 1 are not available. |
|
210 |
Output modules of the Slaves Bus 0 and 1 are configured differently. |