Toastie

LEGO History: Programming 20 years old Mindstorms RCX’ on modern computers

Recommended Posts

Dear All,

LEGO lasts forever – assuming “forever” is exceeding 6 decades – which surely will happen (or has happened already?).

I still have bricks from 1965 (my first LEGO set was #323 – a push along steam train running on rubber tires …) – that still have very good clutch, colors only very little faded – and seamlessly fit into 2017 sets. Almost as long as I live, LEGO has been part of my life. True, there were dark ages from the late 1970’s to 1996 – but then it instantly came back – everything: The excitement about a new model, just another LEGO box, new bricks, colors … and it never disappeared since then, in contrast. 1998 was the ultimate rush back into the LEGO world: The Mindstorms RIS system – the RCX (at that time without the “1.0” extension) – it blew my mind. And since then a somewhat larger collection of all themes has assembled over the past 20 years. Building over multiple themes is my brick-philosophy.

During my dark ages computer technology became my favorite hobby. The “IBM PC” was lightyears out of reach but other miracle machines came up: The C64, the Sinclair ZX81 – and that one was within reach of my limited budget! 1 kByte of memory and a 16 kByte dynamic RAM extension I built myself. “Tri state TTL bidirectional bus drivers”, the 74LS243 – and no internet, that remained to be invented. And it went on – the ZX Spectrum with 16 kByte of on-board memory got a 64 kByte memory “upgrade” – switchable in two banks. It was fun. Today, TTL chips are fading out and 64 kByte would result in the worst digital “photo” ever …

I am not whining – so many wonderful new things have emerged! What really shocked me though was when TLG did not even think about making a 64 bit driver for the “perfect” Mindstorms USB IR/VLL tower. That beautiful communication hub for all RCX1.0, 1.5, 2.0, Scout, Spybotics, MicroScout, CodePilot bricks one is truly dead since 64 bit operating systems have taken over. At least this is what I have learned from the internet after years of searching. The next shock came around 2002, when .NET came up and Microsoft said “no more VB6 development at all”. VB.NET was so different from what I knew. In the following years I stuck to VB6 … my fault, sure. But I am moving slowly as time for LEGO is rather limited. XP vanished, 32 bit OS came out of fashion – and all that cool stuff – the Mindstorms software, the NXT software, NQC for RCX, RobotC for RCX … and all my VB6 programs – almost “gone”. Well, I kept of course my Dell Latitude E6500 laptop running WinXP SP3 with all that stuff installed and I still have it! Carefully backed-up everything and there it is, slowly aging. I hardly like to play with that thing – I don’t want that it gives up, which will eventually happen of course.

Yes I know: “Install XP within a virtual machine” – but that did not work to the extent I would like to use a “LEGO programming and playing workspace”. The one thing that changed everything were internet rumors about the old Mindstorms RS232 tower working well with NQC/BricxCC on a 64 bit Win7 machine. So for the past couple of days between Christmas and New Year’s I was browsing the net, installing this and that, copying stuff from my old XP machine … and: BINGO. It all works! Everything works on my rather new DELL Precision 7510 with Win10 Professional as OS. All the old-back-from-the-late-1990’s stuff! OK, I know, not everybody will be as excited as I am. But I believe LEGO lasts forever – and now all the software I love so much, as well as all my old-fashioned programmable bricks (there are currently 9 RCX1.0, 6 Scouts, 10 MicroScouts, and 1 NXT PBricks doing work on my train layout) are directly accessible from this laptop, and they are programmed/operated using NQC/BricxCC, NXC, NXT-G, RobotC, the Mindstorms SDK 2.5, and most importantly VB6 SP6 programs – all natively running on a Win10 64 bit platform. A dream came true.

And for all old or old-fashioned Mindstorms PBrick heads, for all who never managed to get their head around .NET stuff, for all who still believe that RCX’ and Scouts are miracle thing: Here is how I got it to work:

  1. Assemble some software from the internet:

    1. BricxCC (free, latest version from 2011)

    2. The Mindstorms Software Developers Kit (SDK) 2.5 (free on Philo’s homepage)

    3. RobotC for RCX 2.03 (which is free as well). Don’t download the 32 bit tower driver. It won’t work.

    4. The NXT 64 bit driver from TLG 

    5. VB6 SP6 from Microsoft

    6. VB6 cumulative update for SP6 from Microsoft

  2. Get out the original CDs for:

    1. VB6 (SP5 or higher)

    2. The NXT-G 2.0 software suite – if that is not at hand, TLG’s Mindstorms website has it

  3. Assemble some required hardware

    1. The Mindstorms RS232 tower. They came in 1998 with the original RIS system – and they are widely available at BrickLink for about $5. Don’t forget to put a fresh 9V battery into the battery compartment on the back. Slide the range knob on the front to the left (short range).

    2. An USB2RS232 converter – I tried a (randomly picked) LogiLink converter, which works just fine.

    3. A PBrick of type RCX, RCX1.5, RCX2.0, Scout, or Spybotics.

  4. The next steps are for proper tower access:

    1. Plugin the USB2RS232 converter into the computer and let it find and install the driver (either shipped with the converter or on the internet).

    2. Open device manager (Windows key + X, select “Device Manager”), expand the “Ports (COM and LPT)” section, find the “USB Serial Port (COM X)” entry, double click it, choose “Port settings” then “Advanced” and make sure the COM port for this device is in the range between 1 and 8. Otherwise BricxCC and other old programs will not find the USB/RS232 converter = IR tower! It cost me some time to figure that out. When all COM ports in this range are taken by other devices, move one of them to the next free COM port far up and then manually (modern hard/software has no issue using COM ports in the range exceeding COM 8!) assign the converter to the now free COM port in the 1 – 8 range.

    3. Plugin the IR tower cable into the USB2RS232 converter.

  5. Next is getting access to RCX, RCX2, Scout, and Spybotics PBricks via BricxCC – this will also let you download the latest RCX firmware is case it is “gone”:

    1. Install BricxCC (full install) – this comes with NQC and many more things, e.g., the RCX firmware downloader.

    2. Put a PBrick from the list above into the IR tower range, a couple of inches away.

    3. Start-up BricxCC – it will try to connect to an RCX PBrick and most probably fail (“Cannot find brick. Switch it on or move it closer and press OK”). Press “Cancel”. Select “Tools” in the menu, go to “Find brick” and in the window that opens, select the correct COM port manually. Also select the correct PBrick. An RCX, RCX1.5, or RCX2 without firmware will correctly reply to the “RCX-type” in this window.

    4. The LED in the tower should come on and the program should connect to the PBrick, which is shown by many of the menu icons now being enabled.

    5. Download firmware to the PBrick (RCX, RCX1.5, RCX2) and that is done.

  6. Next is RobotC – this very straight forward:

    1. Install the software and run it.

    2. Select menu entry “Robot” and then “Platform type”. This should be “LEGO Mindstorms RCX”.

    3. Select menu entry “View”, then “Preferences”, then “RCX communications port” and select the COM port you have the USB to serial converter on.

    4. Download the required RobotC RCX firmware – and done.

  7. Next ist NXT-G – again very straight forward:

    1. Install the NXT-G software.

    2. Install the 64 bit NXT driver – done.

  8. Finally VB 6 – this is a little more elaborate:

    1. Install the Mindstorms SDK 2.5 – this will register one essential DLL correctly (vpbcom.dll). I don’t know how many times I tried that manually – I am too old I guess. Don’t install any USB tower software – it won’t work.

    2. You can test a PBrick connection using the “ScriptEd” program – upon starting it, the IR Tower LED should come on. This program also lets you download firmware or monitor the IR tower. Very handy for checking things.

    3. Install VB 6 from the CD. Now the trick here is that a full default install won’t work. Follow the instructions of this youtube video. There are many others, but this worked for me. I did the install directly from the “VB6 Professional CD” I still had (the video assumes you have an enterprise version but that makes no difference). The single most important point is to uncheck either the entire “Data Access” check box during the preparation steps for the installation or select “Data Access”, click “Change Options” and uncheck the “ADO, RDS, OLE DB Data providers” entry.

    4. The let the install program do what it has to do and be patient at the end, when it attempts to register all sorts of things. That may take several minutes, at least on my machine. I had a cup of coffee, did some other things and when I came back, it successfully finished the install.

    5. Install VB6 SP6 in case it is not already on the CD.

    6. Install the cumulative patch for VB6 SP6 in case it is not already on the CD.

    7. Right click on the new VB6 icon in the start menu, go to “Properties” and select “Run in XP SP3 compatibility mode”.

    8. Run VB6.

    9. Open or start a new project, then select “Project”, “References” and then tick the “LEGO VPBrick 2.1 Type Library” – and access to the above PBricks is established! The Mindstorms SDK has a PDF explaining the calls to the routines you need for that (e.g. ”FindPort” or “OpenPort”.

This is it. At least on my computer. There may some other things to do on other machines, but it really appears to be doable.

Just in case you want to program with VB6 “forever” or more importantly run all of TLG’s miracle PBricks from the latest Microsoft OS … as I do.

And Yes I know, neither Microsoft nor any decent programmer will endorse this, in contrast. But then: It wasn’t my fault that TLG never published a 64bit driver for the Mindstorms USB tower. Nor did Microsoft ask me whether or not it would be OK to abandon VB6:tongue:.

 

All the best
Thorsten

Edited by Toastie

Share this post


Link to post
Share on other sites

Thanks for this. I've been meaning to get myself a few RCX bricks, since I have acquired an abundance of 9V motors and RCX sensors second hand, and have mostly used them with NXT via converters. With your findings, it should make it less daunting to set everything up.

Share this post


Link to post
Share on other sites

Oh dear, this brings back memories. Thanks for this very detailed guide. I really appreciate this since rcx was my first robotic kit.

I remember using original Lego software with Windows 2000 (not ME) and XP. I remember that installation was a drag. Have you perhaps tried to install it?

I liked the IR port of RCX as it enables one to control Power Functions with it (a chap named Bob Kojima made some sort of demo program a while ago). However my knowledge of programing is so low, that I couldn't do anything serious with this.

Share this post


Link to post
Share on other sites

Nice to hear that you got it working - there are occasional posts here asking for help getting RCX to play nice with modern operating systems (and vice versa). I think your excitement will be shared by others. 

Share this post


Link to post
Share on other sites

Yes.. I have an RCX brick that has not been touched in far too long... I've been meaning to find time to bring it alive again, maybe to operate some GBC's... thanks for your work!

Share this post


Link to post
Share on other sites

This is really great work. :classic:

Programming with NQC was my first programming experience and taught me so much about programming, compiling and using the command line.
To this day i prefer programming in a text editor (Kate) and using the command line to compile and run a code over any integrated development program.

My RCX is sitting in my current collection just waiting to be used.

 

21 hours ago, Toastie said:

Assemble some required hardware

  1. The Mindstorms RS232 tower. [...]

  2. An USB2RS232 converter

Did you by chance test your setup with the USB IR-Tower?

Share this post


Link to post
Share on other sites

Thank you all for your kind words! I am kinda surprised (although I surely hoped for!) that so many people do have their RCX' close by ...

5 hours ago, schraubedrin said:

Did you by chance test your setup with the USB IR-Tower?

Well, that was part of the motivation for the entire install-frenzy:laugh::  TLG never released a 64 bit USB tower driver. And their 32 bit driver does of course not work on 64 bit OS'. Which is really really bad, as this tower had some handy settings available (3 ranges, and more) plus, it also had a VIS LED that allowed communication via VLL and thus access to Code Pilot and MicroScout bricks. I was very frustrated when I learned that. But: The old serial tower is the work around. As new computers are hardly equipped with RS232 interfaces - particularly laptops - the USB2serial converter is the work around. The Mindstorms communication DLL VPBrick, which installs correctly with the Mindstorms SDK 2.5, is capable of talking to both 32bit USB as ports well as plain vanilla RS232 COM ports, I believe. And the FindPort command of VPBrick simply tries to first find any USB towers connected and then continues to find any serial towers - again I only believe from what I tried out. In short: The USB tower won't work on a 64 bit OS.

19 hours ago, teflon said:

I remember using original Lego software with Windows 2000 (not ME) and XP. I remember that installation was a drag. Have you perhaps tried to install it?

Which original LEGO software are you referring to? The graphical Mindstorms software that came with the RIS1.0/1.5/2.0 sets? No, I did not try that simply because I had the impression that slightly more complex programs are hard to compose within this environment. This is why I used NQC from the very beginning. This is a little different with NXT-G; however, the GUI has serious issues with long spaghetti-like code (not the compiler) - that is taken care of by organizing the code up using MyBlocks. See for example here (links to the NXT-G software further down).

Thanks again and all the best,

Thorsten   

 

 

Share this post


Link to post
Share on other sites
Just now, Toastie said:

In short: The USB tower won't work on a 64 bit OS.

That's really a bummer.

Guess i have to try and install the old linux version on which i worked in those days :sceptic:. If i remember correctly the drivers for the USB Tower were part of the core package

Share this post


Link to post
Share on other sites

Hi @Coder Shah,

thank you! Well @Jim outlined a way to do this ... but I forgot what that was. Maybe he reads this and then does something, I don't know.

I am still looking at the PBrick line followers line-up you made!!! That one is really great.

All the best
Thorsten

Share this post


Link to post
Share on other sites
5 hours ago, Toastie said:

Hi @Coder Shah,

thank you! Well @Jim outlined a way to do this ... but I forgot what that was. Maybe he reads this and then does something, I don't know.

I am still looking at the PBrick line followers line-up you made!!! That one is really great.

All the best
Thorsten

If I'm not mistaken, post creator just has to paste the link to this topic;

Haha glad you liked the line followers line-up! Next thing, maybe robotic arms?

Share this post


Link to post
Share on other sites

@Toastie - I am wondering if you know a resource with documentation on how to interface with the USB tower from the computer side! I've been thinking of learning Rust and it would be nice project to create a modern device driver, especially for Mac/Linux users!

Share this post


Link to post
Share on other sites
31 minutes ago, elfprince13 said:

I am wondering if you know a resource with documentation on how to interface with the USB tower from the computer side!

No sorry, I don't. To get "through" to the tower, you need the USB driver. I never did any such thing as programming a driver. As far as I know, you need to know a lot about the hardware layer of the tower (?) - and that is, again as far as I know, "not" documented. It will be a rather simple hardware infrastructure, I am sure of; there is a USB to serial converter, some 38 kHz IR LED driver/receiver and that is pretty much it, I guess. The USB tower has to generate/read 2400 baud IR signals when it talks/listens to the PBricks ... also, the VLL link is of course serial in nature. This is used by the Spybotics and MicroScouts.

Again, sorry for that. Should you have a 32bit OS/computer at hand, the 32 bit driver for the USB tower will run smoothly, of course.

Best wishes,
Thorsten

Share this post


Link to post
Share on other sites
47 minutes ago, Toastie said:

No sorry, I don't. To get "through" to the tower, you need the USB driver. I never did any such thing as programming a driver. As far as I know, you need to know a lot about the hardware layer of the tower (?) - and that is, again as far as I know, "not" documented. It will be a rather simple hardware infrastructure, I am sure of; there is a USB to serial converter, some 38 kHz IR LED driver/receiver and that is pretty much it, I guess. The USB tower has to generate/read 2400 baud IR signals when it talks/listens to the PBricks ... also, the VLL link is of course serial in nature. This is used by the Spybotics and MicroScouts.

Again, sorry for that. Should you have a 32bit OS/computer at hand, the 32 bit driver for the USB tower will run smoothly, of course.

Best wishes,
Thorsten

I do have an old Windows XP machine but I haven't turned it on in almost a decade and would be honestly surprised if it works. I wonder if it shows up as standard "USB Serial" device to the OS? That would make it easier to figure out! I thought I saw you mention somewhere that Bricx CC (which I've used in the past) knows how to use the both the VLL and IR components of the tower, but I was never aware until today that there was a VLL capability in the USB tower, so I'm curious to dig into that a bit.

Share this post


Link to post
Share on other sites
44 minutes ago, elfprince13 said:

I wonder if it shows up as standard "USB Serial" device to the OS?

You need to install the tower driver first, then attach the USB tower to the computer. Then it shows up as, well, LEGO tower.

Of course the XP machine works, man, I have an IBM XT from 1985 running as if it were a very well lubricated sawing machine! This is for the LEGO Technic Control world ... 

Good luck!

Best,
Thorsten

Share this post


Link to post
Share on other sites
2 minutes ago, Toastie said:

You need to install the tower driver first, then attach the USB tower to the computer. Then it shows up as, well, LEGO tower.

Understood

 

4 minutes ago, Toastie said:

Of course the XP machine works, man, I have an IBM XT from 1985 running as if it were a very well lubricated sawing machine! This is for the LEGO Technic Control world ... 

Good luck!

Best,
Thorsten

I have an SGI O2+ from '96 under my table too, but every time I plug it in it trips the circuit breaker :cry2:

Anyway, I'll poke around and see what I can discover.

Share this post


Link to post
Share on other sites
2 hours ago, JaBaCaDaBra said:

was there ever a way to use a vic-20 with it?

Not as I am aware - however, rumors have it that Konrad Zuse entertained the idea of implementing a USB3 port on his Z3 (that's actually where the name came from), without the need of installing any drivers. Unfortunately, they could not get the proper (more importantly cheap) jacks from China without using a time machine, H.G. Wells made popular 150 years earlier. Well. Where is my Aluminum hat - here it is.

Best,
Thorsten

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.