Technical Issues - FilmStar News 2014

Other editions: 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2016, 2017

January 9    AR Reflectance in MEASURE

A user requested help in setting up MEASURE for AR reflectance using BK7 as a standard. His configuration includes reflectance attachments in both sample and reference beams. While utilizing two attachments may be a holdover from chart-paper days, spectrophotometers may perform better when energy levels in sample and reference compartments are equalized. This can be implemented with ND filters or attenuators (built into newer models), thereby eliminating the expense of a second reflectance attachment.

In any case, V Reflectance is the method to use for AR coats. VW is generally unsuitable for AR.

When scanning 0% Baseline, some users remove the optic from the reflectance attachment while other users block the sample beam. V reflectance requires a known Standard. There is NO OPTION to scan the Standard; it must come from a higher authority. More about Standard files can be found here.

In the case of BK7 users typically rely on its known optical properties and compute the Standard spectrum in DESIGN. It is imperative to use optical glass and not anonymous float glass slides. There are many issues involved in obtaining accurate results; click here and here for illuminating papers by Ron Willey. The Scan Method 3B dialog shows how to specify the Standard file.

Scan range/interval for Baseline and Reference scans can differ from Sample. As long as Sample range is within Reference and Sample ranges, there may be no reason (assuming instrument stability) to re-measure Reference and Baselines after changing Sample range. One might, therefore, only need to scan the entire range from UV to NIR once a day.

The known Standard file (CSV format) is located in the Reference Spectra directory specified in File.. Configuration.. Directories.

It may be a good idea to set the Spectrophotometer Scale to a wide range. For example, the Lambda 950 will generally return T > 100%.

In many cases (narrow wavelength range), sufficiently accurate measurements can be performed without a 0% Baseline scan and with a constant value for the Standard.


January 13    Plotting Index Functions

A FilmStar user in Texas wanted to tweak dispersion functions initially determined by VASE. Unfortunately he selected the wrong function (CAUCHY instead of CAUCHYM), resulting in the dreaded 'Cannot invert singular matrix' error. Had he first plotted the VASE functions he would have discovered the error.

While functions cannot be plotted in DESIGN, it's an easy matter to copy to the clipboard in DESIGN and paste in INDEX. Easy? Realizing that the capability was somewhat hidden and that too many clicks were required, we added a new Paste & Plot command to INDEX 2.51.0400. (Don't forget that the function to be transferred must already be checked in Functions..Built-in or added in Functions..User-Defined.)

1. DESIGN: Place highlight on required line
 and click
Edit..Copy Function <Ctrl+U>

2. INDEX: Click Functions..Paste & Plot <Ctrl+S>
The Add button permits up to four curves.

Not familiar with dispersion functions? We suggest you visit n,k for Oxides Step by Step.

Other improvements: INDEX 2.51.0400 deletes File..Export Graph and replaces it with File..Copy Graph. New File..Save Graph saves plots in PNG format. If printing, set background color to white in Graph..Details. We recommend Bitmap Size = 300% when printing or pasting into documents. Finally, 2.51.0400 lets you save dispersion (*.itw) files when there is no index table.

January 27    Saving Tolerancing Data in Excel

Users have asked about saving tolerancing data for further analysis. One possibility is to save spectra and corresponding designs in Excel. We have now added BASIC program ExcelRand.bas (..\Winfilm\Basic32) and Excel workbook RandData.xlsx (..\Winfilm\Excel 2007) to the FilmStar installer.

Examine ExcelRand.bas and note that 'CalcRand, 1' instead of 'CalcRand' retains the randomized design so that we can extract layer values. 'Design = des0$' restores the original design before the next iteration. Errors are specified in in Evaluate.. Tolerancing.. Values. Template file RandData.xlsx is read-only, forcing users to re-store with a new file name.

