libPCBUSB  Version 0.13, Build 1978 of July 28, 2024
macOS Library for PCAN-USB Interfaces
PCBUSB.h File Reference

Go to the source code of this file.

Data Structures

struct  tagTPCANMsg
 
struct  tagTPCANTimestamp
 
struct  tagTPCANMsgFD
 
struct  tagTPCANChannelInformation
 

Macros

#define PCAN_NONEBUS
 Undefined/default value for a PCAN bus. More...
 
#define PCAN_USBBUS1
 PCAN-USB interface, channel 1. More...
 
#define PCAN_USBBUS2
 PCAN-USB interface, channel 2. More...
 
#define PCAN_USBBUS3
 PCAN-USB interface, channel 3. More...
 
#define PCAN_USBBUS4
 PCAN-USB interface, channel 4. More...
 
#define PCAN_USBBUS5
 PCAN-USB interface, channel 5. More...
 
#define PCAN_USBBUS6
 PCAN-USB interface, channel 6. More...
 
#define PCAN_USBBUS7
 PCAN-USB interface, channel 7. More...
 
#define PCAN_USBBUS8
 PCAN-USB interface, channel 8. More...
 
#define PCAN_USBBUS9
 PCAN-USB interface, channel 9. More...
 
#define PCAN_USBBUS10
 PCAN-USB interface, channel 10. More...
 
#define PCAN_USBBUS11
 PCAN-USB interface, channel 11. More...
 
#define PCAN_USBBUS12
 PCAN-USB interface, channel 12. More...
 
#define PCAN_USBBUS13
 PCAN-USB interface, channel 13. More...
 
#define PCAN_USBBUS14
 PCAN-USB interface, channel 14. More...
 
#define PCAN_USBBUS15
 PCAN-USB interface, channel 15. More...
 
#define PCAN_USBBUS16
 PCAN-USB interface, channel 16. More...
 
#define PCAN_ERROR_OK
 No error. More...
 
#define PCAN_ERROR_XMTFULL
 Transmit buffer in CAN controller is full. More...
 
#define PCAN_ERROR_OVERRUN
 CAN controller was read too late. More...
 
#define PCAN_ERROR_BUSLIGHT
 Bus error: an error counter reached the 'light' limit. More...
 
#define PCAN_ERROR_BUSHEAVY
 Bus error: an error counter reached the 'heavy' limit. More...
 
#define PCAN_ERROR_BUSWARNING
 Bus error: an error counter reached the 'warning' limit. More...
 
#define PCAN_ERROR_BUSPASSIVE
 Bus error: the CAN controller is error passive. More...
 
#define PCAN_ERROR_BUSOFF
 Bus error: the CAN controller is in bus-off state. More...
 
#define PCAN_ERROR_ANYBUSERR
 Mask for all bus errors. More...
 
#define PCAN_ERROR_QRCVEMPTY
 Receive queue is empty. More...
 
#define PCAN_ERROR_QOVERRUN
 Receive queue was read too late. More...
 
#define PCAN_ERROR_QXMTFULL
 Transmit queue is full. More...
 
#define PCAN_ERROR_REGTEST
 Test of the CAN controller hardware registers failed (no hardware found) More...
 
#define PCAN_ERROR_NODRIVER
 Driver not loaded. More...
 
#define PCAN_ERROR_HWINUSE
 Hardware already in use by a Net. More...
 
#define PCAN_ERROR_NETINUSE
 A Client is already connected to the Net. More...
 
#define PCAN_ERROR_ILLHW
 Hardware handle is invalid. More...
 
#define PCAN_ERROR_ILLNET
 Net handle is invalid. More...
 
#define PCAN_ERROR_ILLCLIENT
 Client handle is invalid. More...
 
#define PCAN_ERROR_ILLHANDLE
 Mask for all handle errors. More...
 
#define PCAN_ERROR_RESOURCE
 Resource (FIFO, Client, timeout) cannot be created. More...
 
#define PCAN_ERROR_ILLPARAMTYPE
 Invalid parameter. More...
 
#define PCAN_ERROR_ILLPARAMVAL
 Invalid parameter value. More...
 
#define PCAN_ERROR_UNKNOWN
 Unknown error. More...
 
#define PCAN_ERROR_ILLDATA
 Invalid data, function, or action. More...
 
#define PCAN_ERROR_ILLMODE
 Driver object state is wrong for the attempted operation. More...
 
#define PCAN_ERROR_CAUTION
 An operation was successfully carried out, however, irregularities were registered. More...
 
#define PCAN_ERROR_INITIALIZE
 Channel is not initialized [Value was changed from 0x40000 to 0x4000000]. More...
 
#define PCAN_ERROR_ILLOPERATION
 Invalid operation [Value was changed from 0x80000 to 0x8000000]. More...
 
#define PCAN_NONE
 Undefined, unknown or not selected PCAN device value. More...
 
#define PCAN_PEAKCAN
 PCAN Non-PnP devices. NOT USED WITHIN PCAN-Basic API. More...
 
#define PCAN_ISA
 PCAN-ISA, PCAN-PC/104, and PCAN-PC/104-Plus. More...
 
#define PCAN_DNG
 PCAN-Dongle. More...
 
#define PCAN_PCI
 PCAN-PCI, PCAN-cPCI, PCAN-miniPCI, and PCAN-PCI Express. More...
 
#define PCAN_USB
 PCAN-USB and PCAN-USB Pro. More...
 
#define PCAN_PCC
 PCAN-PC Card. More...
 
#define PCAN_VIRTUAL
 PCAN Virtual hardware. NOT USED WITHIN PCAN-Basic API. More...
 
#define PCAN_LAN
 PCAN Gateway devices. More...
 
#define PCAN_DEVICE_ID
 Device identifier parameter. More...
 
#define PCAN_5VOLTS_POWER
 5-Volt power parameter More...
 
