LinuxMCE Forums
May 21, 2013, 07:25:58 am GMT-1 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com
 
   Home   Help Search Chat Login Register  
Pages: [1]
  Print  
Author Topic: Help in Ruby and GSD  (Read 649 times)
edbroni
Newbie
*
Posts: 12


View Profile
« on: March 18, 2011, 03:44:45 am »

Hi,

   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,

Edgar
Logged
JoakimL
Veteran
***
Posts: 149



View Profile
« 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

/Joakim
Logged
edbroni
Newbie
*
Posts: 12


View Profile
« Reply #2 on: March 18, 2011, 01:41:44 pm »

0JoakimL,

   - I use the FBS 24MA PLC from Fatek.
   - The protocol communication can be Fatek protocol or ModBus. (link:www.esea.cz/support/fatek/FBs_Manual/Manual_2/Appendix2.pdf)
   - A example of a command in Fatek protocol - in attached file. (The command is a hexadecimal code).
   
   My PLC are in the IP 192.168.1.3 (like server). I used this script in Ruby to connect at the PLC:

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

Thanks,

Edgar
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!