LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-14-2010, 10:03 AM   #1
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 444

Rep: Reputation: 17
Linux RS485 multi drop and RS232 programming differences


Hello
I wanted to know how can I write a program that work with multi-drop RS485 networks. I know that RS485 and RS232 are the same in programming in point to point situations but what about in multi-drop network that I have to address the receivers or does RS485 Hardware manage the connection(Impossible I think).
and do you know any good TCP to RS485 gateway application or module for linux .
 
Old 12-14-2010, 10:48 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,164

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
RS-485 is strictly a electrical specification and nothing to do with protocols. How to address devices on the bus depends on their individual protocols as specified in the manual. I played with one TCP 485 gateway, a device sold by Omega and did it did not really work with the software I was using so I can not recommend any others.
 
Old 12-17-2010, 10:11 AM   #3
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 444

Original Poster
Rep: Reputation: 17
you said that you used TCP 485 gateway but I do not want to use that it cost too much in my project and all of my devices have RS485 so I want to use it directly (multi drop connection)and it has to have some addressing in programming when all of the devices using single bus to transmitting data and it can not be hardware responsibility to manage it.
 
Old 12-17-2010, 02:12 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,164

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
I ended up not using the gateway.

It depends on the hardware. All of the RS-485 equipment that I have uses simple ASCII commands. The command consists of a start character, address and the actual command which can be any valid ASCII character. The end of command is typically a CR. If the address does not match then the other devices on the bus ignore it.
 
Old 12-18-2010, 02:25 AM   #5
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 444

Original Poster
Rep: Reputation: 17
thanks a lot.
do you have any good site reference that has some example on some simple brand or can you share your code for me for more guide.
 
Old 12-18-2010, 04:53 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,164

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
http://www.easysw.com/~mike/serial/serial.html
http://tldp.org/HOWTO/Serial-Programming-HOWTO/

What type of 485 devices are you using?
 
Old 01-10-2011, 05:28 AM   #7
golden_boy615
Member
 
Registered: Dec 2008
Distribution: Ubuntu Fedora
Posts: 444

Original Poster
Rep: Reputation: 17
I found my answer
I am using modbus behind RS485 and modbus has it's own slave ID to recognize devices on same bus.
 
Old 01-10-2011, 01:17 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,164

Rep: Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784Reputation: 784
Thanks for posting back that you found the answer.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtualization of a com port (RS232 and RS485) msstevens Linux - Networking 3 12-14-2010 04:48 PM
rs232 serial port programming ddlawrence Programming 18 06-06-2010 12:47 PM
RS232 Multi I/O nick2005 Red Hat 1 02-02-2010 03:51 PM
RS232 + Networking Programming lucky6969b Linux - Networking 5 11-29-2005 08:16 PM


All times are GMT -5. The time now is 03:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration