RTSWITCH example

Discussion on both general simulation and Proteus VSM microcontroller simulation.
Post Reply
electony
Professional User
Posts: 33
Joined: Fri 2018-12-14 19:08

RTSWITCH example

Post by electony »

hello, it`s possible some example for the function of RTSWITCH modeling primitive.?
thank you.
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: RTSWITCH example

Post by Ettore »

RTSWITCH is substantially a variable resistor where its value is represented by a STATE number.
It gets no practical use outside an ACTIVE models; for example it is largely used in rotary switches active models.

However I attach a project file with a couple of examples:
a) The SW1 changes its internal resistor value based to given STATE value. Try STATE=0, 1, 2 and 3 (STATE is in the *DEFINE block) and the current probe value will change accordingly.
b) The 2nd example with SW2 to SW5 represents the internal model of SW-ROT4 (four position rotary switch). As you change the STATE value a lamp lights up accordingly.
Attachments
Annotazione 2020-06-14 174640.jpg
Annotazione 2020-06-14 174640.jpg (134.37 KiB) Viewed 575 times
RTSWITCH examples.pdsprj
(12.9 KiB) Downloaded 53 times
Kind regards,
Ettore Arena - Labcenter Electronics.
electony
Professional User
Posts: 33
Joined: Fri 2018-12-14 19:08

Re: RTSWITCH example

Post by electony »

OK, and is there any way to make variable "state" time dependent?
thank you.
Ettore
Labcenter Staff
Posts: 2932
Joined: Fri 2006-03-03 11:56
Location: Milan
Contact:

Re: RTSWITCH example

Post by Ettore »

No. STATE variable is simply a number requiring user's interaction.
Only voltages and current are time dependent in SPICE. If you need a time dependent variable resistor then you must use the Linear Voltage Controlled Resistor (VCR).
Pick it from "Modelling Primitives library" and once you got it placed edit it and press Help button. This will tell you how to use it.
Kind regards,
Ettore Arena - Labcenter Electronics.
Post Reply