SIMetrix/SIMPLIS - Automatically Changing Component Values
Circuit Analysis
0:00 / 0:00
SIMetrix/SIMPLIS - Automatically Changing Component Values
9 087 просмотров · 8 л. назад
Circuit Analysis
4,31 тыс. подписчиков
9 087 просмотров · 8 л. назад
This tutorial shows how to automatically load parts values from a text file using a built in feature of SIMetrix/SIMPLIS and also buy writing a custom script file for added flexibility.
0:00 Intro
0:17 Default CSV Option
2:28 Custom Parts File
4:40 Write Script
12:10 Run Script
Part of Playlist:
• SIMetrix/SIMPLIS
Script:
*load values from text
ClearMessageWindow
*
let spath = SplitPath( ScriptName() )
let sdir = spath[0] & spath[1]
echo working directory is {sdir}
*** determine file name
Let filename = sdir & 'tols.txt'
*** load the contents of the file into an array
Let lines = ReadFile( filename )
*** determine indexes of column names
Let headers = Scan( lines[0], EscapeString( '\t' ) )
Let ref_idx = Search( headers, 'ref' )
Let prop_idx = Search( headers, 'prop' )
Let nom_idx = Search( headers, 'nom' )
Let bol_min_idx = Search( headers, 'bol_min' )
Let bol_max_idx = Search( headers, 'bol_max' )
Let eol_min_idx = Search( headers, 'eol_min' )
Let eol_max_idx = Search( headers, 'eol_max' )
*** determine list of reference designators
Let refdes_list = SelectColumns( lines, ref_idx, EscapeString( '\t' ) )
Echo ---- Start ----
*** SET ALL VALUES TO NOMINAL
for i=1 to Length( refdes_list ) - 1
Echo Selecting {refdes_list[i]}
unselect
select /prop ref {refdes_list[i]}
*Skip if not found
if selectCount()=0 then
**Select Failed
Echo Cannot find component {refdes_list[i]}
else
let propVal = SelectColumns( lines[i], prop_idx, EscapeString( '\t' ) )
let nomVal = SelectColumns( lines[i], nom_idx, EscapeString( '\t' ) )
prop {propVal} {nomVal}
Echo Set {propVal} to {nomVal}
endif
next i
Echo ---- End ----