Reference Manual
Chapter
1
Ruler E
Overview
1.3
Developing Applications
Once the quality of the measurement data is sufficient, you need to write an application
that takes care of the measurement data, analyzes it and makes the decisions based on
the measurements. This application is developed in Visual Studio 7, using one of the APIs
that are delivered with the Ruler.
There are two APIs included with the development software for Ruler, to be used in Visual
Studio:
RulerNet API
for use with.Net, and
Ruler C++ API
for use with C++. Both APIs
contain the same functions but differ in the syntax.
The APIs handles all of the communication with the Ruler, and contain functions for:
$
retrieving profiles from the Ruler
$
starting and stopping the Ruler
$
changing Ruler configuration
Most of these functions are encapsulated in a Ruler class, and your application estab-
lishes contact with the Ruler camera by creating a Ruler object.
When the Ruler is measuring, it will send a profile to the PC as soon as it has finished
measuring a cross-section. On the PC, the profiles are collected and placed in a buffer by
the Ruler object. When your application needs measurement data, it requests data from
the Ruler object, which will then return a full buffer of profiles.
Figure 1.7 – All communication with the Ruler is handled by the API. Your application
retrieves buffers of profiles from a Ruler object.
Your application can specify the size of the buffers, and it is possible to set the buffer size
to 1 in order to receive one profile at a time. However, this will also add overhead to the
application, and put extra load on the CPU.
The profiles that your application receives are
calibrated
– that is, the measurement
values are given in a metric coordinate system local to the Ruler. You can translate these
measurement values to a different coordinate system by setting a Transformation for the
Ruler object in your application.
This could be useful for example if you have several Rulers mounted around a conveyor
belt where the objects are passing by. By setting transformations for each Ruler, your
application will receive all measurements given in a common coordinate system, relieving
your application from having to recalculate each value itself.
Profiles
request()
Ruler API
Application
buffers
Control
SICK IVP • Industrial Sensors • www.sickivp.com • All rights reserved
11