Lenze L-Force 3241C Software Manual

SHPIPCBPB
.Dvñ
Ä.Dv'ä
Software Manual
Industrial PC
L-force Controller 3241C - Backplane Bus
L-force Controls
Contents
1
Contents
1
Introduction ........................................................................................... 3
2 Architecture............................................................................................ 4
3 API functions ..........................................................................................5
3.1 Functio
ns of the interface DLL.................................................................................. 5
3.2 Basic functio
ns........................................................................................................... 6
3.2.1 Function: BpbOpen
...............................................................................................6
3.2.2 Function: BpbClose
...............................................................................................6
3.3 Diagno
stics, service functions and network management .................................... 7
3.3.1 Diagnostics functions
...........................................................................................7
3.3.2 Service functions
...................................................................................................9
3.3.3 Network management
...................................................................................... 10
3.4 Commu
nication....................................................................................................... 11
3.4.1 SDO communication
.......................................................................................... 11
3.4.2 SDO functions
...................................................................................................... 12
3.4.3 SDO indexes
......................................................................................................... 13
3.4.4 SDO block structure
........................................................................................... 15
3.4.5 Memory requirements fo
r SDO....................................................................... 17
3.4.6 PDO communication.......................................................................................... 18
3.4.7 PDO functions...................................................................................................... 19
3.4.8 Memory requirements fo
r process data....................................................... 20
3.4.9 Example constellation
....................................................................................... 20
3.5 Status de
scription of the backplane bus (state machine) .................................... 23
3.6 Error co
des ............................................................................................................... 23
3.7 I/O mo
dule types and their data width ................................................................. 26
4 Software ...............................................................................................28
4.1 Driver
........................................................................................................................ 28
4.2 Progra
mming interface........................................................................................... 28
4.3 Inclu
de and library files........................................................................................... 28
5 Definitions, acronyms, and abbreviations .........................................29
Contents
2
Introduction 1
3
1 Introduction
This manual describes the programming interface for the on board I/O system 1000. The L-force Controller 3241 and the I/O compound modules are connected via a backplane bus. By means of an interface DLL (BpbDrvApi.dll), the connection of the individual application to the backplane bus device driver (BpbDrvXp.sys) and the I/O system is enabled.
Up to 64 I/O compound modules can be connected to the 3241 controller. Digital input/output modules, analog modules, and counter modules are provided as I/O compound modules. Further information can be found in the manual of the I/O system 1000.
2 Architecture
4
2 Architecture
In the following illustration the architecture of the backplane bus to the application is shown in a detailed manner.
Abb. 1 Structure of the backplane bus driver
API functions 3
5
3 API functions
The programming interface is based on the backplane bus device driver and provides an interface for the transmission/reception of process data (PDOs) and configuration data (SDOs).
By means of this interface, a cyclic thread is created, copying the process data from/to the I/O modules. The grouping for the customer application interface is simplified, so that there only is one group. During transmission this group contains all output data, and during reception it contains all input data.
3.1 Functions of the interface DLL
The following functions
are provided:
Function Description
BpbApiOpen
Log on application on application interface
BpbApiClose
Log off application on application interface
BpbApiGetVersion
Returns the version
BpbApiGetStates
Read out status of the backplane bus (BPB)
BpbApiResetBpb
Carries out a reset on the BPB controller
BpbApiGetError
Read last error message of the BPB
BpbApiResetError
Resets the error memory in the BPB controller
BpbApiReadSdo
Reading out the input buffer
BpbApiWriteSdo
Writing to the output buffer
BpbApiSetOperational
Starts free-running BPB operation
BpbApiReadPdo
Imports the process image
BpbApiWritePdo
Writes the process image
In the following the functions listed above are specified.
3 API functions
6
3.2 Basic functions
The basic functions serve to the connection establishment or connection termination:
3.2.1 Function: BpbOpen
Register to the hardware
of the controller. The return value is a handle for identification. This handle must be transferred as the first parameter for all further functions.
Parameters
[in] LPTSTR szAppName Name of the application to be registered
[out] PHANDLE hOpen Pointer to open context (handle) for identification
Return values
S_OK Successful
E_LOADED Incomplete (driver not loaded)
3.2.2 Function: BpbClose
Disconnection of the backplane bus
connection to the 3241 controller.
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
Return values
S_OK Successful
E_HANDLE Error during connection termination (handle is invalid)
API functions 3
7
3.3 Diagnostics, service functions and network management
3.3.1 Diagnostics functions
The diagnos
tics function provide some return information on the version, available
errors, and states of the backplane buses.
BpbGetVersion function
The
BpbGetVersion function supplies the version of the backplane bus driver.
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
[out] PSTRING pszVersion Version of the backplane bus driver
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)
BpbGetError function
In the stat
us register an error status is signalised. It contains a byte error code. The BpbGetError function reads out this error code from the status register of the backplane bus.
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
[out] PUCHAR pbError Error code
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)
A description of the error code can be found in the chapter "Error code“.
3 API functions
8
BpbGetStates function
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
[out] PBPBSTATES pBpbStates Pointer to the states structure
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)
The states are returned in the BpbStates structure. In the following the organisation of this structure is shown.
BpbState structure
Structure of
the status register:
UCHAR hRaw Raw value of the status information
Name
hName Status information of the controller and the groups
Structure of the name
Structure of the name:
Bit 0 .. bit 1 Controller Status of the controller
Bit 2 .. bit 3 Group1 Status of group 1
Bit 4 .. bit 5 Group2 Status of group 2
Bit 6 .. bit 7 Group3 Status of group 3
The byte is divided according to the status byte of the 3241 controller status register and the I/O modules configured.
Return values of the controller
1 BPB_ CONTROLLER_STATE_INIT
2 BPB_ CONTROLLER_STATE_PREOP
3 BPB_ CONTROLLER_STATE_OP
Return values of the group
0 BPB_GROUP_STATE_UNAVAILABLE
1 BPB_GROUP_STATE_INIT
2 BPB_GROUP_STATE_RUNNING
3 BPB_GROUP_STATE_ERROR
Please note: Under XP the grouping for the programming interface is simplified, so that there only is one group. During transmission this group contains all output data, and during reception it contains all input data.
Loading...
+ 22 hidden pages