Vous êtes sur la page 1sur 2

################## Model Data Report ################## ============= SPICE Model ================= ============= Model template ================= * !!!

BEGIN-INTERACT * : Ion ++++f4 ; * : Ioff ++++f6 ; * : delay_time ++++f2 ; * 0 constant S_OFF * 1 constant S_ON * 100.0 constant low * 1e12 constant high * low VARIABLE resistance * 0.0 VARIABLE r1Cur * 0.0 VARIABLE time_on * 0.0 VARIABLE time_off * 0.0 VARIABLE flag * 0.0 VARIABLE show_time * * .( Loading the time delay relay ... ) cr * * : PWR_OFF * S_OFF ==>_*animation_state * low high resistance GRADUAL_CHANGE_AT_RUN * 1.0 ==>_*flag * 0.0 ==>_*time_on * 0.0 ==>_*time_off * delay_time ==>_*show_time * ; * * : PWR_ON * S_ON ==>_*animation_state * high low resistance GRADUAL_CHANGE_AT_RUN * 0.0 ==>_*flag * ; * * : UPDATE_SETTINGS * *show_time 0.0 f.<= if * 0.000 ==>_*show_time * endif * *show_time VALUE SET_ANIMATION_TEXT * ; * * : CHECK_STATUS * *flag 0.0 f.> if * TIME ==>_*time_on * 0.0 ==>_*flag * endif * *time_on 0.0 f.>= if * *time_on delay_time f.+ ==>_*time_off * endif * TIME *time_off f.> if * PWR_ON * endif * *time_off TIME f.- ==>_*show_time * ; * :GRADUAL_CHANGE_AT_RUN locals| ref value1 value2 | * value1 SET_INSTANCE Resistor ::R r1 resistance * value2 SET_INSTANCE Resistor ::R r2 resistance

* ; * :BEGIN_PLOT * PWR_OFF * UPDATE_SETTINGS * ; * :OUT_DATA * GET_INSTANCE Vsource ::V V i ==>_*r1Cur * Ion *r1Cur f.<= if * CHECK_STATUS * UPDATE_SETTINGS * else Ioff *r1Cur f.>= if * PWR_OFF * UPDATE_SETTINGS * endif endif * ; * : BEGIN_ANALYSIS UPDATE_SETTINGS ; * :ON_USER_UPDATE * PWR_OFF * UPDATE_SETTINGS * ; * !!!END-INTERACT * x%p %t1 %t2 %t3 %t4 TIMED_NOTC%p * .SUBCKT TIMED_NOTC%p 1 2 3 4 Lc 1 6 #7 RL 6 7 #9 V 7 2 DC 0 W0 3 4 V2 NO_contact V3 10 0 DC 5 V2 20 0 DC 0 R1 10 20 1e12 R2 10 0 100 .MODEL NO_contact ISWITCH (Ion=0.045 Ioff=0.005 Ron=1e-8 Roff=1e30) .ENDS