libPCBUSB  Version 0.8, Build 689 of September 20, 2017
macOS Library for PCAN-USB Interfaces
 All Data Structures Files Functions Variables Typedefs Defines
PCBUSB.h File Reference

Go to the source code of this file.

Data Structures

struct  tagTPCANMsg
struct  tagTPCANTimestamp
struct  tagPCANMsgFD

Defines

#define _DEF_ARG
#define BYTE
#define WORD
#define DWORD
#define QWORD
#define UINT64
#define LPSTR
#define PCAN_NONEBUS
 Undefined/default value for a PCAN bus.
#define PCAN_USBBUS1
 PCAN-USB interface, channel 1.
#define PCAN_USBBUS2
 PCAN-USB interface, channel 2.
#define PCAN_USBBUS3
 PCAN-USB interface, channel 3.
#define PCAN_USBBUS4
 PCAN-USB interface, channel 4.
#define PCAN_USBBUS5
 PCAN-USB interface, channel 5.
#define PCAN_USBBUS6
 PCAN-USB interface, channel 6.
#define PCAN_USBBUS7
 PCAN-USB interface, channel 7.
#define PCAN_USBBUS8
 PCAN-USB interface, channel 8.
#define PCAN_ERROR_OK
 No error.
#define PCAN_ERROR_XMTFULL
 Transmit buffer in CAN controller is full.
#define PCAN_ERROR_OVERRUN
 CAN controller was read too late.
#define PCAN_ERROR_BUSLIGHT
 Bus error: an error counter reached the 'light' limit.
#define PCAN_ERROR_BUSHEAVY
 Bus error: an error counter reached the 'heavy' limit.
#define PCAN_ERROR_BUSWARNING
 Bus error: an error counter reached the 'warning' limit.
#define PCAN_ERROR_BUSPASSIVE
 Bus error: the CAN controller is error passive.
#define PCAN_ERROR_BUSOFF
 Bus error: the CAN controller is in bus-off state.
#define PCAN_ERROR_ANYBUSERR
 Mask for all bus errors.
#define PCAN_ERROR_QRCVEMPTY
 Receive queue is empty.
#define PCAN_ERROR_QOVERRUN
 Receive queue was read too late.
#define PCAN_ERROR_QXMTFULL
 Transmit queue is full.
#define PCAN_ERROR_REGTEST
 Test of the CAN controller hardware registers failed (no hardware found)
#define PCAN_ERROR_NODRIVER
 Driver not loaded.
#define PCAN_ERROR_HWINUSE
 Hardware already in use by a Net.
#define PCAN_ERROR_NETINUSE
 A Client is already connected to the Net.
#define PCAN_ERROR_ILLHW
 Hardware handle is invalid.
#define PCAN_ERROR_ILLNET
 Net handle is invalid.
#define PCAN_ERROR_ILLCLIENT
 Client handle is invalid.
#define PCAN_ERROR_ILLHANDLE
 Mask for all handle errors.
#define PCAN_ERROR_RESOURCE
 Resource (FIFO, Client, timeout) cannot be created.
#define PCAN_ERROR_ILLPARAMTYPE
 Invalid parameter.
#define PCAN_ERROR_ILLPARAMVAL
 Invalid parameter value.
#define PCAN_ERROR_UNKNOWN
 Unknown error.
#define PCAN_ERROR_ILLDATA
 Invalid data, function, or action.
#define PCAN_ERROR_CAUTION
 An operation was successfully carried out, however, irregularities were registered.
#define PCAN_ERROR_INITIALIZE
 Channel is not initialized [Value was changed from 0x40000 to 0x4000000].
#define PCAN_ERROR_ILLOPERATION
 Invalid operation [Value was changed from 0x80000 to 0x8000000].
#define PCAN_NONE
 Undefined, unknown or not selected PCAN device value.
#define PCAN_PEAKCAN
 PCAN Non-Plug&Play devices. NOT USED WITHIN PCAN-Basic API.
#define PCAN_ISA
 PCAN-ISA, PCAN-PC/104, and PCAN-PC/104-Plus.