#define PCAN_RECEIVE_EVENT
 PCAN receive event handler parameter. More...
 
#define PCAN_MESSAGE_FILTER
 PCAN message filter parameter. More...
 
#define PCAN_API_VERSION
 PCAN-Basic API version parameter. More...
 
#define PCAN_CHANNEL_VERSION
 PCAN device channel version parameter. More...
 
#define PCAN_BUSOFF_AUTORESET
 PCAN Reset-On-Busoff parameter. More...
 
#define PCAN_LISTEN_ONLY
 PCAN Listen-Only parameter. More...
 
#define PCAN_LOG_LOCATION
 Directory path for log files. More...
 
#define PCAN_LOG_STATUS
 Debug-Log activation status. More...
 
#define PCAN_LOG_CONFIGURE
 Configuration of the debugged information (LOG_FUNCTION_***) More...
 
#define PCAN_LOG_TEXT
 Custom insertion of text into the log file. More...
 
#define PCAN_CHANNEL_CONDITION
 Availability status of a PCAN-Channel. More...
 
#define PCAN_HARDWARE_NAME
 PCAN hardware name parameter. More...
 
#define PCAN_RECEIVE_STATUS
 Message reception status of a PCAN-Channel. More...
 
#define PCAN_CONTROLLER_NUMBER
 CAN-Controller number of a PCAN-Channel. More...
 
#define PCAN_TRACE_LOCATION
 Directory path for PCAN trace files. More...
 
#define PCAN_TRACE_STATUS
 CAN tracing activation status. More...
 
#define PCAN_TRACE_SIZE
 Configuration of the maximum file size of a CAN trace. More...
 
#define PCAN_TRACE_CONFIGURE
 Configuration of the trace file storing mode (TRACE_FILE_***) More...
 
#define PCAN_CHANNEL_IDENTIFYING
 Physical identification of a USB based PCAN-Channel by blinking its associated LED. More...
 
#define PCAN_CHANNEL_FEATURES
 Capabilities of a PCAN device (FEATURE_***) More...
 
#define PCAN_BITRATE_ADAPTING
 Using of an existing bit rate (PCAN-View connected to a channel) More...
 
#define PCAN_BITRATE_INFO
 Configured bit rate as Btr0Btr1 value. More...
 
#define PCAN_BITRATE_INFO_FD
 Configured bit rate as TPCANBitrateFD string. More...
 
#define PCAN_BUSSPEED_NOMINAL
 Configured nominal CAN Bus speed as Bits per seconds. More...
 
#define PCAN_BUSSPEED_DATA
 Configured CAN data speed as Bits per seconds. More...
 
#define PCAN_IP_ADDRESS
 Remote address of a LAN channel as string in IPv4 format. More...
 
#define PCAN_LAN_SERVICE_STATUS
 Status of the Virtual PCAN-Gateway Service. More...
 
#define PCAN_ALLOW_STATUS_FRAMES
 Status messages reception status within a PCAN-Channel. More...
 
#define PCAN_ALLOW_RTR_FRAMES
 RTR messages reception status within a PCAN-Channel. More...
 
#define PCAN_ALLOW_ERROR_FRAMES
 Error messages reception status within a PCAN-Channel. More...
 
#define PCAN_INTERFRAME_DELAY
 Delay, in microseconds, between sending frames. More...
 
#define PCAN_ACCEPTANCE_FILTER_11BIT
 Filter over code and mask patterns for 11-Bit messages. More...
 
#define PCAN_ACCEPTANCE_FILTER_29BIT
 Filter over code and mask patterns for 29-Bit messages. More...
 
#define PCAN_IO_DIGITAL_CONFIGURATION
 Output mode of 32 digital I/O pin of a PCAN-USB Chip. 1: Output-Active 0 : Output Inactive. More...
 
#define PCAN_IO_DIGITAL_VALUE
 Value assigned to a 32 digital I/O pins of a PCAN-USB Chip. More...
 
#define PCAN_IO_DIGITAL_SET
 Value assigned to a 32 digital I/O pins of a PCAN-USB Chip - Multiple digital I/O pins to 1 = High. More...
 
#define PCAN_IO_DIGITAL_CLEAR
 Clear multiple digital I/O pins to 0. More...
 
#define PCAN_IO_ANALOG_VALUE
 Get value of a single analog input pin. More...
 
#define PCAN_FIRMWARE_VERSION
 Get the version of the firmware used by the device associated with a PCAN-Channel. More...
 
#define PCAN_ATTACHED_CHANNELS_COUNT
 Get the amount of PCAN channels attached to a system. More...
 
#define PCAN_ATTACHED_CHANNELS
 Get information about PCAN channels attached to a system. More...
 
#define PCAN_ALLOW_ECHO_FRAMES
 Echo messages reception status within a PCAN-Channel. More...
 
#define PCAN_DEVICE_PART_NUMBER
 Get the part number associated to a device. More...
 
#define PCAN_HARD_RESET_STATUS
 Activation status of hard reset processing via CAN_Reset calls. More...
 
#define PCAN_LAN_CHANNEL_DIRECTION
 Communication direction of a PCAN-Channel representing a PCAN-LAN interface. More...
 
#define PCAN_EXT_BTR0BTR1
 UVS: bit-timing register. More...
 
#define PCAN_EXT_TX_COUNTER
 UVS: number of transmitted frames. More...
 
#define PCAN_EXT_RX_COUNTER
 UVS: number of received frames. More...
 
#define PCAN_EXT_ERR_COUNTER
 UVS: number of error frames. More...
 
#define PCAN_EXT_RX_QUE_OVERRUN
 UVS: receive queue overrun counter. More...
 
#define PCAN_EXT_HARDWARE_VERSION
 UVS: version number of the interface firmware. More...
 
#define PCAN_EXT_SOFTWARE_VERSION
 UVS: version number of the driver respectively library. More...
 
#define PCAN_EXT_RECEIVE_CALLBACK
 UVS: callback function called on the reception of an URB. More...
 
