Error in Netlist in pspice

Discussion in 'General Electronics Chat' started by Electronicsguy774, Nov 24, 2015.

  1. Electronicsguy774

    Thread Starter New Member

    Nov 24, 2015
    5
    0
    I'm not sure why my netlist won't work in pspice:


    **** 11/25/15 04:45:36 ****** PSpice Lite (October 2012) ****** ID# 10813 ****

    * source PROJECT1


    **** CIRCUIT DESCRIPTION


    ******************************************************************************



    R_R1 N14426 N14640 167 TC=0,0
    R_R2 0 N14426 5.572k TC=0,0
    C_C1 N14410 N14426 4u TC=0,0
    V_V1 0 N14410 18Vdc
    X_S1 N14728 N14426 N15165 N14640 SCHEMATIC1_S1
    V_V2 N14728 N14410 23Vdc
    I_I1 0 N15165 DC 10mA
    R_R4 0 N15165 1000k TC=0,0
    X_U1 N14426 N15255 Sw_tOpen PARAMS: tOpen=1us ttran=1u Rclosed=0.01
    + Ropen=1Meg
    V_V3 N15255 N14410
    +EXP 23V 15V 1us 1e-7 0 0

    .subckt SCHEMATIC1_S1 1 2 3 4
    S_S1 3 4 1 2 _S1
    RS_S1 1 2 1G
    .MODEL _S1 VSWITCH Roff=1Meg Ron=1 Voff=0 Von=1
    .ends SCHEMATIC1_S1


    ERROR(ORPSIM-15108): Subcircuit Sw_tOpen used by X_U1 is undefined
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,768
    4,802
    Well, where do you define the subcircuit Sw_tOpen?
     
  3. Electronicsguy774

    Thread Starter New Member

    Nov 24, 2015
    5
    0
    I tried to define it subckt SCHEMATIC_S1 but it still gave me an error
     
  4. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Is it just a switch? If so, you can use a regular switch and define it as Sw_tOpen.
     
  5. Electronicsguy774

    Thread Starter New Member

    Nov 24, 2015
    5
    0
    I tried to but it gives me the error below:

    **** 11/25/15 10:49:46 ****** PSpice Lite (October 2012) ****** ID# 10813 ****



    **** CIRCUIT DESCRIPTION


    ******************************************************************************



    **** 11/23/15 21:55:22 ****** PSpice Lite (October 2012) ****** ID# 10813 ****

    * source ONE_ROOM_CIRCUIT_WITH_POST_DISTURB_VER2


    **** CIRCUIT DESCRIPTION


    ******************************************************************************



    R_R2 0 N43230 5572 TC=0,0
    V_V2 N40547 N40437 23Vdc
    V_V3 N40347 N40437
    + EXP 23Vdc 15Vdc 1us 1e-7 0 0
    C_C1 N40437 N40447 4uF TC=0,0
    X_U1 N40447 N40347 SCHEMATIC_U1
    R_R4 0 N40607 1000k TC=0,0
    X_S1 N40547 N40447 N40607 N40515 SCHEMATIC1_S1
    R_R1 N40447 N40515 167 TC=0,0
    I_I1 0 N40607 DC 12mAdc
    V_V1 0 N40437 18Vdc
    L_L1 N43230 N40447 200H

    .subckt SCHEMATIC1_S1 1 2 3 4
    .subckt SCHEMATIC1_U1 1 2 3 4
    $
    ERROR(ORPSIM-16363): Command invalid in subcircuit
    S_S1 3 4 1 2 _S1
    RS_S1 1 2 1G
    .MODEL _S1 VSWITCH Roff=1Meg Ron=1 Voff=-1V Von=1V
    .MODEL _U1 Sw_tOpen tOpen=1us ttran=1u Rclosed=0.01 Ropen=1Meg
    .ends SCHEMATIC1_S1
     
  6. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    I think you have to do it like this:

    .subckt SCHEMATIC1_S1 1 2 3 4
    ...
    ...
    .end SCHEMATIC1_S1

    .subckt SCHEMATIC1_U1 1 2 3 4
    ...
    ...
    .end SCHEMATIC1_U1

    ...been a couple years since I used Spice
     
    Electronicsguy774 likes this.
  7. Electronicsguy774

    Thread Starter New Member

    Nov 24, 2015
    5
    0

    I'll try it thank you
     
  8. Techno Tronix

    Member

    Jan 10, 2015
    140
    10
    I think you need to define a voltage source +5V.
     
  9. WBahn

    Moderator

    Mar 31, 2012
    17,768
    4,802
    Your netlist calls two subcircuits:

    X_s1 calls SCHEMATIC1_s1, which you define below. But X_U1 calls Sw_tOpen, which is undefined.
     
  10. WBahn

    Moderator

    Mar 31, 2012
    17,768
    4,802
    You can't define a subcircuit within a subcircuit and, even if you could, you never end the inner subcircuit.
     
  11. Electronicsguy774

    Thread Starter New Member

    Nov 24, 2015
    5
    0
    It won't simulate because of this error:

    **** 11/26/15 09:59:14 ****** PSpice Lite (October 2012) ****** ID# 10813 ****

    * source PROJECT1


    **** CIRCUIT DESCRIPTION


    ******************************************************************************



    .SUBCKT SCHEMATIC1
    R_R1 N14426 N14640 167 TC=0,0
    R_R2 0 N14426 5.572k TC=0,0
    C_C1 N14410 N14426 4u TC=0,0
    V_V1 0 N14410 18Vdc
    X_S1 N14728 N14426 N15165 N14640 SCHEMATIC1_S1
    V_V2 N14728 N14410 23Vdc
    I_I1 0 N15165 DC 10mA
    R_R4 0 N15165 1000k TC=0,0
    X_U1 N14426 N15255 Sw_tOpen PARAMS: tOpen=1us ttran=1u Rclosed=0.01
    + Ropen=1Meg
    V_V3 N15255 N14410
    +EXP 23V 15V 1us 1e-7 0 0
    .ENDS

    .subckt SCHEMATIC1_S1 1 2 3 4
    S_S1 3 4 1 2 _S1
    RS_S1 1 2 1G
    .MODEL _S1 VSWITCH Roff=1Meg Ron=1 Voff=0 Von=1
    .ends SCHEMATIC1_S1


    WARNING(ORPSIM-15188): There are no devices in this circuit
     
  12. WBahn

    Moderator

    Mar 31, 2012
    17,768
    4,802
    Because you have defined two subcircuits but no main circuit.

    Are you even bothering to READ the warning and error messages it is giving you?
     
Loading...