#define PCAN_DNG
 PCAN-Dongle.
#define PCAN_PCI
 PCAN-PCI, PCAN-cPCI, PCAN-miniPCI, and PCAN-PCI Express.
#define PCAN_USB
 PCAN-USB and PCAN-USB Pro.
#define PCAN_PCC
 PCAN-PC Card.
#define PCAN_VIRTUAL
 PCAN Virtual hardware. NOT USED WITHIN PCAN-Basic API.
#define PCAN_LAN
 PCAN Gateway devices.
#define PCAN_DEVICE_NUMBER
 PCAN-USB device number parameter.
#define PCAN_5VOLTS_POWER
 PCAN-PC Card 5-Volt power parameter.
#define PCAN_RECEIVE_EVENT
 PCAN receive event handler parameter.
#define PCAN_MESSAGE_FILTER
 PCAN message filter parameter.
#define PCAN_API_VERSION
 PCAN-Basic API version parameter.
#define PCAN_CHANNEL_VERSION
 PCAN device channel version parameter.
#define PCAN_BUSOFF_AUTORESET
 PCAN Reset-On-Busoff parameter.
#define PCAN_LISTEN_ONLY
 PCAN Listen-Only parameter.
#define PCAN_LOG_LOCATION
 Directory path for log files.
#define PCAN_LOG_STATUS
 Debug-Log activation status.
#define PCAN_LOG_CONFIGURE
 Configuration of the debugged information (LOG_FUNCTION_***)
#define PCAN_LOG_TEXT
 Custom insertion of text into the log file.
#define PCAN_CHANNEL_CONDITION
 Availability status of a PCAN-Channel.
#define PCAN_HARDWARE_NAME
 PCAN hardware name parameter.
#define PCAN_RECEIVE_STATUS
 Message reception status of a PCAN-Channel.
#define PCAN_CONTROLLER_NUMBER
 CAN-Controller number of a PCAN-Channel.
#define PCAN_TRACE_LOCATION
 Directory path for PCAN trace files.
#define PCAN_TRACE_STATUS
 CAN tracing activation status.
#define PCAN_TRACE_SIZE
 Configuration of the maximum file size of a CAN trace.
#define PCAN_TRACE_CONFIGURE
 Configuration of the trace file storing mode (TRACE_FILE_***)
#define PCAN_CHANNEL_IDENTIFYING
 Physical identification of a USB based PCAN-Channel by blinking its associated LED.
#define PCAN_CHANNEL_FEATURES
 Capabilities of a PCAN device (FEATURE_***)
#define PCAN_BITRATE_ADAPTING
 Using of an existing bit rate (PCAN-View connected to a channel)
#define PCAN_BITRATE_INFO
 Configured bit rate as Btr0Btr1 value.
#define PCAN_BITRATE_INFO_FD
 Configured bit rate as TPCANBitrateFD string.
#define PCAN_BUSSPEED_NOMINAL
 Configured nominal CAN Bus speed as Bits per seconds.
#define PCAN_BUSSPEED_DATA
 Configured CAN data speed as Bits per seconds.
#define PCAN_IP_ADDRESS
 Remote address of a LAN channel as string in IPv4 format.
#define PCAN_LAN_SERVICE_STATUS
 Status of the Virtual PCAN-Gateway Service.
#define PCAN_ALLOW_STATUS_FRAMES
 Status messages reception status within a PCAN-Channel.
#define PCAN_ALLOW_RTR_FRAMES
 RTR messages reception status within a PCAN-Channel.
#define PCAN_ALLOW_ERROR_FRAMES
 Error messages reception status within a PCAN-Channel.
#define PCAN_INTERFRAME_DELAY
 Delay, in microseconds, between sending frames.
#define PCAN_ACCEPTANCE_FILTER_11BIT
 Filter over code and mask patterns for 11-Bit messages.
#define PCAN_ACCEPTANCE_FILTER_29BIT
 Filter over code and mask patterns for 29-Bit messages.
#define PCAN_EXT_BTR0BTR1
 UVS: bit-timing register.
