FTV ME Expression ok?

Hi guys- I don't use expressions very often but I'm trying to change a valve color based on the open and closed limit switch. If neither are in, the valve is gray. I won't be around to start this up so I want to make sure it's ok for the guy who will be. Is this valid?color expression.JPG
 
I would say yes, that looks OK, but one suggestion I would make is to further assert the value of boolean tags using the == operator. This is not essential but just a good habit to get into.

Also, to check validity, use the Expression button to the right and open the Expression Editor proper. This way you can access the operators and check validity when your done.

Here's a similar example in one of my projects...
Colour_Animation_Expression.bmp


Regards,
George
 
Good deal- Thanks guys. Unfortunately I realized I'm going to have to rethink this.

The issue is the customer wants the valve as follows: closed=green, open=red, and faulted = grey.

Faulted could be (open AND closed) or (NOT open AND NOT closed). My original expression doesn't cover if both switches are on at the same same time.This throws a little wrench into the mix. I'm not sure if I want to add PLC logic to handle this or redo the expression to cover this?
 
I'd handle fault logic on the controller anyway, and leave the HMI to display states.

That said, you can expand your sub-expressions with other binary operators &, OR, XOR, and so on.
 
I'd handle fault logic on the controller anyway, and leave the HMI to display states.

That said, you can expand your sub-expressions with other binary operators &, OR, XOR, and so on.

If I handle it in the PLC I think i would just have a "valve status DINT" that would equal the following:

0=closed
1=open
2=faulted

Only problem is there's 50 + valves. O well, I guess no option will be a quick fix!
 
Been using this trick for ages...
Valve_ZSC + Valve_ZSO*2

0 closed=0, open=0 - valve is moving (if it persists too long, it's a fault)
1 closed=1, open=0 - valve is closed
2 closed=0, open=1 - valve is open
3 closed=1, open=1 - limit switch failure (one or the other is stuck)
 
Been using this trick for ages...
Valve_ZSC + Valve_ZSO*2

0 closed=0, open=0 - valve is moving (if it persists too long, it's a fault)
1 closed=1, open=0 - valve is closed
2 closed=0, open=1 - valve is open
3 closed=1, open=1 - limit switch failure (one or the other is stuck)

Slick little trick- I like!!!! (y)
 

Similar Topics

I asked this question briefly in my previous post long post, I'm asking again here as the main point so it doesn't get buried. I am pretty new at...
3
Replies
2,755
Views
Dabbling with some expressions in my OIT program FTV ME 9, not something I am that experienced with. Managed an If,then, else that works well for...
6
Replies
2,547
Views
Hello all, I am working on a FactoryTalk View program and am having trouble viewing the offline tags. The Runtime is pointed to the correct...
9
Replies
802
Views
Hello, I am using maintained push button to set bit, but logic in PLC reset it. The problem is that when I click the button, it shows a state of...
1
Replies
533
Views
hi everybody i am facing issue on FTV Studio on HMI and SCADA also while i am opening tag browser below the error came give me solutions 1.HTTP...
0
Replies
542
Views
Top