I have a SCADA developed on Ignition v. 8.1.20 and it is set up as a dual monitor system. Both screens work great (show two different screens independent of each other), right up until we get to the generator page. That page has a drop-down which lets a user select which generator is being viewed on that page. It is a session-driven property using session.custom.Generator. Because of this, if I select let’s say Generator 2 on Monitor 1, Generator 2 also shows on Monitor 2. What is the easiest way to fix this issue and allow for the drop-down to control different views on the same page? Thanks in advance!!
Don't go through session properties for this kind of things.
I know it's appealing because it's easy, but then you end with 2 things that I really don't want to end up with:
- a big mess of properties all in the same place with no easy way to know where their values come from and what use them
- the kind of problems you just ran into.
Avoid session properties for things that are not session scoped.
So, what's the alternative ?
Well if you want to show data based on a dropdown that's on the page... use that dropdown directly.
But I'm guessing that if the selection goes through session customs, it's because there's a layer in between the actual data and the dropdown. Embedded view maybe ?
The solution is parameters. Parameterize the view that displays the data, so that it takes the id/path/whatever allows you to tell the view "show THAT data".
Then use that parameter instead of a session property.
If your setup is more complex than that, you'll have to tell us more about it so we can help you find the best way to handle it.
And then do your best to do the same thing for every session custom property. Most of the time, they're being mis-used as a big global space where people store anything and everything. Do yourself a favor and don't do this.
@pascal.fragnoud Thanks for the quick response!! Yeah, this project was developed by someone else and… not a fan of the setup.
Sounded like we had the same line of thinking so I went ahead and linked tag parameters to view.custom.Generator instead of session.custom.Generator, and just duplicated the individual pages to make 3 generator pages, with individual parameters Generator 1,2,3. Didn’t have to edit anything in the Drop-down, and it works great now. Super glad it was a faster fix than it initially looked. Thank you so much for the second opinion and the fast response. All done at this job site for today.