FellyTone84
FellyTone84

Reputation: 695

ruby script to read data over port 4001

At work, we purchased a package of sensors that count items as they pass down a conveyor belt. The sensors' information is accessible via the following protocol:

XL Series Products use a binary protocol for Ethernet communication. By default, the protocol is available on port 4001. (This is a configurable property.)

I'd like to write a ruby script that periodically reads this data, but so far, I haven't even figured out how to access the data.

I played around with telnet and tested a simple client script in ruby, both of which left me pretty much where I started.

Does anyone have any information that could help?

Upvotes: 0

Views: 306

Answers (1)

ziq
ziq

Reputation: 1018

Since it supports Ethernet communication, try to use Socket provided in Ruby Standard Library.

Check :http://www.ruby-doc.org/stdlib-1.9.3/libdoc/socket/rdoc/Socket.html

Upvotes: 1

Related Questions