Lenze L-Force 3241C Mounting instructions

SHPIPCBPB
.Dvñ
Ä.Dv'ä
Software Manual
Industrial PC
L-force Controller 3241C - Backplane Bus
Programming Interface I/O-System 1000
L-force Controls


Contents
1
Contents
1Introduction ........................................................................................... 3
2Architecture............................................................................................ 4
3API functions .......................................................................................... 5
3.1Functions of the interface DLL.................................................................................. 5
3.2Basic functions........................................................................................................... 6
3.2.1Function: BpbOpen ...............................................................................................6
3.2.2Function: BpbClose ...............................................................................................6
3.3Diagnostics, service functions and network management.................................... 7
3.3.1Diagnostics functions...........................................................................................7
3.3.2Service functions ...................................................................................................9
3.3.3Network management...................................................................................... 10
3.4Communication....................................................................................................... 11
3.4.1SDO communication.......................................................................................... 11
3.4.2SDO functions...................................................................................................... 12
3.4.3SDO indexes......................................................................................................... 13
3.4.4SDO block structure ........................................................................................... 15
3.4.5Memory requirements for SDO....................................................................... 17
3.4.6PDO communication.......................................................................................... 18
3.4.7PDO functions...................................................................................................... 19
3.4.8Memory requirements for process data....................................................... 20
3.4.9Example constellation....................................................................................... 20
3.5Status description of the backplane bus (state machine) .................................... 23
3.6Error codes ............................................................................................................... 23
3.7I/O module types and their data width................................................................. 26
4Software ...............................................................................................28
4.1Driver........................................................................................................................ 28
4.2Programming interface........................................................................................... 28
4.3Include and library files........................................................................................... 28
5Definitions, acronyms, and abbreviations .........................................29

Contents
2

Introduction 1
3
1Introduction
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
2Architecture
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
3API 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 diagnostics 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 status 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.

API functions 3
9
3.3.2 Service functions
The two functions BpbResetBpb and BpbResetError serve to carry out troubleshooting.
BpbResetBpb function
The service function BpbResetBpb carries out a reset of the backplane bus and restarts
the backplane bus controller.
Note:
After a reset, BpbSetOperational should be called to start cyclic communication.
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)
BpbResetError function
The service function BpbResetError deletes the fault memory in the status register.
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)

3 API functions
10
3.3.3 Network management
By means of the BpbSetOperational network management function, the status of the
backplane bus can be changed over from Operational to PreOperational.
BpbSetOperational function
The BpbSetOperational function implicitly executes the BpbReset function.
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
[in] ULONG ulCycleTime Cycle time for internal BPB cycle [μs]
[in] BOOLEAN bOperational Operational = TRUE or
PreOperational = FALSE
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)

API functions 3
11
3.4 Communication
In this chapter the transmission/reception of process data (PDOs) and configuration
data (SDOs) is described.
3.4.1 SDO communication
Configuration data (SDOs)
During writing the configuration data the SDOs are stored directly in an output buffer
of the driver. Access is basically initiated by the IPC. The BPB controller then responds
accordingly. If the SDOs can be written to the corresponding FIFO of the backplane
bus, they are transmitted. A definite job number is assigned to each SDO by the driver,
in order to be able to assign responses to the response FIFO and store them in the
corresponding input buffer of the application.
Abb. 2 FIFOs, buffers, and job numbers
Response
FIFO
SDO +
Job number
Response +
Job number
Transmission:
SDO
Application interface
Reception:
Respond
PCI
BPB
BPB driver
Out
p
ut buffer
Input buffer
Application
interface
Reception
FIFO

3 API functions
12
A configuration parameter of an I/O module is treated as an SDO in the IPC and is
transferred to the BPB controller via the FIFOs in the form of a structure, which
contains the data in a format suitable for DS 401. Access of the IPC to the BPB
controller is effected in 2 possible ways:
IPC BPBcontroller
Writing: Write request Status message
Reading: Read request Response
3.4.2 SDO functions
BpbReadSdo function
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
[out] PUCHAR pReadBuffer SDO memory area
[in] WORD usBufferSize Size of the memory area
[out] PWORD pusActualSdoSize Size of the memory area assigned
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)
E_MEMORY Incorrect (BPB message memory area overflown)
BpbWriteSdo function
Parameter
[in] HANDLE hOpen Pointer to open context (handle) for identification
[in] PUCHAR pWriteBuffer SDO memory area
[in] USHORT usBufferSize Size of the memory area
[in] USHORT usSdoCount Number of SDOs
[out] PUSHORT pusSdoWritten Number of SDOs written
Return values
S_OK Successful
E_HANDLE Incorrect (handle is invalid)
E_FIFO Incorrect (output buffer has overflown)

