Programmatically determine USB type

Hi all,
This is likely one of those really obvious things that I've somehow just missed, but I was wondering if anyone knew of a way to programmatically determine whether a device I'm communicating with is using USB 1.0 or 2.0?  I'm working on a VISA driver for an USB instrument that returns a data set in a completely different format depending on what kind of USB port it is plugged into.  The instrument itself automatically determine which format it will use - and there doesn't appear to be any obvious status/data type indicator I can read off the instrument.  I could pull the data in and analyze it to determine the format, but that seems clumsy.  It would be much better if I could just detect the type and parse the data based on the type...
Any help at all would be appreciated!
Thanks,
Jason

I'm currently doing some programming with the FTDI chipset of USB devices.  The FT_GetDeviceInfoList query contains information regarding the speed.  The D2XX_Programmer's Guide descriptions lists: 
The flag value is a 4-byte bit map containing miscellaneous data as defined Appendix A – Type Definitions. Bit 0 (least significant bit) of this number indicates if the port is open (1) or closed (0). Bit 1 indicates if the device is enumerated as a high-speed USB device (2) or a full-speed USB device (0). The remaining bits (2 - 31) are reserved. 
I also believe the information is stored in the EEPROM (again, depending upon the chip).  There is a BCD field that is either 0x0110 or 0x0200 depending upon the speed.
Jason
Jason

