February 7 MCalc
to FilmStar DESIGN/INDEX
A new
Excel
workbook transfers layers and materials from MCalc (D Arhilger) to FilmStar
DESIGN and INDEX. VBA code is unsecured, so users can adjust as
required. Calculation parameters such as angle and polarization are not
transferred, so compare results and adjust accordingly. Designs are is
in physical thickness, so check that Type = Phs in DESIGN's Film
Indices editor. VBA code is unsecured and highly instructive.
February 17
Excel Issues (Early and Late Binding, etc.)
A user reported difficulties with Excel
workbooks utilizing ActiveX with FilmStar DESIGN and INDEX. This led us
to test compatibility with older and newer versions of Excel and
Windows. Links below illustrate Early and Late Binding.
' Early binding
' FtgDesign1 defined in Tools...References
' DESIGN-Ref-Early.xlsm
MultCalcXL-Ref-Early.xlsm
Dim dBasic As FtgDesign1.clsBasic
Set
dBasic = New FtgDesign1.clsBasic
Application.Wait Now + TimeValue("00:00:02")
' 2
sec delay
Early Binding has a major advantage (IntelliSense)
when writing code. Typing "." after dBasic
triggers the object list as shown below. Late binding provides
no similar help. (You can develop code with early
binding and then switch to late binding if found to be more
reliable.)
Late Binding works whether
DESIGN is running or not. With DESIGN not running, activate the Task
Manager (<Ctrl+Shift+Esc>) and note how Process Design1.exe *32
appears and then disappears when the VBA code terminates with Set
dBasic = Nothing. If DESIGN was running before you activate the VBA
code, Process Design1.exe *32 is not deleted.
' Late Binding
'
DESIGN-Ref-Late.xlsm
MultCalcXL-Late.xlsm
Dim dBasic As Object
Set dBasic = CreateObject("FtgDesign1.clsBasic")
Application.Wait Now + TimeValue("00:00:02")
' 2 sec delay
Note the Application.Wait statement. Removing or commenting-out gives weird error messages. It
may be necessary to increase delay in some cases, e.g.
FilmStar DESIGN is run right after booting. Another option is Sub Pause instead of Application.Wait. This allows smaller
delay values which might be appropriate to fast computers and
solid-state drives.
Sub Pause(ByVal Delay!)
' Delay in seconds
Dim t0!, t1!
If delay > 0 Then
t0 = Timer ' start time
t1 = t0 + Delay ' end time
Do
DoEvents
If t0 > Timer
Then t1 = t1 - 86400 ' adjust for midnight
Loop Until Timer >= t1
End If
End Sub
Click here,
here and
here for additional discussions about early-late
binding; search the web for early vs.
late binding. Report any issues with examples illustrating your difficulties.
February 18
File List Dialogs
File List dialogs have previously
required that Display and save
file descriptions was checked in File..
Configuration.. Preferences. In effect, these dialogs
were hidden.
File List dialogs were implemented in FilmStar for Windows
3.1 where a description overcame the 8
character file name imitation. Realizing that the
dialogs also provide means for previewing files, File Lists in DESIGN/INDEX and MEASURE
no longer require the Display and save... option.
Click or <Enter> opens the file without closing the dialog. The View menu
provides find <Ctrl+F> and sort by date <Ctrl+S> options. File.. Exit or <Esc> closes the dialog.
Oops! You opened a FILM Archive
before saving the design you were working on? No problem!
Click File... Open All.
Another option is the more complicated
NTFS File Properties dialog available with the Facility License. The File List dialog is much simpler
and will suit most users. |
|
MEASURE COM Port Global
Update
You replaced an XP computer running your
Perkin Elmer Lambda and need to change COM1 to COM3 in multiple
Scan Method files.
Click here to download a FilmStar BASIC program which
globally re-assigns COM.
Be
sure to back up *.scw files before running the code!
March 9
Excel Filter Analysis
A coating manufacturer, currently
relying on FTG Software FTIR custom automation with
Pike accessories, also
requires QA methods for filters scanned manually.
Computing %T at CWL, FWHM, etc. can be tedious and
error-prone. Boxcar averaging is essential for
characterizing blocking. Our VBA-based Excel includes
worksheets FTIR, Scan, Setup, Results, etc.
As filters are manually scanned a technician immediately
inspects bandpass and blocking curves with option to reject
or repeat.
Printed QA documents are not really useful. Your customers have Excel
and need actual data. Reports are delivered as workbooks
without VBA macros.
This is
not an off-the-shelf standard product. Solutions
are adapted to all coating types (not just bandpass) and customized to
match work flow. Currently we support Nicolet/PE
FTIR as well as PE Lambda, PE 983, Cary, etc.
To understand our approach and learn more about manual
or automatic filter inspection, contact us for a
personal webinar.
Meanwhile click here for Excel solutions using some of the same techniques. |
Report sheet includes blocking and passband plots.
Failed samples
are deleted from customer reports.
Click here to download the workbook shown above.
VBA code window ~1000 lines |
March 16
Si3N4 on Si Case Study
March 20 Edge Filter
Calculator
May 20
Optical Glass
Revised June 2
A large number (731) of optical glasses
are included in FilmStar DESIGN/INDEX. Dispersion (*.itw) files deduced
from manufacturers' data will be found in ..\Winfilm\Index
subdirectories. When re-saved in ..\Winfilm\Index they
appear in Setup.. Film Indices Dispersion.
Your old Schott Glass directory is renamed to Schott Glass Old, thereby adding another 182 entries.
Can't find the glass you need?
Click here for a Hoya-Schott-Ohara-Hikari-Sumita-CDGM
cross-reference (compiled by Hoya Glass).
Support lapsed? Data files converted to Excel macro-enabled workbooks can be
downloaded here:
Ohara,
Schott,
Hoya,
CDGM. The
workbooks create W,n,k arrays which can be pasted and manually
saved in INDEX.
If absorption is not an issue (k~0), the Glass menu in
DESIGN Setup.. Film Indices and INDEX Functions..Fit
Index inserts Sellmeier coefficients. Note: If you insert a glass as film
material, Type is changed to massive. Verify values in INDEX or
in DESIGN using BASIC Sub GetIndex. The code below copies
a W,n,k array to the clipboard in Excel format.
Sub Main
' for FilmStar
DESIGN
Dim xn!, xk!, w!, s$
For w = 400 To 800 Step 10
GetIndex 2, w, xn, xk
' or GetIndex "SUB",
w, xn, xk
s$ = s$ & CStr(w) & vbTab & Format(xn,
"0.00000") & _
vbTab &
Format(xk, "0.00000E+00") & vbCrLf
Next w
Clipboard s$
' Paste into INDEX
or Excel; compare with manufacturer's data
End Sub
More conveniently, DESIGN 2.61.4510 adds
Plot in INDEX to View menus in the Film Indices dialog
and Stack Editor. This is useful in detecting spurious n&k
solutions or working with alloys
or Double Dispersion.
Workbooks and n&k tables are
provided without warranty. Use at your own risk and compare with original Ohara,
Schott,
Hoya,
CDGM
data and/or
RefractiveIndex.INFO. Please notify FTG Software of any discrepancies.
June 11
More Optical Glass
~3K optical classes
are included in the Synopsys Code V
XML glass catalog. Why so many? The Schott catalog lists 120
current glass types while the Code V catalog adds obsolete types
giving 497 total.
XML to Excel conversion provides access to
these glasses.
Click here for a version for up-do-date FilmStar users
(auto INDEX plot and save). Not using FilmStar?
Click
here for a generic version giving W,n,k arrays.
It is your responsibility to verify results.
Manufacturer's Excel data converted to macro-enabled workbooks can be
downloaded here:
Ohara,
Schott,
Hoya,
CDGM.
A Hoya Glass cross-reference can be
downloaded here (XLSM).
Click here for the CDGM Glass Finder (web app),
here for the CDGM cross-reference (PDF) and
here
for the Ohara cross-reference (PDF).
August 20
Batch Convert Spectra to Excel
Do you have a multitude of spectral files in text format (CSV, ASC, TXT, TAB, etc.). Unfortunately these are nonstandard
formats not easily shared by colleagues and customers. The
situation is further confused by the use of "," as decimal
point, "." as thousands separator and ";" as list separator in
European notation.
A new
Excel workbook
(FilmStar not required, revised Aug 26) provides a general and international
solution for text files
containing a two column list of wavelength (nm, µm, 1/cm) and
response (%R/%T/OD) values. Response may be in the range 0-1
instead of 0-100%.
Files may contain column headers as well as additional rows
above and possibly below spectral data. In our solution
TEXT specifies text file wavelength
type while XLSX specifies type for the converted Excel
file. Check FilmStar format to add column headers [e.g. W (nm) %T].
Should TEXT R/T range from 0-1, X
100 multiplies values by 100.
Thousands of files can be converted in minutes. While files can
have different numbers of data points, row structure defined by
Range must be the same within a directory.
Extn
is not utilized when converting single files. Original files (e.g.
TXT, CSV) are not altered or deleted, but prudence dictates that
files be backed-up before utilizing the workbook.
Suggestion: convert and verify a single file before proceeding.
When converting multiple files, the first conversion is
displayed for review and confirmation. Delimiters are
In addition to text files with two-column data,
JCAMP-DX format is also supported. Since JCAMP includes
format information, most choices are irrelevant and grayed-out
as shown below.
When converting multiple files, the
first conversion is displayed for review and confirmation.
The workbook has not been tested with
all possible files.
Please e-mail samples of files incorrectly converted and
include country setting if using "," as decimal point.
FilmStar users can convert MEASURE files with a BASIC macro
based on the following. Contact FTG Software should
modifications be required. Original files are not deleted.
Note: nm limitation in FilmStar CSV.
' SpcConvert.bas for
FilmStar MEASURE
' Converts FilmStar spectral file formats
' Paths must already exist
Const Path1$ = "C:\Winfilm\Spectra1\"
Const Ext1$ = ".dx"
' .csv/.dx/.spc/.xls/.xlsx
CSV: NM ONLY
Const Path2$ = "C:\Winfilm\Spectra2\"
Const Ext2$ = ".xlsx"
' .csv/.dx/.spc/.xls/.xlsx
CSV: NM ONLY
Sub Main
k% = Len(Ext1$)
s$ = Dir(Path1$ & "*" & Ext1$)
Do
i& = i& + 1
FileOpen Path1$ & s$
FileSave Path2$ & Left$(s$, Len(s$) -
k%) & Ext2$
s$ = Dir$()
StatusLabel "Converting file #" &
CStr(i&)
Loop Until s$=""
StatusLabel ""
End Sub
October 8
MEASURE (Scantraq) Response Bar
A response bar graph has been added to
versions for PerkinElmer Lambda instruments. The graph is accessed
via the Lambda Commander in Mpe983 and Setup..Response
Bar in Mpe950 and Mpe1050.
Right click on the graph to adjust the bar's maximum value
(default 100).
October 12
Excel (Office 365), Windows 10 Issues
MS Office includes 32-bit and 64-bit
versions. 32-bit is recommended.
A user reported that FilmStar DESIGN BASIC
macro ExcelRand.bas did not work in Windows 10. Upon testing, we
found it to work in Windows 7 (64-bit) with both 32 and 64-bit
Excel and Windows 10 with 32-bit Excel.
ExcelRand.bas inserts tolerancing spectra
At first, it appears that 64-bit Excel and Windows 10 are
incompatible with FilmStar BASIC. The usual fix of deleting and
resetting the reference fails because the reference does not
appear in Edit..References. If you examine the .bas code
in a text editor (Notepad++
recommended) you see the '#Reference line that is hidden
in the FilmStar BASIC editor.
'#Reference
{00020813-0000-0000-C000-000000000046}#1.9#0#C:\Program
Files (x86)\Microsoft
Office\Root\Office16\EXCEL.EXE#Microsoft Excel 16.0 Object
Library
'ExcelRand.bas
for FilmStar DESIGN (early binding)
...
Const xlFile$ = "c:\Winfilm\Excel 2007\RandData.xlsx"
...
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSpectra As Excel.Worksheet
Dim xlLayers As Excel.Worksheet
....
Set xlApp = New Excel.Application
...
AppActivate "RandData.xlsx"
' Current title
format
'AppActivate
"Microsoft Excel"
' Older Excel
versions
Referring to the '#Reference line shown above, Excel
64-bit worked in Windows 10 when
(x86) was deleted in a text editor.
Edit..References lists it as a 'Bad reference', but it
works. Apparently, Windows 7 substitutes 64-bit \Program
Files\ for 32-bit \Program Files (x86)\ without the 'Bad
reference' designation. As Windows is constantly updated, it is
possible that our results might not be universal.
Such incompatibilities are avoided through late binding
instead of early binding. Since coding is harder as
intellisense becomes unavailable, an option is to develop
code on a machine where early binding works and then implement
late binding when distributing to others who might have various
versions of Excel and/or Windows. Note that the BASIC code does
not include a '#Reference line.
'ExcelRandLB.bas
for FilmStar DESIGN (late binding)
...
Const xlFile$ =
"c:\Winfilm\Excel 2007\RandData.xlsx"
...
Dim xlApp As Object
Dim xlBook As Object
Dim xlSpectra As Object
Dim xlLayers As Object
...
Set xlApp = CreateObject("Excel.Application")
...
AppActivate "RandData.xlsx"
' Current title
format
'AppActivate
"Microsoft Excel"
' Older Excel
versions
Previous related discussions:
Excel Issues and
Class
References. Microsoft seems to be limiting 64-bit
Office references to other Office applications in Windows 10.
This could be a mistake or a security feature. If still using
Windows XP:
ExcelRandXP.bas,
RandData.xls (copy to ..\Winfilm\Excel 97). Please
contact FTG Software regarding any other issues raised by
the latest versions of Office.
November 2
Stack Mode Issues
Stack Mode is intended for calculations involving many layers
of many materials. While of little benefit to most users, Stack
Mode is critical in the fabrication of certain
devices.
Test example:
StackTest.faw &
StackTest.dmw Copy to ..\Winfilm\Designs
A user reported issues in the following sequence: copy stack,
expand repeated layers, paste original stack. In the DESIGN
BASIC code below we use FSPlot to verify that the pasted
original design is correctly evaluated. Reversed shows
that we did not merely replot the same spectrum four times.
Sub Main
' STACK MODE
REQUIRED
PlotClose
' Close FSPlot if
open
PlotActivate '
Activate FSPlot
Calculate
' Original (copy to
clipboard)
PlotNext
StackAction 4 ' Copy
design to clipboard
StackAction 1 '
Expand repeated layers
Calculate
PlotNext
StackAction 3 '
Reverse layers
Calculate
PlotNext
AxesDraw
StackAction 5
Calculate '
Pasted Original
PlotNext
End Sub
(The same sequence is possible through menu
commands.) As shown below the Reversed spectrum
is different, as expected.
Stack Mode includes two similar 'reverse'
functions: 1. Reverse layers (StackAction 3) which does
not change AIR and SUB, 2. Reverse stack (StackAction
2) which switches AIR and SUB. In the second case Original
and Reversed spectra are the same, as shown below (%T always the
same, %R the same when k=0).
November
25
Collector Speed Issues
A user requested a more
efficient Excel VBA method for importing data arrays as shown
below. It was hoped that replacing a series of Collect calls
with a single call would be speedier.
Blue text indicates spectra generated in DESIGN.
A custom Collection was implemented in
BASIC Sub CollectThkVar. DESIGN 2.61.4552 or newer
required. In addition, Subs CollectCopy and CollectSave
make it easy to transfer spectra to Excel. The new functions are
described in <F1> help.
Comparing calculation speeds for Sub Collect
(repeated calls) and Sub CollectThkVar (single call) using the
Excel workbook and sample design
uploaded here,
we could not discern any non-trivial speed differences.
Referring to RTvsThk.xlsm, note how the Collector is much faster
(X3) if data is unformatted. Unfortunately, testing indicates that the
Collector slows as it becomes bloated with data. While not an issue in typical use, the Collector bogs down
with huge data sets. Even worse, CollectThkVar ultimately fails with the error
shown below. Should that happen, click <Cancel> and delete
Design1.exe in Task Manager. An easier way to do the same is the
FTG
Process Ender.
Another idea is to utilize GetRTData
(Method #1 in RTvsThk.xlsm) and insert %R and/or
%T directly into Excel cells, as shown in the following VBA snippet:
dBasic.SetLayers qm(),
qmt$() '
Collector not utilized
For w = wMin To wMax Step wDelta
kRow = kRow + 1
dBasic.GetRTData w, 0, rs, rp, ts, tp, True
Sheet1.Cells(kRow, kCol) = tp
Next w
While this method doesn't bog down, it is
suboptimal. The fastest method (#7) utilizes BASIC's Calculate
and Spectrum_Y and inserts data into cells as arrays.
Differences between the fastest and slowest methods are a factor
of ~30.
Those who think
Excel VBA is too slow are referred to the
tutorials offered at Paul Kelly at
Excel Macro
Mastery. Please examine
our own
Excel speed example (FilmStar not required)
inspired by Kelly. Note how we were able to speed-up
calculations by ~700.
While Kelly illustrates code with business examples,
Charlie Young's
EngineerExcel offers worksheet and VBA tutorials
aimed at engineers and scientists. |
December 2
Bandwidth in Excel VBA
A user requires a simple method for
computing center wavelength and bandwidth. We first thought to
apply VBA techniques previously implemented in automation solutions, but
decided it was more
instructive to utilize worksheet functions instead, thus NO VBA.
Contact FTG Software for further explanation
and/or to
request modifications meeting your specific requirements.
FSPlot Module verifies bandwidth calculations
FREE download:
BW_NoVBA.xlsx.
FilmStar is NOT required!
Paste spectra (nm, µm, 1/cm) in A&B and adjust Level in G4.
The worksheet is a great example of the useful (obscure?)
INDIRECT function.
Opinion: The filter industry
seems stuck with QA methods developed before
computers were invented. Qualifying filters by
'spectral geometry' results in good filters being
rejected and poor filters accepted. We welcome your
comments!
December
11
BASIC Calculate Revision
Consider a quarter wave stack (1H 1L)10
with nH = 2.3, nL = 1.46, kL = 1000. Clicking Calculate or
pressing <F9> gives the Overflow error. BASIC Sub Calculate,
however, ignores the error with erroneous results. The issue has
been addressed in DESIGN 2.61.4560 by replacing Sub Calculate()
with Function Calculate() and adding Property DesignError$ as
illustrate below.
If Not Calculate() Then
MsgBox DesignError$, vbCritical, "Calculate"
End
End If
or when running DESIGN from Excel VBA...
If Not dBasic.Calculate()
Then
MsgBox dBasic.DesignError$,
vbCritical, "Calculate"
Set dBasic = Nothing
GoTo DoTheNeedful
End If
Previous code using Calculate will work
without modification.
December
14
Veeco Spector OMS Support
A new version of
SpectorOMS.bas adds Cauchy
dispersion. CAUCHYM is the built-in DESIGN/INDEX function: n = A
+ B/W^2 + C/W^4, k = 0 (W in µm).
' SpectorOMS.bas for
FilmStar DESIGN
' Copyright 2020 FTG Software Associates
' Creates coating files (*.fsd) for Veeco Spector OMS
' Version 1 Layers only
' Version 2 adds Cauchy dispersion
' *****************
Change as required **************************
Const fPath$ = PgmPath & "\Spector" ' usually
c:\Winfilm\Spector
Const Title$ = "Spector OMS Coating File"
Const Version = 2
'
***************************************************************
Designs (SpectorTest.faw
utilized here) are specified in optical thickness with QWOT=1.0.
The BASIC code checks for these conditions. A Version 1
recipe eliminates SUBSTRATE: and MATERIAL: lines
but is otherwise identical.
ITISPECTORDESIGN
VERSION:2.0
DESIGNWAVELENGTH:550.00
SUBSTRATE:CAUCHY:1.5047:3.98748E-03:3.02956E-05
MATERIAL:L:CAUCHY:1.3784:.0016959:2.34207E-05
MATERIAL:H:CAUCHY:2.07845:.020082:1.11098E-03
LAYERS:20
LAYER:1:H:0.72725
LAYER:2:L:0.75417
LAYER:3:H:1.00000
LAYER:4:L:1.00000
...
LAYER:17:H:1.10767
LAYER:18:L:0.21573
LAYER:19:H:0.62411
LAYER:20:L:1.26478
December
21
Spectrophotometer Noise Issues
Spectrophotometer detector/grating/lamp
changes can be troublesome. A new MEASURE option excludes noisy data with BASIC Function ExcludeRange. DataConvert
optionally
inserts missing data
points.
Sub Main
' Convert and
change data spacing
ExcludeRange 850, 970
DataConvert 700, 1000, 2
End Sub
Sub Main
' Convert using
Sample scan range
If ExcludeRange(850, 970) Then DataConvert
End Sub
Examining the BK7 graph below (from Lambda
900), it appears that the IR-Vis transition has negligible noise
with sufficient signal averaging time.
A closer look (FSPlot Zoom Mode <Ctrl+Z>)
shows that noise is not completely eliminated. Whether or not
that is important depends on specifications.
Since the spectrum of BK7 is flat from 850
to 970 nm, we can safely replace noisy data with interpolated
points. ExcludeRange can be applied repeatedly for
multiple ranges. Other options to reduce noise:
1. Cary machines
include a Signal to Noise Mode which (we assume) relates
averaging time to signal strength. That should reduce noise while
optimizing throughput.
2. PE Lambda 1050 adds an InGaAs near-IR detector which
considerably reduces noise.
3. Lambda 900-1050: Expert Mode allows custom Slit Width
and Signal Averaging Time vs. wavelength. One could, for
example, increase values in the range 850 to 970.
4. A spectroscopist suggested utilizing a high reflector instead
of BK7 for the 100% Reference scan.
That requires its reflectance to be known (STAN-SSH-NIST).
No traceable standard? A VW (absolute) reflectance accessory
could also be utilized.
Comments from readers with Lambda
and/or Cary UV/Vis/NIR instruments are welcome.
December
23
Electric Field Algorithm
A new (DESIGN 2.61.4561) status bar
field indicates whether electric field Algorithm 1
(k<<n, any angle) or Algorithm 2 (any k, angle = 0) is
utilized. This also applies to differential absorptance. |
|