1. 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.
    Dismiss Notice

Working with netlists: line continuation

Discussion in 'Circuit Simulation & PCB Design' started by alec_t, Apr 15, 2018.

  1. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,586
    Likes:
    1,268
    Location:
    Cardiff, Wales
    In LTspice, how does one make a long netlist entry which extends over more than one line? I've tried using the '+' character and the '&' character at the start of a continuation line, but neither seems to work and LTS complains.
     
  2. Ian Rogers

    Ian Rogers User Extraordinaire Forum Supporter Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,678
    Likes:
    947
    Location:
    Rochdale UK
    Have you tried underscore?? That's another line delimiter..
     
  3. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,586
    Likes:
    1,268
    Location:
    Cardiff, Wales
    Yup. No joy there. According to LTWiki the '+' character should work, but it doesn't for me. Perhaps there's some other gotcha (number of characters per line, phase of the moon?) :(
     
    Last edited: Apr 15, 2018
  4. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  5. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    600
    Likes:
    59
    Hi

    Line continuation is a + (plus) character.
    Comments use * (asterisk)

    Try opening the file in LTspice....it will show hidden characters if any.

    Or...post your file and Ill take a look.

    eT
     
  6. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,586
    Likes:
    1,268
    Location:
    Cardiff, Wales
    Thanks. I was trying to get the low-pass filter model listed here to run in LTspice, but failed. There's at least one bug in the model as printed (the second-order transfer function is missing), so perhaps that was part of the problem, though inserting the function didn't resolve the problem. The Laplace definition seems incompatible with LTS. If I open the model text file in LTS it highlights part of that definition as if it were a comment! Maybe LTS gets confused by all the asterisks (some used as multipliers, some as comment markers)?
     
  7. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    600
    Likes:
    59
    Hi

    Yes...this code might be ok for cadence but has issues with LTspice.
    The semi colons used for comments should be changed to asterisks and the comments shouldn’t be embedded in a line of code. They should be placed above or below the commented line to avoid confusion. Just good practice, and some interpreters become confused with embedded comments.

    There are some other issues with the code. I’ll post a “massaged” file later this evening.

    eT
     
  8. dave miyares

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    2
    Likes:
    -10


     
  9. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,586
    Likes:
    1,268
    Location:
    Cardiff, Wales
    Thanks for looking into it. I've played further with the code, but LTS still complains. It doesn't seem happy with the Laplace expression spread over multiple lines, or even strung together as one long line.

    Edit:
    Further testing seems to show that in LTS a VCVS (e device) or VCCS (g device) won't accept defined functions within the Laplace expression, although normal voltage and current sources will. LTS even goes as far as reporting that the defined function doesn't exist!! I've attached a .asc to demo this. Versions 1 and 2 of the Laplace expression (commented) work, but version 3 doesn't.
     

    Attached Files:

    Last edited: Apr 17, 2018
  10. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    600
    Likes:
    59
    Hi

    I've completed modifiying the original subckt to work with LTspice.
    See attached image.

    A zip file is attached with symbol, subckt, and test file.

    eT

    LowPassFilter.png
     

    Attached Files:

    Last edited: Apr 17, 2018
    • Like Like x 1
  11. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,586
    Likes:
    1,268
    Location:
    Cardiff, Wales
    Nice. Many thanks. I'll have a play and then see if I can modify it further to define high-pass, band-pass etc filters (mainly for my own amusement/education, but they might be of use to other LTS users if not already available).
     
  12. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,586
    Likes:
    1,268
    Location:
    Cardiff, Wales
    I've had a brief play. The odd order filters look ok but the even ones all display the output as 0db :confused:
     
  13. eTech

    eTech Active Member

    Joined:
    Apr 25, 2012
    Messages:
    600
    Likes:
    59
    Hi

    I fixed a couple things I missed in the file.
    It works now.
    I've updated post #8

    eT
     
    • Like Like x 1
  14. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,586
    Likes:
    1,268
    Location:
    Cardiff, Wales
    Great. Thanks again!
     

Share This Page