This video introduces how to create an attribute of a subcircuit in PSIM. With attributes, you can pass variables from your main circuit into the subcircuit.
https://www.youtube.com/watch?v=iSNjmwrEPeU