Running ExcelRand.bas automatically opens RandData.xlsx in the background. The DESIGN status window indicates progress. Once calculations are complete, Excel pops-up enabling you to save results. Consider adding a third sheet with information such as the original design, film indices, etc. Tolerancing errors can be included via DESIGN 2.61.3195's new Copy button in the Tolerancing Values dialog or new macro command TolErrCopy (BASIC statement: Macro "TolErrCopy;").

Users who require assistance in implementing or modifying FilmStar BASIC and Excel examples should contact FTG Software.

April 2    Excel VBA, FilmStar BASIC Objects & Processes

Recent questions about using FilmStar with Excel led us to address the following issues:

1. How to run Excel from FilmStar BASIC when Excel is open? The code snippets below show how we modified our original 'Calculate in Excel.bas'. The updated version is included in the FilmStar installer and (DESIGN password required). GetObject tells us if Excel is running, preventing the system from opening a second instance via keyword New. This method is utilized in our color tolerancing example.

    Dim xlApp As Excel.Application
    Dim xlBook As Excel.Workbook
    Dim xlSheet As Excel.Worksheet
    Dim isXLOpen As Boolean
    On Error Resume Next
    Set xlApp = GetObject(, "Excel.Application")
    If Err.Number = 0 Then
        isXLOpen = True
        Set xlBook = xlApp.Workbooks("Book1")
        Set xlSheet = xlApp.Worksheets("Sheet1")
        Set xlApp = New Excel.Application
        Set xlBook = xlApp.Workbooks.Add
        Set xlSheet = xlBook.Worksheets.Add
    End If
    ' ....
    If isXLOpen Then
        xlApp.Quit ' quit Excel
    End If   

The code is easily modified to force a user to manually open Excel before proceeding. This might be useful if the workbook includes graphics, etc. On the other hand, if Excel is utilized as a silent calculation engine, it is just as well to keep it hidden.

2. How to run DESIGN from Excel VBA when DESIGN is open? Here we utilize VBA function CreateObject. A complete example can be found in Colors.xlsm. The relevant code snippets are given below. It appears that the following works with DESIGN running or not.

Dim dBasic As FtgDesign1.clsBasic
Set dBasic = CreateObject("FtgDesign1.clsBasic")
' ....
Set dBasic = Nothing

The code can be easily modified to force a user to manually open DESIGN or MEASURE before proceeding. In MEASURE a test scan might be required before running VBA. Finally, one can always open a hidden copy and display it with dMain.MainShow True.

3. Added July 3...When running DESIGN or MEASURE as client from Excel, you might want to be sure that your VBA code opens up one unique copy of the program. In that case you need to delete any previously running processes. The following code was adapted from VBForums.

Sub FilmStarDelete()
    TerminateProcess "Design1.exe" ' DESIGN
   'TerminateProcess "Mpe983.exe"  ' MEASURE
End Sub

Private Sub TerminateProcess(app_exe As String)
    Dim Process As Object
    For Each Process In GetObject("winmgmts:").ExecQuery _
      ("Select Name from Win32_Process Where Name = '" & app_exe & "'")
End Sub

May 13    Reflectance vs. Wavelength and Layer Thickness - 3 Ways

FilmStar DESIGN plots reflectance vs. layer thickness at a single wavelength, but there is no built-in facility for generating data over thickness and wavelength ranges, as recently requested by a USA user. There are, however, several ways this can be accomplished with FilmStar BASIC. The design utilized in these examples is a linear profile reflector recently requested by a graduate student in Florida. Click here to download the design. Click here to see how we generated linear profile optimization targets in Excel.

1. FSPlot Method (RvsT_FSPlot.bas)...Although the Formulator has a limit of 20 spectra, FSPlot can hold a very large number of data sets. After calculations are complete, click FSPlot Data.. Copy or Save As to retain values. Note that there is an eventual  limit to the number of spectra that can be saved in FSPlot memory and that spectra must fit within axes (no truncation at the top or bottom).

