Kvaser CANLIB: Named Parameter Settings
Functions

Named Parameter Settings

Functions

canStatus canParamGetCount (void)
canStatus canParamCommitChanges (void)
canStatus canParamDeleteEntry (int index)
canStatus canParamCreateNewEntry (void)
canStatus canParamSwapEntries (int index1, int index2)
canStatus canParamGetName (int index, char *buffer, int maxlen)
canStatus canParamGetChannelNumber (int index)
canStatus canParamGetBusParams (int index, long *bitrate, unsigned int *tseg1, unsigned int *tseg2, unsigned int *sjw, unsigned int *noSamp)
canStatus canParamSetName (int index, const char *buffer)
canStatus canParamSetChannelNumber (int index, int channel)
canStatus canParamSetBusParams (int index, long bitrate, unsigned int tseg1, unsigned int tseg2, unsigned int sjw, unsigned int noSamp)
canStatus canParamFindByName (const char *name)

Function Documentation

canStatus canParamCommitChanges ( void  )
C#
static Canlib.canStatus canParamCommitChanges();
Delphi
function canParamCommitChanges(): canStatus;

This function writes the current set of named parameters to the Registry. Previous entries are erased.

The named parameters are stored in the HKEY_LOCAL_MACHINE\SOFTWARE\KVASER AB\CANLIB32\PredefinedBitrates key in the Registry.

Note:
You must have Administrator's rights to write to the Registry.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canStatus canParamCreateNewEntry ( void  )
C#
static int canParamCreateNewEntry();
Delphi
function canParamCreateNewEntry(): canStatus;

This function creates a new entry in the table of named parameter settings.

The named parameters are stored in the HKEY_LOCAL_MACHINE\SOFTWARE\KVASER AB\CANLIB32\PredefinedBitrates key in the Registry.

Returns:
The index of the created entry (zero or positive) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges(), canParamDeleteEntry()
canStatus canParamDeleteEntry ( int  index)
C#
static Canlib.canStatus canParamDeleteEntry(int index);
Delphi
function canParamDeleteEntry(index: Integer): canStatus;

This function deletes the entry in the table of named parameter settings with the given index. The entries below (i.e. with higher indices) the deleted entry are moved up one step in the table.

The named parameters are stored in the HKEY_LOCAL_MACHINE\SOFTWARE\KVASER AB\CANLIB32\PredefinedBitrates key in the Registry.

Parameters:
[in]indexThe index of the entry to delete.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCreateNewEntry(), canParamCommitChanges()
canStatus canParamFindByName ( const char *  name)
C#
static Canlib.canStatus canParamFindByName(string str_name);
Delphi
function canParamFindByName(const Name: PChar):canStatus;

This function returns the index of the parameter setting with the given name.

Parameters:
[in]nameA pointer to a string containing the name of the setting.
Returns:
The index of the setting (zero or positive) if success.
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges()
canStatus canParamGetBusParams ( int  index,
long *  bitrate,
unsigned int *  tseg1,
unsigned int *  tseg2,
unsigned int *  sjw,
unsigned int *  noSamp 
)
C#
static Canlib.canStatus canParamGetBusParams(int index, out int bitrate, out int tseg1, out int tseg2, out int sjw, out int noSamp);
Delphi
function canParamGetBusParams(index: Integer; var bitrate: LongInt; var tseg1: Cardinal; var tseg2: Cardinal; var sjw: Cardinal; var nosamp: Cardinal): canStatus;

This function retrieves the bus parameters associated with the entry with the given index in the table of named parameter settings.

Parameters:
[in]indexThe index of the entry in the table of named parameter settings.
[out]bitrateBit rate (bits per second).
[out]tseg1Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point.
[out]tseg2Time segment 2, that is, the number of quanta from the sampling point to the end of the bit.
[out]sjwThe Synchronization Jump Width.
[out]noSampThe number of sampling points; can be 1 or 3.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges(), canParamSetBusParams()
canStatus canParamGetChannelNumber ( int  index)
C#
static int canParamGetChannelNumber(int index);
Delphi
function canParamGetChannelNumber(index: Integer): canStatus;