#define PCAN_EXT_LOG_USB
 UVS: Log USB communication (URB buffer <==> CAN messages) More...
 
#define PCAN_DEVICE_NUMBER
 Deprecated parameter. Use PCAN_DEVICE_ID instead. More...
 
#define PCAN_PARAMETER_OFF
 The PCAN parameter is not set (inactive) More...
 
#define PCAN_PARAMETER_ON
 The PCAN parameter is set (active) More...
 
#define PCAN_FILTER_CLOSE
 The PCAN filter is closed. No messages will be received. More...
 
#define PCAN_FILTER_OPEN
 The PCAN filter is fully opened. All messages will be received. More...
 
#define PCAN_FILTER_CUSTOM
 The PCAN filter is custom configured. Only registered messages will be received. More...
 
#define PCAN_CHANNEL_UNAVAILABLE
 The PCAN-Channel handle is illegal, or its associated hardware is not available. More...
 
#define PCAN_CHANNEL_AVAILABLE
 The PCAN-Channel handle is available to be connected (PnP Hardware: it means furthermore that the hardware is plugged-in) More...
 
#define PCAN_CHANNEL_OCCUPIED
 The PCAN-Channel handle is valid, and is already being used. More...
 
#define PCAN_CHANNEL_PCANVIEW
 The PCAN-Channel handle is already being used by a PCAN-View application, but is available to connect. More...
 
#define LOG_FUNCTION_DEFAULT
 Logs system exceptions / errors. More...
 
#define LOG_FUNCTION_ENTRY
 Logs the entries to the PCAN-Basic API functions. More...
 
#define LOG_FUNCTION_PARAMETERS
 Logs the parameters passed to the PCAN-Basic API functions. More...
 
#define LOG_FUNCTION_LEAVE
 Logs the exits from the PCAN-Basic API functions. More...
 
#define LOG_FUNCTION_WRITE
 Logs the CAN messages passed to the CAN_Write function. More...
 
#define LOG_FUNCTION_READ
 Logs the CAN messages received within the CAN_Read function. More...
 
#define LOG_FUNCTION_ALL
 Logs all possible information within the PCAN-Basic API functions. More...
 
#define TRACE_FILE_SINGLE
 A single file is written until it size reaches PAN_TRACE_SIZE. More...
 
#define TRACE_FILE_SEGMENTED
 Traced data is distributed in several files with size PAN_TRACE_SIZE. More...
 
#define TRACE_FILE_DATE
 Includes the date into the name of the trace file. More...
 
#define TRACE_FILE_TIME
 Includes the start time into the name of the trace file. More...
 
#define TRACE_FILE_OVERWRITE
 Causes the overwriting of available traces (same name) More...
 
#define TRACE_FILE_DATA_LENGTH
 Causes using the data length column ('l') instead of the DLC column ('L') in the trace file. More...
 
#define FEATURE_FD_CAPABLE
 Device supports flexible data-rate (CAN-FD) More...
 
#define FEATURE_DELAY_CAPABLE
 Device supports a delay between sending frames (FPGA based USB devices) More...
 
#define FEATURE_IO_CAPABLE
 Device supports I/O functionality for electronic circuits (USB-Chip devices) More...
 
#define SERVICE_STATUS_STOPPED
 The service is not running. More...
 
#define SERVICE_STATUS_RUNNING
 The service is running. More...
 
#define LAN_DIRECTION_READ
 The PCAN-Channel is limited to incoming communication only. More...
 
#define LAN_DIRECTION_WRITE
 The PCAN-Channel is limited to outgoing communication only. More...
 
#define LAN_DIRECTION_READ_WRITE
 
#define MAX_LENGTH_HARDWARE_NAME
 Maximum length of the name of a device: 32 characters + terminator. More...
 
#define MAX_LENGTH_VERSION_STRING
 Maximum length of a version string: 255 characters + terminator. More...
 
#define PCAN_MESSAGE_STANDARD
 The PCAN message is a CAN Standard Frame (11-bit identifier) More...
 
#define PCAN_MESSAGE_RTR
 The PCAN message is a CAN Remote-Transfer-Request Frame. More...
 
#define PCAN_MESSAGE_EXTENDED
 The PCAN message is a CAN Extended Frame (29-bit identifier) More...
 
#define PCAN_MESSAGE_FD
 The PCAN message represents a FD frame in terms of CiA Specs. More...
 
#define PCAN_MESSAGE_BRS
 The PCAN message represents a FD bit rate switch (CAN data at a higher bit rate) More...
 
#define PCAN_MESSAGE_ESI
 The PCAN message represents a FD error state indicator(CAN FD transmitter was error active) More...
 
#define PCAN_MESSAGE_ECHO
 The PCAN message represents an echo CAN Frame. More...
 
#define PCAN_MESSAGE_ERRFRAME
 The PCAN message represents an error frame. More...
 
#define PCAN_MESSAGE_STATUS
 The PCAN message represents a PCAN status message. More...
 
#define LOOKUP_DEVICE_TYPE
 Lookup channel by Device type (see PCAN devices e.g. PCAN_USB) More...
 
#define LOOKUP_DEVICE_ID
 Lookup channel by device id. More...
 
#define LOOKUP_CONTROLLER_NUMBER
 Lookup channel by CAN controller 0-based index. More...
 
#define LOOKUP_IP_ADDRESS
 Lookup channel by IP address (LAN channels only) More...
 
#define PCAN_MODE_STANDARD
 
#define PCAN_MODE_EXTENDED
 
#define PCAN_BAUD_1M
 1 MBit/s More...
 
#define PCAN_BAUD_800K
 800 kBit/s More...
 
#define PCAN_BAUD_500K
 500 kBit/s More...
 
#define PCAN_BAUD_250K
 250 kBit/s More...
 
#define PCAN_BAUD_125K
 125 kBit/s More...
 
