PCAN-API

PCAN-Basic

PCAN-Basic Documentation
Home
PreviousUpNext
PCAN-API

Also called CanApi4 interface, is a synonym for CAN Application Programming Interface (version 2) and is a comprehensively programming interface to the PCAN system of the company PEAK-System Technik GmbH. This interface is more comprehensive than PCAN-Basic. 

Important difference to PCAN-Basic:

  • Transmit a CAN message at a fixed point of time.
  • Several application programs could be connected to one PCAN-PC hardware.
  • Detailed information to PCAN-PC hardware and the PCAN system (PCAN net and PCAN client).
  • The PCAN client is connected via the net to the PCAN-PC hardware.

The following text is a short overview to the CanApi2 functions. The functions itself can be categorized as follows:

Register and remove functions for nets and hardware.

Function 
Description 
CloseAll 
Disconnects all hardware, nets, and clients. 
RegisterHardware 
Registers a Not-Plug-and-Play CAN hardware. 
RegisterHardwarePCI 
Registers a PCI CAN hardware. 
RegisterNet 
Defines of a PCAN net. 
RemoveHardware 
Removes and deactivates CAN hardware. 
RemoveNet 
Removes a PCAN net. 

Configuration functions for nets and hardware.

Function 
Description 
SetDeviceName 
Sets the PCAN device to be used for subsequent CanApi2 function calls. 
SetDriverParam 
Configures a driver parameter, eg. the size of the receive or transmit buffer. 
SetHwParam 
Configures a hardware parameter, eg.
- the PEAK serial number,
- and additional parameters for the PCAN-USB hardware. 
SetNetParam 
Configures net parameter. 

Functions for the management of the clients.

Function 
Description 
ConnectToNet 
Connects a client to a PCAN net. 
DisconnectFromNet 
Disconnects a client from a PCAN net. 
RegisterClient 
Registers an application as PCAN client. 
RegisterMsg 
Expands the reception filter of a client. 
RemoveAllMsgs 
Resets the filter of a Client for a connected Net. 
RemoveClient 
Removes a client from the driver. 
ResetClient 
Resets the receive and transmit queue of a client. 
ResetHardware 
Resets a CAN hardware. 
SetClientFilter 
Configures the reception filter of a client. 
SetClientFilterEx 
Configures the reception filter of a client 
SetClientParam 
Configures a client parameter, eg.
- self-receive mode of transmitted messages.
- improve the accuracy of the reception filter. 

Functions for the data interchange over the CAN bus.

Function 
Description 
Read 
Reads a number of CAN_*-records from the client's receive queue. Records are CAN messages, error events, and other information. 
Write 
Writes a number of CAN messages or other commands into the transmit queue of a client. 

Functions for the information about clients, nets, drivers, and hardware.

Function 
Description 
GetClientParam 
Retrieves client parameter, eg.
- total number of transmitted or received CAN messages,
- the PCAN driver name, PCAN net, or PCAN client name
- the number of received bits. 
GetDeviceName 
Retrieves the currently used PCAN device. 
GetDiagnosticText 
Reads the diagnostic text buffer. 
GetDriverName 
Retrieves the name of a PCAN device type. 
GetDriverParam 
Retrieves a driver parameter. 
GetErrText 
Translates an error code into a text. 
GetHwParam 
Retrieves a hardware parameter. 
GetNetParam 
Retrieves a net parameter. 
GetSystemTime 
Gets the system time. 
Msg2Text 
Creates a text form of a CAN message. 
GetHardwareStatus 
Detects the current status of a CAN hardware. 
GetVersionInfo 
Reads version and copyright information from the driver. 
Copyright © 2017. PEAK-System Technik GmbH. All rights reserved.
Send feedback to this documentation