我在C#中有程序连接到比例设备(数字比例)当我将值设置为比例属性(单位价格和tareWieght)时,我所遇到的问题就是执行。 我得到的例外是
Error occured on SetTareWeight: Microsoft.PointOfService.PosControlException: Failed to set property TareWeight.
at Microsoft.PointOfService.Legacy.LegacyProxy.SetProperty(String propertyName, Object propertyValue)
at Microsoft.PointOfService.Legacy.LegacyScale.set_TareWeight(Decimal value)
at Retalix.Client.SelfWeight.BusinessObjects.Devices.DigiScale.set_TareWeight(Int32 value) in c:\Project\CustomerScaleClient\Src\Retalix.Client.SelfWeight.BusinessObjects\Devices\DigiScale.cs:line 237
at Retalix.Client.SelfWeight.BusinessObjects.Devices.Scale.ScaleLogic.SetScaleTareWeightByScaleManager(Int32 tareWeight) in c:\Project\CustomerScaleClient\Src\Retalix.Client.SelfWeight.BusinessObjects\Devices\Scale\ScaleLogic.cs:line 58
ErrorCode: Illegal
ErrorCodeExtended: 0
2013-01-17 12:31:46,789 [10] FATAL (Retalix.Client.SelfWeight.BusinessObjects.Devices.Scale.ScaleLogic) POS((null),(null)) InitialTrans(ID=(null), SEQ=(null))
Error occured on SetTareWeight: Microsoft.PointOfService.PosControlException: Failed to set property UnitPrice.
at Microsoft.PointOfService.Legacy.LegacyProxy.SetProperty(String propertyName, Object propertyValue)
at Microsoft.PointOfService.Legacy.LegacyScale.set_UnitPrice(Decimal value)
at Retalix.Client.SelfWeight.BusinessObjects.Devices.DigiScale.set_UnitPrice(Decimal value) in c:\Project\CustomerScaleClient\Src\Retalix.Client.SelfWeight.BusinessObjects\Devices\DigiScale.cs:line 253
at Retalix.Client.SelfWeight.BusinessObjects.Devices.Scale.ScaleLogic.SetScaleUnitPrice(Decimal unitPrice) in c:\Project\CustomerScaleClient\Src\Retalix.Client.SelfWeight.BusinessObjects\Devices\Scale\ScaleLogic.cs:line 76
ErrorCode: Illegal
ErrorCodeExtended: 0
我检查了属性DeviceEnable
并声称,当我为UnitPrice
和tareWeight
分配值时,它们的值为true。
下一个代码导致了这个问题 - * // scale是digi scale *
var scale = deviceProvider.GetDevice<IScale>();
scale.TareWeight = tareWeight;
我在TareWeight属性的分配之前检查过deviceEnable是否为真 - **