MassaK.Plugin 1.0.2

dotnet add package MassaK.Plugin --version 1.0.2
NuGet\Install-Package MassaK.Plugin -Version 1.0.2
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="MassaK.Plugin" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MassaK.Plugin --version 1.0.2
#r "nuget: MassaK.Plugin, 1.0.2"
#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.
// Install MassaK.Plugin as a Cake Addin
#addin nuget:?package=MassaK.Plugin&version=1.0.2

// Install MassaK.Plugin as a Cake Tool
#tool nuget:?package=MassaK.Plugin&version=1.0.2

Usage

Setup MassaK

This code creates MassaK Instance without connecting. It is recommended to subscribe to OnStatusChanged and OnWeightChanged before using method Connect()

using MassaK.Plugin
using MassaK.Plugin.Imp;

IMassaK MassaK = new MassaUsb("COM6");
MassaK.OnStatusChanged += ReceiveStatus;
MassaK.OnWeightChanged += ReceiveWeight;

Connect

This method is safely for use, no exceptions only event StatusChanged.

MassaK.Connect();

Get weight

This method requests weight data from the scales. The argument specifies the interval in milliseconds between requests. A smaller value means faster polling, with a minimum of 100 milliseconds (use cautiously). Use OnWeightChanged event

MassaK.StartWeightPolling(100);

Calibrate

Ensure there is no weight placed on the scales before connecting them via USB. If any issues arise, reconnect the scales via USB.

MassaK.Сalibrate();

Disconnect

MassaK.Disconnect();

After calling Disconnect, you can reconnect the object again that's why you need to call Dispose() for full destroy. Or call only Dispose() without Disconnect()

MassaK.Dispose();
Product Compatible and additional computed target framework versions.
.NET net8.0-windows10.0.19041 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 69 6/6/2024
1.0.1 53 6/6/2024
1.0.0 79 6/5/2024
0.0.2 84 6/3/2024
0.0.1 82 6/3/2024