subcircuit2ssc "Index exceeds the number of array elements" error

1 view (last 30 days)
Hello MatLab experts!
I'm working on a SimScape project requiring the import of some PSpice devices, and one in particular is giving me an issue. The TI LMG3422R030 has an avaliable PSpice model avaliable here: https://www.ti.com/product/LMG3422R030#design-development##design-tools-simulation
It's a .lib file, not a .cir, but it is still just a subcircuit file. I'm trying to just test out the conversion functionality right now, so I ran the command:
>> subcircuit2ssc('lmg3422R030.lib','+mylibrary');
It then throws the error:
Index exceeds the number of array elements (0).
Error in spiceSubckt/getElements
Error in spiceSubckt/loadSubckt
Error in spiceSubckt
Error in subcircuit2ssc
Error in subcircuit2ssc (line 31)
subcircuit2ssc(netlist,target);
My initial thought is that it's just a rather complex model and is overwhelming something in the subcircuit2ssc script, but my limited knowledge here is preventing me from figuring out for sure.
Any thoughts on this one, or other steps I can try before getting deeper into the model itself?

Accepted Answer

Bart Basile
Bart Basile on 14 Sep 2021
I was able to find a solution to this error message. It's related to passing parameters to subcircuit calls. It appears to occur with any mal-formatted PARAM list when nesting a subcircuit, but specifically in the LMG3422R030 model from TI, when "lmg3422R030" calls the "POWER_N_MOSFET" subcircuit, it passes the parameter "T={Temp_Celsius}", which is not in the POWER_N_MOSFET definition.
Hopefully this helps anyone else who encounters this error. Just check to make sure that your PARAM lists are correct when you do subcircuit calls.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!