FT View Studio SE Multistate Indicator Not Working

bishoposiris

Member
Join Date
Feb 2017
Location
Cary
Posts
15
I'm running FactoryTalk View Studio SE 9.0. I have a multistate indicator that I want to show gray if a tag is off/low and show green if it is on/high. Initially I was trying this on the bit level until I realized that the States only took integer values. So then I tried just using the tag by itself and passing the value of the tag based on the bits that were high. For example, if Tag.0 is 1, Tag.1 is 2, Tag.2 is 4, and Tag.3 is 8 then if Tag.0 and Tag.3 are high then Tag would be 9 and that's what would be passed to the state value. But that isn't working either. As it is it always shows high no matter what the state is. What am I doing wrong?
 
I've only got version 8, but would a maintained pushbutton work? In Connections, you can assign a boolean tag to the Value property, and you can set the values to 0 and 1 in the States tab.

Or you could do a Macro button which runs a macro to return 0/1/2 etc based on the value of the boolean tag?
 
Last edited:
Can you post the animation screen settings? If what you are after is simply one color or another then your expression needs to evaluate to a true or false (or a 1 or a 0). For example

If tag.0 then 1 else
if tag.1 then 1 else
if tag.2 then 1 else 0

Or

If tag <> 0 then 1 else 0 (any tag.xx bit being on)

OG
 
Last edited:
I THINK I understand but still a little confused. Not quite sure I understand the syntax.

"if tag.0" does this mean "if tag.0 is high"? If so what does "then 1 else" accomplish?

Also, how do I assign color? I would expect something like:

If tag.0 then green else gray

Which I would interpret as "If tag.0 is high then the button is green else it is gray"

Am I way off base?

FT Animation.jpg
 
For future thread readers....

All that was needed here was to put the tag name "tag.0" in the expression field. Nothing else.

Then below that, State A is where you define the color when the tag/expression is a 0. In this example the animation would result in a red background with a black outline.

State B is where you define the color when the tag/expression is a 1. In this example the animation would result in a green background with a black outline.

The object would be either green or red based on Tag.0 being a 1 or a 0.

For additional colors you would define State C and beyond. We could say that State C is when the expression returns a 2. State D is when it returns a 3. The expression gets a little more complicated at that point. For example:

If Tag.0 Then 1 Else
If Tag.0 = 0 AND Tag.1 then 2
Else 0

Note the first line I did not specify Tag.0 = 1. That is assumed. But for clarity, you can specify it. On the second line I was looking for Tag.0 to be off so I had to specify "= 0".

Note too that the values I used for Then and Else could be anything I wanted. I could have written this as:

If Tag.0 Then 105 Else
If Tag.0 = 0 AND Tag.1 then 213
Else 88

I would just have to make sure that the value for state A, B, and C are changed to match what my expression used.

OG
 
Actually it was a little simpler for my case. I just had to attach tag.3 (see attachment Connections where "[PLC1toPLC2]bProcess04[1]" = tag) under Connections. Then I filled in State 0 (see attachment State 0) and State 1 (see attachment State 1) as you see in the attachments. No expressions were necessary.

Connections.jpg State 0.jpg State 1.jpg
 
For future thread readers....

All that was needed here was to put the tag name "tag.0" in the expression field. Nothing else.

Then below that, State A is where you define the color when the tag/expression is a 0. In this example the animation would result in a red background with a black outline.

State B is where you define the color when the tag/expression is a 1. In this example the animation would result in a green background with a black outline.

The object would be either green or red based on Tag.0 being a 1 or a 0.

For additional colors you would define State C and beyond. We could say that State C is when the expression returns a 2. State D is when it returns a 3. The expression gets a little more complicated at that point. For example:

If Tag.0 Then 1 Else
If Tag.0 = 0 AND Tag.1 then 2
Else 0

Note the first line I did not specify Tag.0 = 1. That is assumed. But for clarity, you can specify it. On the second line I was looking for Tag.0 to be off so I had to specify "= 0".

Note too that the values I used for Then and Else could be anything I wanted. I could have written this as:

If Tag.0 Then 105 Else
If Tag.0 = 0 AND Tag.1 then 213
Else 88

I would just have to make sure that the value for state A, B, and C are changed to match what my expression used.

OG

Just a quick nitpick -

If you want to assess whether Tag.0 is equal to 1, the syntax is not Tag.0 = 1, but rather Tag.0 == 1.

The double equals is important - a single equals implies a "set" function (i.e. Tag.0 = 1 would be used to set Tag.0 to a value of 1).
 

Similar Topics

Hello everyone, I am developing an HMI application. In this application, I have a handful of multistate pushbuttons that control various pieces...
Replies
4
Views
3,738
Hello. I am new to expressions in FTView. I am replacing a GOT with a panelview and am trying to drive a multi-state indicator with a expression...
Replies
2
Views
5,210
How do you determine what a multistate indicator is going to do when it is pressed? I have an existing application with a gotoDisplayButton...
Replies
10
Views
12,455
I need a multistate indicator with a trigger type LSB that will span four integers. So, I created it with the connection tag "MESSAGE" assigned...
Replies
2
Views
4,075
I may be missing something here and most likely ,I am. I would like to put a multistate on my display ,but I would like to put a Auto,Off and...
Replies
4
Views
4,964
Back
Top Bottom