To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 24214
24213  |  24215
Subject: 
Re: Two Usb towers
Newsgroups: 
lugnet.robotics
Date: 
Tue, 2 Aug 2005 22:02:32 GMT
Viewed: 
1095 times
  
On Tue, August 2, 2005 4:47 pm, Steve Lane  yahoo.co.uk@qs483.pair.com> 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



Message has 2 Replies:
  Re: Two Usb towers
 
(...) I don't, but I will have soon. All I have/need at the moment is the line: form2.PhantomCtrl1.InitComm (...) 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 (19 years ago, 2-Aug-05, to lugnet.robotics)
  Re: Two Usb towers
 
(...) 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 (...) (19 years ago, 15-Aug-05, to lugnet.robotics)

Message is in Reply To:
  Two Usb towers
 
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 (...) (19 years ago, 2-Aug-05, to lugnet.robotics)

10 Messages in This Thread:



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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
4 hours ago
Custom Search

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