#define PCAN_EXT_TX_COUNTER
 UVS: number of transmitted frames.
#define PCAN_EXT_RX_COUNTER
 UVS: number of received frames.
#define PCAN_EXT_ERR_COUNTER
 UVS: number of error frames.
#define PCAN_EXT_RX_QUE_OVERRUN
 UVS: receive queue overrun counter.
#define PCAN_EXT_HARDWARE_VERSION
 UVS: version number of the interface firmware.
#define PCAN_EXT_SOFTWARE_VERSION
 UVS: version number of the driver respectively library.
#define PCAN_EXT_RECEIVE_CALLBACK
 UVS: callback function called on the reception of an URB.
#define PCAN_EXT_LOG_USB
 UVS: Log USB communication (URB buffer <==> CAN messages)
#define PCAN_PARAMETER_OFF
 The PCAN parameter is not set (inactive)
#define PCAN_PARAMETER_ON
 The PCAN parameter is set (active)
#define PCAN_FILTER_CLOSE
 The PCAN filter is closed. No messages will be received.
#define PCAN_FILTER_OPEN
 The PCAN filter is fully opened. All messages will be received.
#define PCAN_FILTER_CUSTOM
 The PCAN filter is custom configured. Only registered messages will be received.
#define PCAN_CHANNEL_UNAVAILABLE
 The PCAN-Channel handle is illegal, or its associated hardware is not available.
#define PCAN_CHANNEL_AVAILABLE
 The PCAN-Channel handle is available to be connected (Plug&Play Hardware: it means furthermore that the hardware is plugged-in)
#define PCAN_CHANNEL_OCCUPIED
 The PCAN-Channel handle is valid, and is already being used.
#define PCAN_CHANNEL_PCANVIEW
 The PCAN-Channel handle is already being used by a PCAN-View application, but is available to connect.
#define LOG_FUNCTION_DEFAULT
 Logs system exceptions / errors.
#define LOG_FUNCTION_ENTRY
 Logs the entries to the PCAN-Basic API functions.
#define LOG_FUNCTION_PARAMETERS
 Logs the parameters passed to the PCAN-Basic API functions.
#define LOG_FUNCTION_LEAVE
 Logs the exits from the PCAN-Basic API functions.
#define LOG_FUNCTION_WRITE
 Logs the CAN messages passed to the CAN_Write function.
#define LOG_FUNCTION_READ
 Logs the CAN messages received within the CAN_Read function.
#define LOG_FUNCTION_ALL
 Logs all possible information within the PCAN-Basic API functions.
#define TRACE_FILE_SINGLE
 A single file is written until it size reaches PAN_TRACE_SIZE.
#define TRACE_FILE_SEGMENTED
 Traced data is distributed in several files with size PAN_TRACE_SIZE.
#define TRACE_FILE_DATE
 Includes the date into the name of the trace file.
#define TRACE_FILE_TIME
 Includes the start time into the name of the trace file.
#define TRACE_FILE_OVERWRITE
 Causes the overwriting of available traces (same name)
#define FEATURE_FD_CAPABLE
 Device supports flexible data-rate (CAN-FD)
#define FEATURE_DELAY_CAPABLE
 Device supports a delay between sending frames (FPGA based USB devices)
#define SERVICE_STATUS_STOPPED
 The service is not running.
#define SERVICE_STATUS_RUNNING
 The service is running.
#define PCAN_MESSAGE_STANDARD
 The PCAN message is a CAN Standard Frame (11-bit identifier)
#define PCAN_MESSAGE_RTR
 The PCAN message is a CAN Remote-Transfer-Request Frame.
#define PCAN_MESSAGE_EXTENDED
 The PCAN message is a CAN Extended Frame (29-bit identifier)
#define PCAN_MESSAGE_FD
 The PCAN message represents a FD frame in terms of CiA Specs.
#define PCAN_MESSAGE_BRS
 The PCAN message represents a FD bit rate switch (CAN data at a higher bit rate)
