Shop OBEX P1 Docs P2 Docs Learn Events
.Net <-> BS2 — Parallax Forums

.Net <-> BS2

RICoderRICoder Posts: 91
edited 2009-01-14 02:37 in BASIC Stamp
After struggling for some time with RDS, I decided I'd just write my own program. The result is a .Net user control called BoESerialPort that can be plopped down on any form and just works. Not sure if anyone would want such a thing, but if there is interest I will compile it and drop it on this thread as an attachment.

Features thus far:
Properties - Baud / Data Bits / Port
Can set a start/stop character for messages (like a ~ or !)
Raises an event called MessageReceived whenever there is a complete message in the queue waiting
Has a BuildMessage and SendMessage functions that allow for posting messages to the BoE
Built in SerialPort object, so there is no need for any other serial work.

One can literally just drop it on a form, set a couple of properties in the designer, run the app and send it an "Open" command, and it works.

Let me know if anyone is interested, and I'll share.

Comments

  • gdseasgdseas Posts: 2
    edited 2009-01-14 01:30
    I presume RDS is the MS-Robotics Development Studio -- is there enough docs (do you have the URL?) to work with RDS and the BOE2?

    Gregory
  • RICoderRICoder Posts: 91
    edited 2009-01-14 02:37
    Yes, RDS is the MS-Robotics Development Studio. Personally, I don't much see the point of it (though I may be missing something). What it does is expose ways of creating "services" which are encapsulated objects that command a robot to do a particular thing. These services have to contain the code to build and send the serial communications to the robot. Once built they can be used in the visual designer, which I suppose is spiffy, but doesn't do much for me.

    Even still, you need to program the 'bot to receive and handle those messages. At that point, I feel you might as well do it yourself. All I did was create a custom user control that has an embedded serialport object, and then put in a few functions to deal with building the messages how I want them (they start with a 255 and end with a 0) and also receive messages (starting and ending with a ~) and then raising an even when a full message is received. (That gets rid of a lot of the threading issues you can run into with serial communications on a PC).

    The rest was putting the code on the BoE to deal with receiving and sending the messages (of which I have 3 right now). It was pretty straight forward, and I know some people had tried to do it, so I thought I'd share.

    The ONLY issue I have right now, is that I am using Express Edition of C# so I cannot compile the stupid control to a .dll or .ocx. I'll probably just "find" a copy of enterprise edition and use that.
Sign In or Register to comment.