Similar Messages

  • How to programmatically determine if  an object is ready to be destroyed?

    Dear All,
    How can I programmatically determine that whether an object is ready to be garbage collected? I know that the garbage collection process is not guaranteed to occur until the JVM is close to running out of memory. Yet, it is also said that an object is ready for garbage collection if there are no more references to it. Therefore, I am wondering if we have means to know whether an object is ready to be garbage collected, even though that may not happen yet.
    For example, if I define such a simple class structure:
    public class A
    B b = new B();
    public void methodA()
    b.printB();
    public static void main(String[] args)
    A a = new A();
    a.methodA();
    class B {
    public void printB() {
    System.out.println("from B");
    Here I am assuming the object b (of type B) is ready for garbage collection BEFORE the object a (of type A), because the object b is declared and created as a field within object a. Is this assumption true? If yes, how can I verify that during runtime?
    Thank you very much for any help!
    -- SunnyDay

    1. It seems that the System.gc() should be called to make sure garbage collection is performed so that all those WeakReference objects are put into the ReferenceQueue (suppose no strong references to those
    objects to which the weak references are pointing). Is all of this guaranteed to happen? That is, is it guaranteed that those weakly referenced objects are being garbage collected and their WeakReference objects are put into the queue, whenever the System.gc() is called?
    No, it is not guaranteed. Though it seems to be true for current implementation of JVM, where System.gc() usually does Full GC. However, you should not rely on this and it can be in fact changed in future implemenations.
    2. The WeakReference description says the garbage collector may enqueue the newly-cleared weak reference "AT SOME TIME AFTER" the weak reference is cleared. If this happens to be the case, how can I know which
    object is deleted first in my example (e.g., if the weak reference of object A is put into the queue before that of B, it may falsely indicate object A is destroyed beofore B)?
    Yes, it is quite possible for weak reference to be enqueued in different order.
    3. Suppose System.gc() is called and an object's weak reference is put into the queue, can I still know which object is being destroyed at this moment?
    You can't. In fact, java threads may be stopped while GC is running. GC may free memory for multiple objects at once (which in fact happens with Mark-Sweep algorithm). So, "destroyed at the moment" does not make sense from this perspective.
    If can gave us more details on what you are originally trying to do, probably we could find another solution.

  • How can I determine the type of video out connector I need?

    Howdy,
    I have a white macbook purchased Jun/2008. I want to connect to a TV but don't know what adapter I need. How can I determine the type of video out jack my macbook has?
    System Profiler says the model identifier is "MacBook 4,1". Under Graphics/Displays the only thing it says about the "Display Connector" is that no display is connected. Too bad it doesn't tell me what type of connector it is. If I knew the name of the connector I'd probably be home free. But it seems like every macbook model has a different video connector (since the state of the art has advanced over the years) and I haven't been able to keep up with the names.
    Now, I have a 6" long adapter that will convert this connector to VGA. And searching the Apple store for VGA adapters, the existence of mine says my connector is might be one of "Mini DisplayPort", "Apple Mini DVI", "Apple DVI", or "Apple Micro-DVI". But then there is also the connector at
    http://store.apple.com/us/product/M8639G/A?mco=MTY3ODQ5OTY
    and that looks like the one I have. But unlike the other adapters, this one is just called a "VGA Display Adapter". Does the connector have a name? How can I find adapters that have that same connector?
    I know I could use the adapter I have, plus a VGA to VGA cable, to hook up to a TV. But the quality of the VGA signal is poor in the digital world. My goal is to hook up to the TV via HDMI. Is this even possible? By which I mean, will my macbook generate the signals necessary to be able to be converted to HDMI?
    Thanks for any help,
    Zebulon T

    Thanks, Ded,
    You're right, the cable that I have won't work. I't from my previous, 2004 iBook. This is pretty embarrassing... I looked at the cable but didn't bother to try plugging it in.
    Looking at the close-up picture of the Mini-DVI to VGA adapter, that does look like the right connector. So I have Mini-DVI, and the other apter you pointed to can convert this to DVI. I'll take a look to see what makes the most sense, connector wise, downstream from that.
    Thanks very much.
    Zeb T

  • Determine the type of the caught exception

    Hi!
    Here is my problem :
    I'm using a web service and the method I call throws different types of Exception (RemoteException, ServiceException, etc...)
    And, the reaction to the caught exception depends on its type, that's why I need to determine what type of exception i've caught. I know that with C# I use the boolean function is :
    if (exception is TypeOfException1)
        // associated reaction
    else if(exception is TypeOfException2)
       // associated reaction
    }Is there any method or any other way in Java to do that?
    Thanks a lot,
    Gan�che.

    >
    Here is my problem :
    I'm using a web service and the method I call throws different types of Exception (RemoteException, ServiceException, etc...)
    And, the reaction to the caught exception depends on its type, that's why I need to determine what type of exception i've caught. >
    try {
      // stuff that may cause exceptions..
    } catch(RemoteException re) {
      // deal with this re
    } catch(ServiceException se) {
      // deal with this se
    } catch (Throwable didNotExpectThis) {
      // exceptional!
      didNotExpectThis.printStackTrace();
    }

  • Determine data type

    Hi all,
    I've got procedure for inserting data into value1 column of table1.
    My need is to determine data type entered by user.
    If data type is not number then user should receive error.
    How do I perform it?

    The easiest and most reliable way would be to declare the formal parameter as a number like:
    SQL> create procedure p (p_num in number) as
      2  begin
      3     null;
      4  end;
      5  /
    Procedure created.
    SQL> exec p('a');
    BEGIN p('a'); END;
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    ORA-06512: at line 1If you cannot do that, or want to be more "user friendly", then the only alternative is to test it and raise an error like:
    SQL> create procedure p (p_str in varchar2) is
      2     l_num number;
      3  begin
      4     l_num := to_number(p_str);
      5  exception
      6     when value_error then
      7        raise_application_error(-20001, 'I know I said it was a string, but I really want a number');
      8  end;
      9  /
    Procedure created.
    SQL> exec p('a');
    BEGIN p('a'); END;
    ERROR at line 1:
    ORA-20001: I know I said it was a string, but I really want a number
    ORA-06512: at "OPS$ORACLE.P", line 7
    ORA-06512: at line 1John

  • How to determine employee type (management vs nonmanagement) in WebDynpro

    Hi,
    I am running SP14.
    In my WebDynpro application, I need to hide/show a link based on if the employee is management or nonmanagement.
    What is the easiest way to determine the type of employee in a WebDynpro?  Is the management/non-management attribute already exposed and available to the WebDynpro?  Or do I need to invoke a BAPI/RFC to retrieve that information from SAP (eg Employee Group or Personnel Area)?
    Thanks for any help you can provide.
    Kevin

    You only need to call this RFC once and share the results with other views via context binding!
    In my applications I follow the Floorplan manager architecture and have one web dynpro component for all the frontend logic e.g. FcAddress
    In the component controller of FcAddress I setup model nodes for the RFC e.g.
    Address_Input (mapped to input RFC model class with all the import parameters of the RFC)
    Address_Output (mapped to either the output RFC model class with all the export parameters of the RFC or it includes another model node for Address_Records which is mapped to the export table parameter.)
    Address_Messages (mapped to the return parameter of the RFC (BAPIRET2).
    All other views with their component controllers are mapped to those model nodes to allow access to the RFC data.
    You can pass the userid to the RFC and then the RFC will get the related employee number via IT105/ST10. You just need to have the userid defined as an import parameter in the RFC.

  • How to determine IE type(32 bit or 64 bit) in a task sequence while updating Java

    How to determine IE type(32 bit or 64 bit) in a task sequence
    Hi,
    Currently i have to update new version of Java after removing all the previous existing version of Java by using TS in SCCM 2007.
    we have both 32 bit and 64 bit browser in the environment. I am stucked in determining whether the browser is of 32 bit or 64 bit.
    How to determine IE type(32 bit or 64 bit) in a task sequence so that respective java can be installed for that IE browser.
    will highly appreciate quick response.
    Thanks in advance.
    Daya

    But you also need to install JRE x86 on x64 systems, since most people actually use the 32bit browsers on x64 systems.
    The detection logic is actually pretty simple -- just check the right registry hive to find the installation location of the BIN\JAVA.DLL. Both pathnames are stored in HKLM\Software\JavaSoft\Java Runtime Environment\1.7 in the registry value "JavaHome",
    but the x86 path is stored in the 32-bit hive and the x64 path is stored in the 64-bit hive.
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • How do I determine what type of Solaris installation I have ?

    I'm runnig "SunOS PSP 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Fire-480R" but I would like to determine the type of Solaris installation I have....do I have a a "development" installation ? Do I have all the SUNW developer packages ? Also what are the "types of installations" that are possible ?
    I'm thinkig about download the mysql binary (from Sunfreeware.com) and I went to the dpendencies site (http://wwws.sun.com/software/solaris/freeware/s8u7dependencies.html) to check what dependencies exist and I saw the following line (among other non "related" info.):
    mysql-3.23.43 gcmn-1.0 ncurses-5.2
    What exactly does this mean ?

    Hi
    You can check the type of solaris install from the below file
    /var/sadm/system/admin/CLUSTER
    Regards

  • How to determine itab type at run time

    I need to write a subroutine that organizes data in internal tables for presentation by a smartform. There are a few similarly structured internal tables all with the same field name ("recipe_type") by which the data is sorted. My problem is that how I can determine the type of the itab inside my subroutine at run time? Is it ever possible in ABAP?
    The subroutine code is attached below. Thanks for any help.
    FORM beautify_itab    TABLES itab_in TYPE table
                                     USING v_type TYPE any
                                     CHANGING itab_out TYPE table.
    Data declaration
      DATA: v_data_row LIKE LINE OF itab_in,                " THIS WON'T COMPILE!
                 v_blank_row LIKE LINE OF itab_in.              " blank row
    Organize the display of the table data
      LOOP AT itab_in INTO v_data_row.
        IF v_type <> itab_in-recipe_type.                     " 'recipe_type' is the sort key for the incoming itabs
          v_type = itab_in-recipe_type.
          IF sy-tabix > 1.
            APPEND v_blank_row TO itab_out.
          ENDIF.
          APPEND v_data_row TO itab_out.
        ELSE.
          CLEAR v_data_row-recipe_type.
          APPEND v_data_row TO itab_out.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

    The following code does what I want, but only if the input itab structure is declared first in the program. It won't work if the itab is declared as itab_in TYPE TABLE OF sflight. This is because the function 'GET_COMPONENTS_LIST'  only can load the structure of a field declared explicitly in the program.  Does anybody know of any method to load the structure of an itab based off a dtab? 
    Thanks you guys for answers. Points have been rewarded.
    *& Report  Z_GET_ITAB_TYPE_AT_RUN_TIME
    REPORT  z_get_itab_type_at_run_time.
    DATA: BEGIN OF itab_in OCCURS 0,
             seatsocc_b LIKE sflight-seatsocc,
             fldate LIKE sflight-fldate,
          END OF itab_in,
          itab_out TYPE TABLE OF string,
          wa_itab_out TYPE string.
    SELECT seatsocc_b fldate
    INTO TABLE itab_in
    FROM sflight
    WHERE carrid = 'AA' AND
          connid = '0017'
    ORDER BY seatsocc_b.
    PERFORM beautify_itab
                TABLES
                   itab_in
                USING
                   sy-repid
                   'itab_in'
                   'SEATSOCC_B'
                CHANGING
                   itab_out.
    LOOP AT itab_out INTO wa_itab_out.
      WRITE: / wa_itab_out.
    ENDLOOP.
    *&      Form  beautify_itab
          text
         -->ITAB_IN    text
         -->V_KET_FIELD   text
         -->ITAB_OUT   text
    FORM beautify_itab TABLES itab_in TYPE table
                       USING  v_prog_name LIKE sy-repid
                              v_itab_in_name TYPE any
                              v_key_field_name TYPE rstrucinfo-compname
                       CHANGING  itab_out TYPE table.
      DATA: itab_fields TYPE TABLE OF rstrucinfo,
            v_field_name LIKE rstrucinfo-compname,
            v_old_key TYPE string,
            v_field_value TYPE string,
            v_data_line TYPE string,
            v_tabix LIKE sy-tabix,
            c_blank_row TYPE string VALUE ''.
      FIELD-SYMBOLS: <fs_field>,
                     <fs_data_line>,
                     <fs_field_list> TYPE  rstrucinfo.
    gets all of the components of a structure
      CALL FUNCTION 'GET_COMPONENT_LIST'
        EXPORTING
          program    = v_prog_name
          fieldname  = v_itab_in_name
        TABLES
          components = itab_fields.
      LOOP AT itab_in ASSIGNING <fs_data_line>.
        v_tabix = sy-tabix.
        LOOP AT itab_fields ASSIGNING <fs_field_list>.
          v_field_name =  <fs_field_list>-compname.
          ASSIGN COMPONENT v_field_name OF STRUCTURE
                        <fs_data_line> TO <fs_field>.
          v_field_value = <fs_field>.
          IF v_key_field_name = v_field_name.
            IF v_old_key <> v_field_value.
              v_old_key = v_field_value.
              IF v_tabix > 1.
                APPEND c_blank_row TO itab_out.
              ENDIF.
            ELSE.
              CLEAR v_field_value.
            ENDIF.
          ENDIF.
          CONCATENATE v_data_line v_field_value INTO v_data_line
                      SEPARATED BY space.
        ENDLOOP.
        APPEND v_data_line TO itab_out.
        CLEAR v_data_line.
      ENDLOOP.
    ENDFORM.                    "beautify_itab

  • Programmatically: Support content types in the gallery and for content types associated with a document library

    Hi there,
    Help appreciated in programmatically 'Supporting content types in the gallery and for content types associated with a document library'.
    Any resources/references or source is greatly appreciated.
    Regards,

    Hi,
    Would you mind providing more details about your requirement? Cause I'm not quite clear about what you really need.
    What’s more, there are seems two questions in your post. If you have several questions to ask, I suggest you post them into every single thread to make them easier to be discussed
    in the forum.
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to determine the type of an existing iView

    Hi,
    While creating an iView using wizard there is a big list of type of iViews. But after creation of iView, how do I determine the type of iView. Which attribute or property of iView holds this information?
    -Lave Kulshreshtha

    You can copy and paste the existing Iview changing the name and ID if u want to replicate the same.
    Also, when you create a new iView from a template, you get a list of them e.g SAP BSP iView etc.
    Now what you see in the code link is much similar to what you see as a list of templates when u create iViews. So its pretty simple.
    I hope this helped you.

  • Installing Solaris 7 - System hangs while determining bus Types

    Hi,
    I am trying to install Solaris 7 on my Compaq Presario. My system hangs immediately after the first screen. It hangs on the screen where it says "Bus Enumeration Determining Bus Type and gathering hardware configuration data. Not sure why it is doing that. Any help would be appreciated
    Regards,
    Ashish.

    My system is not branded It is custom bulit.
    What more information you want write me.
    Thanks for all help
    Amit

  • Programmatically determine if a cRIO is connected to your computer

    I'm trying to programmatically determine if a specific cRIO is connected to my computer.  What is the best way of going about this (if I know the name and the IP Address)?  The closest I've come is getting a system sessions constant that is a dropdown of all that are connected to the computer, but I can't find a way to access all of the values in the dropdown (only the one that is selected).
    Thanks, Emily
    LV2012, Win7, 64-bit

    Emily101 wrote:
    No, I can't disable the firewall and don't have any control over it... This is a separate issue that other people within my company have been working with our IT department and NI on.  I can see it in MAX if I manually add the IP Address but MAX doesn't automatically discover it. 
    I found another way of detecting if it's connected using shared variables, but if anyone knows of another way to do it in LV2012, I would still be interested in hearing about it.
    If MAX doesn't see it, then it is most likely a firewall issue. I believe the way Max discovers controllers is by reading UDP messages the controllers broadcast. If the firewall is blocking it, then you wont' be able to see it. I have run into this at some of our customers sites, although I can't remember exactly what we did to check. I think we were able to ping them still, so we just pinged but didn't look for the controller name specifically, as you are trying to do.
    CLA, LabVIEW Versions 2010-2013

  • How to achieve image using digital camera of USB-type interface through IMAQ PCI-1424 board.

    1.Is it doable?
    2.How to connect USB-type interface with IMAQ PCI-1424 board.
    Thanks!

    See the Developer's Zone (www.ni.com/zone) for specifics on USB (search for "USB").
    "1.Is it doable?"
    - In short "no".
    - USB is similar to FireWire (IEEE 1394), and no framegrabber is required. We offer an IEEE 1394 IMAQ driver to interface FireWire cameras with LabVIEW & CVI.
    "2.How to connect USB-type interface with IMAQ PCI-1424 board."
    - You will need a USB driver for the camera. The 1424 is not required.

  • Programmatically determine steps referenced in an expression

    Is there an elegant way to programmatically determine any steps that are reference in an expression using API. 
    Such that
     AllOf(RunState.Sequence.Main["ID#:AzvyVD4OcUiZz2vk3ZHknA"].Result.Status == "Passed", RunState.Sequence.Main["ID#:0RT7Ih2QQkimHpGGh30sIA"].Result.Status == "Passed")  Would return ID#:AzvyVD4OcUiZz2vk3ZHknA and ID#:0RT7Ih2QQkimHpGGh30sIA in an array of strings or something along those lines.
    Herrlin
    Just trying to spread the LabVIEW love.

    John B
      Thanks for the reply.
      I actually did implement a similar solution to what you described.  I originally didn’t share the entire scope of what I was trying to accomplish.  I wanted an entry point that would run selected steps and actively look for any steps referenced in the preconditions of the selected steps.  If a step was reference the entry point would know that it also had to run this step.   This will be a useful tool for debugging, since it will record results as well as run steps that the selected test is dependent on, in a sense.
      My team made a decision that we would only be using unique ids to reference steps in expressions felt this was a better programming practice.  Also we only needed this function for the MainSequence of a sequence file.  In addition we always wanted Setup and Cleanup groups to remain the same.  So we only needed to search each precondition for the unique step id of steps that where in the Main group of the MainSequence.
      I have attached the new sequence file I made with a Custom entry point.  The entry point is almost an exact copy of the single pass entry point with a couple of modifications.
    1 It calls Configure Temp Sequence
    2 It references a temp sequence file what during the MainSequence Callback instead of the Client file
    3 In the Cleanup it closes the reference to the temp sequence.
      Also there are two new sequences:
    Configure Temp Sequence
    Get Steps to Exe
      Any way just thought you might be interested and this was no easy task for me so I was excited to share.
      Thanks
    Dan H
    Herrlin
    Just trying to spread the LabVIEW love.
    Attachments:
    ModSequentialModel.seq ‏42 KB

Maybe you are looking for

  • Adobe Dreamweaver CS5.5 - Windows 7 - Java Script Problem

    I am having trouble with Anchor.htm. When I try to insert an anchor in the text (Insert > Named Anchor> I get this error message: "While executing insertObject in Anchor.htm a Java Script error occurred." I recently downloaded both the 32- and 64-bit

  • Issue while changing fields in a fillable form PDF (Acrobat 10.1.4 Pro)

    Good Afternoon! This is my first time posting here, so forgive me if this is in the wrong place. I am an IT technician trying to support a user who is trying to change a PDF into a fillable form using Acrobat 10.1.4.  She is trying to use the wizard

  • Acrobat X on OS X 10.6.8 Printing Fails

    I am printing to an Epson Stylus Photo 280, and have installed the lastest Epson Printer Update 2.7 via software update. Whenever I try and print the printer starts to make noise, but then the printing fails and I get the following error message ever

  • Can not open itunes app after updating to ios7

    i updated to ios7 and now i can not open the itunes app.  it keeps crashing.  anyone else having this issue?  need help

  • Show_errors in 6i

    Hello allls one question pls. i want to show errors on run time using the keyboard any help is appreciated.. Thanks.. Abdetu..