Named Parameter Settings

Handling of Bus Parameters and more. More...

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)
 

Detailed Description

Handling of Bus Parameters and more.

Function Documentation

◆ canParamCommitChanges()

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

◆ canParamCreateNewEntry()

canStatus canParamCreateNewEntry ( void  )
C#
static Int32 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()

◆ canParamDeleteEntry()

canStatus canParamDeleteEntry ( int  index)
C#
static Canlib.canStatus canParamDeleteEntry(Int32 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()

◆ canParamFindByName()

canStatus canParamFindByName ( const char *  name)
C#
static Canlib.canStatus canParamFindByName(String str_name);
Delphi
function canParamFindByName(const Name: PAnsiChar): 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()

◆ canParamGetBusParams()

canStatus canParamGetBusParams ( int  index,
long *  bitrate,
unsigned int *  tseg1,
unsigned int *  tseg2,
unsigned int *  sjw,
unsigned int *  noSamp 
)
C#
static Canlib.canStatus canParamGetBusParams(Int32 index, out Int32 bitrate, out Int32 tseg1, out Int32 tseg2, out Int32 sjw, out Int32 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()

◆ canParamGetChannelNumber()

canStatus canParamGetChannelNumber ( int  index)
C#
static Int32 canParamGetChannelNumber(Int32 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()

◆ canParamGetCount()

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

◆ canParamGetName()

canStatus canParamGetName ( int  index,
char *  buffer,
int  maxlen 
)
C#
static Canlib.canStatus canParamGetName(Int32 index, ref String str_buf);
Delphi
function canParamGetName(index: Integer; buffer: PAnsiChar; 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()

◆ canParamSetBusParams()

canStatus canParamSetBusParams ( int  index,
long  bitrate,
unsigned int  tseg1,
unsigned int  tseg2,
unsigned int  sjw,
unsigned int  noSamp 
)
C#
static Canlib.canStatus canParamSetBusParams(Int32 index, Int32 bitrate, Int32 tseg1, Int32 tseg2, Int32 sjw, Int32 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()

◆ canParamSetChannelNumber()

canStatus canParamSetChannelNumber ( int  index,
int  channel 
)
C#
static Canlib.canStatus canParamSetChannelNumber(Int32 index, Int32 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()

◆ canParamSetName()

canStatus canParamSetName ( int  index,
const char *  buffer 
)
C#
static Canlib.canStatus canParamSetName(Int32 index, String str_buf);
Delphi
function canParamSetName(index: Integer; buffer: PAnsiChar): 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()

◆ canParamSwapEntries()

canStatus canParamSwapEntries ( int  index1,
int  index2 
)
C#
static Canlib.canStatus canParamSwapEntries(Int32 index1, Int32 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()