To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcxOpen lugnet.robotics.rcx in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / 2809
2808  |  2810
Subject: 
Re: Microsoft .NET Interface for LEGO Mindstorms
Newsgroups: 
lugnet.robotics.rcx
Date: 
Sat, 29 Apr 2006 07:21:32 GMT
Viewed: 
10683 times
  
Has anyone tried this?

It appears to be a bit buggy.

I tried the VB version first and found that the C4F.LegoRcx.dll that wraps Ghost for .Net access could not be loaded because it had dependencies on msvcr80d.dll and msvcm80d.dll files. These are debug versions of the msvcr80.dll and msvcm80.dll files found in the WindowsWinSxS folder.

I then tried the C++ version on a machine that already had C++ Express installed and found that C4F.LegoRcx.dll loaded because msvcr80d.dll and msvcm80d.dll were present. Installing C++ Express on the original machine also installed the missing DLLs and then the VB was able to load C4F.LegoRcx as well.

Having got that far, I wrote a small VB test program and that worked fine. Next I looked at the VB Music sample that is supposed to display a piano keyboard so that when you click on it the RCX plays the corresponding note. In practice, the program crashed due to a fairly obvious bug in the PianoControlMouseDown routine.

I changed

Dim keyToPlay As RcxNote = System.Enum.Parse(Type.GetType(“PianoKey”), noteName)

to

Dim note As RcxNote = RcxNote.A0 Dim keyToPlay As RcxNote = System.Enum.Parse(note.GetType, noteName)

and it then played most of the notes without crashing (there are some other bugs). It just goes to show that when using reflection, referring to types by name is as bad as switching Strict off as everything stops working if you rename any of the types concerned.

Also, the documentation does not mention the threading issues you crash into as soon as you try to do something simple like logging events from sensors into a list box for example. Sensor events are generated from a different thread to that running the Windows Forms UI. The easiest thing to do is to set

CheckForIllegalCrossThreadCalls = False

in the Form.Load event handler rather than going to the trouble of programming full inter-thread calls. This will work OK for most simple logging applications.

I guess it’s free so you cannot complain too much, but when I do free stuff, I still test things and take a pride in my work. The guys at MS and SharpLogic must have a different ethos.

NOTE: I have not tried the C# and J# versions, but I suspect that they will have the same problem with C4F.LegoRcx that the VB version did.

Arthur Clarke



Message is in Reply To:
  Re: Microsoft .NET Interface for LEGO Mindstorms
 
(...) Well, that certainly (URL) steals my thunder>, doesn't it! "The Microsoft .NET Interface for LEGO MINDSTORMS wraps LEGO's GhostAPI.dll and emulates a real-time controller model." At least that means the work I've done for the Control Lab won't (...) (19 years ago, 20-Apr-06, to lugnet.robotics.rcx, FTX)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR