Query Tags updated by other users

Hi all.
I use querytags to display a piechart, with two time pickers to perform the Between SQL queries, my problem is when another user connects, the data is updated with the time interval chosen by the new user.
is there a way to solve this problem please ?.
Ignition version 8.1.
Thank you for your help

Well... don't use tags. Use session properties.

Wait, are you using vision or perspective ? For vision, that would be client tags instead of session properties. I think, I don't use vision.

Thank you Pascal , I am using perspective, so you mean i bind the time pickers to custum session properties , but i cant find how i can use those properties in my queries to do the 'Between' interval .

Thank you for your help

No, you'd usually use component or container properties. Client tags only if you wanted a date range used in multiple windows to be synchronized.

How do you use your tags ? Using properties is quite similar.

I can find the tags in the Tag browser when i write my queries but i dont know how to find properties, can you please give en example of the syntax because i tryed every thing .
Thank you

Ah, you are using query tags for your user interface. Don't do that. Use query bindings on component properties.

1 Like

I don't use queries much, so I can't tell just by looking at it where that query is written... Which is an important thing to know in order to help you.
But my guess is that if you don't have a properties browser, you're not in session scope, which is problematic for what you're trying to do.

edit:
So it seems this is the query tag editor.
Drop this.
Here's what I'd do:

  • make a named query
  • where you're using tags, use parameters instead
  • create a custom property on the component that needs that query
  • bind it to your named query, passing the data required for the parameters.

Also, I don't think you should use tags for datedebut and datefin. Those look like component specific variables.
So, whatever is setting the values for those tags, use it to set properties instead.

Thank you guys for your help , i have tryed that, but the syntax to integrate session properties in my query is what blocked me in the begining .
can you please help me find the path to my properties to put in the red squares .

That's not how parameters work. you put in placeholders, and you pass real values when using the query.

Notice how :foo matches the name of the parameter ?

Then on a custom property, use a named query binding and pass a value to replace that parameter:

this passes 42 as parameter, so the query becomes:

select * from some_table where some_value > 42

But you can use expressions instead of a constant or literal. So that means you can pull that value from a tag, from a property, etc.

edit:
Wait, I just noticed you're actually using parameter for 2 other things. Just do the same thing for datedebut and datefin

so that would look something like that:

2 Likes

Thank you Pascal it works , thank you for your patience :smile: :+1: :+1: