Hi,
I would like to run a Python script on the gateway machine from a button on Perspective client.
I am sending a message to Gateway to fire the script. The gateway event script is:
You will have to use a different method to get the result out of your python script most likely ProcessBuilder. There's a few examples on the forum of people doing this you can search for.
It's very possible your python script is running now but you don't think it is because your results are None.
Thank you [bkarabinchak.psi]
I am not relying on the return to determine whether the script fired. As you point out the doco explain that system.util.execute returns nothing. I do not require an results. The script reads and writes to a database. It works when fired from Visual Studio, but when called from Ignition the database is not modified
@jrd, to ping someone or have notification of a reply in their inbox hit the reply button under their post or use the @username syntax. I'm not sure if any of your previous four posts will have generated notifications. You can edit each with the pencil icon link.
Worth asking to get the simple thing out of the way - this path - this is the exact command you would run on the computer on that the ignition gateway is installed on? -"C:\Users\Ross\AppData\Local\Programs\Python\Python311\python.exe", r"C:\Users\Ross\source\repos\PythonApplication1\PythonApplication1.py"
You're running it on a gateway event script, so it's using the file system of the computer that the Ignition Gateway is installed on for one, and for two, then it would need permissions to the User\Ross folder if it doesn't have it. Perhaps all you need is to make sure the file path exists on the gateway or move it to a location the Ignition gateway has permissions for.