#define PCAN_BAUD_100K
 100 kBit/s More...
 
#define PCAN_BAUD_95K
 95,238 kBit/s More...
 
#define PCAN_BAUD_83K
 83,333 kBit/s More...
 
#define PCAN_BAUD_50K
 50 kBit/s More...
 
#define PCAN_BAUD_47K
 47,619 kBit/s More...
 
#define PCAN_BAUD_33K
 33,333 kBit/s More...
 
#define PCAN_BAUD_20K
 20 kBit/s More...
 
#define PCAN_BAUD_10K
 10 kBit/s More...
 
#define PCAN_BAUD_5K
 5 kBit/s More...
 
#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
 Represents a PCAN hardware channel handle. More...
 
#define TPCANStatus
 Represents a PCAN status/error code (ATTENTION: changed from 64-bit to 32-bit) More...
 
#define TPCANParameter
 Represents a PCAN parameter to be read or set. More...
 
#define TPCANDevice
 Represents a PCAN device. More...
 
#define TPCANMessageType
 Represents the type of a PCAN message. More...
 
#define TPCANType
 Represents the type of PCAN hardware to be initialized. More...
 
#define TPCANMode
 Represents a PCAN filter mode. More...
 
#define TPCANBaudrate
 Represents a PCAN Baud rate register value. More...
 
#define TPCANBitrateFD
 Represents a PCAN-FD bit rate string. More...
 
#define TPCANTimestampFD
 Represents a timestamp of a received PCAN FD message. More...
 
#define _DEF_ARG
 

Typedefs

typedef struct tagTPCANMsg TPCANMsg
 
typedef struct tagTPCANTimestamp TPCANTimestamp
 
typedef struct tagTPCANMsgFD TPCANMsgFD
 
typedef struct tagTPCANChannelInformation TPCANChannelInformation
 

Functions

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

Macro Definition Documentation

◆ _DEF_ARG

#define _DEF_ARG

◆ FEATURE_DELAY_CAPABLE

#define FEATURE_DELAY_CAPABLE

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

◆ FEATURE_FD_CAPABLE

#define FEATURE_FD_CAPABLE

Device supports flexible data-rate (CAN-FD)

◆ FEATURE_IO_CAPABLE

#define FEATURE_IO_CAPABLE

Device supports I/O functionality for electronic circuits (USB-Chip devices)

◆ LAN_DIRECTION_READ

#define LAN_DIRECTION_READ

The PCAN-Channel is limited to incoming communication only.

◆ LAN_DIRECTION_READ_WRITE

#define LAN_DIRECTION_READ_WRITE

◆ LAN_DIRECTION_WRITE

#define LAN_DIRECTION_WRITE

The PCAN-Channel is limited to outgoing communication only.

◆ LOG_FUNCTION_ALL

#define LOG_FUNCTION_ALL

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

◆ LOG_FUNCTION_DEFAULT

#define LOG_FUNCTION_DEFAULT

Logs system exceptions / errors.

◆ LOG_FUNCTION_ENTRY

#define LOG_FUNCTION_ENTRY

Logs the entries to the PCAN-Basic API functions.

◆ LOG_FUNCTION_LEAVE

#define LOG_FUNCTION_LEAVE

Logs the exits from the PCAN-Basic API functions.

◆ LOG_FUNCTION_PARAMETERS

#define LOG_FUNCTION_PARAMETERS

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

◆ LOG_FUNCTION_READ

#define LOG_FUNCTION_READ

Logs the CAN messages received within the CAN_Read function.

◆ LOG_FUNCTION_WRITE

#define LOG_FUNCTION_WRITE

Logs the CAN messages passed to the CAN_Write function.

◆ LOOKUP_CONTROLLER_NUMBER

#define LOOKUP_CONTROLLER_NUMBER

Lookup channel by CAN controller 0-based index.

◆ LOOKUP_DEVICE_ID

#define LOOKUP_DEVICE_ID

Lookup channel by device id.

◆ LOOKUP_DEVICE_TYPE

#define LOOKUP_DEVICE_TYPE

Lookup channel by Device type (see PCAN devices e.g. PCAN_USB)

◆ LOOKUP_IP_ADDRESS

#define LOOKUP_IP_ADDRESS

Lookup channel by IP address (LAN channels only)

◆ MAX_LENGTH_HARDWARE_NAME

#define MAX_LENGTH_HARDWARE_NAME

Maximum length of the name of a device: 32 characters + terminator.

◆ MAX_LENGTH_VERSION_STRING

#define MAX_LENGTH_VERSION_STRING

Maximum length of a version string: 255 characters + terminator.

◆ PCAN_5VOLTS_POWER

#define PCAN_5VOLTS_POWER

5-Volt power parameter

◆ PCAN_ACCEPTANCE_FILTER_11BIT

#define PCAN_ACCEPTANCE_FILTER_11BIT

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

◆ PCAN_ACCEPTANCE_FILTER_29BIT

#define PCAN_ACCEPTANCE_FILTER_29BIT

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

◆ PCAN_ALLOW_ECHO_FRAMES

#define PCAN_ALLOW_ECHO_FRAMES

Echo messages reception status within a PCAN-Channel.

◆ PCAN_ALLOW_ERROR_FRAMES

#define PCAN_ALLOW_ERROR_FRAMES

Error messages reception status within a PCAN-Channel.

◆ PCAN_ALLOW_RTR_FRAMES

#define PCAN_ALLOW_RTR_FRAMES

RTR messages reception status within a PCAN-Channel.

◆ PCAN_ALLOW_STATUS_FRAMES

#define PCAN_ALLOW_STATUS_FRAMES

Status messages reception status within a PCAN-Channel.

◆ PCAN_API_VERSION

#define PCAN_API_VERSION

PCAN-Basic API version parameter.

◆ PCAN_ATTACHED_CHANNELS

#define PCAN_ATTACHED_CHANNELS

