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.

Compiler: I am trying to connect High speed converter pro 5.0 using automation DLL

Tool/software: TI C/C++ Compiler

I am trying to connect High-speed converter pro 5.0 using automation DLL, The connection is successful (Via Python).
But selecting the Serial ports failed. HSDC_Pro.Connect_Board(Boardsno,TimeoutinMs)
I have tried supplying the name in the example "TIVHIV9Z" or "TIVHIV9Z-TSW1400" and also the serial number I see when I open the app "T843NGI4-TSW14J56revD" . I get a 5000 status code each time. Other commands seem to be successful.

  • Yaron,

    We are looking into this.

    Regards,

    Jim

  • Yaron,

    The HSDC Pro Automation API functions will return 5000 as error code when there is timeout. Consider the  below-mentioned steps before using the HSDC Pro Automation API functions to debug this issue.

    1)      Give sufficient timeout for HSDC_Pro.Connect_Board function(Ideally TimeoutinMs = 30000)

    2)      Try using “T843NGI4” as Boardsno instead of "T843NGI4-TSW14J56revD"  (where “T843NGI4” is the serial number and “TSW14J56revD” is description of the Board).  

    3)      Make Sure HSDC Pro is Open and Idle(Status of the HSDC Pro should be “Waiting for user input” at the bottom left corner of the HSDC Pro Window) without any dialog windows open.

     

    If the issue persists, kindly share the Python Automation Script and Python version along with bitness (32Bit or 64Bit) being used to debug this issue further.

    Regards,

    Jim

     

  • Hi

    I have tried using "T843NGI4" with no success. The UI is open and waits for 30 seconds. I do manage to communicate with the UI using other commands (After selecting the port manually)

    I am using Python 2.7 64bit.  My script creates a small UI using PyQT. I am attaching the code.2311.ADCConn.7z

  • Yaron,

    We are looking into this.

    Jim

  • Yaron,

    We don’t see any obvious issue with the Python script. We suspect the timeout is not properly sent to the Automation function. Can you verify the TimeoutinMs sent to the automation function?

     

    Regards,

    Jim

  • HI

    I can try and increase the timeout if you like. but I don't think the timeout is the problem. I saw while debugging, that getting the answer from this specific command takes a while, I haven't measured, but  30 seconds seems right. Another thing makes me question the timeout, is when connecting manually , the connection is done a lot quicker. a mater of 1-5 seconds.

    Thanks,

    Yaron

  • Yaron,

    What is this application for? What TI devices are you targeting?

    Regards,

    Jim

  • Hi Jim,

    We have one ADS54J40EVM and one TSW14J56EVM. Running

    So our Target is the TSW14J56EVM.

    Thanks,

    Yaron

  • Yaron,

    The attached HSDC_Pro_Connection_Test.py file contains some example HSDC Pro Automation DLL functions that will do the following automations

    1)      Connects to Board with Serial Number given

    2)      Updates the ADC Out Data Rate of HSDC Pro

    3)      Disconnects the Board

     

    Try this HSDC_Pro_Connection_Test.py file with HSDC Pro. Please share the screenshots of the execution results of the same python script along with the screenshots of HSDC Pro while running the script. This will help us narrow down the issue.

     

    Regards,

    Jim

    HSDC_Pro_Connection_Test.py
    from ctypes import *
    import os
    
    '''******************************** Loading the HSDCPro Automation DLL ****************************************************'''
    dll_path = "C:\\Program Files (x86)\\Texas Instruments\\High Speed Data Converter Pro\\HSDCPro Automation DLL\\64Bit DLL\\HSDCProAutomation_64Bit.dll" #using 64Bit DLL 
    HSDC_Pro = cdll.LoadLibrary(dll_path)
    
    '''*************************************************************************************************************************'''
    '''*******************************************Configuration Settings********************************************************'''
    '''*************************************************************************************************************************'''
    
    Boardsno = "T843NGI4" #Serial Number of board to be connected. Eg: "T843NGI4" or "T843NGI4-TSW14J56revD"
    
    Datarate = 50000000 #ADC output Data Rate
    
    TimeoutinMs = 30000
    
    '''*************************************************************************************************************************'''
    '''**************************** The actual call to the function contained in the dll ***************************************'''
    '''*************************************************************************************************************************'''
    
    print "Connecting to board : " + Boardsno
    Err_Status = HSDC_Pro.Connect_Board(Boardsno,TimeoutinMs)
    print "Error Status = " + str(Err_Status)
    
    print "Using HSDC Ready function to check if the GUI is Ready..."
    Err_Status = HSDC_Pro.HSDC_Ready(120000)
    print "Error Status = " + str(Err_Status)
    
    print "Passing ADC Output Data Rate = " + str(Datarate)
    Err_Status = HSDC_Pro.Pass_ADC_Output_Data_Rate(c_double(Datarate),TimeoutinMs)
    print "Error Status = " + str(Err_Status)
    
    print "Disconnecting from the board"
    Err_Status = HSDC_Pro.Disconnect_Board(30000)
    print "Error Status = " + str(Err_Status)
    
    
    
    
    
    
    

  • Yaron,

    Can you either send screen shots or a video file I can share with the design team? They are a third party vendor and do not have access to E2E.

    Regards,

    Jim

  • Yaron,

    We observe the CSV and Bin Files attached in the previous mail contains the Samples from 2 Channels and with Resolution as 14 Bits.

     

    We believe “sig1 = ((short) (ByteBuffer.wrap(num).order(ByteOrder.LITTLE_ENDIAN).get() & 0xffff))” line in the code causes issue. As get() method in the previously mentioned line returns a single byte(value range is -128 to 127) from the Bytebuffer instead of two bytes which can be fixed by using getShort() method.

     

    Please replace the get() method with getShort() method as shown below,

    sig1 = ((short) (ByteBuffer.wrap(num).order(ByteOrder.LITTLE_ENDIAN).getShort() & 0xffff));

     

    Since the sample format in the Bin file is Offset binary and that of CSV is 2’s Complement, for comparison purposes kindly do the format conversion from the Offset binary to 2’s Complement for the samples read from the Bin files by using the below mentioned formula.

     

    SampleInTwosComplementFormat = SampleInOffsetBinaryFormat -  (2^(N-1))

    Where N is the resolution of sample.

     

    Refer to the following snippet of code(from previously sent mail) with above mentioned edits.

     

    path = Paths.get(file.getAbsolutePath());
    inStream = Files.newInputStream(path, StandardOpenOption.READ);
    buffer = new BufferedInputStream(inStream);

    while (buffer.available() != 0) {
        byte[] num = new byte[2];
        int sig1=0;
        buffer.read(num);
        sig1 = ((short) (ByteBuffer.wrap(num).order(ByteOrder.LITTLE_ENDIAN).getShort() & 0xffff));

      sig1 = sig1-(int)Math.pow(2, 13);// Format Conversion from Offset Binary to 2’s Complement for Sample Resolution as 14Bits
      System.out.println(sig1);

    }

     

    Regards,

    Jim

  • Thanks, that's what I needed.

  • Hi Jim,

    It seemed that there was a mistake with this case. It included two separated problems:

    1. Reading the BIN file, which was resolved for me.
    2. The problem with the Python script and AutomationDLL - Stil waiting for an answer 

    I changed this item to resolved by mistake when item number one was solved.

    Thanks,

    Yaron

  • Yaron,

    We are looking into your second issue still.

    Regards,

    Jim

  • Python.docxYaron,

    See attached.

    Regards,

    Jim

  • Hi 

    I have tried this, after closing the port dialog with cancel I cannot interact with the UI using the script.

    The only way to interact with the UI is to manually select the port from the dialog and from there the scripts become operational.

  • Yaron,

    I am waiting to hear back from the software team regarding this.

    Regards,

    Jim

  • Yaron,

    The ideal sequence of steps that are to be followed before using the “Connect_Board” Automation Functions as below,

    1)      Open HSDC Pro Application

    2)      Close the “Select Board” Dialog Window(Port Dialog) by clicking on the “Cancel” button

    3)      Wait for the HSDC Pro Application to become Idle

    4)      Use the “Connect_Board” Automation Functions with appropriate parameters()

    5)      The HSDC Pro Application will get connected to the Board, which will be indicated with green “Connected” Status at the bottom of the HSDC Pro Application Window

     

    Now that the HSDC Pro is connected to the Board, you should be able to use other automation functions to control the application.

     

    Thanks and Regards,

    Jim