2. Workbook Method...RvsT_Wbook.bas, RvsT_Wbook.xls (save in c:\Winfilm\Workbook)...Here we use a blank FilmStar Workbook sheet as data repository. This has an advantage over the FSPlot method in that thicknesses are displayed in the top row. A possible disadvantage is that the grid is limited to 255 thickness values. (The same limitation as older versions of Excel).

3. Excel Method (RvsT_Excel.bas)...This is the recommended solution, suitable for large data sets. Should the BASIC program fail, it is probably because there is an object library mismatch. In the BASIC editor click File.. References to delete any erroneous entry and reconnect to the Microsoft Excel Object Library.

A final possibility is to utilize FilmStar BASIC to directly create a CSV file. This is left as an exercise for the FilmStar BASIC aficionado.

June 3    Ellipsometric Plots

DESIGN 2.61.3400 adds Psi, Delta plots vs. thickness, angle and wavelength. The FilmStar installer adds four sample FILM Archive files: Ellips*.faw for comparison with E. Kondoh's ELLIPSHEET: Spreadsheet Ellipsometry web page.

Interactor plots are shown below. Selecting Type = Delta vs. Psi under Interactor Graph Axes enables the Label option. In this case we specified Label = Every 50'th (point) for wavelength calculation range 400-800 x 1 nm.

Addendum June 11...Kondoh's 3 layer model has been utilized to verify FilmStar multilayer results. Revision 2.61.3421 adds Delta Range -180 to 180, extends the ability to compare calculated with imported data, and offers further graphics options. In the plots below green lines indicate values at 65.

Addendum June 17...DESIGN adds further graphics and optimization improvements, including additional Delta Ranges to avoid 360 Delta spikes. Reproducing Reliablity of Inverse Synthesis with ellipsometric targets suggests that ellipsometry is not useful for reverse-engineering multilayer structures. We have uploaded examples so that users can verify (or refute) our results. In the case of 2% random errors and 0.5% solution accuracy, ellipsometry gives ~0% confidence, while transmission spectroscopy at 0 and 45 S and P polarization gives ~100% confidence. We have only evaluated one design, and conclusions are expected to be quite different for other structures, such as those containing very thin films. Our analysis technique helps users compare merits of VASE and ARTA in analyzing single and multilayer films.

Note: It is important to select a range which eliminates 360 Delta spikes. Four ranges are supported: 0 to 360, -90 to 270, -180 to 180 and -270 to 90. The setting is modified in Interactor options.

Ellipsometry is an important and useful technique, but anyone regarding it as a panacea for characterizing optical films should find Kondoh's 'black-box' remarks of considerable interest. It might be also pointed out that optical properties at 70 are typically not the same as those at 0.

June 24   MONITOR Glitch at Company X

A user at Company X reported a previously unknown glitch in MONITOR. In Layer 2, the Cycle (turning point) value should be 3, not 2 as displayed. This is clearly seen in the strip-chart simulation.

Layer 2's Cycle value should be 3.

The error (due to round-off) has been corrected in MONITOR 2.53.0101.

In our analysis we realized that users might not know just how interactive the Strip Chart window is. With the Strip Chart window activated, <F4> & <F5> (or <Lt> & <Rt> arrows) rapidly scroll through wavelength values. Click <Ctrl+F4> for minimum wavelength and <Ctrl+F5> for maximum. <Up> & <Dn> arrows select layers, <PgUp> & <PgDn> select chips. Hit <Home> & <End> for first and last chips.

September 22   Index Variation in All or Some Layers
(Revised September 29)

Suspecting that indices are not as designed, you want to simulate the effects of variations. Assuming that indices deviate by a given percent, you know how to do that with constant indices but must now include dispersion. Your first step is to define a dispersive function as shown below. In Setup.. Film Indices, A=100 returns original TiO2 Frank values, 97 multiplies by 97%, etc.

