FTV ME Expression ok?

dginbuffalo

Member
Join Date
Dec 2010
Location
Buffalo,NY
Posts
630
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
 
Last edited:
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?
 
Last edited:
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)
 
Last edited:
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...
Replies
3
Views
1,510
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...
Replies
6
Views
1,799
Hello everyone, I am currently working on a project that uses a Rockwell L33ER controller and the FTV Studio V13 as Supervisory computer...
Replies
0
Views
118
Hello everyone, I am working in a platform and we installed FTV CLIENT SE V 12 IN ALL THE CLIENTS COMPUTERS, we have 6 clients and only 1 is not...
Replies
0
Views
96
Hi all, I'm having difficulties trying to connect FactoryTalk View SE Local Station (V13.00) to MS SQL Server Express. I state that they are...
Replies
2
Views
128
Back
Top Bottom