Author Topic: Help in Ruby and GSD  (Read 2840 times)


  • Newbie
  • *
  • Posts: 12
    • View Profile
Help in Ruby and GSD
« on: March 18, 2011, 03:44:45 am »

   I´m new in the forum. I´m also new in LinuxMCE, I installed the system two month ago. I read many posts but not found a answer to my question.
   I´m trying to build a home automation using a PLC with a ethernet interface. At this moment the house ligth are working fine with the PLC. I want to integrate the PLC to LinuxMCE.
   There are hexadecimal codes capable of create a connection between PLC and a PC. Now I´m trying to create that connection.
   I´m having trouble establishing that connection.
   Could anyone help me? Should the PLC be a server or client (I think a Server)? How do I open a connection and send/receive information?

Thanks in advance,



  • Veteran
  • ***
  • Posts: 149
    • View Profile
Re: Help in Ruby and GSD
« Reply #1 on: March 18, 2011, 08:42:38 am »
I think you need to provide some more information for anybody to help you.
- What device?
- What protocol does it use?
- Do you have any examples?
- And so on



  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Help in Ruby and GSD
« Reply #2 on: March 18, 2011, 01:41:44 pm »

   - I use the FBS 24MA PLC from Fatek.
   - The protocol communication can be Fatek protocol or ModBus. (
   - A example of a command in Fatek protocol - in attached file. (The command is a hexadecimal code).
   My PLC are in the IP (like server). I used this script in Ruby to connect at the PLC:

 require 'socket' 
 streamSock = "", 500 ) 
 str = streamSock.recv( 100 ) 
 print str 
   The port 500 is configured in PLC. When I run this script nothing happens.
   Anyone have an idea?