Page 1 of 1

Peak.PCANBasic.NET NuGet package

Posted: Thu 14. Mar 2024, 10:54
by eriks
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.

Re: Peak.PCANBasic.NET NuGet package

Posted: Thu 14. Mar 2024, 13:03
by K.Wagner
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 1965 times

Re: Peak.PCANBasic.NET NuGet package

Posted: Thu 14. Mar 2024, 14:55
by eriks
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