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.

LMK61E2EVM: VBA control of codeloader

Part Number: LMK61E2EVM
Other Parts Discussed in Thread: CODELOADER, LMK61E2, LMX2572, USB2ANY

Hi,

I am trying to create a C# driver for CodeLoader4 which can then be integrated to another software. I have problems doing that because CodeLoader seems to fail registering itself in the computer. 

I followed the instructions on Page 7 of CodeLoader 4 Operating Instructions (Rev.A). I logged in the administrator account of my computer and double click on CodeLoader4x.exe. There was a GUI flashed on and off which I thought wad normal according to the instruction. I then ran the sample code in VBA from Page 8. It throw an exception in CreateObject line in attached screenshot. I thought that was because the CodeLoader software failed to register itself.

Anything I can do to fix this problem?

Thanks,

Fiona

  • Hi,
    To continue on this question, I have gone through some of the threads on this forum and it seems like CodeLoader has been replaced by TICS Pro. I have installed TICS pro now, but did not find any instructions on how to remotely control TICS pro. Any solution on that?

    thanks,
    Fiona
  • Hi,

    To further continue on this question, I referenced ActiveXTICSPro.dll (included in the folder of TICSPro) in my project in Visual Studio and tried to use the TICSProAPI class.

    My questions are

    1) where can I find the operating instructions of TICSPro for LML61E2EVM in particular?

    2) Is ActiveXTICSPro.dll enough? Do I need to include other dlls in TICSPro folder? Any sample code I can find?

    thanks,

    Fiona

  • 6114.TICSPro Automation Example.xlsmFiona,

    For CodeLoader, we are phasing this out and I don't know why it is not working on your computer, but it's likely some windows issue that I don't know how to fix.

    For TICSPro,  I have a working excel worksheet and there is a tab with some descriptions on it (Attached).

    Regards,

    Dean

  • Hi Dean,
    Thanks for this reply. Could you please also show me a piece of sample code about C# control of TICSPro? Also, any .dll necessary?

    thanks,
    Fiona
  • Fiona,

    The excel worksheet does control TICSPro (not codeloader) and is written in excel VBA.  In developer mode you can see the code.  You can get to developer mode by adding the developer tab  When you install TICSPro, you should be able to automate this without any additional DLL.  Here's the excel code that starts TICSPro

    Option Explicit

    Public TICSProLoader As Object


    Public Sub btn_LaunchTICSPro_Click()
    Dim PathString As String
    Dim StartDevice As String
    Dim i As Integer

    ' Assumes TICS Pro installed at same location as Instrument 97e
    PathString = Cells(2, 4)
    StartDevice = Cells(3, 4)


    Set TICSProLoader = Nothing

    On Error Resume Next
    Set TICSProLoader = CreateObject("TICSPro.ActiveX")
    If Err Then
    ClearTICSproObject
    Else
    Call TICSProLoader.Initialize(PathString)
    TICSProLoader.SelectDevice StartDevice
    End If

    End Sub

    For TICSPro, we cannot share the source code for the main program.  However, for every device, there are device specific files.  You can see them if you go to the install directory and go to the Configurations-> devices and find the device.   Then you will see a *.py file that is the python code for the GUI.

    Regards,

    Dean

  • Hi Dean,

    I did not find device type LMK61E2 in the File menu in the GUI. Although I revised the "Selected Device" to "LMK61E2" in xml and saved the file, the GUI was still trying to load another type of device. What is the reason for that?

    thanks,

    Fiona

  • Fiona,
    OK, seems like it is working. On the tab, it has a startup device and it has "LMX2572". Change this to LMK61E2.

    Regards,
    Dean
  • Hi Dean,

    Thanks for your reply. Here is the point. In the "Select Device" menu of TICS PRO, there are many types of devices (LMX or LMKxxxx) organized in different lists such as "PLL", "PLL + VCO" and "Clock Distribution with Divider" etc. I did not find "LML61E2" in anywhere in these lists. My questions are:

    1) Could you find "LMK61E2" in the lists under "Select Device" menu? If so, could you please give me a screenshot to show where that is?

    2) If you also cannot find "LMK61E2", does that mean I cannot use TICS PRO for "LMK61E2"?

    Thanks,

    Fiona

  • Hi Fiona,
    Dean is on vacation till Sep, he will response later.
  • Hi, i tried running the vba file shown above. it does not load the TICS pro software properly. it loads the software with "Device not connected" however when I start the software through the start menu, it loads properly. am using excel 2010
  • Hi Dean,

    Is there a similar code to what you provided in this e2e thread that will work with Excel 2010?

    Buki mentioned via email that she was able to get it to work on Excel 2016, but the system she needs to use this on has Excel 2010.

    I'm not sure if this is something you have available?

    Best Regards,
    Brian Gosselin

  • Buki,

    Just got back from vacation.

    To find the LMK61E2 in ticspro try:
    Select Device -> Oscillators -> LMK61E2

    So in the excel worksheet, it should be able to start this automatically if you make the start device "LMK61E2"

    About the "Device Not Connected". This has nothing to do with the VBA interface. You get this message whenever there is not anything for TICSPro connected at the USB port.

    Regards,
    Dean
  • thanks for the reply, am actually using the worksheet for LMK2592. running the TISCPro GUI works well but  does not work well through the vba code (device not connected). I tried running this on a different system with windows 10 and it works well. is there any reason why this doesn't work on windows 7?

  • Buki,

    So from what I read, the VBA code is actually working and it controls the TICSPro as it should.  The issue seems to be that when TICSPro is started from the VBA code, it gives a "Device NOT Connected".  message.  This is not the fault of the VBA code and there is nothing that can be done with the VBA code to fix this.

    This sounds like some issue with the windows drivers and USB communications.  In our lab, we use windows 7 and don't have this issue.  A few things you could try is:

    1.  Try a different USB interface, like USB2ANY board

    2.  Try unplugging and plugging in the board.

    3.  In the menu go "USB Communications" -> "Interface", then select "USB2ANY".   It should not be in demo mode.  However, if it can't find the USB interface, it will force Demo mode.

    If these don't work, I'm no expert on windows 7 or USB drivers, so I really can't debug this issue any further.

    Regards,
    Dean