Get information about PCAN channels attached to a system.

◆ PCAN_ATTACHED_CHANNELS_COUNT

#define PCAN_ATTACHED_CHANNELS_COUNT

Get the amount of PCAN channels attached to a system.

◆ PCAN_BAUD_100K

#define PCAN_BAUD_100K

100 kBit/s

◆ PCAN_BAUD_10K

#define PCAN_BAUD_10K

10 kBit/s

◆ PCAN_BAUD_125K

#define PCAN_BAUD_125K

125 kBit/s

◆ PCAN_BAUD_1M

#define PCAN_BAUD_1M

1 MBit/s

◆ PCAN_BAUD_20K

#define PCAN_BAUD_20K

20 kBit/s

◆ PCAN_BAUD_250K

#define PCAN_BAUD_250K

250 kBit/s

◆ PCAN_BAUD_33K

#define PCAN_BAUD_33K

33,333 kBit/s

◆ PCAN_BAUD_47K

#define PCAN_BAUD_47K

47,619 kBit/s

◆ PCAN_BAUD_500K

#define PCAN_BAUD_500K

500 kBit/s

◆ PCAN_BAUD_50K

#define PCAN_BAUD_50K

50 kBit/s

◆ PCAN_BAUD_5K

#define PCAN_BAUD_5K

5 kBit/s

◆ PCAN_BAUD_800K

#define PCAN_BAUD_800K

800 kBit/s

◆ PCAN_BAUD_83K

#define PCAN_BAUD_83K

83,333 kBit/s

◆ PCAN_BAUD_95K

#define PCAN_BAUD_95K

95,238 kBit/s

◆ PCAN_BITRATE_ADAPTING

#define PCAN_BITRATE_ADAPTING

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

◆ PCAN_BITRATE_INFO

#define PCAN_BITRATE_INFO

Configured bit rate as Btr0Btr1 value.

◆ PCAN_BITRATE_INFO_FD

#define PCAN_BITRATE_INFO_FD

Configured bit rate as TPCANBitrateFD string.

◆ PCAN_BR_CLOCK

#define PCAN_BR_CLOCK

◆ PCAN_BR_CLOCK_MHZ

#define PCAN_BR_CLOCK_MHZ

◆ PCAN_BR_DATA_BRP

#define PCAN_BR_DATA_BRP

◆ PCAN_BR_DATA_SAMPLE

#define PCAN_BR_DATA_SAMPLE

◆ PCAN_BR_DATA_SJW

#define PCAN_BR_DATA_SJW

◆ PCAN_BR_DATA_TSEG1

#define PCAN_BR_DATA_TSEG1

◆ PCAN_BR_DATA_TSEG2

#define PCAN_BR_DATA_TSEG2

◆ PCAN_BR_NOM_BRP

#define PCAN_BR_NOM_BRP

◆ PCAN_BR_NOM_SAMPLE

#define PCAN_BR_NOM_SAMPLE

◆ PCAN_BR_NOM_SJW

#define PCAN_BR_NOM_SJW

◆ PCAN_BR_NOM_TSEG1

#define PCAN_BR_NOM_TSEG1

◆ PCAN_BR_NOM_TSEG2

#define PCAN_BR_NOM_TSEG2

◆ PCAN_BUSOFF_AUTORESET

#define PCAN_BUSOFF_AUTORESET

PCAN Reset-On-Busoff parameter.

◆ PCAN_BUSSPEED_DATA

#define PCAN_BUSSPEED_DATA

Configured CAN data speed as Bits per seconds.

◆ PCAN_BUSSPEED_NOMINAL

#define PCAN_BUSSPEED_NOMINAL

Configured nominal CAN Bus speed as Bits per seconds.

◆ PCAN_CHANNEL_AVAILABLE

#define PCAN_CHANNEL_AVAILABLE

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

◆ PCAN_CHANNEL_CONDITION

#define PCAN_CHANNEL_CONDITION

Availability status of a PCAN-Channel.

◆ PCAN_CHANNEL_FEATURES

#define PCAN_CHANNEL_FEATURES

Capabilities of a PCAN device (FEATURE_***)

◆ PCAN_CHANNEL_IDENTIFYING

#define PCAN_CHANNEL_IDENTIFYING

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

◆ PCAN_CHANNEL_OCCUPIED

#define PCAN_CHANNEL_OCCUPIED

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

◆ PCAN_CHANNEL_PCANVIEW

#define PCAN_CHANNEL_PCANVIEW

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

◆ PCAN_CHANNEL_UNAVAILABLE

#define PCAN_CHANNEL_UNAVAILABLE

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

◆ PCAN_CHANNEL_VERSION

#define PCAN_CHANNEL_VERSION

PCAN device channel version parameter.

◆ PCAN_CONTROLLER_NUMBER

#define PCAN_CONTROLLER_NUMBER

CAN-Controller number of a PCAN-Channel.

◆ PCAN_DEVICE_ID

#define PCAN_DEVICE_ID

Device identifier parameter.

◆ PCAN_DEVICE_NUMBER

#define PCAN_DEVICE_NUMBER

Deprecated parameter. Use PCAN_DEVICE_ID instead.

◆ PCAN_DEVICE_PART_NUMBER

#define PCAN_DEVICE_PART_NUMBER

Get the part number associated to a device.

◆ PCAN_DNG

#define PCAN_DNG

PCAN-Dongle.

◆ PCAN_ERROR_ANYBUSERR

#define PCAN_ERROR_ANYBUSERR

Mask for all bus errors.

◆ PCAN_ERROR_BUSHEAVY

#define PCAN_ERROR_BUSHEAVY

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

◆ PCAN_ERROR_BUSLIGHT

#define PCAN_ERROR_BUSLIGHT

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

◆ PCAN_ERROR_BUSOFF

#define PCAN_ERROR_BUSOFF

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

◆ PCAN_ERROR_BUSPASSIVE

