Re: Two Usb towers

"Steve Hassenplug" <[email protected]>
Newsgroups gmane.comp.hardware.lego.robotics
Organization None
Message-ID <[email protected]>
On Tue, August 2, 2005 4:47 pm, Steve Lane  [email protected]> wrote:
> My current setup use's two IR towers, one serial, one Usb, to communicate to two
> Rcx's. The usb setup is contained inside a cardboard box to prevent clashing of
> the IR.
>
> I'd like to swap the serial tower for a Usb version so I don't have to keep on
> having to buy 9V batteries.
>
> I have a Visual basic program that talks to the two towers, and it's really easy
> to differentiate between them, but if I use two towers I'll need to address Usb1
> and Usb2 via the Phantom.dll. Is this possible and if so which command(s) do I
> use to differentiate between the two towers?

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
--

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?)

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.