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.
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
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?