Open the Interactor and hit Setup.. Adjust Indices <Ctrl+A>. You can now modify indices with the arrow keys or by typing.

Results are shown below:

But what if you have evidence that Layer 7 was not deposited correctly and want to simulate errors in only that layer. In that case you need to activate Stack Mode (Design.. Stack Mode <Ctrl+K>).

We can then see the effect of variations in Layer 7 index.

DESIGN 2.61.3450 adds new capability to BASIC Functions StackIndex and StackIndexSet. This enables us, in conjunction with Sub RndNorm, to perform tolerancing calculations based on both index and thickness. For SD=1% TiO2 index variation we obtain the following.

Compare with SD=1% TiO2 thickness variation as shown below.

Varying both thickness and index has an expected effect.

What happens when we vary all TiO2 layers by the same % physical thickness or refractive index n. (Stack Mode not required; use the Interactor.) While (as shown below) the output coupler demands superb index control, thickness and index variations in a BBAR have about the same effect on the merit function. In the case of bandpass filters thickness variations largely affect band position while index variations mainly affect bandwidth. Each design must be considered separately.

Finally, the table at the right shows % changes in merit function resulting from a 1% change in TiO2 index.

These examples can be downloaded. Copy .bas files to ..\Winfilm\Basic32, .itw to ..\Winfilm\Index and .faw to ..\Winfilm\Designs. Excel enthusiasts should copy .xlsm to ..\Winfilm\Excel 2007.

Users who require assistance with running BASIC code should contact FTG for an online introduction via our Glance Networks facility.

More complex index models can be treated in the same manner. One possibility is to assume that indices vary systematically (e.g. function of deposited thickness).

Users who prefer to generate stacks in Excel can utilize File.. Copy/Paste Grid, File.. DDE.. Import/Export, or Sub StackAction 4/5 (copy/paste), 6-9 (DDE import/export) implemented in 2.61.3460.

Stack Editor: File...DDE...Options...Import

October 6   Smooth Phase Plots

Phase plots are displayed in the range yMin to yMin+360. A user requested the ability to visualize phase shifts without 360 degree jumps.

DESIGN 2.61.3470 implements smooth phase plots in the Interactor and FSPlot Module. Just set phase range yMax-yMin to a value greater than 420 to obtain the following. November 18: DESIGN 2.61.3501 greatly extends this capability with phase smoothing in evaluation and optimization.

Setting PhaseSmoothDif=360 under [Configuration] in ..\Winfilm\Config\Design1.ini changes the value to 360. Set a large integer value to suppress phase smoothing. Remember to specify P or S when angle of incidence = 0. Selecting R gives zero phase difference. Plotting vs. angle also works.

October 20   Labeling Spectra in MEASURE (Simple Method)

As shown below, MEASURE (Scantraq) 2.51.1420 adds the ability to automatically include spectra names in FSPlot graphs. To enable, check Use spectrum name... in File.. Configuration.. Preferences. The current file name is also utilized as main screen title as well as FSPlot title for a single plot when legend Location is Top or Bottom. Recall that Location is defined in FSPlot Setup.. Legends.

Multiple spectra can be saved via FSPlot Data.. Save As which offers the option to save legends:


Users requiring customized options should utilize BASIC Property PlotLegend to assign legends. Note that there is a 40 character limit.  Click here to review methods for saving multiple spectra and here for further information about FSPlot data arrays.

October 22   Labeling Spectra in DESIGN/MEASURE (BASIC Method)

In response to the above, a user asked whether such the capability could be implemented in DESIGN. The same functionality is available with FilmStar BASIC as listed below. The code also works in MEASURE.

' SpectraPlot.bas for FilmStar DESIGN/MEASURE
' Plots multiple spectra in FSPlot,
' assigning file names to legends

Const SpcPath$ = "C:\Winfilm\Spectra"  ' Spectra path (adjust as required)

