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.

Working with netlists: line continuation

Status
Not open for further replies.

alec_t

Well-Known Member
Most Helpful Member
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.
 
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:
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.

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
 
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)?
 
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)?

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
 
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.
 

Attachments

  • LaplaceTry.asc
    1.2 KB · Views: 157
Last edited:
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
 

Attachments

  • LowPassFilter.zip
    65.5 KB · Views: 176
Last edited:
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).
 
I've had a brief play. The odd order filters look ok but the even ones all display the output as 0db :confused:
 
Great. Thanks again!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top