Wednesday 1 February 2017

LTSpice: how do I pass to a function a component name as parameter?


Good morning all. I am implementing a subcircuit in LTspice, and I want also to modify the plot.defs to calculate some quantities with the voltages/currents inside the subcircuit. Thus, I will have a function like:



.func A(x) V(x:Vo)/V(x:Vin)



where the function "A" should take the instance name of the subcircuit as parameter, in order to access to its nodes (labelled Vo and Vin in the subcircuit, using a behavioral voltage source to make the node name always the same).


The syntax written above doesn't work, I get the error:



undefined symbol in: "A(<>)"




Where of course "X1" is the name given by spice to the instance of my subcircuit. What could be the problem? Please note that by explicitly writing the expression of "A" in the plot panel, everything works fine, so it is a matter of how to pass the instance name as parameter.


Thanks all in advance!




No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...