#define PCAN_MESSAGE_ESI
 The PCAN message represents a FD error state indicator(CAN FD transmitter was error active)
#define PCAN_MESSAGE_STATUS
 The PCAN message represents a PCAN status message.
#define PCAN_MODE_STANDARD
#define PCAN_MODE_EXTENDED
#define PCAN_BAUD_1M
 1 MBit/s
#define PCAN_BAUD_800K
 800 kBit/s
#define PCAN_BAUD_500K
 500 kBit/s
#define PCAN_BAUD_250K
 250 kBit/s
#define PCAN_BAUD_125K
 125 kBit/s
#define PCAN_BAUD_100K
 100 kBit/s
#define PCAN_BAUD_95K
 95,238 kBit/s
#define PCAN_BAUD_83K
 83,333 kBit/s
#define PCAN_BAUD_50K
 50 kBit/s
#define PCAN_BAUD_47K
 47,619 kBit/s
#define PCAN_BAUD_33K
 33,333 kBit/s
#define PCAN_BAUD_20K
 20 kBit/s
#define PCAN_BAUD_10K
 10 kBit/s
#define PCAN_BAUD_5K
 5 kBit/s
#define PCAN_BR_CLOCK
#define PCAN_BR_CLOCK_MHZ
#define PCAN_BR_NOM_BRP
#define PCAN_BR_NOM_TSEG1
#define PCAN_BR_NOM_TSEG2
#define PCAN_BR_NOM_SJW
#define PCAN_BR_NOM_SAMPLE
#define PCAN_BR_DATA_BRP
#define PCAN_BR_DATA_TSEG1
#define PCAN_BR_DATA_TSEG2
#define PCAN_BR_DATA_SJW
#define PCAN_BR_DATA_SAMPLE
#define TPCANHandle
 PCAN hardware channel handle (ATTENTION: changed from BYTE to WORD)
#define TPCANStatus
 PCAN status/error code.
#define TPCANParameter
 PCAN parameter to be read or set.
#define TPCANDevice
 PCAN device.
#define TPCANMessageType
 The type of a PCAN message.
#define TPCANType
 The type of PCAN hardware to be initialized.
#define TPCANMode
 PCAN filter mode.
#define TPCANBaudrate
 PCAN Baud rate register value.
#define TPCANBitrateFD
 PCAN-FD bit rate string.
#define TPCANTimestampFD
 timestamp of a received PCAN FD message

Typedefs

typedef struct tagTPCANMsg TPCANMsg
typedef struct tagTPCANTimestamp TPCANTimestamp
typedef struct tagPCANMsgFD TPCANMsgFD

Functions

TPCANStatus CAN_Initialize (TPCANHandle Channel, TPCANBaudrate Btr0Btr1, TPCANType HwType _DEF_ARG, DWORD IOPort _DEF_ARG, WORD Interrupt _DEF_ARG)
 Initializes a PCAN Channel.
TPCANStatus CAN_InitializeFD (TPCANHandle Channel, TPCANBitrateFD BitrateFD)
 Initializes a FD capable PCAN Channel.
TPCANStatus CAN_Uninitialize (TPCANHandle Channel)
 Uninitializes one or all PCAN Channels initialized by CAN_Initialize.
TPCANStatus CAN_Reset (TPCANHandle Channel)
 Resets the receive and transmit queues of the PCAN Channel.
TPCANStatus CAN_GetStatus (TPCANHandle Channel)
 Gets the current status of a PCAN Channel.
TPCANStatus CAN_Read (TPCANHandle Channel, TPCANMsg *MessageBuffer, TPCANTimestamp *TimestampBuffer)
 Reads a CAN message from the receive queue of a PCAN Channel.
TPCANStatus CAN_ReadFD (TPCANHandle Channel, TPCANMsgFD *MessageBuffer, TPCANTimestampFD *TimestampBuffer)
 Reads a CAN message from the receive queue of a FD capable PCAN Channel.
TPCANStatus CAN_Write (TPCANHandle Channel, TPCANMsg *MessageBuffer)
 Transmits a CAN message.
