Script examples

Navigation:  Views > View objects > Action items > Measurement series >

Script examples

Previous pageReturn to chapter overviewNext page

Script to prepare the series 'measurement series prepare new series'

 

workbook command, clear

workbook command, rename sheet, 0, Fitted Data

workbook command, append sheet, Measured Data

 

This code clears the workbook and renames the only existing worksheet to 'fitted data'. Then it generates a second worksheet named 'measured data'.

 

 

 

Script to acquire and analyze spectra 'measurement series measurement script'

 

This example is taken from a method which controls a reflectance measurement system. It uses a label called 'status' to display information on the progress of the actions. The acquire command executes data acquisition, and then 'start fit' starts the fit. The settings for the fit make sure that after 5 seconds the fit is finished. Then, finally, various results from the list 'final numbers' and both the measured and simulated spectra are written to the workbook pages.

 

set label, status, ... busy ...

update data

update plot

acquire

start fit

 

delay, 5000

 

set label, status, ... writing data ...

update data

update plot

 

workbook command, save final number names, fitted data, 5,1,4,12

workbook command, measurement series save final number values, fitted data, 5,1,4,12

workbook command, measurement series average final number values, fitted data, 5,1,4,12

 

object command, R coated, write spectral positions to workbook,fitted data,25,1,176,2,463

object command, R coated, measurement series write simulated values to workbook,fitted data,25,1,176,2,463

object command, R coated, measurement series write simulated average to workbook,fitted data,25,1,176,2,463

 

workbook command, save final number names, measured data, 5,1,1,3

workbook command, measurement series save final number values, measured data, 5,1,1,3

workbook command, measurement series average final number values, measured data, 5,1,1,3

 

object command, R coated, write spectral positions to workbook,measured data,20,1,176,2,463

object command, R coated, measurement series write measured values to workbook,measured data,20,1,176,2,463

object command, R coated, measurement series write measured average to workbook,measured data,20,1,176,2,463

 

delay, 2000

set label, status, ... idle ...

update data

update plot

 

Please not that the content of the workbook can be saved in Excel format to permanently store the results.The script could also contain a command to store the results in a SQL database table.

 

 

 

 

Script to acquire and analyze spectra 'measurement repeat fit'

 

This is just a copy of the 'measurement script' above, without the acquire command:

 

set label, status, ... busy ...

update data

update plot

 

start fit

 

delay, 5000

 

set label, status, ... writing data ...

update data

update plot

 

workbook command, save final number names, fitted data, 5,1,4,12

workbook command, measurement series save final number values, fitted data, 5,1,4,12

workbook command, measurement series average final number values, fitted data, 5,1,4,12

 

object command, R coated, write spectral positions to workbook,fitted data,25,1,176,2,463

object command, R coated, measurement series write simulated values to workbook,fitted data,25,1,176,2,463

object command, R coated, measurement series write simulated average to workbook,fitted data,25,1,176,2,463

 

workbook command, save final number names, measured data, 5,1,1,3

workbook command, measurement series save final number values, measured data, 5,1,1,3

workbook command, measurement series average final number values, measured data, 5,1,1,3

 

object command, R coated, write spectral positions to workbook,measured data,20,1,176,2,463

object command, R coated, measurement series write measured values to workbook,measured data,20,1,176,2,463

object command, R coated, measurement series write measured average to workbook,measured data,20,1,176,2,463

 

delay, 2000

set label, status, ... idle ...

update data

update plot