Kkula
Browse Questions » WinCC Unified Systems: Combined v20 Visibility Scripting within Faceplates

About User

Questions Asked: 29.3K

Answers Given: 0

0
  • Open

WinCC Unified Systems: Combined v20 Visibility Scripting within Faceplates

Hello, 
I am trying to run a visibility script on a button within a faceplate and I am having some trouble making it work. The reason I'm using a script rather than just a tag or expression is because I am trying to read just one bit of a Dint as one of my conditions and then eventually I'll add some more conditions to the IF statement.
Below is an example that works outside of the faceplate. 
var coupling = Tags("Coupling").Read();
var bit4 = (coupling >> (4-1)) & 1;
if (bit4 === 1) {
Screen.Items("Button_1").Visible = true;
} else {
Screen.Items("Button_1").Visible = false;
}
And below is what I tried doing in the faceplate but have had no success. Additionally, I just made this very simple for testing purposes but I hope to make it look similar to the code above. 
var pump2 = Tags("See_Pump_2").Read();
if (pump2 === 1) {
Faceplate.Items("Button_1").Visible = true;
}
I haven't gotten any syntax complaints from compiling but I know I'm missing something. If you have any suggestions or comments, please send them over.
Thank you!
Lisa

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(0)