API functions 3
13
3.4.3 SDO indexes
The following table provides a summary of possible telegrams:
Designation Index Subindex
Description
DS301
80d
String[14] for config. file version of
the BPB controller
Hardware/firmware
version
1009h
81dString[14] for ID of the BPB master
80dString[14] for version of Nios SW
(build#.major.minor.micro)
Software version 100A h
81dString[14] for the master version of
the BPB master
0dNumber of disks
Indexes 0-1FFF
Module identification 1027 h
n Identification according to disk (1-
64)
Manufacturer-
specific Module type
designation
2028 h 1d– 40dReturns string[10] with the type
designation of terminal n.
DS401
Module parameter
for….
See documentation for I/O system 1000

3 API functions
14
In the following the identification of the modules is described:
Module Value
DI_2X 0x001
DI_4X 0x003
DI_8X 0x005
DI_4X_3WIRE 0x006
DI_2X_NPN 0x002
DI_4X_NPN 0x004
DI_8X_NPN 0x007
DO_2X 0x101
DO_4X 0x104
DO_8X 0x106
DO_2X_2A 0x102
DO_2X_NPN 0x103
DO_4X_NPN 0x105
DO_8X_NPN 0x107
AI_2X_U 0x401
AI_4X_U 0x404
AI_2X_I 0x402
AI_4X_I 0x405
AO_2X_U 0x501
AO_4X_U 0x503
AO_2X_I 0x502
AO_4X_I 0x504
AI_2X_TC 0x403
AI_4X_R 0x406
CNT_1X_24V 0x991
CNT_1X_5V 0x992
CNT_2X_24V 0x993
CNT_2X_24VEC 0x994
SSI_1X 0x995

API functions 3
15
3.4.4 SDO block structure
SDO memory area header 1. DWORD
Status register 2. DWORD
BpbSdoBlockHeader
SDOs
3. DWORD
…
n. DWORD
(binary data, according to SDO
package formats)
The structure of the SDO memory area results from the different SDO package
formats. The following package formats are defined there:
Write request (BpbSdoHeader, BpbWrite) status message (BpbSdoHeader)
Read request (BpbSdoHeader) response (BpbSdoHeader, BpbRead)
Each SDO (FIFO telegram) starts with a header, which is identical for the IPC and the
BPB controller:
Header
Structural element Type Bits Description FIFO
Index WORD 16-31 Index of the parameter
Subindex BYTE 8-15 Subindex of the parameter
Control BYTE 0-7 Bit 7 = 0 (read) / 1 (write)
Bit 0-6 = job number
1 DWORD
Via the index and subindex, the BPB controller basically decodes the action to be
executed and, if required, generates a suitable command for the BPB master, which
the backplane bus master in turn transmits to the I/O module/s. Since a telegram on
the BPB must only contain a maximum of 64 bytes of user data, a data volume greater
than that, if necessary, has to be fragmented into several individual telegrams by the
IPC. After processing, the BPB controller sends a status message on the response FIFO
to the IPC. The response contains the job number and one byte regarding the success
of the action.

3 API functions
16
In the following the SDOs for writing/reading and the corresponding status
message/response are shown:
Write request
Structural element Type Bits Description FIFO
Header 1 DWORD
Value BYTE 24-31
Value BYTE 16-23
0. WORD
Number of values BYTE 8-15 Number of bytes (max. 64)
Reserved BYTE 0-7
1 DWORD
Values WORD 2. WORD
WORD 1. WORD
1 DWORD
WORD 4. WORD
WORD 3. WORD
1 DWORD
WORD 6. WORD
WORD 5. WORD
1 DWORD
For the sequence of the values, in the 2. and all following DWORD ascending byte
addresses are selected, respectively.
Status message (identical to the response to a read request)
Structural element Type Bits Description FIFO
Header 1 DWORD
Reserved BYTE 24-31
Reserved BYTE 16-23
Number of values BYTE 8-15 Number of bytes (max. 64)
Status BYTE 0-7 Status information (0 = OK)
1 DWORD
Read request
Structural element Type Bits Description FIFO
Header 1 DWORD

API functions 3
17
Response
Structural element Type Bits Description FIFO
Header 1 DWORD
Value BYTE 24-31 2. value
Value BYTE 16-23 1. value
Number of values BYTE 8-15 Number of bytes
(max. 64)
Status BYTE 0-7 Status information (0 = OK)
1 DWORD
Values ARRAY Other values to be transmitted n DWORDs
Notes:
All SDOs are to be stored in a DWORD-aligned manner.
Job is completed automatically by the driver.
3.4.5 Memory requirements for SDO
For SDO there are also two directions:
L-force Controller transmits control data/commands to the backplane bus
controller
Backplane bus controller transmits control data/status information to the
L-force Controller
For both directions FIFOs are used as mailbox. The size of the FIFOs is 128 bytes in
each case.

3 API functions
18
3.4.6 PDO communication
Process data (PDO)
In order to read process data from the backplane bus, the BpbReadPdo function is
used, reading the process input image. The process output image can be written to
the backplane bus by means of the BpbWritePdo function. The reading/writing of
PDOs is only possible in the Operational state.
Reading/writing the PDOs of a group is only transmitted from/to the BPB controller if
the group status is "RUNNING“. During the "INIT“ group status, the values are read as
0 (directly in the driver, not from the BPB controller).
By the BpdReadPdo and BpbWritePdo functions, a PDO block including a header
(contains the size of the PDOs and the status register) is provided or expected. In the
case of the writing access, the contents of the status register are ignored.
Abb. 3 Reading/writing the process image
DPRAM
Process output image
Process input image
RWB_Read(...)
{
...
ReadDPRAM()
...
}
RWB_Write(...)
{
...
ReadDPRAM()
...
}
PC
I
BPB driver
Table of contents
Other Lenze Industrial PC manuals

Lenze
Lenze L-force CPC 2800 User manual

Lenze
Lenze Command Station CS 5000 DVI User manual

Lenze
Lenze CS 5800 User manual

Lenze
Lenze EL 1800 User guide

Lenze
Lenze V80GBS Series User manual

Lenze
Lenze EL 1800 User manual

Lenze
Lenze L-force MC Series User manual

Lenze
Lenze L-force Controls User manual

Lenze
Lenze CPC 9100 User manual

Lenze
Lenze L-force Controls User guide
Popular Industrial PC manuals by other brands

IBASE Technology
IBASE Technology SI-58 Series user manual

Advantech
Advantech UBC-310 quick start guide

Premio
Premio VCO-6022C-2PWR user manual

Moxa Technologies
Moxa Technologies UC-8112-LX STK Hardware Quick Installation Guide

IEI Technology
IEI Technology PXE-12S Quick installation guide

B&R
B&R Panel PC 3100 user manual