Technical Issues - FilmStar News 2017

Other editions: 2006, 2007, 2008, 2009, 2010, 2011, 2012
2013, 2014, 2015, 2016, 2018
, 2019, 2020, 2021, 2022, 2023

January 16    Photopic Response Curves

A user requested an automatic way to plot photopic transmittance as a function of wavelength. This is readily accomplished manually in Excel, but tedious. Our solution combines the FilmStar Workbook, FilmStar BASIC and the FSPlot Module. It works as well for photopic reflectance.

Download PhotopicPlot.zip, unzip and copy (assuming default directories)

PhotopicPlot.bas  >>>  C:\Winfilm\Basic32
Photopic.vts  >>>  C:\Winfilm\Workbook
Highpass_CIE_1nm.faw  >>>  C:\Winfilm\Designs

Referring to Setup...Parameters, we utilize Transmittance vs. Wavelength Range. This allows us to set graph range 350-800 even though CIE calculations are 380-780. The example uses CIE 1931 values (1 nm interval) and is easily modified. Users requiring help with FilmStar BASIC or Workbook should contact FTG Software.


January 17    Auto-Optimize in Workbook

The Workbook is useful for designs that cannot be defined by usual targets. Examples: beamsplitter, color with and without ITO layer.

A user asked about automating Workbook optimization. This raises issues as BASIC can be embedded in the Workbook (BasRun, BasExec, BasChain) and Workbook functions can also be triggered from Main Menu BASIC <F6>.

BASIC functions WbOptimize and WbExecute do not allow BASIC embedded in Workbook macros. Attempting to do so triggers the BASIC Conflict error message.

In this particular case the user was hoping to utilize BASIC GetCieData. Our suggested workaround is simply to perform CIE calculations in the Workbook itself. This is slower and a bit of work, but quite straightforward.


Here's a simple illustrative example. Download AutoWbOpti.zip; unzip and copy as follows (assuming default directories).

AutoWbOpti.bas  >>>  C:\Winfilm\Basic32
BBAR_AutoOpti.vts  >>>  C:\Winfilm\Workbook
BBAR*.faw  >>>  C:\Winfilm\Designs

You should get a similar graph after clicking <Ctrl+Z> for Zoom Mode. Changing the Workbook Macro from CALCULATE; ($D$1) to something like BasExec x=5; gives the BASIC Conflict message. The Workbook may be the most challenging module in FilmStar; users are invited to contact FTG Software for an online run-through via ZOOM.


January 20    Zero Layers

An Overflow error can occur in DESIGN when thick absorbing films are evaluated at short wavelengths. These conditions force calculations beyond numeric limits.

DESIGN's Set Zero Layers effectively 'removes' layers without affecting the film design. This capability has been updated.

The algorithm relies on the fact that light does not penetrate the entire absorbing stack. Users should verify that removal of layers below a given wavelength has no effect on the reflectance spectrum.

As illustrated for an IR reflector evaluated from 200 nm to 20 µm, we compare Zero Layers with Ignore Layers. (Ignore Layers is effectively the same as actual deletion, but more convenient). Designs containing parentheses are not supported. Click here to download the design example.

As shown above, there is a great difference in the spectra when 14 layers (including a massive 1 mm Si substrate) are deleted. But as Zoom Mode shows below, the spectrum at short wavelengths is not affected by the removal, thus verifying the algorithm.


Note how spectra overlap at short wavelengths, verifying
that UV/Vis/NIR light does not penetrate the structure.

Previous versions failed when Side 2 Compensation <> FWD ignore Side 2. That is still the case, but now Zero Layers automatically changes Side 2 Compensation if necessary, thereby eliminating error messages. Substrates should be treated as massive layers; designs with parentheses are not supported. Most users will never require Zero Layers, but those that do consider it to be a very important capability.


February 23    MEASURE (Scantraq) Saving Two File Types

A user requested the ability to automatically save spectra in two formats. Click here to download BASIC code that does the job. Copy to your C:\Winfilm\Basic32 directory. In order to automatically save scans, enter the following in the Setup.. Scan Macros editor. Substitute Scantraq for Winfilm as required.

When there is no Scan Macros editor, as is the case for instruments such as Ocean Optics or FTIR, the code is specified at the end of the Sample Scan macro in the Control Macros dialog (part of the Setup.. Scan Method sequence).

Sub Main
    ....
    ....
    BasChain "C:\Winfilm\Basic32\Save_CSV&SPC.bas"
End Sub

You can also enter the following in Tools.. Macro Commands, in this case assigning to Macro Button 4.


March 6    Identifying Bad Data

Measuring %R/%T for a fused silica substrate seems easy, but maybe not! A user, intending to deduce n&k vs. wavelength, sent us data collected with a PerkinElmer Lambda 1050 with a goniometer accessory and UV Winlab software. As this is a well-known material, expected values are easy to  calculate. Comparing theory (SiO2 Sopra.itw) and measurements in FSPlot's View.. Zoom Mode <Ctrl+Z>, we note problems from 300-400 and 800-900 nm. There is no better way to identify bad data. Such comparison will be difficult (impossible??) in UV Winlab.

 

