AnsweredAssumed Answered

vrf Waveform question

Question asked by ptarso on Nov 11, 2003
OK, I'll let you in on my secret. I cheated. On the input to
the IF/THEN/ELSE, I edited the input terminal "A" and forced
the REQUIRED TYPE to "TEXT". This made the input not a Real64
ZERO value, but a "0" text value. It does not evaluate the
same in the equation as a Real64 would. In fact, if you set
different input values, you'll see the A<10 doesn't even work
after A gets above 2. To make it work correctly, keep the "A"
terminal forced to TEXT (like I did), but change the equation
to the following...

  (asReal64(A)<10)*A

Then it will evaluate the equation correctly AND return a "0"
on the THEN pin if the input happens to be zero.

Remember that if A="0", 1*A="0", 2*A="00", 3*A="000", etc. Now
the part where VEE's IF/THEN/ELSE acts strange, is in the case
of 0*A. This actually returns a null "", but the IF/THEN/ELSE
evaluates it as FALSE and sends the NULL (not ZERO) to the
ELSE pin. This case is not covered in the HELP section, but
I've used it for years and (so far) it's been very predictable.

One thing you have to remember is you are dealing with a TEXT
value on the ELSE pin and NOT a REAL. Most of the time VEE
will convert it to a REAL as needed, but to make sure, either
put the output through an "asReal" formula, or just force the
input pin on the next box to a REAL value and VEE will make
the change for you.

Mike Groves

-----Original Message-----
From: VEE user at ESF GmbH [mailto:vee@esf-gmbh.de]
Sent: Tuesday, November 11, 2003 11:53 PM
To: VRF
Subject: [vrf] AW: RE: If/Then/Else - Bug?


This is, why I sometimes hate VEE!!!!

I made experience in a similar way that a VEE functionality performs
incorrectly dependent on the context, even context in other User Functions
not being involved in the issue under discussion.

Hans-Joachim

-----Ursprngliche Nachricht-----
Von: Mike Groves [mailto:mikegroves@pacbell.net]
Gesendet: Mittwoch, 12. November 2003 02:32
An: VRF
Betreff: [vrf] RE: If/Then/Else - Bug?


Ah, but then sometimes you can coax it into doing exactly what you want!
<grin>

Mike Groves

-----Original Message-----
From: M Watts [mailto:MikeJWatts@compuserve.com]
Sent: Tuesday, November 11, 2003 1:02 AM
To: VRF
Subject: [vrf] If/Then/Else - Bug?


Hi Vinod,
         This seems normal behaviour to me.  If you set the top part of
your example ( say ) to 20 so that the statement is false then you will see
an output of 0 type real64 ( not sure why this is not type int, but that's
another issue! ).

The (A<10)*A is a 'trick' - all it does is say 'evaluate the expression, if
<> 0 then output to pin 1, otherwise pin 2'.  It just so happens that A<10
and (A<10)*A both evaluate to non-zero but the output of the latter is
arguably more useful than that of the former.

What I think you are pointing out is: "don't use this construct".

I tend not to use this structure - either I use If/then/else for branching
flow, or I use the incredibly useful triadic operator y=(A<10?A:0).


Cheers,

Mike Watts

---
You are currently subscribed to vrf as: mikegroves@pacbell.net
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".


---
You are currently subscribed to vrf as: mikegroves@pacbell.net
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com".
If you need help with the mailing list send a message to
"owner-vrf@it.lists.it.agilent.com".


---
You are currently subscribed to vrf as: rsb@soco.agilent.com
To subscribe send a blank email to "join-vrf@it.lists.it.agilent.com".
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".

Outcomes