IVHooks interface : ProtocolStarted method

ProtocolStarted method
Event
A protocol started.
Description
VWorks software calls the ProtocolStarted method after a protocol starts.
Syntax
 
HRESULT ProtocolStarted(
[in] BSTR sXML,
[in, out] BSTR* sResultXML
);
Parameters
 
ProtocolStarted method input
VWorks software passes a ProtocolStarted XML element into the sXML parameter of the ProtocolStarted method. This XML element provides information about the protocol that started.
ProtocolStarted element
The ProtocolStarted element has the following attributes:
 
If the protocol has been saved, the value of this attribute is the protocol’s file path. If the protocol has not been saved, the value is the default protocol name.
1 = Startup
2 = Main
3 = Cleanup
0 = The protocol is not running in simulation mode
1 = The protocol is running in simulation mode
Example of ProtocolStarted method input
The following sample code is a ProtocolStarted XML element that is received by the plugin from VWorks software as a string in the sXML parameter of the ProtocolStarted method. VWorks software tells the plugin that the protocol named MyProtocol started in the Startup Protocol and that the protocol is running in simulation mode.
 
<ProtocolStarted Path='C:\V11\MyProtocol.pro' ProtocolType='1' Simulating='1' />
ProtocolStarted method output
The plugin returns a HookResults XML block in the sResultXML parameter of the ProtocolStarted method. For information about the structure and contents of this XML block, see “HookResults XML block” .
Example of ProtocolStarted method output
The following sample code is a HookResult XML block that is returned to VWorks software by the plugin as a string in the sResultXML parameter of the ProtocolStarted method. The plugin tells VWorks software to write the following Info-type message to the Main Log:
MyProtocol.pro started.
 
<HookResults>
<Results>
<HookResult ResultType='Log Message' ResultValue='MyProtocol.pro started.' />
</Results>
</HookResults>
Related information