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.

TSW1400EVM: Bug in python dll?

Part Number: TSW1400EVM

Hello,

I have a TSW1400EVM and I'm trying to perform automated measurements with it. Whenever I try to connect to the board the output of the following code (Python) is: "Error Status = 7004"

from ctypes import *
import os
import subprocess

if('PROGRAMFILES(X86)' in os.environ): #selecting the DLL path from HSDC Pro installed location based on 32 bit or 64 bit OS
    dll_path = "C:\\Program Files (x86)\\Texas Instruments\\High Speed Data Converter Pro\\HSDCPro Automation DLL\\64Bit DLL\\HSDCProAutomation_64Bit.dll"
else:
    dll_path = "C:\\Program Files\\Texas Instruments\\High Speed Data Converter Pro\\HSDCPro Automation DLL\\64Bit DLL\\HSDCProAutomation_64Bit.dll"
HSDC_Pro = cdll.LoadLibrary(dll_path)


TimeoutinMs = 30000
#Boardsno = 'K1227453-TSW1400' #Serial Number of board to be connected. Eg: "TIVHIV9Z" or "TIVHIV9Z-TSW1400"
Boardsno = 'K1316405-TSW1400' #TUM Board

Err_Status = HSDC_Pro.Connect_Board(Boardsno,TimeoutinMs)
print("Error Status = " + str(Err_Status))

However, if I try to connect to the board using Matlab, the connection takes place without errors, the output is "0" and the Board Number can be seen in the GUI's bottom side. The Matlab code I use is:

% Add folder into path that contains the Automation DLL
addpath(genpath('C:\Program Files (x86)\Texas Instruments\High Speed Data Converter Pro\HSDCPro Automation DLL'));

% Load the Automation DLL
if ~libisloaded('HSDCProAutomation_64Bit')
    [notfound,warnings]=loadlibrary('C:/Program Files (x86)/Texas Instruments/High Speed Data Converter Pro/HSDCPro Automation DLL/64Bit DLL/HSDCProAutomation_64Bit.dll', @HSDCProAutomationHeader);
end

BoardSerialNumber = 'K1316405-TSW1400';
TimeoutInMs = 30000;

% Connecting to the board and selecting DAC device
fprintf('\n\nConnecting to board : %s',BoardSerialNumber);
[Error_Status] = calllib('HSDCProAutomation_64Bit','Connect_Board',BoardSerialNumber,TimeoutInMs);
fprintf('\nError Status = %d (%s)',Error_Status,HSDCPro_Automation_Error_to_String(Error_Status)); 

I have triple-checked, the Board Number is K1316405, no I's.

Is there a bug in the Python code?

Thank you in advance

Regards

Ricardo

  • Ricardo,

    What version of HSDC Pro GUI are you using?

    Regards,

    Jim

  • Hi Jim,

    HSDC Pro GUI Version: V 5.00

    Dll version: 0.1

    Firmware Version: 0.2

    Patch Version: No Patch Applied

    BR

    Ricardo

  • Ricardo,

    We believe you are using the Python3 for the automating the HSDC Pro application, whereas the example “HSDCPro Automation DLL ADC Example.py” file was created to use with Python2.7. Please try using Python2.7 for automating the HSDC Pro application or try using the following lines to describe the board serial number in Python3.

     

    1.       Boardsno = b”K1316405-TSW1400”

    2.       Boardsno = b”K1316405”

    3.       Boardsno = ”K1316405”

     

    Try using the above-mentioned lines for describing the board serial number. The ‘b’ character is used for converting the string to bytes literal, as the HSDC Pro automation functions expects the strings to in ASCII format for proper execution.

     

    Regards,

     

    Jim

  • Hi Jim,

    as easy as it can get. using the first (or second) line works as expected (Python 3.6). I frankly don't know how I didn't come up with it myself. Thank you very much for your support, the problem has been solved.