BISS 1SL Interfacemanual E7en
BISS 1SL Interfacemanual E7en
im
INTERFACE DESCRIPTION prel
Rev E7, Page 1/42
DESCRIPTION
This document describes the functionality of the shared library available to application developers for the
BiSS Interface. The shared library provides an intermediate layer between applications, e.g. Graphical User
Interfaces (GUI), and the underlying hardware (drivers). This is demonstrated in figure 1.
Application
Layer
Appl 1 ... XYZ
Features
• Reading of SCD frames from multiple slaves via the BiSS chain
• Reading and writing of slave registers
• Automatic detection of slaves using BiSS identifier or profile XML
• Manual setup of BiSS Communication and Frame parameters
CONTENTS
GENERAL SETUP 4
PACKAGE DESCRIPTION 4
FUNCTIONS 5
BISS_Open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
BISS_Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
BISS_SetInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
BISS_GetInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
BISS_SetComParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
BISS_GetComParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
BISS_SetFrameParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
BISS_GetFrameParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
BISS_AutoDetection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
BISS_WriteMasterParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
BISS_InitBissComm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
BISS_ReadSCD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
BISS_WriteSlaveRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
BISS_ReadSlaveRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
BISS_SendCommand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
BISS_GetDLLVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
OPTIONAL FUNCTIONS 13
BISS_SetSlaveLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
BISS_GetSlaveLabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
BISS_SetScdContentLabels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
BISS_GetScdContentLabels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
BISS_SetScdContentParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
BISS_GetScdContentParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
BISS_GetScdContent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
BISS_WriteMasterRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
BISS_ReadMasterRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
BISS_GetMasterRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
BISS_ReadSCDFrames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
BISS_GetSCDFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
BISS_GetSCDFrameEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
BISS_GetScdFrameContent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
BISS_GetScdFrameContentEx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
BISS_SaveMasterConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
BISS_SaveRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
BISS_LoadRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
BISS_SaveDLLConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
BISS_LoadDLLConfig . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
BISS_CalculateCRC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
BISS_CalculateCRC_Ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 3/42
BISS_GetInterfaceInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
BISS_SetMb3uPins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
BISS_GetMb3uPins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
BISS_SetFtdiFreq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
BISS_SetEdsParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
BISS_GetEdsParam . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
BISS_SetEdsRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
BISS_GetEdsRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
BISS_ReadEdsParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
BISS_WriteEdsParams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
BISS_GetLastError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
APPLICATION EXAMPLES 32
Example 1 - Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Example 2 - BISS_ReadSCD with Control Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Example 3 - Two connected MB4U adapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Example 4 - Read BiSS chain with BISS_ReadSCDFrames . . . . . . . . . . . . . . . . . . . . . . . . . 36
Example 5 - Read BiSS chain with BISS_GetScdContents . . . . . . . . . . . . . . . . . . . . . . . . . . 38
APPENDIX 40
REVISION HISTORY 41
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 4/42
GENERAL SETUP
Other programming languages are not verified but may be able to use this library.
Operating Systems
This shared library was developed for Microsoft Windows and Linux (x86-64).
PACKAGE DESCRIPTION
The bin directory contains the shared libraries for several operating systems (OS) in subdirectories named
according to the OS. The subdirectory windows includes the Dynamic Link Libraries (.dll) and import libraries
(.lib) for the Windows OS.The libraries are provided both as 32 bit and 64 bit compilations. The 32 bit-version is
located in the subdirectory x86, and the 64 bit-version is located in x86-64, respectively. The Shared Object files
for the Linux (.so) are provided only as 64 bit-compilation, and can be found in the subdirectory linux.
The package includes the latest PC USB-adapter drivers for running 32 and 64 bit applications. The drivers can
be found in the directory drivers.
The include folder contains C/C++ header files for easier integration of the BiSS shared library into customer
applications. In documentation users can find the release notes and the software manual for the current shared
library version. The directory examples includes C++ example programs to demonstrate certain usages of the
shared library. The lv_interface directory contains all necessary sources for an easy integration of the BiSS
shared library into customer LabVIEW applications.
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 5/42
FUNCTIONS
BISS_Open
Loads the library and returns a handle that will be used for subsequent accesses.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_Close
Releases the handle and terminates established connections.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SetInterface
Connects to the interface defined by parameter ulInterface.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetInterface
Returns the selected interface from the shared library.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SetComParam
Sets the BiSS Communication parameter in the shared library.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code.(see table 8, page 30).
Hints :
Configure BiSS Communication and Frame parameters with calls of the functions BISS_SetComParam and
BISS_SetFrameParam. Then use BISS_WriteMasterParams to write all parameters to the BiSS master.
XML
File
AutoDetection
SetFrameParam
SetComParam WriteMasterParams
DLL BiSS
Master
Application GetComParam
GetFrameParam Device
Software
ReadSCD
ReadSlaveRegister
WriteSlaveRegister
BiSS
BiSS
Slave
Slave
Device
Devices
BISS_GetComParam
Gets the BiSS Communication parameter from the shared library.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SetFrameParam
Sets a BiSS Frame parameter in the shared library.
unsigned long
BISS_SetFrameParam ( unsigned long ulBISSHandle,
unsigned long ulDataChannel,
unsigned long ulParam,
unsigned long ulValue)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Configure BiSS Communication and Frame parameters with calls of the functions BISS_SetComParam and
BISS_SetFrameParam. Then use BISS_WriteMasterParams to write all parameters to the BiSS master.
BISS_GetFrameParam
Gets a BiSS Frame parameter from the shared library.
unsigned long
BISS_GetFrameParam ( unsigned long ulBISSHandle,
unsigned long ulDataChannel,
unsigned long ulParam,
unsigned long *pulValue)
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 9/42
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_AutoDetection
Reads the BiSS Identification and BiSS Profile XML file to detect the connected slaves and sets the BiSS
Communication and Frame parameters.
unsigned long
BISS_AutoDetection ( unsigned long ulBISSHandle,
char *pcFilename,
unsigned long *pulSlaveCount,
unsigned long ulWriteMasterParams)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_WriteMasterParams
Writes all BiSS parameters from the shared library to the BiSS master.
unsigned long
BISS_WriteMasterParams ( unsigned long ulBISSHandle)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 10/42
BISS_InitBissComm
Initializes the BiSS bus communication.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_ReadSCD
Reads one SCD frame.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30). In case of
eBISS_COMM_FAILED, check pulScdValid for details.
Hints :
Transmission of Control Data is optional and for BiSS C slaves only. Before using ulStartControlFrame to
start the transmission of a control frame, set the following parameters via the function BISS_SetComParam:
eBISS_SLAVE_ID, eBISS_REGISTER_ADDRESS, eBISS_WNR and eBISS_REGISTER_VALUE.
Call the function BISS_ReadSCD in a loop until the parameter pulControlFrameEnd returns ’1’. Use
BISS_GetComParam to get eBISS_REGISTER_VALUE after a read. For example, see listing 2 in the ap-
pendix.
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 11/42
BISS_WriteSlaveRegister
Writes a specified number of registers to the BiSS slave.
unsigned long
BISS_WriteSlaveRegister ( unsigned long ulBISSHandle,
unsigned long ulProtocol,
unsigned long ulSlaveId,
unsigned long ulRegisterAddress,
unsigned long *pulNumberOfBytes,
unsigned long *pulRegisterContent)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
The number of bytes for parameter pulNumberOfBytes is limited by the BiSS master. Use parameter
eBISS_MAX_REG_CNT from the enumeration BISS_ComParamEnum to determine the maximum number of
bytes. See table 5 on page 28 and or the respective BiSS master specification for more details.
BISS_ReadSlaveRegister
Reads a specified number of registers from the BiSS slave.
unsigned long
BISS_ReadSlaveRegister ( unsigned long ulBISSHandle,
unsigned long ulProtocol,
unsigned long ulSlaveId,
unsigned long ulRegisterAddress,
unsigned long *pulNumberOfBytes,
unsigned long *pulRegisterContent)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
The number of bytes for parameter pulNumberOfBytes is limited by the BiSS master. Use parameter
eBISS_MAX_REG_CNT from the enumeration BISS_ComParamEnum to determine the maximum number of
bytes. See table 5 on page 28 and or the respective BiSS master specification for more details.
BISS_SendCommand
Sends a command to the selected slaves.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetDLLVersion
Gets the version number of the shared library.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Index ’1’ of the version number comprises the major version number, index ’0’ the minor version number. The
function does not need a handle.
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 13/42
OPTIONAL FUNCTIONS
BISS_SetSlaveLabel
Sets information of the selected slave.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetSlaveLabel
Gets information of the selected slave.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SetScdContentLabels
Sets the labels of the SCD content of the selected data channel.
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 14/42
unsigned long
BISS_SetScdContentLabels ( unsigned long ulBISSHandle,
unsigned long ulDataChannel,
unsigned long ulContentIndex,
char *pcScdContentLabel,
char *pcScdContentUnit)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Initially set the parameter eBISS_SCD_CONTENT_CNT via the function BISS_SetFrameParam to set the num-
ber of SCD contents of the data channel.
BISS_GetScdContentLabels
Gets the labels of the SCD content of the selected data channel.
unsigned long
BISS_GetScdContentLabels ( unsigned long ulBISSHandle,
unsigned long ulDataChannel,
unsigned long ulContentIndex,
char *pcScdContentLabel,
char *pcScdContentUnit)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Use BISS_GetFrameParam to get the number of SCD contents of the data channel (eBISS_SCD_CONTENT_CNT).
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 15/42
BISS_SetScdContentParams
Sets the parameters of the SCD content.
unsigned long
BISS_SetScdContentParams ( unsigned long ulBISSHandle,
unsigned long ulDataChannel,
unsigned long ulContentIndex,
BISS_ScdContentStruct *pScdContentItems)
Parameters :
Element Description
ulZero Set to ’1’ if content is a zerobit (for iC-NQ only)
ulDataLength Data length (bits).
ulResolution Resolution (e.g. 1024)
lOffset Output offset
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Initially set the parameter eBISS_SCD_CONTENT_CNT via the function BISS_SetFrameParam to set the num-
ber of SCD contents of the data channel.
BISS_GetScdContentParams
Gets the parameters of the SCD content.
unsigned long
BISS_GetScdContentParams ( unsigned long ulBISSHandle,
unsigned long ulDataChannel,
unsigned long ulContentIndex,
BISS_ScdContentStruct *pScdContentItems)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Use BISS_GetFrameParam to get the number of SCD contents of the data channel (eBISS_SCD_CONTENT_CNT).
BISS_GetScdContent
Gets the SCD content of the selected data channel.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Use BISS_GetFrameParam to get the number of SCD contents of the data channel (eBISS_SCD_CONTENT_CNT).
BISS_WriteMasterRegister
Writes a register to the BISS master.
unsigned long
BISS_WriteMasterRegister ( unsigned long ulBISSHandle,
unsigned long ulRegisterAddress,
unsigned long ulRegisterContent)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 17/42
BISS_ReadMasterRegister
Reads a register from the BISS master.
unsigned long
BISS_ReadMasterRegister ( unsigned long ulBISSHandle,
unsigned long ulRegisterAddress,
unsigned long *pulRegisterContent)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetMasterRegister
Gets a master register value from the shared library.
unsigned long
BISS_GetMasterRegister ( unsigned long ulBISSHandle,
unsigned long ulRegisterAddress,
unsigned long *pulRegisterContent)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_ReadSCDFrames
Reads multiple SCD frames via the MB4U/MB5U adapter only.
unsigned long
BISS_ReadSCDFrames ( unsigned long ulBISSHandle,
unsigned long ulCycleCnt,
unsigned long *pulDataScdH
unsigned long *pulDataScdL
unsigned long *pulTimestamp
unsigned long *pulStatus)
Parameters :
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 18/42
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Use BISS_SetComParam to set master clock frequency (FREQ_SCD) and frame repetition rate (FREQ_AGS)
(see table 5, 11, and 13).
If multiple data channels are configured, use the function BISS_GetSCDFrame to get single cycle data of all data
channels.
BISS_GetSCDFrame
Gets selected SCD frame acquired by the function BISS_ReadSCDFrames.
unsigned long
BISS_GetSCDFrame ( unsigned long ulBISSHandle,
unsigned long ulFrameIndex,
unsigned long *pulDataScdH
unsigned long *pulDataScdL
unsigned long *pulTimestamp
unsigned long *pulStatus)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetSCDFrameEx
Gets SCD frames of selected data channel acquired by the function BISS_ReadSCDFrames.
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 19/42
unsigned long
BISS_GetSCDFrameEx ( unsigned long ulBISSHandle,
unsigned long ulCycleCnt,
unsigned long ulDataChannel,
unsigned long *pulDataScdH
unsigned long *pulDataScdL
unsigned long *pulTimestamp
unsigned long *pulStatus)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetScdFrameContent
Gets contents of selected data channel acquired by the function BISS_ReadSCDFrames.
unsigned long
BISS_GetScdFrameContent ( unsigned long ulBISSHandle,
unsigned long ulCycleCnt,
unsigned long ulDataChannel,
unsigned long ulContentIndex,
unsigned long *pulValues)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 20/42
BISS_GetScdFrameContentEx
Gets contents of selected data channel acquired by the function BISS_ReadSCDFrames.
uint32_t
BISS_GetScdFrameContentEx ( unsigned long ulBISSHandle,
uint32_t ulCycleCnt,
uint32_t ulDataChannel,
uint32_t ulContentIndex,
uint64_t *pulValues)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SaveMasterConfig
Saves the BiSS master configuration to a file.
unsigned long
BISS_SaveMasterConfig ( unsigned long ulBISSHandle,
char *pcCfgFilename)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SaveRegister
Saves the data of the specified address range to a file. The file format is Intel HEX.
unsigned long
BISS_SaveRegister ( unsigned long ulBISSHandle,
char *pcFilename,
unsigned long ulStartAdr,
unsigned long ulNumberOfBytes,
unsigned long *pulData)
Parameters :
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 21/42
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_LoadRegister
Loads the data of the specified address range from a file. The file format is Intel HEX.
unsigned long
BISS_LoadRegister ( unsigned long ulBISSHandle,
char *pcFilename,
unsigned long ulStartAdr,
unsigned long ulNumberOfBytes,
unsigned long *pulData)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SaveDLLConfig
Saves the shared library configuration to a XML file.
unsigned long
BISS_SaveDLLConfig ( unsigned long ulBISSHandle,
char *pcCfgFilename)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 22/42
BISS_LoadDLLConfig
Loads the shared library configuration from a XML file.
unsigned long
BISS_LoadDLLConfig ( unsigned long ulBISSHandle,
char *pcCfgFilename)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_CalculateCRC
Calculates the CRC checksum over a range of bytes.
unsigned long
BISS_CalculateCRC ( unsigned long ulBISSHandle,
unsigned long ulCrcPoly,
unsigned long *pulData,
unsigned long ulByteCount,
unsigned long *pulCheckSum)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_CalculateCRC_Ex
Calculates the CRC checksum over a range of bytes.
unsigned long
BISS_CalculateCRC_Ex ( unsigned long ulBISSHandle,
unsigned long ulCrcPoly,
unsigned long ulCrcStartValue,
unsigned long *pulData,
unsigned long ulByteCount,
unsigned long *pulCheckSum)
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 23/42
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetInterfaceInfo
Gets additional information about the selected interface.
unsigned long
BISS_GetInterfaceInfo ( unsigned long ulBISSHandle,
unsigned long ulIndex,
char *pcInterfaceInfo)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SetMb3uPins
Sets direction and state of the free MB3U interface pins.
Parameters :
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 24/42
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetMb3uPins
Gets direction and state of the free MB3U interface pins.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SetFtdiFreq
Sets the MB3U internal SPI frequency.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
Hints :
Formula for the SPI frequency:
12 MHz
(1 + [(ulFreqH(7:0) · 256) + ulFreqL(7:0)]) · 2
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 25/42
BISS_SetEdsParam
Sets an EDS parameter in the shared library.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetEdsParam
Gets an EDS parameter from the shared library.
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_SetEdsRegister
Sets an EDS register in the shared library.
Parameters :
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 26/42
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetEdsRegister
Gets an EDS register from the shared library.
unsigned long
BISS_GetEdsRegister ( unsigned long ulBISSHandle,
unsigned long ulAdr,
unsigned long *pulValue)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_ReadEdsParams
Reads EDS registers from the iC-BISS to the shared library.
unsigned long
BISS_ReadEdsParams ( unsigned long ulBISSHandle,
unsigned long ulSlaveId)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_WriteEdsParams
Writes all EDS parameters from the shared library to the iC-BISS registers.
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 27/42
unsigned long
BISS_WriteEdsParams ( unsigned long ulBISSHandle,
unsigned long ulSlaveId)
Parameters :
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BISS_GetLastError
Returns details about the last error occurred.
unsigned long
BISS_GetLastError ( unsigned long ulBISSHandle,
unsigned long *pulLastError,
unsigned long *pulErrorType,
char *pcErrorText)
Parameters :
Table 4: BISS_ErrorTypeEnum
Return Value :
eBISS_OK if successful, otherwise the return value is an error code (see table 8, page 30).
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 28/42
Protocols
Error Definitions
APPLICATION EXAMPLES
int main()
{
uint32_t version[2];
uint32_t error;
uint32_t bissHandle;
// Load the library and get a handle that will be used for subsequent accesses.
error = BISS_Open(&bissHandle);
if (error) {
return -1;
}
case eBISS_INTERFACEDRIVER_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACEDRIVER_NOT_FOUND):" << endl
<< "Install FTDI Interface Drivers" << endl;
break;
case eBISS_INTERFACE_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACE_NOT_FOUND): " << endl
<< "Check wire connections and power supply" << endl;
break;
default:
cout << "BISS_SetInterface failed (error code: " << error << ")"
<< endl;
break;
}
} else {
cout << "Interface MB3U opened" << endl << endl;
// Set the library properties (BiSS Master Clock Frequency for Single Cycle Data)
// p.e. FREQ_SCD = 2 MHz @ MB3U
error = BISS_SetComParam(bissHandle, eBISS_FREQ_SCD, 0x4);
error = BISS_SetComParam(bissHandle, eBISS_FREQ_AGS, 0x64);
// CrcPoly: 1000011
error = BISS_SetFrameParam(bissHandle, 0x0, eBISS_SCD_CRC_POLY, 0x43);
error = BISS_SetFrameParam(bissHandle, 0x0, eBISS_SCD_CRC_INVERT, 0x1);
error = BISS_WriteMasterParams(bissHandle);
}
error = BISS_InitBissComm(bissHandle);
int main()
{
uint32_t error;
uint32_t bissHandle;
error = BISS_Open(&bissHandle);
error = BISS_SetInterface(bissHandle, eBISS_MB3U, "");
uint32_t slCount;
error = BISS_AutoDetection(bissHandle, "resources/idbiss6943.xml", &slCount, 1);
uint32_t regEnd;
uint32_t scdDataH[3];
uint32_t scdDataL[3];
uint32_t scdValid;
error = BISS_InitBissComm(bissHandle);
uint32_t registerValue;
error = BISS_GetComParam(bissHandle, eBISS_REGISTER_VALUE, ®isterValue);
BISS_Close(bissHandle);
}
Listing 3: Source code example (C++) with two connected MB4U adapters
#include "BISS_1SL_interface.h"
#include <iostream>
int main()
{
uint32_t version[2];
uint32_t error;
// Load the library and get the handles that will be used for subsequent accesses.
error = BISS_Open(&bissHandleA);
error = BISS_Open(&bissHandleB);
// Set the DLL properties (BiSS Master Clock Frequency for Single Cycle Data)
// p.e. FREQ_SCD = 2 MHz @ MB4U
error = BISS_SetComParam(bissHandleA, eBISS_FREQ_SCD, 4);
error = BISS_SetComParam(bissHandleB, eBISS_FREQ_SCD, 4);
if (error) {
switch (error) {
case eBISS_INTERFACEDRIVER_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACEDRIVER_NOT_FOUND):" << endl
<< "Install FTDI Interface Drivers" << endl;
break;
case eBISS_INTERFACE_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACE_NOT_FOUND): " << endl
<< "Check wire connections and power supply" << endl;
break;
default:
cout << "BISS_SetInterface failed (error code: " << error << ")"
<< endl;
break;
}
} else {
cout << "Interface MB4U B opened" << endl << endl;
// CrcPoly: 1000011
error = BISS_SetFrameParam(bissHandleA, 0, eBISS_SCD_CRC_POLY, 0x43);
error = BISS_SetFrameParam(bissHandleA, 0, eBISS_SCD_CRC_INVERT, 1);
error = BISS_WriteMasterParams(bissHandleA);
// CrcPoly: 1000011
error = BISS_SetFrameParam(bissHandleB, 0, eBISS_SCD_CRC_POLY, 0x43);
error = BISS_SetFrameParam(bissHandleB, 0, eBISS_SCD_CRC_INVERT, 1);
error = BISS_WriteMasterParams(bissHandleB);
error = BISS_InitBissComm(bissHandleA);
error = BISS_InitBissComm(bissHandleB);
uint32_t controlFrameEnd;
error = BISS_ReadSCD(bissHandleA, scdH, scdL, &scdValid, startControlFrame, &
controlFrameEnd);
cout << "SCD MB4U A: 0x" << hex << scdH[0] << scdL[0] << endl;
error = BISS_ReadSCD(bissHandleB, scdH, scdL, &scdValid, startControlFrame, &
controlFrameEnd);
cout << "SCD MB4U B: 0x" << hex << scdH[0] << scdL[0] << endl;
}
}
Listing 4: Source code example (C++) for BiSS chain with BISS_ReadSCDFrames
#include "BISS_1SL_interface.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#define SLAVECNT 2
#define CYCLECNT 1000
int main()
{
uint32_t version[2];
uint32_t error;
// Load the library and get a handle that will be used for subsequent accesses.
error = BISS_Open(&bissHandle);
if (error) {
switch (error) {
case eBISS_INTERFACEDRIVER_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACEDRIVER_NOT_FOUND):" << endl
<< "Install FTDI Interface Drivers" << endl;
break;
case eBISS_INTERFACE_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACE_NOT_FOUND): " << endl
<< "Check wire connections and power supply" << endl;
break;
default:
cout << "BISS_SetInterface failed (error code: " << error << ")"
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 37/42
<< endl;
break;
}
} else {
cout << "Interface MB4U opened" << endl << endl;
if (error) {
cout << "Data Acquisition failed!" << endl;
} else {
// Get Slave data from last ReadSCDFrames
for (int iFrameIndex = 0; iFrameIndex < CYCLECNT; iFrameIndex++) {
error = BISS_GetSCDFrame(bissHandle, iFrameIndex, dummy1, dummy2, timeDummy,
statusDummy);
Listing 5: Source code example (C++) for BiSS chain with BISS_GetScdContents
#include "BISS_1SL_interface.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#define SLAVECNT 2
#define CYCLECNT 1000
int main()
{
uint32_t bissHandle;
uint32_t version[2];
uint32_t error;
// Load the library and get a handle that will be used for subsequent accesses.
error = BISS_Open(&bissHandle);
if (error) {
switch (error) {
case eBISS_INTERFACEDRIVER_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACEDRIVER_NOT_FOUND):" << endl
<< "Install FTDI Interface Drivers" << endl;
break;
case eBISS_INTERFACE_NOT_FOUND:
cout << "BISS_SetInterface failed (eBISS_INTERFACE_NOT_FOUND): " << endl
<< "Check wire connections and power supply" << endl;
break;
default:
cout << "BISS_SetInterface failed (error code: " << error << ")"
<< endl;
break;
}
} else {
BiSS Shared Library i nar y
im
INTERFACE DESCRIPTION prel
Rev E7, Page 39/42
BISS_ScdContentStruct contents;
// Slave 0
// MT
contents.ulDataLength = 16;
BISS_SetScdContentParams(bissHandle, 0, 0, &contents);
// ST
contents.ulDataLength = 12;
BISS_SetScdContentParams(bissHandle, 0, 1, &contents);
// EW
contents.ulDataLength = 2;
BISS_SetScdContentParams(bissHandle, 0, 2, &contents);
APPENDIX
FREQ_SCD Description
0x00.. f CLK
0x0F 2·(FREQ_SCD(3:0)+1)
0x10 not permissible
0x11.. f CLK
0x1F 20·(FREQ_SCD(3:0)+1)
Note f CLK = 20 MHz for PC adapters MB3U (MB3U-I2C), MB4U and MB5U
FREQ_REG Description
0x00 FREQ_SCD / 2
0x01 FREQ_SCD / 4
0x02 FREQ_SCD / 8
0x03 FREQ_SCD / 16
0x04 FREQ_SCD / 32
0x05 FREQ_SCD / 64
0x06 FREQ_SCD / 128
0x07 FREQ_SCD / 256
FREQ_AGS Description
0x00.. f CLK
0x7B 20·(FREQ_AGS(6:0)+1)
0x7C AGSMIN
0x7D.. AGSINFINITE
0x7F
0x80.. f CLK
0xFF 625·(FREQ_AGS(6:0)−127)
Notes f CLK = 20 MHz for PC adapters MB3U (MB3U-I2C), MB4U and MB5U
REVISION HISTORY
Modifications made to this document are listed below. For modifications made to the corresponding shared library
see the latest release notes (included in the shared library zip package).
The data and predicted functionality is intended solely for the purpose of product description and shall represent the usual quality and behaviour of the product.
In case the Documents contain obvious mistakes e.g. in writing or calculation, iC-Haus reserves the right to correct the Documents and no liability arises insofar
that the Documents were from a third party view obviously not reliable. There shall be no claims based on defects as to quality and behaviour in cases of
insignificant deviations from the Documents or in case of only minor impairment of usability.
No representations or warranties, either expressed or implied, of merchantability, fitness for a particular purpose or of any other nature are made hereunder with
respect to information/specification resp. Documents or the products to which information refers and no guarantee with respect to compliance to the intended
use is given. In particular, this also applies to the stated possible applications or areas of applications of the product.
iC-Haus products are not designed for and must not be used in connection with any applications where the failure of such products would reasonably be
expected to result in significant personal injury or death (Safety-Critical Applications) without iC-Haus’ specific written consent. Safety-Critical Applications
include, without limitation, life support devices and systems. iC-Haus products are not designed nor intended for use in military or aerospace applications or
environments or in automotive applications unless specifically designated for such use by iC-Haus.
iC-Haus conveys no patent, copyright, mask work right or other trade mark right to this product. iC-Haus assumes no liability for any patent and/or other trade
mark rights of a third party resulting from processing or handling of the product and/or any other use of the product.
Software and its documentation is provided by iC-Haus GmbH or contributors "AS IS" and is subject to the ZVEI General Conditions for the Supply of Products
and Services with iC-Haus amendments and the ZVEI Software clause with iC-Haus amendments (www.ichaus.com/EULA).