#define PCAN_ERROR_BUSPASSIVE

Bus error: the CAN controller is error passive.

◆ PCAN_ERROR_BUSWARNING

#define PCAN_ERROR_BUSWARNING

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

◆ PCAN_ERROR_CAUTION

#define PCAN_ERROR_CAUTION

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

◆ PCAN_ERROR_HWINUSE

#define PCAN_ERROR_HWINUSE

Hardware already in use by a Net.

◆ PCAN_ERROR_ILLCLIENT

#define PCAN_ERROR_ILLCLIENT

Client handle is invalid.

◆ PCAN_ERROR_ILLDATA

#define PCAN_ERROR_ILLDATA

Invalid data, function, or action.

◆ PCAN_ERROR_ILLHANDLE

#define PCAN_ERROR_ILLHANDLE

Mask for all handle errors.

◆ PCAN_ERROR_ILLHW

#define PCAN_ERROR_ILLHW

Hardware handle is invalid.

◆ PCAN_ERROR_ILLMODE

#define PCAN_ERROR_ILLMODE

Driver object state is wrong for the attempted operation.

◆ PCAN_ERROR_ILLNET

#define PCAN_ERROR_ILLNET

Net handle is invalid.

◆ PCAN_ERROR_ILLOPERATION

#define PCAN_ERROR_ILLOPERATION

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

◆ PCAN_ERROR_ILLPARAMTYPE

#define PCAN_ERROR_ILLPARAMTYPE

Invalid parameter.

◆ PCAN_ERROR_ILLPARAMVAL

#define PCAN_ERROR_ILLPARAMVAL

Invalid parameter value.

◆ PCAN_ERROR_INITIALIZE

#define PCAN_ERROR_INITIALIZE

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

◆ PCAN_ERROR_NETINUSE

#define PCAN_ERROR_NETINUSE

A Client is already connected to the Net.

◆ PCAN_ERROR_NODRIVER

#define PCAN_ERROR_NODRIVER

Driver not loaded.

◆ PCAN_ERROR_OK

#define PCAN_ERROR_OK

No error.

◆ PCAN_ERROR_OVERRUN

#define PCAN_ERROR_OVERRUN

CAN controller was read too late.

◆ PCAN_ERROR_QOVERRUN

#define PCAN_ERROR_QOVERRUN

Receive queue was read too late.

◆ PCAN_ERROR_QRCVEMPTY

#define PCAN_ERROR_QRCVEMPTY

Receive queue is empty.

◆ PCAN_ERROR_QXMTFULL

#define PCAN_ERROR_QXMTFULL

Transmit queue is full.

◆ PCAN_ERROR_REGTEST

#define PCAN_ERROR_REGTEST

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

◆ PCAN_ERROR_RESOURCE

#define PCAN_ERROR_RESOURCE

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

◆ PCAN_ERROR_UNKNOWN

#define PCAN_ERROR_UNKNOWN

Unknown error.

◆ PCAN_ERROR_XMTFULL

#define PCAN_ERROR_XMTFULL

Transmit buffer in CAN controller is full.

◆ PCAN_EXT_BTR0BTR1

#define PCAN_EXT_BTR0BTR1

UVS: bit-timing register.

◆ PCAN_EXT_ERR_COUNTER

#define PCAN_EXT_ERR_COUNTER

UVS: number of error frames.

◆ PCAN_EXT_HARDWARE_VERSION

#define PCAN_EXT_HARDWARE_VERSION

UVS: version number of the interface firmware.

◆ PCAN_EXT_LOG_USB

#define PCAN_EXT_LOG_USB

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

◆ PCAN_EXT_RECEIVE_CALLBACK

#define PCAN_EXT_RECEIVE_CALLBACK

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

◆ PCAN_EXT_RX_COUNTER

#define PCAN_EXT_RX_COUNTER

UVS: number of received frames.

◆ PCAN_EXT_RX_QUE_OVERRUN

#define PCAN_EXT_RX_QUE_OVERRUN

UVS: receive queue overrun counter.

◆ PCAN_EXT_SOFTWARE_VERSION

#define PCAN_EXT_SOFTWARE_VERSION

UVS: version number of the driver respectively library.

◆ PCAN_EXT_TX_COUNTER

#define PCAN_EXT_TX_COUNTER

UVS: number of transmitted frames.

◆ PCAN_FILTER_CLOSE

#define PCAN_FILTER_CLOSE

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

◆ PCAN_FILTER_CUSTOM

#define PCAN_FILTER_CUSTOM

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

◆ PCAN_FILTER_OPEN

#define PCAN_FILTER_OPEN

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

◆ PCAN_FIRMWARE_VERSION

#define PCAN_FIRMWARE_VERSION

Get the version of the firmware used by the device associated with a PCAN-Channel.

◆ PCAN_HARD_RESET_STATUS

#define PCAN_HARD_RESET_STATUS

Activation status of hard reset processing via CAN_Reset calls.

◆ PCAN_HARDWARE_NAME

#define PCAN_HARDWARE_NAME

PCAN hardware name parameter.

◆ PCAN_INTERFRAME_DELAY

#define PCAN_INTERFRAME_DELAY

Delay, in microseconds, between sending frames.

◆ PCAN_IO_ANALOG_VALUE

#define PCAN_IO_ANALOG_VALUE

Get value of a single analog input pin.

◆ PCAN_IO_DIGITAL_CLEAR

#define PCAN_IO_DIGITAL_CLEAR

Clear multiple digital I/O pins to 0.

◆ PCAN_IO_DIGITAL_CONFIGURATION

#define PCAN_IO_DIGITAL_CONFIGURATION

Output mode of 32 digital I/O pin of a PCAN-USB Chip. 1: Output-Active 0 : Output Inactive.

◆ PCAN_IO_DIGITAL_SET

#define PCAN_IO_DIGITAL_SET

