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.

LMK03328: Automating TICSPro

Part Number: LMK03328
Other Parts Discussed in Thread: USB2ANY

Hi,

I am using the LMK03328 in my design and I like to automate its programming process.

I am trying to use the TICSpro for my automation process.

I have been trying to use Vbscript commands in order to operate the TICSPropro.

Currently I am using the following code (based on a reference the I have found in previous E2E threads):

"
Dim TICSProLoader

On Error Resume Next
Set TicsProLoader = CreateObject("TICSPro.ActiveX")
If Err Then
    Clear TICSProObject
Else
Call TICSProLoader.Initialize("C:\Program Files (x86)\Texas Instruments\TICSpro")
TicsProLoader.SelectDevice "LMK03328"
End If

TICSProLoader.RestoreSetUp ("C:\Project\Config_LMK03328.tcs")
TICSProLoader.ReadAllRegiters
"

This piece of code does open the TICSpro GUI and it seems that it selects the LMK03328 device and restores the configuration file
but it seems the it does not connect the TICSPro to the USB2ANY,
It seems as if the TICspro is stuck on demo-mode and I can't change this state (using the GUI).
When I open the TICSrpo manually, without using the script (i.e. by double clicking on the its desktop icon) it seems to work correctly
(USB2ANY is connected and I able to program the device)
I am using windows7

Please your advise
Best regards,
Moshe Marcu

  • Moshe,

    As far as I know, nothing about the setup you described should prevent TICS Pro from finding a USB2ANY. Did you open a TICS Pro instance manually before testing the VBScript? It's possible that the manually-opened TICS Pro instance was already assigned to the USB2ANY, and removed the handle from the available handle pool before the VBScript TICS Pro instance could find it. Any previously opened TICS Pro instances either need to be closed or set to Demo Mode manually to free up the USB2ANY handle for the automation-opened TICS Pro instance.

    Regards,

    Derek Payne

  • Hello Derek,

    Thanks for your answer,

    I have verified that there was no other previous instance of TICSPro open in my PC,
    In order to ensure it I have also rebooted my PC. It seems that problem persists.

    Regards,

    Moshe

  • Moshe,

    I have determined that there is a bug in TICS Pro USB2ANY handling. It appears that switching devices does not fully close the USB2ANY under some circumstances. I'm working on a fix for this issue in hopes that I can deploy it before our next release.

    For now, to work around this bug, you can actually configure TICS Pro to start up on the LMK03328 by default and skip the device switching step entirely until the bug is fixed:

    1. Go to your TICS Pro install path (C:\Program Files (x86)\Texas Instruments\TICS Pro) and navigate into the Configurations directory
    2. Open the TICS Pro.ini file
    3. In the [SETUP] section, modify the line containing DEVICE_NAME00 so that the device in the value field is LMK03328

    Now, when you open TICS Pro through your VBScript, it should automatically startup into LMK03328. Since there is no device switching step, there is no chance for the device switching function to fail to release a used USB2ANY, and you should be able to proceed without issues.

    Regards,

    Derek Payne

  • Hello Derek,

    I have found the TICS pro.ini file under "C:\ProgramData\Texas Instruments\TICS pro\Configurations"
    (Is this the correct file?)

    The DEVICE_NAME00 was already set to LMK03328.

    I have tried also to disconnect and reconnect the USB cable form the PC

    1) In the "manual opened" TICS pro I see that the TICS Pro reports correctly that the USB2ANY is disconnected/connected
    2) In the "VBScript opened" TICS pro when  - the USB2ANY is not recognized,  when I disconnect and re-connect the cable I get an error message:

    "Invalid Hardware Configuration
    Error while initializing Communication Setup. Possible Reason:An
    Attempt was made to load a program with an incorrect format.
    (Exception from HRESULT:0x8007000B)"

    Regards,
    Moshe Marcu

  • Moshe,

    Your location for TICS Pro.ini is the correct one, I made a mistake when reporting the original location. Apologies for the confusion.

    The error you described (HRESULT:0x8007000B) usually occurs when a 64-bit program attempts to load a 32-bit DLL. USB2ANY bundled with TICS Pro is 32-bit, and TICS Pro is a 32-bit application. Is it possible that your VBScript program is compiled against x64? If so, try x86 or AnyCPU targets.

    It's also possible that we made a mistake and accidentally compiled one of the assemblies as an x64 assembly when we released the software, and no one has noticed until now... but as far as I can tell we did not do this. It is also easy to check if we did this: run TICS Pro manually from within a 32-bit command prompt (C:\Windows\SysWow64\cmd.exe) and see if there's a similar problem. I tested these steps and did not see any issues on my end with the currently available version of the installer, so I don't think this is our assemblies being compiled for x64.

    It's a bit unclear, but once you have LMK03328 as the DEVICE_NAME00 value, you can and should omit the SelectDevice instruction. If you were calling it even while the correct device is selected, reloading the same device profile might cause trouble (but it doesn't seem to on my machine).

    Regards,

    Derek Payne

  • Hello Derek,

    I followed your suggestion, it seems that I can run the script manually from sysWow64.

    I wrote a script (in VBscript) that call my original script using the following code:

    "

    Dim objShell, err

    objShell = Wscript.CreateObject("Wscript.Shell")

    err = objShell.run  ("%windir%\sysWow64\cscript.exe C:\MyScriptFolder\AutoLMK03328.vbs",1,True)

    "

    It seem that this resolved the problem.

    This solution works for Windows 10 as well

    Thanks,

    Moshe