Question

Using Scales with Devicehub without having Warehouse "Automated Warehouse Operations".

  • 30 April 2021
  • 2 replies
  • 15 views

Is there a way to connect a single scale, maybe two or three in time, to Devicehub without having to purchase "Automated Warehouse Operations"? It seems kind of silly that we can’t even connect one.

Will we ever purchase "Automated Warehouse Operations"? Likely in time but we have a long way to go before getting into the Manufacturing and Warehousing aspects of Acumatica and we’d like to be utilizing this in Shipping now.

Is there a compromise or work around anyone’s thought of that works?

 

Thanks ;-)


2 replies

Userlevel 6
Badge +6

@jmckinnon I think DeviceHub is available regardless of your license; that’s all you need to integrate with the scale. The problem is that the standard Shipments screen doesn’t support the scale, but a developer can create a customization that pulls in the current weight from the user’s scale and inputs it in the current row in the Packages tab. Here’s a mockup of what I have in mind:

Do you work with a consultant that is familiar with the Acumatica framework? I don’t have a USB scale to test, but sample code to read the current scale weight can be found in PickPackShip.cs, in the ProcessScaleWeight function (extracted here in case anyone is interested) -- basically it just reads from the SMScale table to get the last received weight, and does some sanity checks in case the weight hasn’t changed in the last 30 seconds:

        protected virtual bool? ProcessScaleWeight(SOPackageDetailEx package)
{
Guid? scaleDeviceID = UserSetup.For(Base).ScaleDeviceID;

Base.Caches<SMScale>().ClearQueryCache();
SMScale scale = SMScale.PK.Find(Base, scaleDeviceID);

if (scale == null)
{
ReportError(Msg.ScaleMissing, "");
return false;
}

DateTime dbNow = GetServerTime();

if (scale.LastModifiedDateTime.Value.AddHours(1) < dbNow)
{
ReportError(Msg.ScaleDisconnected, scale.ScaleID);
return false;
}
else if (scale.LastWeight.GetValueOrDefault() == 0)
{
if (HeaderView.Current.LastWeighingTime == scale.LastModifiedDateTime.Value)
{
SkipBoxWeightInput();
return true;
}
else
{
ReportWarning(Msg.ScaleNoBox, scale.ScaleID);
Prompt(Msg.ScaleSkipPrompt);
HeaderSetter.Set(h => h.LastWeighingTime, scale.LastModifiedDateTime.Value);
return null;
}
}
else if (scale.LastModifiedDateTime.Value.AddSeconds(ScaleWeightValiditySeconds) < dbNow)
{
ReportError(Msg.ScaleTimeout, scale.ScaleID, ScaleWeightValiditySeconds);
return null;
}
else
{
decimal weight = ConvertKilogramToWeightUnit(scale.LastWeight.GetValueOrDefault(), CommonSetupUOM.Current.WeightUOM);
SetPackageWeight(weight);
return true;
}
}

 

 

@Gabriel Michaud

 

Regarding the Error…

I thought the error was on the client app itself, I’ll do some due diligence and follow-up with some details to be sure and I’ll be crossing my fingers that you’re right.

 

Regarding the customization…

This is C#, right? I haven’t gotten into that part yet. I see there’s a lot of checking / error trapping going on… guess that’s par for the course lol In addition to this then I suspect I’d also have to focus on the readings from the specific scale, just in case there’s two of them being used. on two different stations.

 

Thanks again for your guidance! maybe this will serve as my introduction into C#. ;-)

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved