Peak.PCANBasic.NET NuGet package

The free CAN Software API (Application Programming Interface) for Windows®
Post Reply
User avatar
eriks
Posts: 14
Joined: Tue 16. Jul 2019, 14:40

Peak.PCANBasic.NET NuGet package

Post by eriks » Thu 14. Mar 2024, 10:54

Recently we noticed that there now is a NuGet package for PCANBasic .NET.

However I cannot find a simple demo program how to use it. All the examples still use the pcanbasic.cs and not the NuGet package.

The Introduction pages tell a lot but not much how to get started: https://docs.peak-system.com/API/PCAN-B ... 6f22a0.htm

Whatever I try to do it always seems to include immediately the Peak.Can.Basic.BackwardCompatibility namespace.

So is there any info/demo how to use actually the new way? Even how to Initialize is not clear.

Kind regards,
Erik Schuurman
DIS Sensors B.V.

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: Peak.PCANBasic.NET NuGet package

Post by K.Wagner » Thu 14. Mar 2024, 13:03

Hello,

there is indeed no demo using the assembly, but you can see a lot of code within the online documentation:
https://docs.peak-system.com/API/PCAN-Basic.Net/

Mainly, you have a better version of the PCANBasic class called just "Api", a PCANBasic class as backward compatibility option, and the new Worker class. Each class and their methods have examples in C#, VB.NET, and C++/CLI. For starting working with the package, it is recommended to first read the How-Tos and Q&As chapter (the link is in the picture you posted). You find in there questions like: Then you can just check any class or method for code samples, like this:
image from site: https://docs.peak-system.com/API/PCAN-Basic.Net/html/ec0bbf44-83c6-e45e-2056-9d835c34525f.htm
image from site: https://docs.peak-system.com/API/PCAN-Basic.Net/html/ec0bbf44-83c6-e45e-2056-9d835c34525f.htm
Broadcast.png (34.2 KiB) Viewed 1960 times
Best regards,
Keneth

User avatar
eriks
Posts: 14
Joined: Tue 16. Jul 2019, 14:40

Re: Peak.PCANBasic.NET NuGet package

Post by eriks » Thu 14. Mar 2024, 14:55

Thanks for the info, in the meantime I already found some parts of demo code indeed.

For now I was just curious for the new worker class, that seems to simplify things. We'll leave the existing code using the backward compatibility. I needed a small test/debug utility and thought that would be a good reason to test the new way :-)

Regards,
Erik

Post Reply