Condition function not working

Discuss issues and ideas you have to configuring displays with PowerVision
vom1rhi
Posts: 14
Joined: Mon Oct 10, 2011 2:26 pm

Condition function not working

Post by vom1rhi » Mon Nov 14, 2011 8:34 am

Hi Everybody

I created a state machine, to show either a blank page or a yellow layer, based on a signal, I get from the CAN
The Value is between 12288 and 12800. So you see, there a a lot of values!
So here is my problem:
I programmed:
Blank Page Condition1:
Signal1<12288
Blank Page Condition2:
Signal1=12291

Yellow Page Condition1:
Signal1=12289
Yellow Page Condition2:
Signal1=12290

That worked fine! Yellow is shown at 12289 and 12290, otherwise, Blank Page is shown

Now, since I don't want to put 800 different conditions in there I tried it with:
Blank Page Condition1:
Signal1<12288
Blank Page Condition2:
Signal1=12350

Yellow Page Condition1:
12289<=Signal1<=12349


Now, I got my blank page at 12288 and yellow starts at 12289, that works fine, too!
But when I reach 12350, and yellow should switch back to blank, it stays yellow.

So is my Yellow Page Conditon1 wrong or is the display not able to use this function?

I set the yellow and blank page with a variable which I set to 1 or 0. That works fine! So the only thing with make trouble is the Yellow Page Condition1

I am using PowerVision 2.3 and a PV-450

Thanks
vom1rhi
mbowdich
Posts: 209
Joined: Tue Oct 05, 2010 10:54 am

Re: Condition function not working

Post by mbowdich » Mon Nov 14, 2011 3:58 pm

The format is wrong. You cannot do a double evaluation in a single step like that. You need to evaluate them with an AND or OR statement:

Code: Select all

FOR YELLOW CONDITION
and(signal1>=12289,signal1<=12349)

FOR BLANK CONDITION

or(signal1<12289,signal1>12349)

bseidl

Re: Condition function not working

Post by bseidl » Tue Nov 15, 2011 8:10 am

Hello vom1rhi

instead of using "12289<=Signal1<=12349," try using the AND function.

AND(12289 <= Signal1, Signal1 <= 12349)

Let us know if this does not work.

bseidl
vom1rhi
Posts: 14
Joined: Mon Oct 10, 2011 2:26 pm

Re: Condition function not working

Post by vom1rhi » Tue Nov 15, 2011 9:36 am

Works fine now!

Code: Select all

OR(AND("PCode01">=12289,"PCode01"<=12321),"PCode01"=12323,"PCode01"=12325,(AND("PCode01">=12327,"PCode01"<=12339)))
Thanks for your help!