Expression from RSView32

asterof

Member
Join Date
May 2007
Location
Califonia
Posts
554
Trying to conver this expression from RSView32 version 7.6
to a standard algebra equation
Can not figure it out, expression is weird
It sets the color of an object based on a value of 0-7

tag1 = analog, tag2, tag3, tag4 = digital

((0 < tag1) + 2 * tag2 + 4 * tag3) * (Not tag4) + (tag4) * 8

trying to figure out the correct order it is using

((0 < tag1) + 2 * tag2 + 4 * tag3)
(Not tag4) + (tag4) * 8

could use some help
 
Last edited:
looks like the derived number will be 0 to 8 (not 0 to 7) ...

suggestion: set up a simple "test bed" as shown below - and experiment with different values for the tags ...

if I just type in the formula that you posted, here's what I'm seeing:

if all tags = 0 then the result tag = 0 ...

anytime that (digital) tag4 = 1 then the result tag = 8 ... (note: sometimes a trick like this is used to intentionally produce an "out of range" value - and therefore cause an ERROR indication on the display) ...

if (analog) tag1 is greater than 0 then ADD 1 to the value of the result tag ...

if (digital) tag2 is = 1 then ADD 2 to the value of the result tag ...

if (digital) tag3 is = 1 then ADD 4 to the value of the result tag ...

and to answer your specific "order of operations" question:

the text below gives the same results – and the extra parentheses should help you understand the execution order ... (basic idea: MULTIPLICATION outranks ADDITION) ...

(((0 < tag1) + (2 * tag2) + (4 * tag3)) * (NOT tag4)) + (tag4 * 8) ...

if this doesn't answer your questions, I recommend that you post a screen shot of the formula (maybe there's a typo) – and please give the min and max allowable values for tag1 (can it go below ZERO for example?) ...

.

formula.PNG
 
Last edited:
RSView32

Ahh ok I thought it was RSV
The syntax works in RSV but in the new HMI iFix5.5
it does not like the syntax, so I am trying to figure out
what will work
 
not working

I tried to do what the graphic shows
I dont get errors but the result tag does
not change off O
I was in run mode not test
did you make tag2-4 digital ?

oops forgot to start derived tags
Thanks for the help, I created it in RSV so maybe I can
figure out the syntax in iFix
 
Last edited:

Similar Topics

I'm writing some structured text that's handling a data structure that comes from a PC. The PC structure is in the "new" LREAL 64-bit floating...
Replies
3
Views
488
Good Morning, I've been working on an HMI using the Panel View 5000 series. I admittedly was not very good at Factory Talk View Studio, but I...
Replies
7
Views
983
Hey everyone, I am trying to right an expression in FTView and getting syntax errors. If {[PLC]System.Auto} Then 1 OR If {[PLC]System.Estopped}...
Replies
2
Views
565
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,516
Hello Everyone, First time poster here. I have run into a problem with testing my HMI program. (I'm using FactoryTalk View Studio ME Edition...
Replies
2
Views
1,386
Back
Top Bottom