![]() |
VWorks software calls the Compile method to notify the plugin of the state of a protocol’s compile sequence. With every call to this method, VWorks software passes a value in the iCompileType parameter that represents the current compilation stage. During the compile sequence, the plugin should do the following:
• Accumulate information about changes in the compile state for each stage in the compile sequence
• Report to VWorks software any compiler errors or warnings that occur so VWorks software can log them to the Main Log
HRESULT Compile(
[in] enum CompileType iCompileType,
[in] BSTR MetaDataXML,
[out,retval] BSTR *CompileResultXML
);
0 = Compiling begins (COMPILE_BEGIN)1 = Compiling the task in a process in the Main Protocol (COMPILE_TASK_PROCESS)2 = Compiling the task in a subprocess that uses this device (COMPILE_TASK_SUBPROCESS)3 = Compiling the task in a process in the Startup Protocol (COMPILE_TASK_PREPROCESS)4 = Compiling the task in the Cleanup Protocol (COMPILE_TASK_POSTPROCESS)5 = Compiling a subprocess begins (COMPILE_BEGIN_SUBPROCESS)6 = Compiling a subprocess ends (COMPILE_END_SUBPROCESS)7 = Compiling ends (COMPILE_END)8 = Compiling a Loop task in a subprocess that uses this device (COMPILE_LOOP_BEGIN)9 = Compiling a Loop End task in a subprocess that uses this device (COMPILE_LOOP_END) [in] A Command XML block. The contents vary for different values of the iCompileType parameter. If there are no errors or warnings to report to VWorks software, this parameter contains an empty string; otherwise, this parameter contains a CompilerErrors XML block. The CompilerErrors XML block describes any errors that occurred while the protocol was compiling and classifies them as errors or warnings.The contents of the Command XML block vary for different values of the iCompileType parameter, as shown in the following table:
Data for the currently selected profile and the file path of the protocol that is compiling. An empty Command element. The metadata for the task that is compiling. See “Command XML block” .If no errors occurred during protocol compilation, the plugin returns an empty CompileResult XML element in the CompileResultXML parameter of the Compile method.The following sample code is an empty CompileResult XML element that is returned by the plugin to VWorks software as a string in the CompileResultXML parameter of the Compile method. The plugin tells VWorks software that no errors occurred during the protocol compilation.
If one or more errors occurred during protocol compilation, the plugin returns a CompileErrors XML block in the CompileResultXML parameter of the Compile method.The CompilerErrors XML block contains the CompilerErrors element and all its children. This XML block describes any errors that occurred during protocol compilation, which the plugin must report to VWorks software.
The CompilerError element has the following attributes:
0 = Compiler error1 = Compiler warningThe following sample code is a CompilerErrors XML block that is returned by the plugin to VWorks software as a string in the CompileResultXML parameter of the Compile method. The plugin tells VWorks software that the following two warning-type compiler errors occurred during the protocol compilation: Warning: xyz and Warning: xyzabc.