VOOZH about

URL: https://www.nuget.org/packages/Peak.PCANBasic.NET/

⇱ NuGet Gallery | Peak.PCANBasic.NET 5.0.1.1131




👁 Image
Peak.PCANBasic.NET 5.0.1.1131

Prefix Reserved
dotnet add package Peak.PCANBasic.NET --version 5.0.1.1131
 
 
NuGet\Install-Package Peak.PCANBasic.NET -Version 5.0.1.1131
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Peak.PCANBasic.NET" Version="5.0.1.1131" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Peak.PCANBasic.NET" Version="5.0.1.1131" />
 
Directory.Packages.props
<PackageReference Include="Peak.PCANBasic.NET" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Peak.PCANBasic.NET --version 5.0.1.1131
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Peak.PCANBasic.NET, 5.0.1.1131"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Peak.PCANBasic.NET@5.0.1.1131
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Peak.PCANBasic.NET&version=5.0.1.1131
 
Install as a Cake Addin
#tool nuget:?package=Peak.PCANBasic.NET&version=5.0.1.1131
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

PCAN-Basic.NET Assembly

PCAN-Basic.NET is an interface for accessing and using the native PCAN-Basic API in .NET applications. The assembly is written using .NET Standard 2.0 which makes it suitable for developing under Windows and Linux.

The underlying native library (PCANBasic.dll on Windows and libpcanbasic.so on Linux), is used to do CAN communication through plug-and-play devices from PEAK-System Technik GmbH like PCAN-USB FD, and PCAN-PCI Express, among others.

Note: the native library files are not part of the PCAN-Basic.NET package. See next block for installation instructions.

Documentation

For full online API documentation see docs.peak-system.com/API/PCAN-Basic.Net. Alternatively, the documentation is available as a CHM file. It can be found within the "NuGet" folder of the PCAN-Basic package, and can also be downloaded directly using this link.

Getting Started

Windows:

For using PCAN-Basic.NET you need:

  1. to have the Windows device drivers installed, by using the PEAK-Drivers Setup,
  2. to have any plug-and-play device of the PCAN series attached to your PC, and
  3. to have the PCAN-Basic API installed, by using the PEAK-Drivers Setup (recommended). Alternatively, you can download a package containing all needed files and setting instructions.

PCAN-Gateway devices: If you want to communicate to PCAN-Gateways devices using PCAN-Basic, then you need to additionally install the feature "Virtual PCAN-Gateway" within the PEAK-Drivers Setup. Note that this is only supported on Windows systems.

For Linux:

For using PCAN-Basic.NET you need:

  1. to have the character-based Linux driver (chardev) installed, by compiling the source code yourself. Instructions are found in the PEAK-System Linux site.
  2. to have any plug-and-play device of the PCAN series attached to your PC, and
  3. to have the PCAN-Basic API installed, by downloading and compiling the source files. See instructions in the readme.txt file enclosed in the package.

Usage

Reference the following namespace from the file where you want to use PCAN-Basic functionality:

C#:

 using Peak.Can.Basic;

VB:

 Imports Peak.Can.Basic

C++/CLI:

 using namespace Peak::Can::Basic;

The namespace contains type enumerations, structures and classes for PCAN-Basic API accessing. Use the class Api to access API methods and constants:

C#:

PcanStatus result; 
result = Api.Initialize(PcanChannel.Usb01, Bitrate.Pcan500);

VB:

Dim result As PcanStatus
result = Api.Initialize(PcanChannel.Usb01, Bitrate.Pcan500)

C++/CLI:

using namespace Peak::Can::Basic;
result = Api::Initialize(channelUsed, Bitrate::Pcan500);

Use the class Worker for event driven reading and writing

C#:

Worker myWorker = new Worker();
PcanMessage message = new PcanMessage(0x100, MessageType.Standard, 3, new byte[] { 1, 2, 3 }, false);
Broadcast broadcast = new Broadcast(message, 100);

myWorker.MessageAvailable += OnMessageAvailable;
if (myWorker.AddBroadcast(ref broadcast))
 Console.WriteLine($"Broadcast {broadcast.Index}' configured successfully.");

myWorker.Start();
Console.WriteLine("The Worker was activated successfully."); 

VB:

Dim myWorker As Worker = New Worker()
Dim message As PcanMessage = New PcanMessage(&H100, MessageType.Standard, 3, New Byte() {1, 2, 3}, False)
Dim broadcast As Broadcast = New Broadcast(message, 100)

AddHandler myWorker.MessageAvailable, AddressOf OnMessageAvailable 
If myWorker.AddBroadcast(broadcast) Then
 Console.WriteLine($"Broadcast '{broadcast.Index}' configured successfully.") 
End If

myWorker.Start()
Console.WriteLine("The Worker object was activated successfully.")

C++/CLI:

Worker^ myWorker = gcnew Worker();
PcanMessage^ message = gcnew PcanMessage(0x100, MessageType::Standard, 3, gcnew array<Byte> { 1, 2, 3 }, false);
Broadcast^ broadcast = gcnew Broadcast(message, 100); 

myWorker->MessageAvailable += gcnew System::EventHandler(&OnMessageAvailable); 
if (myWorker->AddBroadcast(broadcast))
 Console::WriteLine("Broadcast '{0}' configured successfully.", broadcast->Index); 

myWorker->Start(false, false, false);
Console::WriteLine("The Worker object was activated successfully."); 

Need Support?

If you need further information or help, you can contact us using the following channels:

PEAK-System team

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on Peak.PCANBasic.NET:

Package Downloads
Meadow.Foundation.ICs.CAN.PCanBasic

PCAN-Basic USB CAN Controller for Windows

CanKit.Adapter.PCAN

Peak PCAN (PCAN-Basic) adapter for CanKit, providing unified bus access to PCAN hardware on Windows.

CanLink.Net

Can分析仪通讯库,整合广成/图莫斯/Peak的Can通讯工具收发消息的Can通讯库

CanLink.x86

Can分析仪通讯库,支持 “广成科技/天成创芯科技/图莫斯/Peak” 的Can通讯工具收发消息的Can通讯库(x86版本)

Hsu.Can.Peak

Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Peak.PCANBasic.NET:

Repository Stars
WildernessLabs/Meadow.Foundation
Unified driver and library framework for Meadow applications.