Where To Find This Script
You can run this script by clicking on Scripts-> Schematic->Master_Slave_Assign from AWRDE menu.
Description
The AWR Design environment supports a parameter syntax that allows one parameter to have the same value as another model parameter without the need for equations. The general parameter syntax is <Parameter>@<Model>.<ID>. Where <Parameter> is the parameter of the referenced model, <Model> is the name of the referenced model and <ID> is the ID of the referenced model. For example, see the picture below showing the top MLIN being the master and the bottom MLIN has this parameter definition type setup.
For several parameters, typing in these values is simple. This gets more complicated if there are many parameters that need to be set or if many elements need to reference the master. This script helps with this process by selecting the items that should be linked together and then selecting which of the items is the master and then assigning all of the parameters of the other times to match the master.
To use the script:
-
Save your project or make a backup before running the script.
-
Make the schematic you are working in the active schematic. If a schematic window is not the active window, you will get an error.
-
Select the models that should be linked together in the schematic. You can choose more than two if you want multiple to match the master. If you do not select two or more items, you will get an error.
-
Run the script.
-
The dialog below will open for you to choose which of the selected items is the master.
-
Click the OK button to let the script assign the slave model parameters to match the master. The script will only work on models that have the same name as the master. If the names do not match, nothing is changed.
-
A log file is added to the data files of the project and opened for viewing. The date and time are encoded in the log file. The log file lists every change made to the project in case you need to go back to your original values.
For example, see the schematic below that has 3 MTRACE elements. The top MTRACE is routed and the bottom two should mirror the top element.
The situation above has all three MTRACE's selected and one of the ports accidentally. When the script was run MTRACE.X1 was selected as the master.
When the script is done, the schematics and layout have changed as shown below.
The log file shows exactly which model was the master, what model parameters changed and also if models did not match the master that nothing was changed.
Scripting Information
Scripts included in the install are configured to run directly from the NI AWR Design Environment from the Scripts menu.
Scripts that you download must be imported into a project or placed in your global scripts folder to use them. See Working with VB Scripts for information on how to use these scripts.
You can also customize the AWRDE to run scripts from hotkeys, menus, or toolbar buttons. See Working with VB Scripts for more information.
For complete information about the AWRDE API, see the AWRDE API Programming Guide Help in the AWRDE installation. You can also view our Scripting Website for more scripting examples.