Sub Main
    Dim k%, s$
    PlotClose     ' close FSPlot if it's open
    PlotLegendOn True
    PlotActivate  ' activate new FSPlot window
        s$ = GetFilePath( ,, SpcPath$, "Select spectrum", 0)
        If Len(s$) > 0 Then
            FileOpen s$
            k = k + 1 ' legend number
            PlotLegend(k) = Right$(s$, InStr(StrReverse(s$), "\") - 1)
        End If
        If MsgBox("Add another curve?", vbQuestion + vbYesNo, "Plot Module") _
          = vbNo Then Exit Do
End Sub

The same PlotLegend function is useful for delineating calculated curves, say as a function of angle.

' MultPlot.bas for FilmStar DESIGN
' Calculate and plot spectra vs. angle

Sub Main
    Dim a!, k%
    PlotClose      ' close FSPlot if it's open
    PlotActivate   ' activate new FSPlot window
    For a = 0 To 60 Step 15 ' loop over angles
        k = k + 1: PlotLegend(k) = CStr(a) & "" ' assign legend
        Angle = a: Calculate: PlotNext           ' calculate and plot
    Next a
End Sub

Users who are perplexed by FilmStar BASIC (perhaps finding our tutorial too brief) are invited to contact FTG for an online presentation via our Glance Networks facility. Even if you don't wish to create or modify code, you should know how to assign BASIC to a macro button.

November 4   Embedding BASIC Code in MEASURE (Scantraq)

The Setup.. Scan Macros dialog lets users insert prompts, calculations, etc. before and after Baseline, Reference and Sample scans. Illustrated below are what to do next prompts and an After Sample macro (row 6) for drawing and labeling filter curves. There is no easier way to customize QA procedures.

Note that Before Sample (row 5) includes "Sub Main" and "End Sub" statements while rows 1-4 do not. These can be omitted in codes containing one subroutine. Edit.. Select File <F3> inserts a BASIC file name; Edit.. Embed Code.. Select File <F4> embeds code. Checking Compact deletes spaces and comments. Click Edit.. Edit Row <Ctrl+E> to make changes. The advantage of embedded code is that everything is saved in one Scan Method file (.scw). Version 2.51.1430 increases code capacity to 24K characters per row, thereby allowing complex code with multiple subroutines. One possibility is to include references to documents, web pages, or videos. As show below, this is easily implemented.

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpOper As String, ByVal lpFile As String, ByVal _
lpParam As String, ByVal lpDir As String, ByVal nShowCmd As Long) As Long

Sub Main
    If MsgBox("Need help with procedures?", 292, "Visible AR") = vbYes Then
        ' Obtaining Good %T and %R Measurements by Ron Willey
        ShellExecute 0, "open", "", "", "", 1
        MsgBox "Click OK to proceed", 0, "Visible AR"
    End If
End Sub

In the similarly upgraded Scan Method 1B dialog shown below, rapid-scan instruments such as Ocean Optics and FTIR are supported by ActiveX EXE or DLL servers which return data to MEASURE through BASIC macros (.bas, .bse) or BASIC code.

November 10   Importing Filmetrics (and similar) Spectra

A FilmStar user installed a Filmetrics spectrometer for %R measurements and needs to import spectra into DESIGN. Since Filmetrics can save data in CSV format, he could open the file in Excel, copy to the clipboard and paste into DESIGN or MEASURE.

But that includes several steps with possible errors, so he asked if a BASIC macro might simplify the task. This has been implemented in the code below. The file name becomes the graph title, a big advantage over copy and paste which requires manual labeling.

Option Explicit    ' good practice!

Sub Main
    Dim k, file$, path$
    path$ = IniString("Filmetrics", "SpcPath")    ' get path
    file$ = GetFilePath$(, "csv", path$, "Open Filmetrics data", 0)
    If file$ = "" Then End Else ImportFile file$
    k = InStrRev(file$, "\"): path$ = Mid$(file$,1,k - 1)
    WriteIniString "Filmetrics", "SpcPath", path$ ' save path
    PlotTitle$ = Mid$(file$, k + 1): AxesDraw: Replot
End Sub

Sub ImportFile(ByVal file$)  ' %R OR %T DESIGN and MEASURE
    Dim kc%, kRow%, kFN%, dat$, xDat!(), yDat!()
    kFN = FreeFile
    Open file$ For Input As #kFN
    Line Input #kFN, dat$    ' skip row #1
    While Not EOF(kFN)
        kRow = kRow + 1: Line Input #kFN, dat$
        kc = InStr(dat$, ",")
        ReDim Preserve xdat(kRow), yDat(kRow)
        xDat(kRow) = Val(Mid$(dat$, 1, kc-1))     ' wavelength
        yDat(kRow) = .01 * Val(Mid$(dat$, kc+1))  ' ordinate
    Close #kFN: Spectrum_X = xDat: Spectrum_Y = yDat
End Sub

What if the CSV data file includes %R and %T data columns? In that case we must first count the number of points as in this alternate Sub ImportFile. (Here we are guessing at Filmetrics format for files containing %R and %T (i.e. F10-RT). If you have such data, please send us a sample CSV file.)

Sub ImportFile(Byval file$) ' %R AND %T DESIGN only
    Dim kRow%, nRows%, kFN%, dat$, xDat!(), yDat!()
    kFN = FreeFile
    Open file$ For Input As #kFN
    Line Input #kFN, dat$   ' skip row #1
    While Not EOF(kFN)      ' count number of rows
        kRow = kRow + 1: Line Input #kFN, dat$
    Close #kFN
    nRows = kRow: ReDim xdat(nRows), yDat(nRows, 2)
    Open file$ For Input As #kFN
    Line Input #kFN, dat$   ' skip row #1
    For kRow = 1 To nRows
        Input #kFN, xDat(kRow), yDat(kRow,1), yDat(kRow,2)
        yDat(kRow,1)=.01*yDat(kRow,1): yDat(kRow,2)=.01*yDat(kRow,2)
    Next kRow
    Close #kFN: Spectrum_X = xDat: Spectrum_Y = yDat
End Sub

Verify macro operation by comparing imported data with the original CSV. Users requiring help utilizing BASIC should contact us for online assistance via our Glance Networks facility.

December 2   Contour Plot Update

DESIGN contour plots have been updated with new format options: Color Scheme, Legend Type, Grid Lines, etc. Click Setup.. Graph Details <Ctrl+H> to view and test. Resolution (0.1 in the plot below) is set in Graph Axes. Contour plots are displayed in the main menu, Interactor and FSPlot. Format options are saved globally; Resolution is stored with FILM Archive. Click here to download this highpass example. Click here to learn how to export and import contour data via DDE.

Users can delete graph labels and legends to create artistic (?) images. The same graphs are available in the FSPlot Module where further cosmetic adjustments (fonts, etc.) are available for those who wish to regale OSA or SVC conferees with PowerPoint slides.

Color Scheme = Random (Jackson Pollock mode)

December 16   FSPlot Customizer

Click File.. Customize <Ctrl+U> in the FSPlot Module to open the Customizer window. Enter a description and click the Save button to retain current Graph Details and window size. Up to 10 formats can be stored. Click Load to regenerate the graph with the selected format. The Customizer dialog stays open so that you can scroll through various formats (up to 10).

The Customizer is shared by DESIGN and MEASURE. Transfer formats to other users by copying PlotModule Format entries in ..\Winfilm\Config\Common.ini.

December 22...A similar capability has been implemented in the Report Generator. Click File.. Organize <Ctrl+Z> to access the Report Organizer. Note, however, that Organizer Templates are saved separately for DESIGN (Design1.ini) and MEASURE (Measure.ini).

Back to Technical Issues