When I attempt to run the same thing in a propertyChange Script Editor of a label in Vision I receive the following error and I'm not sure what I need to do differently; does anyone have any tips on what may be the issue?
Traceback (most recent call last):
File "<event:propertyChange>", line 23, in <module>
com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Read timed out
caused by GatewayException: Read timed out
caused by SocketTimeoutException: Read timed out
Ignition v8.1.32
Java: Azul Systems, Inc. 11.0.18
If you absolutely have to tolerate unusually long queries, a workable (notsimple) approach would be:
Use system.util.sendRequest() to ask a gateway message handler to start the query in an asynchronous task. Have it immediately return a unique token for the task.
In the asynchronous task, when complete, use system.util.sendMessage() to deliver the query result to the origin client ID, with the token in the payload, too.
In the client, place the token and some followup task information in a library script top-level dictionary. Perhaps with a timeout value.
Define a client message handler to receive completed queries, popping the tokens from the dictionary, and performing the follow-up task.
Define a client timer event to occasionally loop through the dictionary, checking and handling timeouts.
I recommend figuring out how to make that query reliably return results in a couple seconds.