What does polling mode off actually mean

I am pretty sure I am failing to understand how polling mode works when “off”. My interpretation was if my data from the result changes then the query executes but I think it is actually only firing when my parameters update. So I added a custom parameter “refresh” that doesn’t change the query results but does get sent to the named query. Still no change in behavior.

What am I not understanding correctly?

Are you actually changing the value of refresh? Setting true to true will probably be ignored, for instance.

Regardless, you should probably be doing a refreshBinding() instead: Perspective Component Methods - Ignition User Manual 8.1 - Ignition Documentation

How could the result data change without a query execution?

Polling mode set to off means the query will not update unless one of the parameters change. If you want to force trigger a refresh, the correct way to do that in a script is

table = event.source.parent.getComponent('Power Table')
system.db.refresh(table,'data')

The question is for vision I think.

Ah, yeah, so it is, I misinterpreted the dialog.

Still: system.db.refresh - Ignition User Manual 8.1 - Ignition Documentation

I was flipping true to false and false to true. The data still wasn’t updating so I am trying to locate my problem.

What changes are you expecting to see? Are you sure it isn’t running the query and the result set is the same?

I thought I would get new data but I may need to toggle something else to force the new data to appear.

The system.db.refresh() seems like the way to go though so I am not adding useless parameter to all my queries.

I will test further and report back.

1 Like

After some testing it doesn’t seem like system.db.refresh is working… but I know why.

In my setup I am not actually running the named query from the powertable. I have attached the powertable to a dataset tags custom property that is running the named query. So refreshing the table doesn’t accomplish anything (doesn’t appear to be).

Use system.db.refresh on the component & property that actually has the binding you wish to re-execute. (The custom property in this case.)

I hope you caught @dkhayes117 comment about not seeing anything changing in a DB without executing a query. While some DB brands may have event notifications available in their connection technology, JDBC doesn’t have a universal way to expose such.

3 Likes

Ok, what is the syntax to update a property on a root container?

This code isn’t cutting it…

system.db.refresh(event.source.parent, "data")

In this case my button the script is being called from is directly under the ‘Root Container’.

Is the name of the root container custom property “data” ?

1 Like

It sure isn’t!

:sweat: :man_facepalming:

1 Like