Logic statements in LTspice

Status
Not open for further replies.

Flyback

Well-Known Member
Hi,
I wish to do
IF {(I(C7) > 5) OR IF (I(C7)<-5)}, THEN I(C7) = 5, ELSE I(C7) = I(C7)

Do you know how the syntax goes for this in LTspice?
 
Hi,
I wish to do
IF {(I(C7) > 5) OR IF (I(C7)<-5)}, THEN I(C7) = 5, ELSE I(C7) = I(C7)

Do you know how the syntax goes for this in LTspice?

If used with a BV or BI device, like this:

V=if ( (I(C7)>5) | (I(C7)< -5), 5, I(C7)) <---the result is a voltage
-or-
I=if ( (I(C7)>5) | (I(C7)< -5), 5, I(C7)) <---the result is a current

How do you plan to use result?
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…