Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Phidget Devices

  1. #1
    Join Date
    Aug 2005
    Location
    bout 12 miles west of town, make a left, go 2 miles, make a left, then a right, got the end.
    Posts
    58
    Rep Power
    44

    Phidget Devices

    Is there a list of device names that show up in "PHIDGET.DeviceType" so that I can determine the correct type that was connected? Is there a way to decode the serial number?

    How can I determine the difference between a 0/0/4, 0/0/8, 8/8/8, or a 0/16/16 when hooked up to my app. I am trying to build some flexibility into the program.
    For example: the 0/0/4 returns "PhidgetInterfaceKit" but I think the others do also and the The "NumOutputs" returns 4, but on the 0/0/8 and the 8/8/8 the count would be the same.

    Am I overlooking a simple answer to this?


    Thanks
    J
    Last edited by cmmguy; 03-04-2008 at 06:56 AM.

  2. #2
    Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695
    Images
    118
    Rep Power
    106

    Re: Phidget Devices

    Probably the easiest way of finding the Phidget device type that was connected is by using a Phidget.Manager object. Assuming you're using .NET, download any of the example Zip files and look at the ManagerExamples. edit: I also attached the two C# Manager Examples

    Going through the code, you'll see that the Phidget Manager is basically an object that sits "outside" of the normal Phidget devices in the sense that it is used for the purpose of detecting Attach and Detach events for all Phidgets, not just a particular type. If you look in the Attach event, you'll see the AttachEventArgs object (e) getting passed in. Use this and you can run a test on e.Device.Name to see if it's the device type that you want. You can also run a check at any time on the manager object to return a list of all the connected Phidget devices using the Phidget.Manager.Devices collection.

    Is this what you're looking for?

    I'm not sure what you mean by "decode" the serial number though...

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin

  3. #3
    Join Date
    Aug 2005
    Location
    bout 12 miles west of town, make a left, go 2 miles, make a left, then a right, got the end.
    Posts
    58
    Rep Power
    44

    Re: Phidget Devices

    I am able to get the following:

    PHIDGET.DeviceType
    PHIDGET.DeviceVersion
    PHIDGET.IsAttached
    PHIDGET.LibraryVersion
    PHIDGET.Open
    PHIDGET.SerialNumber
    PHIDGET.Tag

    But I believe that the DeviceType is not unique to the 0/0/4
    I thought that maybe within the serial number may have been "coded" a model number. Some manufacturers will code various info into the serial number such as manufacture date or lot numbers.

    Of all the different Phidget devices, what are all the different DeviceType(s) that show up when hooked up?

    Thanks
    J

  4. #4
    Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695
    Images
    118
    Rep Power
    106

    Re: Phidget Devices

    Which programming language are you using?

    If you're using .NET, are you sure you're using the Phidget.Manager object? None of these commands are available on the Phidget.Manager object...

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin

  5. #5
    Join Date
    Aug 2005
    Location
    bout 12 miles west of town, make a left, go 2 miles, make a left, then a right, got the end.
    Posts
    58
    Rep Power
    44

    Re: Phidget Devices

    I am using VB6.
    The PHIDGET is the object I create when the connection is made so it could be named anything.

    Code at the top:
    Code:
    Private WithEvents PM As PhidgetManager
    Dim WithEvents IFKit As PhidgetInterfaceKit
    In the Form load event:
    Code:
    Set PM = New PhidgetManager
    the Attach Event:
    Code:
    'An InterfaceKit was found. Start everything up
    Private Sub PM_OnAttach(ByVal PHIDGET As PHIDGET.IPhidget)
        Dim I As Long
        If PHIDGET.DeviceType <> "PhidgetInterfaceKit" Then
            bInterfaceActive = False
            shapeInterface.FillColor = vbRed
        Else
            Set IFKit = PHIDGET
            iIFPortCount = PHIDGET.NumOutputs
            iDeviceSerialNo = PHIDGET.SerialNumber
            bInterfaceActive = True
            shapeInterface.FillColor = vbGreen
            ' Save settings
            ProfileWrite sINIPath, "misc", "IFPorts", Str(iIFPortCount)
            ProfileWrite sINIPath, "misc", "IFSerialNo", Str(iDeviceSerialNo)
        End If
    End Sub

  6. #6
    Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695
    Images
    118
    Rep Power
    106

    Re: Phidget Devices

    What Phidget version are you using? I just downloaded the latest vb6 Example files from Phidgets.com and this is what I found in the OnAttach Event:

    Code:
    Private Sub PM_OnAttach(ByVal deviceType As String, ByVal deviceName As String, ByVal serialNumber As Long, ByVal version As Long, ByVal tag As String)
        DisplayDevice deviceName, version, serialNumber, True
    End Sub
    Make sure you have the latest Phidget MSI installed too

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin

  7. #7
    Join Date
    Aug 2005
    Location
    bout 12 miles west of town, make a left, go 2 miles, make a left, then a right, got the end.
    Posts
    58
    Rep Power
    44

    Re: Phidget Devices

    I am using the older version because I dont like the .net extensions that I have to install for the newer version to work(examples).

    Looking at the example you posted doesnt provide any more info that the code I posted and I am still trying to see if there is an answer to my original question about "which interface is connected".

    Thanks
    J

  8. #8
    Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695
    Images
    118
    Rep Power
    106

    Re: Phidget Devices

    Looking at the example you posted doesnt provide any more info that the code I posted
    I didn't paste that code as an example to help you out. I pasted it because I was confused because the code you posted didn't match what I was looking at in the examples.

    I am still trying to see if there is an answer to my original question about "which interface is connected".
    and I'm trying to help you find that answer That's why I needed to know if we were on the same page, which now I know that we're not because you're using the older Phidget.MSI. They're significantly different in functionality and operation.

    The older Phidget.MSI I believe will return a different value than the new one when you call the DeviceType method, so it's pretty hard to help you since I only have the new Phidget.MSI. I can't remember for sure though (it's been a while since I used the old Phidget.MSI), so don't download the new one just yet cause I'm at home. When I get to work tomorrow, I'll give Phidgets a call and see what they have to say.
    Last edited by Alex; 03-05-2008 at 07:06 PM.

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin

  9. #9
    Join Date
    Sep 2006
    Location
    Carol Stream, Illinois
    Posts
    1,695
    Images
    118
    Rep Power
    106

    Re: Phidget Devices

    Hey cmm guy. Before I call Phidgets up, I wanted to check to make sure that I need to. I realized that I was mistaken about something. I was getting the DeviceType method confused with the DeviceName method.

    Using the Phidget21.MSI and the vb6 example called PhidgetMonitor, this is the results of the DeviceName method from all the Phidget devices that I just attached:

    Phidget Servo Controller 4-motor
    Phidget InterfaceKit 8/8/8
    Phidget InterfaceKit 0/0/4
    Phidget InterfaceKit 0/0/8
    Phidget Touch Rotation

    and from the TextLCD with 8/8/8 returns two DeviceNames:
    Phidget TextLCD
    Phidget InterfaceKit 8/8/8
    Could you test this method in your Phidget20 version? Maybe we get the same results?



    Also, I wanted to address your question in your PM publicly because I think it'll help a lot of other people reading this thread:

    is there a way to use the new DLL without all the .net overhead? I thought I saw a thread on that very questions but never really understood the final answer.
    There is no way around having to download the .NET framework with the Phidget 2.1 DLL. However, just because you need to have the .NET framework installed, doesn't mean that you use it in every case. VB6 doesn't use the .NET framework at all. In the case of the Phidgets 2.1 Library and vb6, vb6 uses the COM DLL and talks directly to the C DLL. The .NET framework is only required for the .NET based DLL's used in any of the .NET based languages. You can also read all about the Phidget 2.1 Libraries in their Phidget Library documentation
    Last edited by Alex; 03-06-2008 at 10:12 AM.

    �In the long history of humankind (and animal kind, too) those who learned to collaborate and improvise most effectively have prevailed�
    - Charles Darwin

  10. #10
    Join Date
    Aug 2005
    Location
    bout 12 miles west of town, make a left, go 2 miles, make a left, then a right, got the end.
    Posts
    58
    Rep Power
    44

    Re: Phidget Devices

    There is no DeviceName method or property. This must be unique to 2.1
    And yes, that is exactly what I was looking for.
    Thanks for you help with this.

    J

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Contest Entry Front Door Security via Phidget RFID Reader
    By fish123456 in forum Project Showcase
    Replies: 34
    Last Post: 02-11-2009, 06:07 PM
  2. 1-Motor Phidget servo problem
    By Eric in forum DYNAMIXEL & Robot Actuators
    Replies: 8
    Last Post: 03-05-2008, 08:38 PM
  3. Project Including the Phidget MSI in VB install routine
    By cmmguy in forum Software and Programming
    Replies: 7
    Last Post: 03-03-2008, 11:46 AM
  4. Is Pololu Phidget Friendly?
    By FeralBot in forum Arbotix, Microcontrollers, Arduino
    Replies: 1
    Last Post: 09-04-2007, 10:20 PM
  5. Multiple Phidget 8/8/8 board problem
    By askinner in forum Arbotix, Microcontrollers, Arduino
    Replies: 10
    Last Post: 07-03-2007, 06:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •