TCP Communications with scale controller

Hello,
I am trying to do a program to send commends to a scale controller. Can anyone please guide me? I was looking at the ClientSocket but I just can’t figure it out. Basically, I know the IP address and port of the scale controller and I want to send it commands so that it can reply with scale info.

Thanks in advance

Hi Allen. Do you have any docs from the Scale manufacturer, perhaps a “Communications Protocol”? I’ve done a great deal of Scale integrations, but all have been via standard RS232 serial comms. Nevertheless if you have more info about the Scale itself that’d be helpful. :slight_smile:

Hi William,
The scale is the Rice Lake 1280 Enterprise. Basically, it is always “Listening” and if it sees a command F#, it calls up a handler to process the data. the manual is the following link under “IRite programmer referance language” here.https://www.ricelake.com/products/1280-enterprise-series-programmable-weight-indicator-and-controller/

If I use the old “Hyperterminal” terminal program and connect to the scale IP with the port, I can send the commands and it works. I try using the ServerSocketClientTest.xojo_binary_project sample, changed the IP and port and it says connected but when I send a command, is like the scale is not receiving it.

Did you remember to send EndOfLine.CR after your command?

Yes, I use + chr(13) + chr(10)

I also tried +endofline

Try using a TCPSocket instead of a serversocket

1 Like

I believe I need an intercharacter delay because I am getting the correct command as in Hyperterminal (I used a terminal screen that shows control codes too to see what the scale is receiving) so the only thing I can think of is that it is sending the code too fast to the scale. Does anyone know or have done a routine to take a textfield.text and send each character with a specified delay between each character?

I got it guys,
I actually started fresh with a new project and added a TCPSocket like Dean suggested. For some reason, the example is doing something else that I am not sure what because it made sense to me the way it was done but anyway, I got what I was looking for.

Thank You to all

2 Likes