This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USB2ANY: Current API documentation:

Part Number: USB2ANY
Other Parts Discussed in Thread: LMX2820, CODELOADER

Hello, we are currently trying to control a LMX2820 through an USB2ANY interface.

We found some preliminary api docs from 2015 but i looks kinda of old and it seems to miss the documentation for the C# .NET api (it has the VB .NET documentation but i seems incomplete).

Do you have a more current version of the API-docs?

  • Hello andHag,

    Our recommended way of controlling LMX2820 is through the TICS Pro software GUI. There are also ways to automate TICS Pro interactions with the device through ActiveX controls, which are documented in the following E2E thread (in VBA code for Excel, but if you are comfortable interacting with 32-bit COM objects, this should be sufficient): 

    If you really need to do direct API calls to the USB2ANY in your own C# application, you can wrap the USB2ANY DLL like so:

    public class U2AWrapper
    {
        const string _dllLocation = "USB2ANY.dll"; //replace with your DLL location
        
        [DllImport(_dllLocation, EntryPoint = "_u2aOpen@4")]
        private static extern int u2aOpen(string SerialNumber);
        [DllImport(_dllLocation, EntryPoint = "_u2aClose@4")]
        private static extern int u2aClose(int handle);
        // etc
        //Examples: Open Communication
    
        /// <summary>
        /// This function opens communication with the USB2ANY controller that has the specified serial number.
        /// </summary>
        /// <param name="SerialNumber">serial number string that was return by a call to the u2aGetSerialNumber function.</param>
        /// <returns>A handle, which must be used for subsequent calls to API functions. The handle is always a positive number (never zero). If an error occurs, a negative error code is returned.</returns>
        public int OpenConnection(string SerialNumber){
            return u2aOpen(SerialNumber);
        }
    
        //Close Communication
    
        /// <summary>
        /// This function closes communication with the USB2ANY controller associated with the specified handle.
        /// </summary>
        /// <param name="handle">A valid handle, obtained by a call to the u2aOpen function.</param>
        /// <returns>Returns zero on success. If an error occurs, a negative error code is returned.</returns>
        public int CloseConnection(int handle){
            return u2aClose(handle);
        }
        
        // etc
    }

    The DLL entry points are in the API documentation. I've attached the latest version I have (2.8.2) below.

    API Reference for USB2ANY SDK 2.8.pdf

    Please note that TI will not support your application development with the USB2ANY SDK, beyond providing you with the API documentation and suggesting some means of usage.

    Regards,

  • Thank you for providing the API:documentation!

    2 follow-up questions:

    1: "There are also ways to automate TICS Pro interactions with the device through ActiveX controls, which are documented in the following E2E thread (in VBA code for Excel, but if you are comfortable interacting with 32-bit COM objects, this should be sufficient):"

    Are you refering to Microsofts old ActiveX framwork? or some other software I'm not aware of? Since our platform is Win10 and my understanding is that ActiveX is discouraged to use on that platform, besides the current IE11 (which is soon disappearing). There must be some better way to interact with the GUI.

    2: In the SDK it was included a C-sharp example using the USB2ANY_CS.dll which I currenlty have been using. The code example that you gave me in your post must have been implemented in that file, due to it already existing similar functions that you can use. My question is related to that dll. Is this something that is recommended to use or is this something I found that is depreciated and should not be used? 

    The library name seems to be TI.eLAB.EVM.

  • Hi andHag,

    1. Yes, the old one that's discouraged. TICS Pro is 32-bit software, and we were mimicking/integrating COM DLLs from TICS Pro's deprecated progenitor, CodeLoader. There's a long explanation that boils down to "for legacy reasons, it made sense at the time." At any rate, we have been testing a socket server version of TICS Pro automation for some time internally, and it should be ready for release some time in the next few months.
    2. I pulled my wrapper code example directly out of the Interface DLL used in TICS Pro. Chances are, the original developers pulled their code directly out of the original USB2ANY_CS code. Honestly I'm not sure, I haven't used USB2ANY_CS.dll myself, and I don't know if that example USB2ANY_CS.dll wrapper is tied to a specific version of USB2ANY.dll or if there are some functions that are not implemented. As long as you're okay with the firmware version used in the USB2ANY SDK you found, I think you should be able to use USB2ANY_CS.dll without implementing your own wrapper.

    Please keep this in mind: TI doesn't want to provide customer support for the USB2ANY platform or the software associated with it. TI isn't selling a programmer or a completed device passing rigorous testing; rather, TI is including a tool to aid in using and evaluating TI products. In general, the USB2ANY DLL will always be repackaged with a piece of other TI software that manages the USB2ANY, for which we are able to provide customer support. So if you start building some programming/validation platform around the USB2ANY, perhaps using USB2ANY_CS.dll, and encounter some bug in the library, TI isn't going to fix it for you. TI discourages making USB2ANY a dependency in any part of your product or build process, and I want to make sure you understand the potential risk to you if you do still choose to use the USB2ANY.

    Regards,