I don't think there is a way in PI System Explorer to expand the expression box. You can copy/paste from a text editor, but then of course you would be missing out on the intellicense provided in the UI.
I was going to go and make a user voice request on our feedback website. Before doing so, can you share how you think this could be made more user friendly? I'd include the details you provide in the request.
Thanks Seb. As you suggested the ability to expand the expression box would help make it more user friendly for long expressions. Thanks.
2 of 2 people found this helpful
My Houston co-worker, Ales Soudek, wrote a fantastic paper called Tips and Tricks for Asset Based Analytics. On page 9, he discusses breaking Analysis into many expressions, each with their own intermediate variable. On page 10, he mentions how you may use SHIFT+ENTER to force a line break in the middle of an expression - this is great to do with a long IF-THEN-ELSE where you may break right before the THEN and again before the ELSE so that it appears as:
If condition /* page 28 mentions inline comments */
You can shorten somethings with its own variable expression:
You may consider different branching. For instance, TagA'>25 and 'TagB' < 35 covers 3 long cases. You could group them as one:
If TagA'>25 and 'TagB' < 35 Then
/* different conditions, shorter now because A>25 and B<35 is true */
Else If TagA'>25 and 'TagB' > 35 Then
/* other conditions */
Else 'TagA'>25 and 'TagB'<25 Then
/* still more conditions */
Else If TagA'<25 And JActive Then 0 Else NoOutput() ))))
Although I would also bring up that if 'TagA' was exactly equal to 25 that the NoOutput() would be assigned.
Thanks Rick. That's really handy . I had already shortened it from the 14 conditions I was given, but I can see there may be some more scope for doing this. And great point about values that are exactly 25. Thanks for your help.
4 of 4 people found this helpful
Hello again Tui,
Great that you understand that 'TagA' < 25 is not the opposite of 'TagA' > 25. The opposite of 'TagA' > 25 is actually 'TagA' <= 25.
With the above in mind, there may be an opportunity to make the expression more readable. Let's say the main or good condition for TagA is when it is > 25. And your good condition for TagB is when it is < 35, and so on. If that is the case, then you can do something like:
Variable Expression A 'TagA' > 25 B 'TagB' < 35 C 'TagC' > 5 J DigText('TagJ') = "Active"
This reduces the logic of the main expression to things like:
If A and B and C etc.
For the case where you want to check 'TagA' > 25' and 'TagB' >= 35, that is to say when you want the opposite of 'TagB' < 35, then the logic stub would be:
If A and Not B and etc.
By combining certain conditions into their own variable, you could end up with:
Sorry for the delay replying, I missed your answer until now. That is an awesome idea. Thanks so much. That will make it much tidier.