Scales Integration

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)

image

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. :sunglasses:

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)

Results.

Looks normal when ā€˜Emulate POS’ is NOT selected.

log.zip (2.3 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. :+1::+1::+1:

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:
image

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:
image

Best I could do for testing:
2022-05-13_22;54_1652504047_vmware

1 Like

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

2022-05-15_09;17_1652627842_Samba.Presentation

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?