Description

Learn how the different polling modes (polling off, relative, and absolute) work for the SQL Query binding.

Video recorded using: Ignition 7.7

Transcript

(open in window)

[00:00] Let's take a look at the polling mode for the SQL query binding. Essentially the polling mode dictates how often the query's going to execute. So here I have a label. I'm going to bind the text property of the label to a SQL query. I'm going to type in a really simple query that's going to select the current time. So that's SELECT CURRENT_TIMESTAMP. Of course I can specify which database connection to run that query through, and then I can specify the polling mode. The polling mode exists on all the database binding types, so DB Browse as well as SQL Query. There are three modes, Off, Relative, and Absolute. Off means the query's going to run once when the window's opened. Relative means it's going to poll at a projects base rate which is five seconds by default. You can over on the right-hand side specify a number of seconds to add or subtract to that base rate. Absolute, you can specify any rate that you want, so it can poll every five seconds 10 seconds, 30 seconds, whatever you type in here on the right-hand side. Let's first look at the polling mode, Off which is going to run once. So if I use this type and press OK, I'll see the date come back. And right now it's 9:32 and 25 seconds. It is not updating because it only ran once. If I close the window here, the Designer, and then reopen it I will see now it's at 9:32 and 35 seconds. So it ran once and that was it. The second polling mode is to poll at a project's base rate, and that's the Relative, which by default is five seconds. So if I use this and press OK, I'll see this date update every five seconds. Right now it's 49, in a few seconds it'll be 54, and so on. So it's polling every five seconds right now. I can change that base rate by going up here to Project, Properties, and going to the Client, Timing section, and change the Polling Base Rate, which is number of milliseconds here, so it's 5,000 which is five seconds. So every query that is using the Relative rate, you can change that rate in one place. That's what's nice about the Relative polling mode. The last mode is to basically specify your own rate where you can do anything you want. So I'm going to type in over here, one second so I can see it update every one second. Let me go ahead and press OK, and now I can see the date coming back every one second. Now it's important to note that if you have queries that are polling, if you have 100 clients open that have the same window open at the same time, and they're all doing a polling query, say, every second, you're going to have 100 queries running to your database every second. So really be cautious on all the queries you put in there that are polling. There are times when you do want that screen to automatically update from values in the database.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.

close

Share this video