TPCANStatus CAN_WriteFD (TPCANHandle Channel, TPCANMsgFD *MessageBuffer)
 Transmits a CAN message over a FD capable PCAN Channel.
TPCANStatus CAN_FilterMessages (TPCANHandle Channel, DWORD FromID, DWORD ToID, TPCANMode Mode)
 Configures the reception filter.
TPCANStatus CAN_GetValue (TPCANHandle Channel, TPCANParameter Parameter, void *Buffer, DWORD BufferLength)
 Retrieves a PCAN Channel value.
TPCANStatus CAN_SetValue (TPCANHandle Channel, TPCANParameter Parameter, void *Buffer, DWORD BufferLength)
 Configures or sets a PCAN Channel value.
TPCANStatus CAN_GetErrorText (TPCANStatus Error, WORD Language, LPSTR Buffer)
 Returns a descriptive text of a given TPCANStatus error code, in any desired language.

Define Documentation

#define _DEF_ARG
#define BYTE
#define DWORD

Device supports a delay between sending frames (FPGA based USB devices)

Device supports flexible data-rate (CAN-FD)

Logs all possible information within the PCAN-Basic API functions.

Logs system exceptions / errors.

Logs the entries to the PCAN-Basic API functions.

Logs the exits from the PCAN-Basic API functions.

Logs the parameters passed to the PCAN-Basic API functions.

Logs the CAN messages received within the CAN_Read function.

Logs the CAN messages passed to the CAN_Write function.

#define LPSTR

PCAN-PC Card 5-Volt power parameter.

Filter over code and mask patterns for 11-Bit messages.

Filter over code and mask patterns for 29-Bit messages.

Error messages reception status within a PCAN-Channel.

RTR messages reception status within a PCAN-Channel.

Status messages reception status within a PCAN-Channel.

PCAN-Basic API version parameter.

#define PCAN_BAUD_100K

100 kBit/s

#define PCAN_BAUD_10K

10 kBit/s

#define PCAN_BAUD_125K

125 kBit/s

#define PCAN_BAUD_1M

1 MBit/s

#define PCAN_BAUD_20K

20 kBit/s

#define PCAN_BAUD_250K

250 kBit/s

#define PCAN_BAUD_33K

33,333 kBit/s

#define PCAN_BAUD_47K

47,619 kBit/s

#define PCAN_BAUD_500K

500 kBit/s

#define PCAN_BAUD_50K

50 kBit/s

#define PCAN_BAUD_5K

5 kBit/s

#define PCAN_BAUD_800K

800 kBit/s

#define PCAN_BAUD_83K

83,333 kBit/s

#define PCAN_BAUD_95K

95,238 kBit/s

Using of an existing bit rate (PCAN-View connected to a channel)

Configured bit rate as Btr0Btr1 value.

Configured bit rate as TPCANBitrateFD string.

#define PCAN_BR_CLOCK
#define PCAN_BR_NOM_BRP
#define PCAN_BR_NOM_SJW

PCAN Reset-On-Busoff parameter.

Configured CAN data speed as Bits per seconds.

Configured nominal CAN Bus speed as Bits per seconds.

The PCAN-Channel handle is available to be connected (Plug&Play Hardware: it means furthermore that the hardware is plugged-in)

Availability status of a PCAN-Channel.

Capabilities of a PCAN device (FEATURE_***)

Physical identification of a USB based PCAN-Channel by blinking its associated LED.

The PCAN-Channel handle is valid, and is already being used.

The PCAN-Channel handle is already being used by a PCAN-View application, but is available to connect.

The PCAN-Channel handle is illegal, or its associated hardware is not available.

PCAN device channel version parameter.

CAN-Controller number of a PCAN-Channel.

PCAN-USB device number parameter.

#define PCAN_DNG

PCAN-Dongle.

Mask for all bus errors.

Bus error: an error counter reached the 'heavy' limit.

Bus error: an error counter reached the 'light' limit.

Bus error: the CAN controller is in bus-off state.

Bus error: the CAN controller is error passive.

Bus error: an error counter reached the 'warning' limit.

