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:
I don't, but I will have soon. All I have/need at the moment is the line:
form2.PhantomCtrl1.InitComm
>
> --
> 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
> --
>
> if you save the value of strPort, and execute .Findport again, it should return
> another string, which is the name of the second port. Those are the values you use
> when you open the port you want to communicate from.
>
> Does that help? (is it clear?)
It looks straightforward enough. I can't do anything tonight as it's too late
but I'll report back soon.
Thanks Steve (again) :-)
Steve