Digital Scale interface to IBMi

Any IBM i topic that does not fit in another forum
Post Reply
San_jays
Posts: 5
Joined: Fri Jul 26, 2024 5:18 pm

Digital Scale interface to IBMi

Post by San_jays »

Hi Everyone,

This is a general discussion on how to integrate Digital scale with IBMi. The Scale can connect to PC using serial Connection (RS232) or USBA. Is there a way that the Scale can communicate to As400 automatically when its triggered ?

The scale reads and returns the value if \x05(ASCII 05) is send as key stroke.

Has anyone experienced in this to shade some lights or may be we need to acquire a Third party software like Twedge or something?

Regards.
Scott Klement
Site Admin
Posts: 872
Joined: Sun Jul 04, 2021 5:12 am

Re: Digital Scale interface to IBMi

Post by Scott Klement »

Seems to me that this would depend on the scale you're using and how it works.

You say that a \x05 sent as a keystroke triggers it to return the value. What do you mean by keystroke, here? Does that mean someone has to press that key on the scale? Or do you mean that the IBM i can send that? (please, please, please stop calling it as400, it's 2024 for crying out loud!)

You mention RS232 or "USBA" (which I assume is USB 2.0 with a USB-A type connector.) Are you really running a USB cable or RS232 cable all the way from the scale to your data center where the IBM i is located?

When I have done this sort of thing, I had a small device that hooked up to the scale (it was many years ago I don't remember the exact name of it) that basically converted RS232 to a TCP channel. So a machine like the IBM i (or a PC or anything else) could simply establish a TCP connection over any TCP/IP network, and then could communicate. Doing that, you could easily send a x'05' and get back the response and process it. Assuming it works that way, which you weren't too clear on.

You could do the same thing with a direct RS232 cable, I suppose... but, again, it's 2024. Who still uses RS232? And effectively, the limit on an RS232 cable is 50 feet (about 1500 cm.) So if your scale supports RS232, I would definitely want to adapt that to TCP/IP with an adapter, and write your code using a TCP channel over TCP/IP. Eventually, the scales will likely also do this without the need for an adapter.

Never heard of directly programming USB from IBM i. As USB is a completely different animal that can represent any sort of device, you'd have to know what device it represents itself as and configure that on the IBM i... and research how its possible to work with that device using IBM i software. I've not done anything like that.
San_jays
Posts: 5
Joined: Fri Jul 26, 2024 5:18 pm

Re: Digital Scale interface to IBMi

Post by San_jays »

Hi Scott,

Thank you for taking sometime and responding.

The Scale does have TCP connection and it can be enabled with the CP device (That you refer to, from your past working experience) .

So I believe, the best approach is to have an open TCP connection to send() and receive() from the digital scale and interpret in the IBMi.

https://www.scottklement.com/presentati ... 0TCPIP.pdf

Regards
Post Reply