Wherever SambaPOS was installed. Default is "%PROGRAMFILES(X86)%\SambaPOS5"
I specified x86 for this build. See if this works.
BT.SambaModules.MettlerToledoVivaScale_0.9.0.0.zip (25.3 KB)
and now the forum is throwing shade
Wherever SambaPOS was installed. Default is "%PROGRAMFILES(X86)%\SambaPOS5"
I specified x86 for this build. See if this works.
BT.SambaModules.MettlerToledoVivaScale_0.9.0.0.zip (25.3 KB)
and now the forum is throwing shade
I donāt know what to tell you. I throw the modules in the programās install directory and theyāre just there.
5.3.0
5.3.6 fresh install in VM
I see you donāt have the other scales in your list, Iāll uninstall those then see what happens.
It feels so close to being complete.
He may need to right click the dll go to properties and unblock it
@Jesse is correct, you have to unblock the dll.
With the the addon and the the mettler library copied locally:
With the mettler library downloaded from the forum:
and unblocked
That has worked!!!
I couldnāt unblock the file whilst it was in the SambaPOS folder ( I received an error about semaphores etc). Anyway I unblocked it in the download folder OK then copied it over.
I have added the scale and it kind of works. Itās cutting off some figures, e.g. 0.580 is showing up as 0.5.
Log file attached.
scale_log.zip (892 Bytes)
For the one that shows ā0.5ā when it should be ā0.580ā the raw data received from the scale shows ā0.5ā
2022-05-17 09:30:55.184 [DEBUG] Raw received: [0.5]
Line 208 gets the raw data from the serial port and line 212 logs it before any regex/transformation has happened
I did notice in the log decimals without a leading 0 which wonāt match the regex pattern. But in the test data you collected for me, the weights always had a leading zero.
As you can see towards the end, decimals without a leading zero arenāt matched.
I added some log entries to help me see when things begin and end so please keep debug logging enabled. Thanks!
I switched back to reading the actual bytes then converting to string. Weāll see if that changes things so give this a try:
BT.SambaModules.MettlerToledoVivaScale_0.9.0.1.zip (25.9 KB)
New log file attached. On a few occasions I had to press the āScaleā button (the one I created to send the W) before something came up. The .62 should have been .625
Getting close
no log file in your post
On a few occasions I had to press the āScaleā button
Thatās how it has to work. You press the scale button, then it sends the init string, then the scale responds.
Lol, I meant to say 'press the āScaleā button twice. Nothing would come up the first time.
Log file attached this time.
scale_log (2).zip (1.8 KB)
I was sending a CR even if the setting wasnāt enabled. Iām not sure if that was causing the scale to not know what the POS was asking. Oops.
I see this for .625 which wouldnāt match and doesnāt end with the char specified in the docs.
2022-05-17 13:01:47.369 [DEBUG] HEX string: [2E 36 32 35 0D 02 3F]
2022-05-17 13:01:47.371 [DEBUG] Decoded bytes: [.625
?]
a second later, thereās this
2022-05-17 13:01:48.411 [DEBUG] HEX string: [30 2E 36 32 35 0D 02]
2022-05-17 13:01:48.413 [DEBUG] Decoded bytes: [0.625
]
which matches the regex and ends with the proper char
Give this build a shot and send me the log again, please.
BT.SambaModules.MettlerToledoVivaScale_0.9.0.2.zip (26.0 KB)
Looking good
Only a couple of times I had to press the scale button twice.
Log file attached.
scale_log (4).zip (2.4 KB)
the one you had to click the scale button twice, was that for the item that weighs 4.485?
I believe so, yes, that is correct.
Okay, I think I understand whatās going on.
The initial response
2022-05-17 14:52:57.360 [DEBUG] HEX string: [02 30 34]
2022-05-17 14:52:57.362 [DEBUG] Decoded bytes: [04]`
code preview isnāt showing STX (hex/char 02)
Seems to match up with seems to be the status byte which the docs say has to be converted to binary.
Let me work on this and Iāll let you know.
Logging added for processing the status byte and parsing the individual bits for the status.
For the last weigh before you upload the log, do a negative weight if you can. I want to see the output.
BT.SambaModules.MettlerToledoVivaScale_0.9.0.3.zip (27.4 KB)
Forgot to reverse the binary string when checking the bits. Arrays start at 0 on the left, but binary bits start at 0 on the right.
latest build
BT.SambaModules.MettlerToledoVivaScale_0.9.0.4.zip (27.5 KB)
0.9.0.4 crashes the system so Iāve reverted back. I pressed āScaleā, nothing seemed to be happening for about 5 seconds then SambaPOS just closed.
Log file attached.
scale_log (5).zip (2.7 KB)
Could you send the crash exception from the POS log. I donāt have any try/catch blocks as Iām punting to the appās handler.