Reference Manual
Chapter
5
Ruler E
Ruler API
Once connected, you can start and stop the camera by using the
StartRuler()
and
StopRuler()
methods. When you are done with the camera, call the
CloseRuler()
method.
When the camera is started and measuring, it may alter between two states:
Started
The camera is measuring and sending measurement data to the PC.
WaitingForEnable
If the
UseEnable
parameter is set in the parameter file used by the
Ruler, the camera is waiting for the Enable signal to become high, and
therefore not sending any measurement data.
You can find out which state the Ruler currently is in by calling the Ruler object’s
Ping()
method.
NotInitialized
Stopped
Started
WaitingForEnable
InitRuler()
StartRuler()
StopRuler()
UpdateParameters()
CloseRuler()
Figure 5.1 – The normal states for a Ruler object and the Ruler camera.
In addition to the states in the illustration, the Ruler also has an
Error
state, which means
that the current configuration of the Ruler is not valid, and therefore the Ruler cannot be
started.
NOTINITIALIZED
STOPPED
STARTED
create
object
5.2
Retrieving Measurement Data
When retrieving the profiles with the Ruler object, the measured values for each point in
the profile are placed in up to four separate arrays of data:
x
X coordinate for the measured point in millimeters (float).
range
Range values (height values) in millimeters at the measured point (float)
intensity
Intensity values (grayscale values) at the measured point (0–255, byte).
scatter
When used with a Ruler with the Scatter option, scatter values at the
measured point (0–255, byte).
The index of a value in the arrays tells which point the data belongs to. For example, the x
value for the 3:rd point in the first profile in the buffer is stored in the 3:rd item in the
x
array, and the corresponding range value in the 3:rd item in the
range
array.
Since a number of profiles are retrieved at a time, the values for the other profiles are
placed in order after the first profile. For example, the x value for the 3:rd point in the
second profile is stored in item number (3 +
PointsPerProfile)
in the
x
array, etc.
SICK IVP • Industrial Sensors • www.sickivp.com • All rights reserved
41