Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top