An operation was successfully carried out, however, irregularities were registered.

Hardware already in use by a Net.

Client handle is invalid.

Invalid data, function, or action.

Mask for all handle errors.

Hardware handle is invalid.

Net handle is invalid.

Invalid operation [Value was changed from 0x80000 to 0x8000000].

Invalid parameter.

Invalid parameter value.

Channel is not initialized [Value was changed from 0x40000 to 0x4000000].

A Client is already connected to the Net.

Driver not loaded.

#define PCAN_ERROR_OK

No error.

CAN controller was read too late.

Receive queue was read too late.

Receive queue is empty.

Transmit queue is full.

Test of the CAN controller hardware registers failed (no hardware found)

Resource (FIFO, Client, timeout) cannot be created.

Unknown error.

Transmit buffer in CAN controller is full.

UVS: bit-timing register.

UVS: number of error frames.

UVS: version number of the interface firmware.

UVS: Log USB communication (URB buffer <==> CAN messages)

UVS: callback function called on the reception of an URB.

UVS: number of received frames.

UVS: receive queue overrun counter.

UVS: version number of the driver respectively library.

UVS: number of transmitted frames.

The PCAN filter is closed. No messages will be received.

The PCAN filter is custom configured. Only registered messages will be received.

The PCAN filter is fully opened. All messages will be received.

PCAN hardware name parameter.

Delay, in microseconds, between sending frames.

#define PCAN_IP_ADDRESS

Remote address of a LAN channel as string in IPv4 format.

#define PCAN_ISA

PCAN-ISA, PCAN-PC/104, and PCAN-PC/104-Plus.

#define PCAN_LAN

PCAN Gateway devices.

Status of the Virtual PCAN-Gateway Service.

PCAN Listen-Only parameter.

Configuration of the debugged information (LOG_FUNCTION_***)

Directory path for log files.

#define PCAN_LOG_STATUS

Debug-Log activation status.

#define PCAN_LOG_TEXT

Custom insertion of text into the log file.

The PCAN message represents a FD bit rate switch (CAN data at a higher bit rate)

The PCAN message represents a FD error state indicator(CAN FD transmitter was error active)

The PCAN message is a CAN Extended Frame (29-bit identifier)

#define PCAN_MESSAGE_FD

The PCAN message represents a FD frame in terms of CiA Specs.

PCAN message filter parameter.

The PCAN message is a CAN Remote-Transfer-Request Frame.

The PCAN message is a CAN Standard Frame (11-bit identifier)

The PCAN message represents a PCAN status message.

#define PCAN_NONE

Undefined, unknown or not selected PCAN device value.

#define PCAN_NONEBUS

Undefined/default value for a PCAN bus.

The PCAN parameter is not set (inactive)

The PCAN parameter is set (active)

#define PCAN_PCC

PCAN-PC Card.

#define PCAN_PCI

PCAN-PCI, PCAN-cPCI, PCAN-miniPCI, and PCAN-PCI Express.

#define PCAN_PEAKCAN

PCAN Non-Plug&Play devices. NOT USED WITHIN PCAN-Basic API.

PCAN receive event handler parameter.

Message reception status of a PCAN-Channel.

Configuration of the trace file storing mode (TRACE_FILE_***)

Directory path for PCAN trace files.

#define PCAN_TRACE_SIZE

Configuration of the maximum file size of a CAN trace.

CAN tracing activation status.

#define PCAN_USB

PCAN-USB and PCAN-USB Pro.

#define PCAN_USBBUS1

PCAN-USB interface, channel 1.

#define PCAN_USBBUS2

PCAN-USB interface, channel 2.

#define PCAN_USBBUS3

PCAN-USB interface, channel 3.

#define PCAN_USBBUS4

PCAN-USB interface, channel 4.

#define PCAN_USBBUS5

PCAN-USB interface, channel 5.

#define PCAN_USBBUS6

PCAN-USB interface, channel 6.

#define PCAN_USBBUS7

PCAN-USB interface, channel 7.

#define PCAN_USBBUS8

PCAN-USB interface, channel 8.