Transmittance results were disappointedly similar. Was integration time (scan speed) optimal? Was the tungsten lamp aligned properly, stabilized, and not approaching burnout? Operator error? 0% baseline compensation? Would FilmStar smoothing help? This includes the ability to smooth before normalization, thereby minimizing noise. That would not, however, improve 300-400 and 800-900 nm regions. Reasonable n&k results from 400-800 nm were deduced with INDEX Calculate n,k Algorithm #4.

Failure to examine data before hitting <Calculate> often leads to wasted hours, frustration, and possible crashes. If in doubt, send us your data (in one Excel file please). We note, however, that the accuracy required for n&k analysis typically exceeds that required for QA pass/fail specifications. When plotted on a 0-100% scale the above spectra give a different impression.


March 20    Preserving Design Format

A user wants to enter designs in a structured format, as in...

(1H 1L)2 6H (1L 1H)2 1L
(1H 1L)2 4H (1L 1H)2 1L
(1H 1L)2 6H (1L 1H)2 1L

His problem is that the Groups editor modifies the format, resulting in something like this...

(1H 1L)2 6H (1L 1H)2 1L (1H 1L)2 4H (1L 1H)2
1L (1H 1L)2 6H(1L 1H)2 1L 

Observe how the Interactor supports QWOT designs as shown at the right. Most importantly, set Layer Change = QWOT. This is our recommended approach for evaluating QWOT-based designs.

Returning to the original issue, there are several possibilities: 1. Type a design in Notepad, copy and paste into the editor. The same can be accomplished with Microsoft Word or Excel via DDE (dynamic data exchange). Enable DDE by checking Show Import / Export commands in File.. Configuration.. Misc. A new feature is the addition of hotkey <F6> to DDE Import.

A single Word or Excel file can contain many designs, distinguished by Bookmark (Word) or Name (Excel). Refer to updated (<F1>) Help instructions: Design Menu.. Groups Design Editor.. Edit...Import. DESIGN 2.61.3980 adds Import hotkey <F6>. Please contact FTG Software if instructions are not clear.


Interactor QWOT editor

Since solutions based on Notepad or Word/Excel may be inconvenient, 2.61.3980 adds a new option to the Groups editor: Edit...Lock Design. In this mode designs can be edited and evaluated but are locked against reprocessing, thus appearing as originally typed when saved and reopened. Optimization and other features are disabled in this mode. The status bar adds  Design Lock  when activated.


May 8    Scan or Calculate with the Collector

Content moved to Saving Multiple Spectra


June 28    Triangle Graph, etc.

A FilmStar user attending Ron Willey's optical coating course indicated that he found RTA Triangle graphs useful. Ron then generously supplied his Excel triangle chart code and asked whether we could embed it within FilmStar DESIGN, thereby simplifying calculations. Note: triangle graphs are described in Practical Design of Optical Thin Films.

This has been accomplished as shown below. Since the graph is implemented in the Interactor, it's very easy to manipulate layers and visualize changes. In addition, all Interactor graphs plotted as a function of layer thickness newly utilize line colors assigned to materials and display designs in colors as shown in the Layer column Clicking Line Colors opens the following:

As shown at the bottom, color-coded lines are useful in polar diagrams (Admittance and Reflectance Amplitude). Previously, even and odd layers were in different colors, thus confusing when more than two materials.

As the black background does not print well, the Color Mode pull-down offers white background options.


September 12    DESIGN BASIC XL Example
(Modified June 25, 2018)

The code below demonstrates DESIGN BASIC XL functions. MEASURE examples can be found here (temperature stage) and here (angular dispersion). A reason to NOT install Excel on QA computers is to prevent accidental or intentional changes in spectral data.

' DESIGNXL.bas
' FTG Software , Princeton, NJ  ©2017

DefInt i-N
DefSng A-H, O-Z
Option Base 1
Option Explicit

' ****************** Change as required ******************
' Default directory for saving Excel files
Const Directory$ = "c:\Winfilm\Spectra\"
' Angle range
Const aMin = 0
Const aMax = 75
Const aDel = 15
Const VLTBLUE& = RGB(228, 228, 255)

