Passing Value between scehmatic simbol and Spice .subckt (2)

Is there a way to pass the Value of a eeschema symbol to the .subckt as happens now to the Value field in Edit Spice Parameter/Passive/Value?

(Copied from topic Passing Value between scehmatic simbol and Spice .subckt)

In example

.SUBCKT my_pulse 1 2 PARAMS: V1=0V V2=10V TD=0us TR=0.1us TF=0.1us PW=9.9us PER=20us
V_my_pulse 1 2 PULSE V1 V2 TD TR TF PW PER
.ENDS

I’d like to set the parameter in eeschema symbol.

Thank you

I think it should work because I found a file in which .SUBCKT is entered in line 149.
CoolMOS_simplified_Spice_models_C6E6CFD2_.lib (103.3 KB)

Thanks for the answer, the above code works in Kicad but I would like to enter the some parameter values in the schematic (not in the file model) and pass the parameter in the model as I have already done in Altium.
Thank you,
Stefano

Attached you will find a project with simple potentiometers. Their values and ratios are transferred to the subcircuit by editing the ‘Spice model’ field. In addition to the subcircuit name (already there after attaching the model), add the parameter values to be transfered. These may either be given directly as numbers or via another ngspice parameter setting (see example).

pot-only.7z (5.6 KB)

1 Like

Some discussion on this issue is found here: Enable "personalizing" of subcircuits by adding parameters to the instance line (lp:#1829618) (#2426) · Issues · KiCad / KiCad Source Code / kicad · GitLab

So far as I can tell, as of June 2024, this potentiometer example doesn’t work.

The OP analysis reports: "Error reading simulation model from symbol ‘P1’: Unknown simulation model parameter ‘value’.

And other steps produce errors for ‘ratio’, and for P2 similarly.

The issue is that the subcircuit program in pot-ng-model.lib fails to declare the parameters on the .subckt line.

Changing:
.subckt RPOT 1 2 3
to:
.subckt RPOT 1 2 3 value=10k ratio=0.4

solved the problem. (You can choose other default values for the parameters to suit.)

I would really like to know why there are quite a few such broken examples to be found on the internet. Did the format for the subckt command change at some point?

Also relating to this example:

Add potentiometer to Simulation_SPICE symbol library