Configuration
2
0
2
2
-0
2
43
2. Output of Line Data
Wait for the container to be filled. The time for this can be limited to 500 ms, as in this case. This
timeout period should be set depending on the data to be received. If there is only one line,
about 40 ms is sufficient. A check is then made as to whether the container exists and whether
it contains data
—
in this case, whether it contains lines. The data of the line is then transferred
to the singleLine variable.
3. Access to a Line Coordinate
To do this, the container must first be collected, as in example 2. Any line coordinate can then
be accessed via the following program line. In this case, it is the first coordinate.
// try to get a data container within 500 ms
var dataItem = await _vsxProtocolDriver.GetDynamicContainer(500);
// dataItem.Container now contains an image/result/line package
if (dataItem.Succ && (dataItem.Container !=null))
{
// Check if there is a line message contained
if (dataItem.Container.ContainsMessage("Line"))
{
var lineMessage = dataItem.Container.GetMessage("Line")
as VsxLineMessage;
// Get line from package
var singleLine = lineMessage.Line;
}
}
Note
For the data structure of the "line," see "Structure of the LineMessage Type" on page 34.
Coordinate coord = singleLine[0];