Sub Main()
    Dim ang, xDat(), yDat(), kCol, nCols, nRows, iDat, nDat, t$
    nCols = 3 + 2*(aMax - aMin)/aDel ' wave and %R %T columns
    For ang = aMin To aMax Step aDel ' loop over angles
        kCol = kCol + 1 ' column number
        If ang < 0 Or ang >= 90 Then MsgBox "Invalid angle",16:XLclose:End
        Calculate
        If kCol = 1 Then
            xDat = Spectrum_X
            nDat = UBound(xDat)
            If ang = aMin Then
                nRows = 1 + nDat
                XLnew nRows, nCols, "Spectrum1" ' open hidden workbook
            End If
            XLwrite 1, 1, "Wave (nm)",,,, VLTBLUE
            For iDat = 1 To nDat
                XLwrite iDat + 1, 1, xDat(iDat)
            Next iDat
            kCol = 2
        End If
        t$ = CStr(ang) & "°"
        XLwrite 1, kCol, "%R " & t$,,,, VLTBLUE
        XLwrite 1, kCol + 1, "%T " & t$,,,, VLTBLUE
        yDat = Spectrum_Y
        For iDat = 1 To nDat
            XLwrite iDat + 1, kCol, 100 * yDat(iDat, 1)  ' %R
            XLwrite iDat + 1, kCol + 1, 100 * yDat(iDat, 2)  ' %T
        Next iDat
        kCol = kCol + 1
    Next ang
    On Error Resume Next
    Kill Directory$ & "Test.xls"
    XLsave Directory$ & "Test.xls"
    XLview Directory$ & "Test.xls"
    XLclose ' close hidden workbook   
    If MsgBox("Click OK to close Excel window", 64) = vbOK Then
        AppActivate "Microsoft Excel"
        SendKeys "%{F4}" ' close Excel
    End If
End Sub

Can't get the BASIC code to work? Contact FTG Software to arrange a ZOOM meeting.


October 9    Converting Spectral Files

A user needed to convert numerous J-CAMP (DX) files to Excel format. The latest FTG Software versions support XLS (Excel 1997+) and XLSX (Excel 2007+). Excel is not required. An advantage of XLSX is smaller file size, e.g. 11 KB instead of 26 KB for 380-780 x 1 nm MEASURE spectra. The code below converts 1000 files in a minute or two.

' SpcConvert.bas
' Converts FilmStar spectral file format
' Paths must already exist
Const Path1$ = "C:\Winfilm\Source\"
Const Ext1$ = ".dx"   ' .csv/.dx/.spc/.xls/.xlsx
Const Path2$ = "C:\Winfilm\Destin\"
Const Ext2$ = ".xlsx" ' .csv/.dx/.spc/.xls/.xlsx

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

Source and destination directories can be the same. Users who wish to experiment with test files can use the following file generator:

' SpcSave.bas for MEASURE/Scantraq
' Create test files for SpcConvert (Test Mode enabled)
Const File$ = "C:\Winfilm\Source\Test"
Const Ext$ = ".dx"
Sub Main
    If Not TestMode Then End
    For i% = 1 To 100
        Scan
        DoEvents
        StatusLabel "Iteration " & CStr(i%)
        FileSave File$ & Format$(i%, "0000") & Ext$
        DoEvents
    Next i
    StatusLabel ""
End Sub

XLSX requires .NET Framework 2.0 [C:\Windows\Microsoft.NET\Framework\v2.0.50727]. This is probably already installed. Can't get BASIC to work? Contact us to arrange a ZOOM meeting.


December 12    Scanning Multiple Samples

While the Collector was originally developed for the Cary UMA, a modification is available in other MEASURE versions. Suppose you need to sample purchased optics. Why save spectra in multiple files when they can be saved in a single Excel file? Here's an example where 5 samples each of 3 different parts are measured:

Option Explicit
Const File$ = "C:\Winfilm\Spectra\MultTest.xlsx" ' .xls or .xlsx 
Const Part$ = "Optic"  ' 5 samples each of 3 different parts
Const Parts% = 3       ' 15 scans total
Const Smpls% = 5

Sub Main
    Dim i%, k%, p$, s$
    If PgmExe$ = "Mcary5U" Then Exit Sub
    Const OK$ = ", then click <OK>"
    MsgBox "Mount reference optic" & OK$, 0, "Multi-scan"
    DataType = 3: Scan ' reference
    DataType = 1       ' sample
    For k = 1 To Parts
        p$ = Part$ & CStr(k)
        For i = 1 To Smpls
            s$ = "Sample " & CStr(i): AxesDraw
            MsgBox "Mount " & s$ & OK$, 0, p$
            Scan ,,,,,"Scanning " & p$ & ", " & s$
            Collect p$, s$, (i=1 And k=1)
        Next i
    Next k
    AxesDraw
End Sub

Try the above with Test Mode enabled (comment-out MsgBox lines if in a hurry). We think you'll agree that this is much easier than dealing with 15 files. Open the FSPlot Module, select one of the data sheets and click Spectra.. Plot Sheet <Shift+F4>.

BASIC is not required; the Collector includes a Scan button. In that case type the Sheet Name and Column Header.

Although the non-UMA Collector does not normalize raw data, it averages P and S as well as ± angles.

This requires that column headers follow a particular format as indicated in the Column Header text shown here. The Insert button generates the required format.

Recognized values are RP, RS, TP, TS and angles. Averaging TP and TS gives TR, etc. Unchecking Goniometer Mode deactivates the Detector entry.

Back to Technical Issues

Copyright © 2023 FTG Software Associates
Last updated on October 11, 2023