#define PCAN_VIRTUAL

PCAN Virtual hardware. NOT USED WITHIN PCAN-Basic API.

#define QWORD

The service is running.

The service is not running.

#define TPCANBaudrate

PCAN Baud rate register value.

#define TPCANBitrateFD

PCAN-FD bit rate string.

#define TPCANDevice

PCAN device.

#define TPCANHandle

PCAN hardware channel handle (ATTENTION: changed from BYTE to WORD)

The type of a PCAN message.

#define TPCANMode

PCAN filter mode.

#define TPCANParameter

PCAN parameter to be read or set.

#define TPCANStatus

PCAN status/error code.

timestamp of a received PCAN FD message

#define TPCANType

The type of PCAN hardware to be initialized.

#define TRACE_FILE_DATE

Includes the date into the name of the trace file.

Causes the overwriting of available traces (same name)

Traced data is distributed in several files with size PAN_TRACE_SIZE.

A single file is written until it size reaches PAN_TRACE_SIZE.

#define TRACE_FILE_TIME

Includes the start time into the name of the trace file.

#define UINT64
#define WORD

Typedef Documentation

typedef struct tagTPCANMsg TPCANMsg

PCAN message

typedef struct tagPCANMsgFD TPCANMsgFD

PCAN message from a FD capable hardware

Timestamp of a received PCAN message Total Microseconds = micros + 1000 * millis + 0xFFFFFFFF * 1000 * millis_overflow


Function Documentation

TPCANStatus CAN_FilterMessages ( TPCANHandle  Channel,
DWORD  FromID,
DWORD  ToID,
TPCANMode  Mode 
)

Configures the reception filter.

Note:
The message filter will be expanded with every call to this function. If it is desired to reset the filter, please use the CAN_SetValue function.
Parameters:
[in]ChannelThe handle of a PCAN Channel.
[in]FromIDThe lowest CAN ID to be received.
[in]ToIDThe highest CAN ID to be received.
[in]ModeMessage type, Standard (11-bit identifier) or Extended (29-bit identifier).
Returns:
A TPCANStatus error code.
TPCANStatus CAN_GetErrorText ( TPCANStatus  Error,
WORD  Language,
LPSTR  Buffer 
)

Returns a descriptive text of a given TPCANStatus error code, in any desired language.

Note:
The current languages available for translation are: Neutral (0x00), German (0x07), English (0x09), Spanish (0x0A), Italian (0x10) and French (0x0C).
Parameters:
[in]ErrorA TPCANStatus error code.
[in]LanguageIndicates a 'Primary language ID'.
[out]BufferBuffer for a null terminated char array.
Returns:
A TPCANStatus error code.

Gets the current status of a PCAN Channel.

Parameters:
[in]ChannelThe handle of a PCAN Channel.
Returns:
A TPCANStatus error code.
TPCANStatus CAN_GetValue ( TPCANHandle  Channel,
TPCANParameter  Parameter,
void *  Buffer,
DWORD  BufferLength 
)

Retrieves a PCAN Channel value.

Note:
Parameters can be present or not according with the kind of Hardware (PCAN Channel) being used. If a parameter is not available, a PCAN_ERROR_ILLPARAMTYPE error will be returned.
Parameters:
[in]ChannelThe handle of a PCAN Channel.
[in]ParameterThe TPCANParameter parameter to get.
[out]BufferBuffer for the parameter value.
[in]BufferLengthSize in bytes of the buffer.
Returns:
A TPCANStatus error code.
TPCANStatus CAN_Initialize ( TPCANHandle  Channel,
TPCANBaudrate  Btr0Btr1,
TPCANType HwType  _DEF_ARG,
DWORD IOPort  _DEF_ARG,
WORD Interrupt  _DEF_ARG 
)

Initializes a PCAN Channel.

Parameters:
[in]ChannelThe handle of a PCAN Channel.
[in]Btr0Btr1The speed for the communication (BTR0BTR1 code).
[in]HwType(not used with PCAN USB devices)
[in]IOPort(not used with PCAN USB devices)
[in]Interrupt(not used with PCAN USB devices)
Returns:
A TPCANStatus error code.

