What is an LTspice directive and how can you add it?
I am asked to set the simulation spice directive to a linear DC sweep between -10V and 10V with increments of 0.1V.


It's actually called a SPICE directive, LTspice is software that provides an interface for SPICE.

Directives are just text, and they start with a period.
Here is an example directive called "step", with parameters after it: .step X 1 10 100

The default hotkey for creating a directive is s

You can also click the .op button as shown below:

ltspice directive button

When you first create a directive, a window opens up for you to type in.

ltspice directive edit window

After you've inserted it, you'll see it as text (default color is black) on the schematic.

ltspice directive

To re-edit the directive, right click on it. Note that some directives have their own special edit windows. If that's the case, right clicking on the directive will open a window with extra settings.

Directives can be disabled by turning them into a text comment. This is done by selecting comment in the edit window:

ltspice directive comment

Again, some directives have their own special edit windows. To turn those into a comment, you have to click cancel in the first window that pops up, and then you'll see the standard edit window with the comment option.

Comments appear as blue text by default. The following image shows a comment (blue) and a directive below it (black):

ltspice directives and comments

As for DC sweep,

Go to the toolbar Simulate > Edit Simulation Cmd and then click the DC Sweep tab. You can fill in your parameters there.

ltspice simulation edit window

Once you're finished editing the sweep parameters, the directive is created as text and you can place it anywhere on your schematic.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.