RS485 NXT-G Block
RS485 NXT-G Block
I have created a NXT-G block to use the RS485. Xander posted to his blog. Here is the somewhat formal release notes:
This block only uses sensor port 4 of the NXT to connect to another NXT (via sensor port 4). This block takes a string (in send mode) and will send it over port 4, using RS485. It does not check to ensure the other NXT receives it. As long as the send block successfully communicates it will return an output string of 0. A non 0 output value means an error occurred. This means you can broadcast a message to several NXTs. You can send numbers via this block, but you must convert them to a string first. In read mode, the NXT will check its RS485 buffer until it gets a message. This means it will wait for a message and not move on until it gets one. If you plan to continually read a value, I suggest you do this in parallel in a loop as to not halt the overall program. The value read will be returned as a string.
This is just the first release, so I am looking for some feedback. I plan on releasing another block in the near future with support for addressing and sending booleans and numbers. Please post comments below.
This block only uses sensor port 4 of the NXT to connect to another NXT (via sensor port 4). This block takes a string (in send mode) and will send it over port 4, using RS485. It does not check to ensure the other NXT receives it. As long as the send block successfully communicates it will return an output string of 0. A non 0 output value means an error occurred. This means you can broadcast a message to several NXTs. You can send numbers via this block, but you must convert them to a string first. In read mode, the NXT will check its RS485 buffer until it gets a message. This means it will wait for a message and not move on until it gets one. If you plan to continually read a value, I suggest you do this in parallel in a loop as to not halt the overall program. The value read will be returned as a string.
This is just the first release, so I am looking for some feedback. I plan on releasing another block in the near future with support for addressing and sending booleans and numbers. Please post comments below.
Blog: 08milluz.wordpress.com
LMS Shuttle: facebook.com/lmsshuttle
LMS Shuttle: facebook.com/lmsshuttle
-
- Posts: 252
- Joined: 22 Oct 2010, 20:05
- Location: The United States of America
- Contact:
Re: RS485 NXT-G Block
Thank you for showing such support to us NXT-G users, and enabling RS485 communication with NXT-G! For quite a few weeks, I've been thinking,"if only I could do RS485, then this would be so much easier!", and here I stand with it a reality! Although, of coarse, you had probably been working on this block for more than a few weeks . I've attached a demo program with this post which scratches the surface of what can and will be done with this new block. I will give feedback in two forms, one in video, and another in text.
Click here for the one in video:
Click here for the version in text which has no stuttering, or "uh"s, and includes some important details that might have gotten left out in the video:All in all, this is a great block, and I take into account that the main reason that we have all these bugs is that this is a very early version, and I hope that my feedback is helpful to you, and that it is taken as friendly criticism, and not interpereted as trolling or flaming. Thank you for bringing the RS485 capabilities to us NXT-G users. Many thanks from me, and keep it up.
Click here for the one in video:
- Attachments
-
- RS485 Test.zip
- Here is a little demo program I made with the new RS485 block, along with a MyBlock, and another costum NXT-G block.
- (625.8 KiB) Downloaded 738 times
-Hayden
Re: RS485 NXT-G Block
Thanks for the feedback. I have no idea what the "t" thing is. I will try to reproduce that.
As for the 0 return value. When do something on the NXT you write to a register in the firmware. This block does the same thing. I dont require a reply in this block (though I am making a block that implements a communication protocol that would handle that) so all it knows is that it was written to the firmware. So in theory if there is a disconnected cable or something, it would have no idea if it got the information.
Keep the feedback coming. Also if there are any artists out there that could make a nice graphic for this (36 pixels by 36 pixels), I would be very happy. My MS Paint skills only go so far.
As for the 0 return value. When do something on the NXT you write to a register in the firmware. This block does the same thing. I dont require a reply in this block (though I am making a block that implements a communication protocol that would handle that) so all it knows is that it was written to the firmware. So in theory if there is a disconnected cable or something, it would have no idea if it got the information.
Keep the feedback coming. Also if there are any artists out there that could make a nice graphic for this (36 pixels by 36 pixels), I would be very happy. My MS Paint skills only go so far.
Blog: 08milluz.wordpress.com
LMS Shuttle: facebook.com/lmsshuttle
LMS Shuttle: facebook.com/lmsshuttle
Re: RS485 NXT-G Block
Dude, they're bloody legendary!milluzaj wrote:My MS Paint skills only go so far.
- 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)
| 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)
-
- Posts: 252
- Joined: 22 Oct 2010, 20:05
- Location: The United States of America
- Contact:
Re: RS485 NXT-G Block
Well, I might be able to help. I have made an icon, and apllied it to the image files in the NXT-G block. In this .zip file can be found screenshots from NXT-G of what the icon looks like when applied to this block. Heres a couple now:milluzaj wrote:Keep the feedback coming. Also if there are any artists out there that could make a nice graphic for this (36 pixels by 36 pixels), I would be very happy. My MS Paint skills only go so far.
In my opinion, it doesn't look too bad, but that's probably just because I am proud of my day's work. Anyway, it's pretty much all there for you in the .zip if you decide to use it. The icon, and the dragged image are there. But you'll notice that I do not know how to edit the "Config RS485.vi" file, and that the original icon is still shown in the configuration panel, so you'd have to raplace it with the "RS485configpanel.png" image that I've also included which should be pretty straight forward (if you decide to use these image files). So, if you think that these images are pathetic, and completely unsuitable for your block, then do not hesitate to say no thanks to this offer, I will not be offended at all. If you decide to use them, then GREAT!!
- Attachments
-
- RS485icon.zip
- Here are the image files that I used when applying the icon to this block, along with a few screenshots of this block in action, and the image that I normally would have put into the configuration panel if I knew how to edit the "Config RS485.vi" file.
- (258.05 KiB) Downloaded 692 times
-Hayden
-
- Posts: 224
- Joined: 30 Oct 2010, 04:10
- Location: 127.0.0.1
- Contact:
Re: RS485 NXT-G Block
I've made some graphics...
-Tim
Hope you like them-Tim
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Re: RS485 NXT-G Block
Thanks for the great block. I tested it, If I send "12345" then send "1234567", the slave NXT shows "123456". I think it's the problem of buffer. Would you please check it? Thanks!
- Attachments
-
- rs485test.zip
- RS485M for Master NXT, RS485S for Slave NXT.
- (355.8 KiB) Downloaded 677 times
Re: RS485 NXT-G Block
Thanks for the images. If you dont mine, I would love to use some of them in future blocks (and revision 2 of this one). I have a block with a protocol coming soon (similar to Xander's protocol for the xbee in robot C).
I am going to play with the buffer issue. I cant seem to replicate it, but I will keep trying. What firmware was that with?
I am going to play with the buffer issue. I cant seem to replicate it, but I will keep trying. What firmware was that with?
Blog: 08milluz.wordpress.com
LMS Shuttle: facebook.com/lmsshuttle
LMS Shuttle: facebook.com/lmsshuttle
-
- Posts: 224
- Joined: 30 Oct 2010, 04:10
- Location: 127.0.0.1
- Contact:
Re: RS485 NXT-G Block
Hi, If it was my images you were talking about then sure you can use them
-Tim
-Tim
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
-
- Posts: 323
- Joined: 29 Sep 2010, 05:03
Re: RS485 NXT-G Block
Hi,
If you looking at adding a higher level protocol you may want to consider bitbus...
http://www.bitbus.org/
When I added RS485 support to leJOS I spent a fair bit of time looking around at various protocols to use and finally decided on bitbus. It seems to strike the right balance between robustness and simplicity. The packets use CRC-16-CITT error checking and the protocol allows for multiple devices and handles retransmission etc. The leJOS firmware and class libraries contain code that allows you to construct a master slave network using the name or Bluetooth address of the NXT to establish reliable connections between up to 8 devices.
Andy
If you looking at adding a higher level protocol you may want to consider bitbus...
http://www.bitbus.org/
When I added RS485 support to leJOS I spent a fair bit of time looking around at various protocols to use and finally decided on bitbus. It seems to strike the right balance between robustness and simplicity. The packets use CRC-16-CITT error checking and the protocol allows for multiple devices and handles retransmission etc. The leJOS firmware and class libraries contain code that allows you to construct a master slave network using the name or Bluetooth address of the NXT to establish reliable connections between up to 8 devices.
Andy
Who is online
Users browsing this forum: No registered users and 2 guests