Re: Two Usb towers

"Steve Lane" <@qs483.pair.com stevenrobertlane@ <nospamplease>[email protected]>
Newsgroups gmane.comp.hardware.lego.robotics
Organization None
Message-ID <[email protected]>
In lugnet.robotics, Steve Hassenplug wrote:

>
> When you use VB, I assume you have a function something like this to find & open the
> port:
>
> --
> Public Function FindTower()
>     On Error GoTo FindError
>     Dim strPort As String
>     Set Me.LEGOcom = New LEGOVPBrickLib.VPBrick
>     Me.LEGOcom.FindPort strPort
>     Me.LEGOcom.Open strPort
>     Me.LEGOcom.Monitor True
>     Exit Function
> FindError:
>     If Err.Number = -520093436 Then
>         MsgBox "Tower not found"
>     Else
>         MsgBox "Error (" & Err.Number & ") " & Err.Description
>     End If
>
> End Function
> --

I decided not to start work on this problem until my second Usb tower arrived.
It came a few days ago and now I've found the time to work on it, but I've hit
another problem.

I haven't got any code like that above, because (as I've only just realised) I'm
not using Ghost.dll but Phantom instead, which is the usb version of Spirit.ocx.
It's been that long since I added it to my program that I'd completely forgotten
I'd done it. The reason I did it was because it was so much simpler to use
Phantom because I already understood Spirit.ocx, rather than learn how to use
Ghost as well.

So now it turns out I can't use Phantom in my attempts to control two usb towers
as it only supports one. I've just been reading some Ghost documentation and it
seems to work in a completely different way to Spirit.ocx. It doesn't even
support the functions I need, namely Poll() and Setvar(). It doesn't even seem
to have equivalents and seems ridiculously complicated.

I've noticed Spirit and Ghost are rarely mentioned here, let alone compared. I'm
beginning to see why, but I like Spirit because of it's simplicity (although I
did have a few problems early on).

If I can't replicate Spirit's functionality with Ghost than I'll have to revert
to the rechargeable solution, which I'm very close to deciding to do at this
point. If the solution exceeds a certain level of difficulty to solve then it
won't be worth it compared with just changing batteries and I'll take that
course instead.

Steve
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.