Value assigned to a 32 digital I/O pins of a PCAN-USB Chip - Multiple digital I/O pins to 1 = High.

◆ PCAN_IO_DIGITAL_VALUE

#define PCAN_IO_DIGITAL_VALUE

Value assigned to a 32 digital I/O pins of a PCAN-USB Chip.

◆ PCAN_IP_ADDRESS

#define PCAN_IP_ADDRESS

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

◆ PCAN_ISA

#define PCAN_ISA

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

◆ PCAN_LAN

#define PCAN_LAN

PCAN Gateway devices.

◆ PCAN_LAN_CHANNEL_DIRECTION

#define PCAN_LAN_CHANNEL_DIRECTION

Communication direction of a PCAN-Channel representing a PCAN-LAN interface.

◆ PCAN_LAN_SERVICE_STATUS

#define PCAN_LAN_SERVICE_STATUS

Status of the Virtual PCAN-Gateway Service.

◆ PCAN_LISTEN_ONLY

#define PCAN_LISTEN_ONLY

PCAN Listen-Only parameter.

◆ PCAN_LOG_CONFIGURE

#define PCAN_LOG_CONFIGURE

Configuration of the debugged information (LOG_FUNCTION_***)

◆ PCAN_LOG_LOCATION

#define PCAN_LOG_LOCATION

Directory path for log files.

◆ PCAN_LOG_STATUS

#define PCAN_LOG_STATUS

Debug-Log activation status.

◆ PCAN_LOG_TEXT

#define PCAN_LOG_TEXT

Custom insertion of text into the log file.

◆ PCAN_MESSAGE_BRS

#define PCAN_MESSAGE_BRS

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

◆ PCAN_MESSAGE_ECHO

#define PCAN_MESSAGE_ECHO

The PCAN message represents an echo CAN Frame.

◆ PCAN_MESSAGE_ERRFRAME

#define PCAN_MESSAGE_ERRFRAME

The PCAN message represents an error frame.

◆ PCAN_MESSAGE_ESI

#define PCAN_MESSAGE_ESI

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

◆ PCAN_MESSAGE_EXTENDED

#define PCAN_MESSAGE_EXTENDED

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

◆ PCAN_MESSAGE_FD

#define PCAN_MESSAGE_FD

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

◆ PCAN_MESSAGE_FILTER

#define PCAN_MESSAGE_FILTER

PCAN message filter parameter.

◆ PCAN_MESSAGE_RTR

#define PCAN_MESSAGE_RTR

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

◆ PCAN_MESSAGE_STANDARD

#define PCAN_MESSAGE_STANDARD

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

◆ PCAN_MESSAGE_STATUS

#define PCAN_MESSAGE_STATUS

The PCAN message represents a PCAN status message.

◆ PCAN_MODE_EXTENDED

#define PCAN_MODE_EXTENDED

◆ PCAN_MODE_STANDARD

#define PCAN_MODE_STANDARD

◆ PCAN_NONE

#define PCAN_NONE

Undefined, unknown or not selected PCAN device value.

◆ PCAN_NONEBUS

#define PCAN_NONEBUS

Undefined/default value for a PCAN bus.

◆ PCAN_PARAMETER_OFF

#define PCAN_PARAMETER_OFF

The PCAN parameter is not set (inactive)

◆ PCAN_PARAMETER_ON

#define PCAN_PARAMETER_ON

The PCAN parameter is set (active)

◆ PCAN_PCC

#define PCAN_PCC

PCAN-PC Card.

◆ PCAN_PCI

#define PCAN_PCI

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

◆ PCAN_PEAKCAN

#define PCAN_PEAKCAN

PCAN Non-PnP devices. NOT USED WITHIN PCAN-Basic API.

◆ PCAN_RECEIVE_EVENT

#define PCAN_RECEIVE_EVENT

PCAN receive event handler parameter.

◆ PCAN_RECEIVE_STATUS

#define PCAN_RECEIVE_STATUS

Message reception status of a PCAN-Channel.

◆ PCAN_TRACE_CONFIGURE

#define PCAN_TRACE_CONFIGURE

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

◆ PCAN_TRACE_LOCATION

#define PCAN_TRACE_LOCATION

Directory path for PCAN trace files.

◆ PCAN_TRACE_SIZE

#define PCAN_TRACE_SIZE

Configuration of the maximum file size of a CAN trace.

◆ PCAN_TRACE_STATUS

#define PCAN_TRACE_STATUS

CAN tracing activation status.

◆ PCAN_USB

#define PCAN_USB

PCAN-USB and PCAN-USB Pro.

◆ PCAN_USBBUS1

#define PCAN_USBBUS1

PCAN-USB interface, channel 1.

◆ PCAN_USBBUS10

#define PCAN_USBBUS10

PCAN-USB interface, channel 10.

◆ PCAN_USBBUS11

#define PCAN_USBBUS11

PCAN-USB interface, channel 11.

◆ PCAN_USBBUS12

#define PCAN_USBBUS12

PCAN-USB interface, channel 12.

◆ PCAN_USBBUS13

#define PCAN_USBBUS13

PCAN-USB interface, channel 13.

◆ PCAN_USBBUS14

#define PCAN_USBBUS14

PCAN-USB interface, channel 14.

◆ PCAN_USBBUS15

#define PCAN_USBBUS15

PCAN-USB interface, channel 15.

◆ PCAN_USBBUS16

#define PCAN_USBBUS16

PCAN-USB interface, channel 16.

◆ PCAN_USBBUS2

#define PCAN_USBBUS2

PCAN-USB interface, channel 2.

◆ PCAN_USBBUS3

#define PCAN_USBBUS3

PCAN-USB interface, channel 3.

◆ PCAN_USBBUS4

#define PCAN_USBBUS4

PCAN-USB interface, channel 4.

◆ PCAN_USBBUS5

#define PCAN_USBBUS5

PCAN-USB interface, channel 5.

◆ PCAN_USBBUS6

