This lesson is part of the Tags in Ignition course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off
Take topic challenge

Description

Client Tags, as the name implies, are only available for use in Vision Clients. This means that their values are isolated to a Client runtime, and even though they are created in the Designer, each Client will create their own instances. This makes them very useful as in-project variables for passing information between screens and between other parts of the Clients, such as scripting.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] Client tags as the name implies are only available for use in clients. This means that their values are isolated to each Vision Client runtime. And even though they're created in the Designer, each client will have their own instance of those tags. For example, if I have a single client tag of the value of say 42, if I open five vision clients, each vision client will have its own instance of my tag with the same value of 42. If I write a 59 to one of my tags from one of my clients, only that client performing the write will reflect the 59 value change. This is because again, each client will have its own independent instance of this client tag. To create client tags in the Designer, we go into the tag browser. This is special tag provider called Vision Client Tags. Since client tags only apply to vision clients, the vision client tags provider will only appear if you're in the vision design space, we can easily right click on the tag browser, scroll down to new tag and create a new client tag, which is the only one available when you're in this provider.

[01:05] We give the tag name, so I'm going to name it Area and a data type. So I'll make that a string. I'll set this value to say processing. A client tag can be a static value where I simply type in the value I want, think of it like a memory tag in that sense, of course it's value could be modified from the vision client by writing to the tag. You can also go to the Expression SQL section here and make it an expression or a SQL Query depends on where you want the tag source value to come from. I want the tag to have a static value processing, so I will leave this as a none. Press OK to exit my configuration and I will see my new client tag in the tag browser. This tag can be used as a variable to be passed between windows, I can read from it, I can write to it. It is a variable we can use and work with. As we saw earlier, client tags can also be expressions. Let's create one. This time I'll name it Flag and set the datatype to Boolean. I will select the Expression SQL option on the left and set the expression type to "Expression" to bring on the expression editor.

[02:04] Say I want this tag to evaluate the truth if my client's IP address equals two one, two, three, four. To do that, I can click the little tag icon here and drill down to my system tag provider, which contains a tag that has the client's IP address. I will complete my expression like so. Now this expression will evaluate to true if, and only if my client's IP address is 1.2.3.4. I will click Okay and you will notice that my tag's value is indeed false because 1.2.3.4 is not my IP address. However, if I have fifty vision clients open, and one of them has an IP address of 1.2.3.4 that single vision client will see it's flag clients tags, and since I'm a value of one or true. One other important thing about clients tags that I want to mention, especially when you're looking at expressions or SQL Queries, is that Client Tags do not have a tag group associated with them. So the values do not poll according to a tag group that we created for regular tags. If you want a client tag to continuously update automatically in the SQL Query mode, you set the polling mode to relative or absolute.

[03:07] So you can specify how often you want the query to run. In the expression mode, you have to make the expression actually reevaluate, which either is dependent on values within the expression changing, or you can use functions that actually poll. For example, in the Date and Time functions, then now function, you can specify a poll rate and it would continuously make that expression calculate over and over again. In this case, it will evaluate every 1000 milliseconds. So Client Tags can really be useful for in project variables. In the next lesson, we're going to look at how we can use them for indirection.

You are editing this transcript.

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