IIODriver interface : Read method

Read method
Description
VWorks software calls the Read method to tell the plugin to read the input signal (voltage) on the specified digital or analog input channel.
Syntax
 
HRESULT Read(
[in,out] BSTR *xml,
[out,retval] enum ReturnCode *retVal
);
Parameters
 
[in, out] The input xml parameter contains the following:
The output xml parameter contains the following:
0 = The request was completed (RETURN_SUCCESS)
1 = Something was wrong with the input, so the request was not completed (RETURN_BAD_ARGS)
2 = The request was not completed (RETURN_FAIL)
Read method input
VWorks software passes one of the following XML blocks into the xml parameter of the Read method:
The value of the file attribute of the Velocity11 element is Velocity11. See “Velocity11 element” .
digitalInputs XML block
The digitalInputs XML block contains the digitalInputs element and one name element. The name element contains the name of a digital input channel.
analogInputs XML block
The analogInputs XML block contains the analogInputs element and one name element. The name element contains the name of an analog input channel.
Example of Read method input received by the plugin
The following sample code is an analogInputs XML block that is received by the plugin from VWorks software as a string in the xml parameter of the Read method. VWorks software asks the plugin for the current input signal (voltage) on the analog input channel named Humidity.
 
version='1.1' >
<analogInputs >
<name >Humidity</name>
</analogInputs>
Read method output
The plugin returns a digitalInput XML element or an analogInput XML element in the xml parameter of the Read method.
digitalInput and analogInput elements
Each digitalInput and analogInput element has the following attributes:
 
Example of Read method input returned by the plugin
The following sample code contains an analogInput XML element that is returned by the plugin to VWorks software as a string in the xml parameter of the Read method. The code contains the current voltage of 70 volts for the analog input channel named Humidity.
 
version='1.1' >
<analogInput name='Humidity' value='70' />
Related information