• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to communicate with Hardware through Ethernet

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 624
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic