FilmStar/Scantraq and Excel

Microsoft Excel is the most widely utilized calculation/data analysis software. Virtually all optical coating engineers rely on Excel. But do they get maximum benefit?

In this page we present ways in which Excel interfaces with FilmStar (or Scantraq). Note that examples 3-7 utilize Excel VBA. Never heard of VBA? Then start Excel and click Alt+F11. Surprised to see Microsoft Visual Basic (VBA) in the title bar? Once you discover the power of Excel VBA, you'll better appreciate how FilmStar's  support far exceeds that of other coating and spectrometer software. (We suggest you compare an ftgsoftware.com site search for 'Excel' with the same search on other coating software sites.)



1. Save Spectra as .xls

FilmStar spectra formats include .csv, .dx (J-CAMP) and .spc (Galactic GRAMS) and .xls (Excel). While .dx and .spc are somewhat standard in spectroscopy, these formats are not generally familiar to optical engineers.

FilmStar DESIGN and MEASURE (Scantraq) save directly in binary .xls format and do not require Excel on the computer. Excel .csv format varies with international Windows settings, so users should be wary of exporting in that format.



2. Copy/Paste Data

As illustrated by the DESIGN Optimization Targets dialog, many FilmStar spreadsheet objects are Excel copy-and-paste-compatible. Data can also be pasted or copied from the FilmStar Workbook.

Applications include

  • DESIGN..Import theoretical optimization targets
  • DESIGN.. Import/export calculated spectra
  • DESIGN..Rugated index profiles and thin film designs
  • INDEX..Import/export n,k tables, import measured spectra for n,k calculations
  • MONITOR..Import/export the monitor Worksheet
  • MEASURE/Scantraq..Export measured spectra, useful for combining multiple measurements

Applications like Mathcad, Origin and SigmaPlot are also Excel-compatible. This greatly extends the usefulness of FilmStar's compatibility.

 



User-friendly glass selector


3. Import Manufacturer's Data

Since Excel is so universal, manufacturers typically supply data in Excel format (*.xls). Examples include Schott and Ohara glass data. To make these workbooks easier to use we added an Export worksheet, a Select Glass dialog and supporting VBA macros.

n values are computed with a Sellmeier equation, while k values are derived from internal transmittance. W,n,k tables are automatically imported into FilmStar:

360 1.94204 6.8983E-06
370 1.93647 2.2231E-06
380 1.93144 8.2988E-07
390 1.92688 3.6167E-07
400 1.92273 1.8007E-07
420 1.91545 7.7770E-08

The end result is that Schott and Ohara glasses appear to be built into FilmStar. Contact us for an online demo!



4. Translate Designs

Designs from another program are pasted into Matl and Thick columns. VBA function getSymbol helps convert to FilmStar DESIGN format. Export from FilmStar would be very similar.

  Function getSymbol$(ByVal Matl$)
      Dim i%, t$
      For i = 1 To 50
          t$ = Ucase(Sh1.Cells(i + 10, 5))
          If t$ = "" Then
              getSymbol = "": Exit Function
          ElseIf UCase(Matl$)=t$ Then
              getSymbol = Sh1.Cells(i+10, 6)
              Exit Function
          End If
      Next i
  End Function


5. Calculate in Excel

There is often need to compute specialized and possibly proprietary values from theoretical or measured spectra. While this might be accomplished in FilmStar BASIC and/or the FilmStar Workbook, Excel offers further possibilities.

One can always utilize Excel by manually pasting spectra, but this approach may not be suitable in production. It's too easy to paste data into the wrong columns and there are possible security issues.

Fortunately Excel is COM (component object model) compatible and can be utilized in the background. Since FilmStar (Scantraq) is also COM compatible, it can send and receive Excel commands and data.

This is illustrated with the instructive 'Calculate in Excel.bas' BASIC macro included with the FilmStar Free Version. A user need only click a button to run a hidden copy of Excel which computes requested quantities.

In the above example we pasted formulas into a blank sheet, but more typically previously saved Excel calculations would be utilized. In example 'SpecCalc5nm.bas' Bruce Lindbloom's Spectral Calculator computes LCH values.



6. Run FilmStar from Excel

In the above example, FilmStar BASIC issues Excel VBA commands. In the client-server model, FilmStar is the client and Excel the server.

The opposite arrangement (Excel as client) is illustrated by an Excel workbook 'Run DESIGN.xls' also in the FilmStar Free Version. Here Excel runs DESIGN in the background. Since DESIGN is invisible, it might appear that Excel has 'magically' gained the ability to perform thin film calculations.

DESIGN BASIC subroutines (like .Calculate) and functions (like .Angle) act as if built into Excel VBA. Skills learned with DESIGN are applicable to MEASURE. Often the only difference in MEASURE or Scantraq is replacing Calculate with Scan.

Optical engineers and spectroscopists who have so far managed without Excel VBA take the risk of putting their companies and possibly their careers in jeapordy. The effort involved in understanding and implementing VBA automation is more than compensated by the advantages.

 



7. Excel as Results Database

A UK coating company needed to sort filters by center wavelength. Here FilmStar MEASURE BASIC communicates with a PLC to move parts into the sample chamber. Filters are scanned, center wavelengths computed, and results automatically inserted into Excel.



8. Excel as Procedure Database

A NH manufacturer required a MEASURE BASIC program to help technicians scan numerous optical parts. Our solution uses Excel as a database. Each row defines a procedure; photos and screen images are included in gMsgBox prompts. Example: 'Does the scan resemble the one shown here?'


Inspired by these examples? Think your organization would benefit from more efficient use of Excel? Contact us for a free consultation and an online demonstration. If your company lacks in-house Excel development resources, we'll be pleased to discuss your requirements and provide a proposal.
 

Copyright © 2010 FTG Software Associates
Last updated on August 31, 2010