Question on RS485

News, rumors, and other broad discussion topics.
Post Reply
phoenix1999
Posts: 5
Joined: 12 Nov 2010, 09:39

Question on RS485

Post by phoenix1999 »

Hi all,

I read some topics on rs485 communication but a detail is still vagueness for me.
For example : I want to make a Rs485 communication between the NXT block and a third-party system. I read that NXT support P-net protocol, but can we use another protocol? What can I do if the third-party system is only compatible with Modbus ?

I just start to work with NXT block maybe I don't understand something but I didn't find information about that.
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Question on RS485

Post by mightor »

The NXT is serial protocol agnostic. Some firmwares have P-Net implemented on top of RS485. You can use whatever you chose to implement. If your peripheral is modbus only then you will need to implement that protocol yourself on top of RS485.

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
phoenix1999
Posts: 5
Joined: 12 Nov 2010, 09:39

Re: Question on RS485

Post by phoenix1999 »

Thank you for your answer,

So I have to modify the firmware or use another if I understand correctly. However, I will have to modify the code of the R/W functions,won't I ?

PS: sorry if my English isn't perfect :)
C.G
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Question on RS485

Post by mightor »

No need to modify the firmware. I was just saying that some firmwares have it already built-in (or implemented in the higher level programming language). You could implement Modbus on top of NXC, ROBOTC, Lejos or nxtOSEK, I'm sure. It won't be trivial, but certainly not impossible. After all, it is a protocol specifically made to be simple for embedded devices, right? :)

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
phoenix1999
Posts: 5
Joined: 12 Nov 2010, 09:39

Re: Question on RS485

Post by phoenix1999 »

mightor wrote:After all, it is a protocol specifically made to be simple for embedded devices, right? :)
- Xander
Yes but for a beginning it's a little disheartening. I think I will look another way but if I have to do it, I will! (or try :D ).
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Question on RS485

Post by mightor »

What are you looking to connect to your NXT with Modbus?

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
phoenix1999
Posts: 5
Joined: 12 Nov 2010, 09:39

Re: Question on RS485

Post by phoenix1999 »

In fact, I want to connect a tracking system to guide the NXT robot. It's a project for my studies ans the final aim is to change the robot's behaviour according to the thing or person seen by the tracking system. This tracking system has multiple connection, and one is a rs485 line with profibus or modbus but finally I don't need a big data bandwidth and a I²C connection can make it. I just wanted to explore all the possibilities.
ronmcrae
Posts: 33
Joined: 28 Sep 2010, 14:56

Re: Question on RS485

Post by ronmcrae »

phoenix1999 wrote:Hi all,

I want to make a Rs485 communication between the NXT block and a third-party system.
What language are you planning to use? If it's NXC I could provide some very basic code that creates a Modbus message, sends it, then packages the response into an NXC string. The code is basic and doesn't do any parsing, decoding or interpretation of the response. I really just wanted to prove that an NXT could talk to my employers products using the port 4 RS485 capability with a Modbus packet. Once I proved the physical link would function (which I did) I lost interest, but what I have might be useful as a start point for your project.

BTW, I'm pretty sure that if you are using the RS485 port to talk to anything but an NXT you must use John's enhanced firmware, since that is the only way to configure stuff like the baud rate, parity etc.

Ron.
mightor
Site Admin
Posts: 1079
Joined: 25 Sep 2010, 15:02
Location: Rotterdam, Netherlands
Contact:

Re: Question on RS485

Post by mightor »

Ron,

I would be interested in this, too :)

- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
phoenix1999
Posts: 5
Joined: 12 Nov 2010, 09:39

Re: Question on RS485

Post by phoenix1999 »

What language are you planning to use?
Good question :) because I discover all the system and finally don't now how to start to send a message with the NXT by RS485. I think that I have to make a Labview block to communicate.

About using other firmware and studying it, I let it be because I don't have enough time for my project (2 days per week) so I have to use a faster way to communicate witch is a simple I2C connection. However, all the possibilities that NXT system offer are interesting, maybe I asking you questions later. ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests