• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to communicate with Hardware through Ethernet

 
Gustavo Moreno
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

I am using a Behavior Box (a hardware device to train animals in Lab). In this device the animal (in case, the Rat) trigger switches and receive as response some stimuli, like water valve opening so it can drink.

I was wondering, how could I use java to get the inputs from the Behavior Box and send Outputs commands to it through Ethernet or USB.

Anyone have any Idea of how to do it or where can I get information out it?

Books recomendations are wellcome.
 
Mark Vedder
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello and welcome to JavaRanch,

I've never done this type of stuff myself. But you may want to start by looking at The Java Communications 3.0 API which is for communicating with attached devices. If I am not mistaken, it primarily is for RS-232 hardware (serial ports) and limited access to IEEE-1284 (parallel ports).

If you are interested in using USB, take a look at the article Java and USB.

As far as Ethernet, if the Behavior Box supports TCP/IP, you can use the standard Java IO classes. If not, how you interact with it over Ethernet will vary depending on protocol the Behavior Box does support. Remember that Ethernet is Layer 2 (if I am remembering my OSI Model correctly.)

Hopefully that can get you started. And some other JavaRanchers may have some additional information and/or resource recommendations. Good Luck.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!