Parameter | Type | Description |
---|---|---|
input_file | string | The file path to the input file. |
Script file name | Description |
---|---|
DeviceArbitration.js | Enables device pooling in JavaScript. |
FileUtilities.js | Provides the following functions: isFileExist(filename) DeleteFile(filename) StripPath(full_path) //for example, changes "c:/mydir/mysubdir/myfile.ext” to “myfile.ext” ForwardToBackSlashes(full_path) //for example, changes "c:/mydir/mysubdir/myfile.ext" to "c:\mydir\mysubdir\myfile.ext" |
ProtocolEditor.js | Provides various functions for editing a protocol. |
StopGo.js | Provides a way to create stop and go tasks using JavaScript, which is useful when stop and go should be scripted based on instance number. |
VIN_handling.js | Provides a way to assign virtual instance numbers (VIN) to plates. This is useful if instance numbers: • Must be passed from process to spawned process. • Require an out-of-order assignment, for example, if rejecting some plates, sequential [virtual] instance numbers can be assigned to the plates that remain. |
XMLKeyValueLookup.js XMLKeyValueLookup SampleData.xml | Script and sample data for mapping one string to another string, where the definition is in XML format. For example, you might use this script to translate an alias into a final file name. |
XML_files.js and Formatter.xml | Provides script for opening XML files, validation against schemas, and saving. Uses MSXMLDOM ActiveX, which requires Msxml2.DOMDocument.6.0 and Msxml2.XMLSchemaCache.6.0. |
File_operations.js | Provides functions for various file operations, such as creating, reading, writing to, and debugging files. |
plateDB_HowTOUse.js | Provides examples on how to use the VWorks plateDB object, which can be accessed by a script. For a description of the plateDB object, see plateDB object. |
WatcherMain function example |
---|
function WatcherMain(input_file_name){ print("Starting WatcherMain...with input file: [" + input_file_name + "]") print("OutputFolder : [" +OutputFolder+"]") if(!isFileExist(input_file_name)) Print("input file does not exist"); var inputParser = new InputParser(); inputParser.Open(input_file_name); var protocol_file_name = inputParser.getOrderAttribute("protocol") print("\n protocol file: " + protocolKey); print("\n protocol_file_name: " + protocol_file_name); var time_string = getTimeString() var protocolEditor = new ProtocolEditor(); protocolEditor.Open(protocol_file_name); var working_input_filename = WorkingFolder + time_string + "_" + StripPath(input_file_name) print("saving working input file to: ["+working_input_filename+"]") inputParser.Save(working_input_filename) print("success") print("modifying protocol") ModifyProtocol(inputParser, protocolEditor, working_input_filename); print("success") var working_protocol_filename= WorkingFolder + time_string + "_" + StripPath(protocol_file_name) print("saving working protocol to: ["+working_protocol_filename+"]") protocolEditor.Save(working_protocol_filename); print("success") runset.appendProtocolFileToRunset(working_protocol_filename, 1, "this is a note: blah", false) print("deleting input file: [" + input_file_name + "]") DeleteFile(input_file_name); } |
For information about... | See... |
---|---|
Configuring the Watcher feature | |
Creating the JavaScript | |
Turning on or off the Watcher feature |