Initializes a FD capable PCAN Channel.

Parameters:
[in]ChannelThe handle of a FD capable PCAN Channel.
[in]BitrateFDThe speed for the communication (FD bit rate string).
Note:
See PCAN_BR_* values
  • Parameter and values must be separated by '='.
  • Couples of Parameter/value must be separated by ','.
  • Following Parameter must be filled out: f_clock, data_brp, data_sjw, data_tseg1, data_tseg2, nom_brp, nom_sjw, nom_tseg1, nom_tseg2.
  • Following Parameters are optional (not used yet): data_ssp_offset, nom_sam.
Example:
 *               f_clock=80000000,nom_brp=10,nom_tseg1=5,nom_tseg2=2,nom_sjw=1,data_brp=4,data_tseg1=7,data_tseg2=2,data_sjw=1
 *  
Returns:
A TPCANStatus error code.
TPCANStatus CAN_Read ( TPCANHandle  Channel,
TPCANMsg MessageBuffer,
TPCANTimestamp TimestampBuffer 
)

Reads a CAN message from the receive queue of a PCAN Channel.

Parameters:
[in]ChannelThe handle of a PCAN Channel.
[out]MessageBufferA TPCANMsg structure buffer to store the CAN message.
[out]TimestampBufferA TPCANTimestamp structure buffer to get the reception time of the message. If this value is not desired, this parameter should be passed as NULL.
Returns:
A TPCANStatus error code.
TPCANStatus CAN_ReadFD ( TPCANHandle  Channel,
TPCANMsgFD MessageBuffer,
TPCANTimestampFD TimestampBuffer 
)

Reads a CAN message from the receive queue of a FD capable PCAN Channel.

Parameters:
[in]ChannelThe handle of a FD capable PCAN Channel.
[out]MessageBufferA TPCANMsgFD structure buffer to store the CAN message.
[out]TimestampBufferA TPCANTimestampFD buffer to get the reception time of the message. If this value is not desired, this parameter should be passed as NULL.
Returns:
A TPCANStatus error code.

Resets the receive and transmit queues of the PCAN Channel.

Note:
A reset of the CAN controller is not performed.
Parameters:
[in]ChannelThe handle of a PCAN Channel.
Returns:
A TPCANStatus error code.
TPCANStatus CAN_SetValue ( TPCANHandle  Channel,
TPCANParameter  Parameter,
void *  Buffer,
DWORD  BufferLength 
)

Configures or sets a PCAN Channel value.

Note:
Parameters can be present or not according with the kind of Hardware (PCAN Channel) being used. If a parameter is not available, a PCAN_ERROR_ILLPARAMTYPE error will be returned.
Parameters:
[in]ChannelThe handle of a PCAN Channel.
[in]ParameterThe TPCANParameter parameter to set.
[in]BufferBuffer with the value to be set.
[in]BufferLengthSize in bytes of the buffer.
Returns:
A TPCANStatus error code.

Uninitializes one or all PCAN Channels initialized by CAN_Initialize.

Note:
Giving the TPCANHandle value "PCAN_NONEBUS" uninitializes all initialized channels.
Parameters:
[in]ChannelThe handle of a PCAN Channel.
Returns:
A TPCANStatus error code.
TPCANStatus CAN_Write ( TPCANHandle  Channel,
TPCANMsg MessageBuffer 
)

Transmits a CAN message.

Parameters:
[in]ChannelThe handle of a PCAN Channel.
[in]MessageBufferA TPCANMsg buffer with the message to be sent.
Returns:
A TPCANStatus error code.
TPCANStatus CAN_WriteFD ( TPCANHandle  Channel,
TPCANMsgFD MessageBuffer 
)

Transmits a CAN message over a FD capable PCAN Channel.

Parameters:
[in]ChannelThe handle of a FD capable PCAN Channel.
[in]MessageBufferA TPCANMsgFD buffer with the message to be sent.
Returns:
A TPCANStatus error code.