IVHooks interface : BarCodeRead method

BarCodeRead method
Event
A barcode read occurred.
Description
VWorks software calls the BarCodeRead method after a barcode read occurs. The plugin must tell VWorks software what action to take if a barcode is present on one of the labware’s four sides.
Plugins can also use this method to determine if a barcode is expected or valid.
Syntax
 
HRESULT BarCodeRead(
[in] BSTR sXML,
[in, out] BSTR* sResultXML
);
Parameters
 
[in] A Velocity11 XML element containing information about the labware that was involved in the barcode read.
[in, out] A Velocity11 XML element or a HookResults XML block that specifies the action to take if a barcode is present on one of the labware’s four sides. See “HookResults XML block” .
BarCodeRead method input
VWorks software passes a Velocity11 XML element into the sXML parameter of the BarCodeRead method. This XML element provides information about the labware involved in the barcode read.
Velocity11 element
The Velocity11 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.
Example of BarCodeRead method input
The following sample code is a Velocity11 XML element that is received by the plugin from VWorks software as a string in the sXML parameter of the BarCodeRead method. VWorks software tells the plugin that a barcode read occurred on the south side of the tip box named NameofPlate.
 
< BarCodeRead NorthBarcode='BAR0001' SouthBarcode='BAR0002' WestBarcode='BAR0003'
EastBarcode='BAR0004' PlateName='NameofPlate' InstanceNumber='1' DatabaseID='1'
Labware='384 V11 ST10 Tip Box 10734.102' Device='NameofDevice'
Location='NameofLocation' Path='C:\VWorks Workspace\Protocols\protocol1.pro'/>
BarCodeRead output
The plugin returns either a Velocity11 XML element or a HookResults element in the sResultXML parameter of the BarCodeRead method as follows:
 
Action VWorks software should take
Ignore the error and continue as if the misread has not occurred.
ResultType=LogMessage or ResultType=LogError
Velocity 11 element (Velocity11 XML element)
For the Velocity11 XML element, the Velocity11 element has the following attributes plus the md5sum and version attributes:
 
The value BarCodeReadResult.
Velocity 11 element (HookResults XML block)
For the HookResults XML block, the Velocity11 element has the following additional attribute:
 
Example of BarCodeRead method output (Velocity11 XML element)
The following sample code is a Velocity11 element that is returned to VWorks software by the plugin as a string in the sXML parameter of the BarCodeRead method. The plugin tells VWorks software to take no action after a barcode read occurs.
 
version='1.0' Action='BCR_IGNORE' />
Example of BarCodeRead method output (HookResults XML block)
The following sample code is a HookResults XML block that is returned to VWorks software by the plugin as a string in the sXML parameter of the BarCodeRead method. (See “HookResults XML block” .) The plugin tells the scheduler to pause the protocol. The plugin also tells VWorks software to quarantine the labware and to write the following Error-type message to the Main Log:
Plugin pause: Barcode is not in the database.
 
version='1.0' Action='BCR_QUARANTINE'>
<HookResults>
<Results>
<HookResult ResultType='LogError' ResultValue='Plugin paused: Barcode is not
in the database.' />
<HookResult ResultType='PauseExecution' ResultValue='True' />
</Results>
</HookResults>
Related information