currently i try to perform this script in a tag value change events:
params = {"gaiacode":"APTS503"}
val = system.db.runNamedQuery("aqualog",params)
When i execute this code in a Script Console the execution finished without error. But inside value change events of every tag in my tag browse it sucks!
In gateway scope, the database connection name argument to runQuery is required.
Your except: can inspect/print/log the actual exception information via python’s sys and/or traceback modules, though you will need a separate except: clause to capture java errors. See this example:
Note that any uncaught errors or logging or printing from gateway scope show up in the gateway log, not in the designer’s console or client console. Printing, in particular, only goes to the text-format wrapper log.
{ Have you gone through the lessons in IA’s Inductive University ? That would cover many of the basic concepts of Ignition and Python that are tripping you up. }
@Alberto_Fagni, please try this going forward:
If you supply snippets on the forums, please either use the UI to format the code using the </> formatting tool, or place all of your code between triple backticks ```
code here ```
to allow for easier reading. I’ll edit your previous posts to assist in this thread, even though you’ve already been directed to the solution to your problems.