This function returns the channel number of the entry with the given index in the table of named parameter settings.

Parameters:
[in]indexThe index of the entry in the table of named parameter settings.
Returns:
The channel number of the entry in question (zero or positive)
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges(), canParamGetChannelNumber()
canStatus canParamGetCount ( void  )
C#
static Canlib.canStatus canParamGetCount();
Delphi
function canParamGetCount(): canStatus;

This function returns the number of entries in the table of named channels.

Returns:
The number of channels (zero or positive)
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canStatus canParamGetName ( int  index,
char *  buffer,
int  maxlen 
)
C#
static Canlib.canStatus canParamGetName(int index, ref string str_buf);
Delphi
function canParamGetName(index: Integer; buffer: PChar; maxlen: Integer): canStatus;

This function returns the name of a given entry in the list of named parameters.

The named parameters are stored in the HKEY_LOCAL_MACHINE\SOFTWARE\KVASER AB\CANLIB32\PredefinedBitrates key in the Registry.

Parameters:
[in]indexThe index of the entry in the named parameters list, whose name is to be returned.
[out]bufferA pointer to a buffer that is to receive a NULL terminated string which contains the name. The buffer is allocated and deallocated by the user.
[in]maxlenThe length of the buffer.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamSetName(), canParamCommitChanges()
canStatus canParamSetBusParams ( int  index,
long  bitrate,
unsigned int  tseg1,
unsigned int  tseg2,
unsigned int  sjw,
unsigned int  noSamp 
)
C#
static Canlib.canStatus canParamSetBusParams(int index, int bitrate, int tseg1, int tseg2, int sjw, int noSamp);
Delphi
function canParamSetBusParams(index: Integer; bitrate: longint; tseq1, tseq2, sjw, noSamp: Cardinal): canStatus;

This function sets or changes the bus parameters for a given entry in the list of named parameters.

Note:
The bus parameters are not checked for validity.
Parameters:
[in]indexThe index of the entry in the named parameter list whose parameters are to be set or changed.
[in]bitrateBit rate (measured in bits per second); or one of the predefined constants canBITRATE_xxx.
[in]tseg1Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point.
[in]tseg2Time segment 2, that is, the number of quanta from the sampling point to the end of the bit.
[in]sjwThe Synchronization Jump Width.
[in]noSampThe number of sampling points; can be 1 or 3.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges(), canParamGetBusParams()
canStatus canParamSetChannelNumber ( int  index,
int  channel 
)
C#
static Canlib.canStatus canParamSetChannelNumber(int index, int channel);
Delphi
function canParamSetChannelNumber(index, channel: Integer): canStatus;

This function sets the channel number for a specified entry in the list of named parameters. Channels are numbered from 0 and up.

Parameters:
[in]indexThe index of the entry in the named parameter list whose channel number is to be set.
[in]channelThe channel number.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges(), canParamGetChannelNumber()
canStatus canParamSetName ( int  index,
const char *  buffer 
)
C#
static Canlib.canStatus canParamSetName(int index, string str_buf);
Delphi
function canParamSetName(index: Integer; buffer: PChar): canStatus;

This function sets or changes the name of a named parameter.

Parameters:
[in]indexThe index of the named parameter whose name is to be changed or set.
[out]bufferA pointer to a NULL terminated string that contains the new name. If the string is longer than the maximum allowed name length, it is truncated.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges(), canParamGetName()
canStatus canParamSwapEntries ( int  index1,
int  index2 
)
C#
static Canlib.canStatus canParamSwapEntries(int index1, int index2);
Delphi
function canParamSwapEntries(index1, index2: Integer): canStatus;

This function swaps two entries in the list of named parameters.

The named parameters are stored in the HKEY_LOCAL_MACHINE\SOFTWARE\KVASER AB\CANLIB32\PredefinedBitrates key in the Registry.

Parameters:
[in]index1The first of the two entries that are to be swapped in the named parameters list.
[in]index2The second of the two entries that are to be swapped in the named parameters list.
Returns:
canOK (zero) if success
canERR_xxx (negative) if failure
See also:
Named Parameter Sets
canParamCommitChanges()