This is how I would do it.
In WinCC Flex:
Create 2 new tags. One an integer, the other a bool.
For the integer, in it's events, change value, select: ActivateScreenByNumber and for the Screen number parameter, select the integer tag you are currently modifying.
Select Cyclic continuous for it's acquisition mode.
The result of this will be that whenever the value of that tag changes, it'll open the picture corresponding with it's new value. If it changes from 5 to 8, then Screen number 8 will activate automatically.
Changing the value of the tag is done in the PLC. Activate valve, you want it to change screens, then just add a load/transfer of the correct integer.
One tag, one variable and so many uses.
Now the other boolean tag is more of an option. Say you have certain screens on the panel that you want to keep activated even when the valves change.
On those screens on their events Loaded and Cleared, use the SetBit and ResetBit functions.
On loading the screen, you set the bit. In the PLC you use this bit to prevent the change of screens. When exiting the screen you reset the bit, allowing autochanging of screens again.
Or something like that. We use the ActivateScreenByNumber function alot and it really works nice.