#define PCAN_USBBUS6

PCAN-USB interface, channel 6.

◆ PCAN_USBBUS7

#define PCAN_USBBUS7

PCAN-USB interface, channel 7.

◆ PCAN_USBBUS8

#define PCAN_USBBUS8

PCAN-USB interface, channel 8.

◆ PCAN_USBBUS9

#define PCAN_USBBUS9

PCAN-USB interface, channel 9.

◆ PCAN_VIRTUAL

#define PCAN_VIRTUAL

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

◆ SERVICE_STATUS_RUNNING

#define SERVICE_STATUS_RUNNING

The service is running.

◆ SERVICE_STATUS_STOPPED

#define SERVICE_STATUS_STOPPED

The service is not running.

◆ TPCANBaudrate

#define TPCANBaudrate

Represents a PCAN Baud rate register value.

◆ TPCANBitrateFD

#define TPCANBitrateFD

Represents a PCAN-FD bit rate string.

◆ TPCANDevice

#define TPCANDevice

Represents a PCAN device.

◆ TPCANHandle

#define TPCANHandle

Represents a PCAN hardware channel handle.

◆ TPCANMessageType

#define TPCANMessageType

Represents the type of a PCAN message.

◆ TPCANMode

#define TPCANMode

Represents a PCAN filter mode.

◆ TPCANParameter

#define TPCANParameter

Represents a PCAN parameter to be read or set.

◆ TPCANStatus

#define TPCANStatus

Represents a PCAN status/error code (ATTENTION: changed from 64-bit to 32-bit)

◆ TPCANTimestampFD

#define TPCANTimestampFD

Represents a timestamp of a received PCAN FD message.

◆ TPCANType

#define TPCANType

Represents the type of PCAN hardware to be initialized.

◆ TRACE_FILE_DATA_LENGTH

#define TRACE_FILE_DATA_LENGTH

Causes using the data length column ('l') instead of the DLC column ('L') in the trace file.

◆ TRACE_FILE_DATE

#define TRACE_FILE_DATE

Includes the date into the name of the trace file.

◆ TRACE_FILE_OVERWRITE

#define TRACE_FILE_OVERWRITE

Causes the overwriting of available traces (same name)

◆ TRACE_FILE_SEGMENTED

#define TRACE_FILE_SEGMENTED

Traced data is distributed in several files with size PAN_TRACE_SIZE.

◆ TRACE_FILE_SINGLE

#define TRACE_FILE_SINGLE

A single file is written until it size reaches PAN_TRACE_SIZE.

◆ TRACE_FILE_TIME

#define TRACE_FILE_TIME

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

Typedef Documentation

◆ TPCANChannelInformation

Describes an available PCAN channel

◆ TPCANMsg

typedef struct tagTPCANMsg TPCANMsg

Represents a PCAN message

◆ TPCANMsgFD

typedef struct tagTPCANMsgFD TPCANMsgFD

Represents a PCAN message from a FD capable hardware

◆ TPCANTimestamp

Represents a timestamp of a received PCAN message Total Microseconds = micros + 1000 * millis + 0x100000000 * 1000 * millis_overflow

Function Documentation

◆ CAN_FilterMessages()

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

Configures the reception filter.

Remarks
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.

◆ CAN_GetErrorText()

TPCANStatus CAN_GetErrorText ( TPCANStatus  Error,
WORD  Language,
LPSTR  Buffer 
)

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

Remarks
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.

◆ CAN_GetStatus()

TPCANStatus CAN_GetStatus ( TPCANHandle  Channel)

Gets the current status of a PCAN Channel.

Parameters
[in]ChannelThe handle of a PCAN Channel.
Returns
A TPCANStatus error code.

◆ CAN_GetValue()

TPCANStatus CAN_GetValue ( TPCANHandle  Channel,
TPCANParameter  Parameter,
void *  Buffer,
DWORD  BufferLength 
)

Retrieves a PCAN Channel value.

Remarks
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.

◆ CAN_Initialize()

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.

◆ CAN_InitializeFD()

TPCANStatus CAN_InitializeFD ( TPCANHandle  Channel,
TPCANBitrateFD  BitrateFD 
)

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).
Remarks
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, nom_brp, nom_sjw, nom_tseg1, nom_tseg2, data_brp, data_sjw, data_tseg1, data_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.

◆ CAN_LookUpChannel()

TPCANStatus CAN_LookUpChannel ( LPSTR  Parameters,
TPCANHandle FoundChannel 
)

Finds a PCAN-Basic channel that matches with the given parameters.

Parameters
[in]ParametersA comma separated string contained pairs of parameter-name/value to be matched within a PCAN-Basic channel
[out]FoundChannelBuffer for returning the PCAN-Basic channel, when found
Returns
A TPCANStatus error code.

◆ CAN_Read()

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.

◆ CAN_ReadFD()

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.

◆ CAN_Reset()

TPCANStatus CAN_Reset ( TPCANHandle  Channel)

Resets the receive and transmit queues of the PCAN Channel.

Remarks
A reset of the CAN controller is not performed.
Parameters
[in]ChannelThe handle of a PCAN Channel.
Returns
A TPCANStatus error code.

◆ CAN_SetValue()

TPCANStatus CAN_SetValue ( TPCANHandle  Channel,
TPCANParameter  Parameter,
void *  Buffer,
DWORD  BufferLength 
)

Configures or sets a PCAN Channel value.

Remarks
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.

◆ CAN_Uninitialize()

TPCANStatus CAN_Uninitialize ( TPCANHandle  Channel)

Uninitializes one or all PCAN Channels initialized by CAN_Initialize.

Remarks
Giving the TPCANHandle value "PCAN_NONEBUS", uninitializes all initialized channels.
Parameters
[in]ChannelThe handle of a PCAN Channel.
Returns
A TPCANStatus error code.

◆ CAN_Write()

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.

◆ CAN_WriteFD()

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.