Lenze 3241C User Manual

SHPIPCBPB
.Dvñ
Ä.Dv'ä
Software Manual
Industrial PC
L-force Controller 3241C - Backplane Bus
Programming Interface I/O-System 1000
Contents
Contents
1
Introduction ........................................................................................... 3
2 Architecture............................................................................................ 4
3 API functions ..........................................................................................5
3.1 Functio
3.2 Basic functio
3.2.1 Function: BpbOpen
3.2.2 Function: BpbClose
3.3 Diagno
3.3.1 Diagnostics functions
3.3.2 Service functions
3.3.3 Network management
3.4 Commu
3.4.1 SDO communication
3.4.2 SDO functions
3.4.3 SDO indexes
3.4.4 SDO block structure
3.4.5 Memory requirements fo
3.4.6 PDO communication.......................................................................................... 18
ns of the interface DLL.................................................................................. 5
stics, service functions and network management .................................... 7
nication....................................................................................................... 11
ns........................................................................................................... 6
...............................................................................................6
...............................................................................................6
...........................................................................................7
...................................................................................................9
...................................................................................... 10
.......................................................................................... 11
...................................................................................................... 12
......................................................................................................... 13
........................................................................................... 15
r SDO....................................................................... 17
3.4.7 PDO functions...................................................................................................... 19
3.4.8 Memory requirements fo
3.4.9 Example constellation
3.5 Status de
3.6 Error co
3.7 I/O mo
des ............................................................................................................... 23
dule types and their data width ................................................................. 26
scription of the backplane bus (state machine) .................................... 23
r process data....................................................... 20
....................................................................................... 20
4 Software ...............................................................................................28
4.1 Driver
4.2 Progra
4.3 Inclu
........................................................................................................................ 28
mming interface........................................................................................... 28
de and library files........................................................................................... 28
5 Definitions, acronyms, and abbreviations .........................................29
1
Contents
2
Introduction 1

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.
3

2 Architecture

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
4
API functions 3

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
Function Description
BpbApiOpen BpbApiClose BpbApiGetVersion BpbApiGetStates BpbApiResetBpb BpbApiGetError BpbApiResetError BpbApiReadSdo BpbApiWriteSdo BpbApiSetOperational BpbApiReadPdo BpbApiWritePdo
are provided:
Log on application on application interface
Log off application on application interface
Returns the version
Read out status of the backplane bus (BPB)
Carries out a reset on the BPB controller
Read last error message of the BPB
Resets the error memory in the BPB controller
Reading out the input buffer
Writing to the output buffer
Starts free-running BPB operation
Imports the process image
Writes the process image
In the following the functions listed above are specified.
5
3 API functions

3.2 Basic functions

The basic functions serve to the connection establishment or connection termination:

3.2.1 Function: BpbOpen

Register to the hardware 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
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
of the controller. The return value is a handle for
connection to the 3241 controller.
Return values
S_OK Successful
E_HANDLE Error during connection termination (handle is invalid)
6
API functions 3

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“.
7
3 API functions
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
UCHAR hRaw Raw value of the status information
Name
the status register:
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.
8
Loading...
+ 22 hidden pages