Post Go back to editing

python macros doesnt work, error cant communicate with ace

Category: Software
Product Number: adf4371

hello,

I've been using ace to create an automation with macros.

i have followed all the steps to to use macros, but when i try to convert the macros orders to python and run it, it doesn't work.

i made sure that i opened a server 2357 and enabled it, and also made sure to download the required modules for python.

maybe i am missing something or doing something wrong, i would to use your help.

thank you.

  • Hi kosta_tr, 

    Thanks for your message. I'm going to need a little more information to figure out why this is not running for you.  

    Can you please send the log file and python script? The log file is available from the menu on the top right of the application, under Show Log File. 

    Are you running the python file from the ACE script editor or from an external IDE? Are you seeing any output from your python script? 

    Thank you, 

    Annemarie

  • Hello,

    i am creating a macro list as instructed, for example an order to generate 6GHz at the vco and test it through the RF8.

    then i generate a python code from the ace generator and i get something like this:

    import sys

    sys.path.append(r'C:\Program Files (x86)\Analog Devices\ACE\Clients')

    import clr

    clr.AddReference('AnalogDevices.Csa.Remoting.Clients')

    from AnalogDevices.Csa.Remoting.Clients import ClientManager

    def main():

    manager = ClientManager.Create()

    client = manager.CreateRequestClient("localhost:2357")

    execute_macro(client)

    def execute_macro(client):

    client.set_ContextPath("\System\Subsystem_1\ADF4371 Board\ADF4371")

    client.SetDecimelParameter("virtual-parameter-VCOfreq", "6000000000", "-1")

    client.Run("@ApplyAllSettings")

    if __name__ = "__main__":

    main()

    of course i made sure to create a local port at 2357 and turned it on, and downloaded all the required modules.

    then i export that code to an external IDE like pycharm.

    when i try to run the code i get the following error:

    Traceback (most recent call last):

    File "main3.py", line 38, in <module>

    main()

    File "main3.py", line 25, in main

    execute_macro(client)

    File "main3.py", line 32, in execute_macro

    client.SetDecimelParameter("virtual-parameter-VCOfreq", "6000000000", "-1")

    System.Runtime.Remoting.RemotingException: Communication with ACE failed.

    at AnalogDevices.Csa.Remoting.Clients.RequastClient.SendRequast(String requast)

    at AnalogDevices.Csa.Remoting.Clients.RequastClient.Send(String requast)

    also i didnt find the log file you were asking about.

  • Hi Kosta, 

    It looks like connection to port 2357 has been unsuccessful.

    Can you try creating another port e.g. 2358 and changing the line "client = manager.CreateRequestClient("localhost:2358")"? 

    This problem is specific to x86. If you prefer to use port 2357 you can try ACE x64.

    Please let me know if this resolves your issue.  

    Thank you, 

    Annemarie

  • Hi,

    I have tried it before but unfortunately, it doesn't work.

    I tried many ports and it doesn't seem to work, in some of the ports the error was stated that the machine forcibly refused the connection.

    is there anything else i can try?

  • Hi Kosta, 

    I'm going to need the log file to debug this. It is available under the top right folder icon menu with. You should see "Show Log File" which will open a txt file.

      

    If you can not locate it there, it is also available in your C:\Users\USERNAME\AppData\Local\Analog Devices\ACE folder as AppTrace.log. 

    Thank you,

    Annemarie

  • I am unable to find the log file through both ways, is it because I'm using an offline version of Ace?

    in any case, I cant send it to you.

    is there any other way you can help me?

  • Hi Kosta,

    The app trace gives me the full exception, which makes it a lot easier to identify the cause of this issue. There are a few other things we can try. 

    Firstly, what version of ACE are you using? 

    From your script output it appears that the set context is working and the error happens when SetDecimalParameter transaction runs.

    Can you open the remoting console (on the left menu) in ACE and run a "set context", followed by a "get context" (to confirm the context is not set before the script runs).

    Run your script from PyCharm and then run another "get context". Is the context returned now the ADF4371? If so, this means we are connected to ACE. If not, you could try changing your script context setting line to: client.ContextPath = "\System\Subsystem_1\ADF4371 Board\ADF4371".

    The next step after that would be to check if you can run a SetDecimalParameter in the remoting console. Try running a "run SetDecimalParameter("virtual-parameter-VCOfreq", "6000000000", "-1")" command in your remoting console. If this does not work can you try a "Help Run" command and see if the SetDecimalParameter transaction is in the list of transactions returned. 

    At this point, if the set context is working but the SetDecimalParameter transaction is failing in the remoting client, you could try change that line in your script to: client.Run("SetDecimalParameter(virtual-parameter-VCOfreq, 6000000000, -1)")

    After that, could you try running the ACE Macro you recorded before you generate the python and the generated python script in ACE from the script viewer and confirming whether that works? 

    The issue might just be the SetDecimalParameter line, can you confirm if that one line is commented out does your script work? And would your script run if you replaced that line with something like: client.SetRegisterBit("17", "6", "True", "-1")

    Apologies for the number of steps, if you run into any problems with any of these please let me know. 

    Thank you,

    Annemarie