Page 1 of 1

Question on RS485

Posted: 12 Nov 2010, 10:13
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.

Re: Question on RS485

Posted: 12 Nov 2010, 11:24
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

Re: Question on RS485

Posted: 12 Nov 2010, 12:57
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

Re: Question on RS485

Posted: 12 Nov 2010, 13:16
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

Re: Question on RS485

Posted: 12 Nov 2010, 13:30
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 ).

Re: Question on RS485

Posted: 12 Nov 2010, 13:39
by mightor
What are you looking to connect to your NXT with Modbus?

- Xander

Re: Question on RS485

Posted: 12 Nov 2010, 14:33
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.

Re: Question on RS485

Posted: 15 Nov 2010, 19:23
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.

Re: Question on RS485

Posted: 15 Nov 2010, 22:11
by mightor
Ron,

I would be interested in this, too :)

- Xander

Re: Question on RS485

Posted: 18 Nov 2010, 08:24
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. ;)