Library \ SysLibDPV1Hilscher.lib¶
Note: It depends on the target system, which system libraries can be used in the application program. Please see the document SysLibs_Overview.pdf.
This library supports the acyclic Profibus DPV1, Class 1, Read- and Write-Services for the data transfer between Master and Slaves. The data are addressed within the slaves by slot and index. (Concerning this see the PB-DP standard.)
If supported by the target system the following function blocks are available:
- DPV1_Read, DPV1_ReadEx: Reading data
- DPV1_Write, DPV1_WriteEx: Writing data
Each module uses the following parameters:
Input variable | Data type | Description |
ENABLE | BOOL | At a rising edge at this input the module starts processing. |
Device | INT | Index of the Hilscher card, to which the request is given. |
StationAddr | INT | Station address of the slave in the Profibus. |
Slot | INT | Data slot, for identification of the data within the slave. |
Index | INT | Data index, for identification of the data within the slave. |
Len | INT | Length of the data to be read/written in Bytes. Fed in the maximum length of the data buffer “buffer”. |
buffer | DWORD | Local address of the data. (Evaluate via using ADR().) |
Output variable | Data type | Description |
Ready | BOOL | The function block has finished processing. |
State | V1State | Information on the state of the request (see below, Enumeration “žV1State”) |
Size | INT | Length of the actually read/written data in case of successful execution. |
Variable | Data type | Description |
ENABLEOLD | BOOL | internal variable. |
JobId | DWORD | internal variable. |
Additionally the modules DPV1_ReadEx and DPV1_WriteEx have an output parameter Error, which tells about possibly occurred errors:
Output variable | Data type | Description |
Error | ARRAY[0..7] OF BYTE; | Byte 1: Hilscher error code (see the documentation on the Hilscher PB-cards “Protocol Interface Manual Profibus DP”. Byte 2: Error class code. These values can be looked up in the PB standard. Bytes 3+4 (index 2+3): Slave-specific error information. These values can be looked up in the slave-specific documentation. |