Here is log.txt
log.zip (330 Bytes)
Sorry, my bad. I was opening the port twice.
Try this build:
TestingPosScale.zip (293.3 KB)
Also, no need to separate log files like I said in the last post; I added a log entry to let me know what config is selected.
Donāt worry about the āWā string - thatās set in the āInit Stringā text box by default and is automatically sent.
As for putty and the access denied error, perhaps this app or something else was already connected to the port.
Here is the result. A lot of question marks being returned?
log.zip (644 Bytes)
2022-05-11 09:38:26.832 [DEBUG] [00.?35?] - This was actually 00.135
022-05-11 09:38:25.675 [DEBUG] [?A?]
I think A (or some other random letter) get returned if the āWā gets sent to quickly after the last one.
This is from after work. Iāve amended the log file to show what weights Iāve used and also put the weights returned using PuTTy down the bottom.
Not sure how to send the W to the scale when Emulate POS is not checked?
log.zip (1.1 KB)
Well shoot. It looks thereās some encoding issues.
Hereās another build to try. Iāve added some logging after getting the serial port data a different way and weāll see how it looks.
Also, check your scale settings and see if they match the defaults Iāve configured.
TestingPosScale.zip (294.8 KB)
Whatever is in this text box is whatās sent along with any line ending character checked so you donāt need to manually send anything - it all happens behind the scene. When start is clicked a timer starts and about a second later āWā, or whatever is in the text box, is sent. The timer isnāt restarted until data is received. Once the data is processed, the timer starts again and after it ticks āWā is send again, then waits for a response.
Results attached.
log.zip (2.1 KB)
Parsing the response as a string doesnāt seem like itās going to work; it may be a configuration issue.
Please go into the settings and verify that baud, bits, parity, stop bit, etc. match the defaults I used from the docs. If they differ, either set the scale to the defaults or change those settings in the test app.
Iāve added another option to process the response differently. Itāll be checked by default. If you would please weight some more with āEmulate POSā selected and deselected.
Sorry for all the back-and-forth. Itās been over two decades since Iāve really done anything with serial communications so some stuff Iāve forgotten and had to refresh along the way. Not that serial comms are all that complicated, Iām just rusty. Thanks for your patience.
TestingPosScale.zip (295.1 KB)
All the settings are the same.
Please donāt be sorry, itās you helping me and I really appreciate it. Without your help Iām screwed lol.
Iāll run some more tests tonight.
Is it weird that PuTTy has no issue displaying the figures correctly?
The only time Iām seeing data returned is with POS emulated and I think itās because I have something misconfigured. With putty I imagine youāre configuring the baud, parity, bits, etc. so that may be why youāre seeing the proper string. The POS module just connects using the port name and doesnāt specify baud, parity, etc. Though the other method of connection has those specified, I wasnāt seeing any response as I probably messed something up.
Iāve added the last couple of settings I could think of and have set everything but port settings to their defaults. Use this build and weāll see what I see.
TestingPosScale.zip (297.5 KB)
can you run some measures with āEmulate POSā and āRead Bytesā deselected please
The results appended to the last log file. All the weights look correct.
log.zip (3.2 KB)
Super, thanks for that.
So the issue here is the port configuration - without it the default scale device wonāt work. Give me a few days and Iāll put together a module for the scale and you can test it and weāll go from there.
Absolutely amazing, cheers.
Alright, I think I have it (mostly) sorted.
The operation is the same as the tutorial linked somewhere above - using an automation command to trigger the init string to be sent.
Action parameters used:
The DLL and PDB files need to go in POSā program files directory as only the addons that come with POS can be loaded from the addons folder.
Logging is written to %USERPROFILE%\Documents\SambaPOS5\scale_log.txt
Defaults are configured so aside from specifying the COM port, you shouldnāt need to to anything else.
This is compiled against 5.3.6 binaries.
So, give this a try and let me know.
BT.SambaModules.MettlerToledoVivaScale_0.9.0.0.zip (25.3 KB)
Device name is Mettler Toledo Viva Scale
Settings:
Best I could do for testing:
Iāve put the 2 files into C:\Program Files (x86)\SambaPOS5
Then deleted the Scale and re-added it again, sadly no joy.
Log file attached.
scale.zip (1.5 KB)
Then I thought maybe I was being dumb so I put the entire folder into C:\Program Files (x86)\SambaPOS5.
Still no joy.
scale (2).zip (194 Bytes)
Wait, am I supposed to āimportā the module somehow?
Remove the old scale device you have installed.
The two files, (DLL and PDB) in the bin folder go into the program files directory.
Then add the Mettler scale device as you would any other
Hmmm, I did that but the scale doesnāt show in the list. I restarted SambaPOS a couple of times as well. Iāve got the right folder above, yes?