
Contents |
Batch Processing
Batch processing with Analysis Template to generate summary report
Minimum Origin Version Required: 8.1 SR0, updated in 8.5.1 SR0
1. Repeatedly Import into Active Analysis Template Window
string fname$, path$="C:\Data\";
findfiles f:=fname$ e:="*.dat"; // findFiles will default to get from path$
batchProcess batch:=active fill:="Linear Fit" method:="impAsc" theme:="batchImporting" append:="FitLinearCurve1";
2. Load Analysis Template
string fname$, path$="C:\Data\";
findfiles f:=fname$ e:="*.dat";
batchProcess batch:=template fill:="Linear Fit" append:="FitLinearCurve1" name:="C:\Data\LinearFit.ogw" method:="impAsc" theme:="batchImporting";
| Display Name | Variable Name | I/O and Type | Default Value | Description |
|---|---|---|---|---|
| Batch Processing Mode | batch |
Input int | |
Specify the batch processing mode. Option list:
|
| Analysis Template | name |
Input string | |
This is available only when the Batch Processing Mode is set to Load Analysis Template. It can be used to specify the analysis template. You can click the |
| Data Source | data |
Input int | | Specify what kind of data source will be used.
Option list:
|
| Use Import Setting in Workbook | last |
Input int | | Specify whether to use the last data importing settings. This is available only when Data Source is Import From Files. |
| File List | fname |
Input string | | Specify the data files which will be imported into the Data Sheet. You can click the |
| Input | iy |
Input XYRange | | This is available only when Use Existing XY Datasets has been selected from Data Source drop-down list. It specifies the xy ranges for batch processing. |
| Dataset Identifier | id |
Input string | Specify whether to add a column with Long Name of "Dataset" to the Output Sheet for identifying each analysis dataset. If None, such a column will not be added. Otherwise, when Data Source is Use Existing XY Datasets, Dataset Identifier can be Range, Book Name, Sheet Name, Long Name, Units or Comments. When Data Source is Import From Files, just File Name, Long Name, Units or Comments can be chosen. | |
| method |
Input string | | This can only be accessed from LabTalk scripts. Specify the method to import the data files. Options include:
| |
| theme |
Input string | | This is available only when Method is selected as an importing X-Function. Specify the theme file to import the data files. | |
| filter |
Input string | | This is available only when Method is selected as ImportWizard. Specify a filter to import data files. | |
| script |
Input string | | This is available only when Method is selected as Script. These scripts will be used to import the data files. | |
| Data Sheet | fill |
Input string | | Specify the source data worksheet in the analysis template. |
| Result Sheet | append |
Input string | | Specify analysis result sheet in the analysis template. |
| Output Sheet | ow |
Output Worksheet | | Specify the worksheet to which results from the Result Sheet will be appended.
See syntax here. |
| Delete Intermediate Analysis Outputs | remove |
Input int | | Specify whether to delete the intermediate analysis outputs after the process. |
| Starting Row of Output Sheet | number |
Input int | | Specify the beginning row in Output sheet to append results. |
| Clear Output Sheet on Start | clear |
Input int | | Clear the Output Sheet when starting the process. |
| Append Label Rows | label |
Input int | | Specify whether to append label rows of the first Result Sheet to Output Sheet. |
| Script after Each Process | loopscript |
Input string | | Scripts in this edit box will be executed after each process. |
| Script at the End | endscript |
Input string | | Scripts in this edit box will be executed at the end of the whole process. |
This X-Function performs batch processing and generates a summary report. You should first create an analysis template, and then reuse the template in this process. This function provides options for either repeatedly importing data into the current workspace's analysis template, or for loading a previously saved analysis template.
More details, please see Batch Processing.
In this example, we will run a script to fit all files named step0*.dat:
// File path string path$ = system.path.program$ + "Samples\Curve Fitting\"; string fname$; // Find all files like step01.dat, step02.dat // findFiles will default to get files from path$ findfiles f:=fname$ e:="step0*.dat"; // Specify the analysis template string tp$ = path$ + "autofit.ogw"; // Perform batch process. // File list is saved in fname$ batchprocess batch:=1 name:=tp$ method:="impAsc" fill:="Data" append:="Summary"