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
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] index The index of the entry to delete.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
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] name A 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
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] index The index of the entry in the table of named parameter settings. [out] bitrate Bit rate (bits per second). [out] tseg1 Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point. [out] tseg2 Time segment 2, that is, the number of quanta from the sampling point to the end of the bit. [out] sjw The Synchronization Jump Width. [out] noSamp The number of sampling points; can be 1 or 3.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
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] index The 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
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] index The index of the entry in the named parameters list, whose name is to be returned. [out] buffer A pointer to a buffer that is to receive a NULLterminated string which contains the name. The buffer is allocated and deallocated by the user.[in] maxlen The length of the buffer.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
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] index The index of the entry in the named parameter list whose parameters are to be set or changed. [in] bitrate Bit rate (measured in bits per second); or one of the predefined constants canBITRATE_xxx. [in] tseg1 Time segment 1, that is, the number of quanta from (but not including) the Sync Segment to the sampling point. [in] tseg2 Time segment 2, that is, the number of quanta from the sampling point to the end of the bit. [in] sjw The Synchronization Jump Width. [in] noSamp The number of sampling points; can be 1 or 3.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
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] index The index of the entry in the named parameter list whose channel number is to be set. [in] channel The channel number.
- Returns
- canOK (zero) if success
- canERR_xxx (negative) if failure
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] index The index of the named parameter whose name is to be changed or set. [out] buffer A pointer to a NULLterminated 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
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] index1 The first of the two entries that are to be swapped in the named parameters list. [in] index2 The 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