IO and Projector Control¶
The IOControl module is an optional on-board module of the rc_visard and requires a separate IOControl license to be purchased. This license is included in every rc_visard purchased after 01.07.2020.
The IOControl module allows reading the status of the general purpose digital inputs and controlling the digital general purpose outputs (GPIOs) of the rc_visard. The outputs can be set to LOW or HIGH, or configured to be HIGH for the exposure time of every image or every second image.
The purpose of the IOControl module is the control of an external light source or a projector, which is connected to one of the rc_visard’s GPIOs to be synchronized by the image acquisition trigger. In case a pattern projector is used to improve stereo matching, the intensity images also show the projected pattern, which might be a disadvantage for image processing tasks that are based on the intensity image (e.g. edge detection). For this reason, the IOControl module allows setting GPIO outputs to HIGH for the exposure time of every second image, so that intensity images without the projected pattern are also available.
Parameters¶
The IOControl module is called rc_iocontrol
in the REST-API and is represented by the
IOControl page in the Configuration tab of the
Web GUI.
The user can change the parameters via the Web GUI, the
REST-API interface, or via GigE Vision
using the DigitalIOControl parameters LineSelector
and LineSource
(Category: DigitalIOControl).
Parameter overview¶
This module offers the following run-time parameters:
Name | Type | Min | Max | Default | Description |
---|---|---|---|---|---|
out1_mode |
string | - | - | Low | Out1 mode: [Low, High, ExposureActive, ExposureAlternateActive] |
out2_mode |
string | - | - | Low | Out2 mode: [Low, High, ExposureActive, ExposureAlternateActive] |
Description of run-time parameters¶
out1_mode
and out2_mode
(Out1 and Out2)¶
The output modes for GPIO Out 1 and Out 2 can be set individually:
Low
sets the ouput permanently to LOW. This is the factory default.
High
sets the output permanently to HIGH.
ExposureActive
sets the output to HIGH for the exposure time of every image.
ExposureAlternateActive
sets the output to HIGH for the exposure time of every second image.Via the REST-API, this parameter can be set as follows.
PUT http://<host>/api/v1/nodes/rc_iocontrol/parameters?<out1_mode|out2_mode>=<value>
Note
The parameters can only be changed if the IOControl license is available on
the rc_cube. Otherwise, the parameters will stay at their factory
defaults, i.e. out1_mode
= Low
and out2_mode
= Low
.
Fig. 37 shows which images are used for stereo
matching and transmission via GigE Vision in ExposureActive
mode with a
user-defined frame rate of 8 Hz.
The mode ExposureAlternateActive
is meant to be used when an external random
dot projector is connected to the rc_visard’s GPIO Out 1.
When setting Out 1 to ExposureAlternateActive
, the
stereo matching
module only uses images with GPIO Out 1 being HIGH, i.e. projector is on. The maximum
frame rate that is used for stereo matching is therefore half of the frame rate
configured by the user
(see FPS). All
modules which make use of the intensity image, like
TagDetect and
ItemPick,
use the intensity images with GPIO Out 1 being LOW, i.e. projector is off.
Fig. 38 shows an example.
Note
In ExposureAlternateActive
mode, an intensity image with GPIO Out 1 being HIGH (i.e. with
projection) is always 40 ms away from an intensity image with Out 1 being LOW (i.e. without
projection), regardless of the user-defined frame rate. This needs to be
considered when synchronizing disparity images and camera images without projection
in this special mode.
The functionality can also be controlled by the DigitalIOControl parameters of the GenICam interface (Category: DigitalIOControl).
Services¶
Each service response contains a return_code
,
which consists of a value
plus an optional message
.
A successful service returns with a return_code
value of 0
.
Negative return_code
values indicate that the service failed.
Positive return_code
values indicate that the service succeeded with additional information.
The IOControl module offers the following services.
get_io_values
¶
This service call retrieves the current state of the rc_visard’s general purpose inputs and outputs (GPIOs).
This service can be called as follows.
PUT http://<host>/api/v1/nodes/rc_iocontrol/services/get_io_valuesThis service has no arguments.
The definition for the response with corresponding datatypes is:
{ "name": "get_io_values", "response": { "in1": "bool", "in2": "bool", "out1": "bool", "out2": "bool", "return_code": { "message": "string", "value": "int16" }, "timestamp": { "nsec": "int32", "sec": "int32" } } }The returned
timestamp
is the time of measurement.
return_code
holds possible warnings or error codes and messages. Possiblereturn_code
values are shown below.
Code Description 0 Success -2 Internal error -9 License for IOControl is not available
save_parameters
¶
With this service call, the module’s current parameter settings are persisted to the rc_cube. That means, these values are applied even after reboot.
This service can be called as follows.
PUT http://<host>/api/v1/nodes/rc_iocontrol/services/save_parametersThis service has no arguments.
The definition for the response with corresponding datatypes is:
{ "name": "save_parameters", "response": { "return_code": { "message": "string", "value": "int16" } } }
reset_defaults
¶
Restores and applies the default values for this module’s parameters (“factory reset”).
This service can be called as follows.
PUT http://<host>/api/v1/nodes/rc_iocontrol/services/reset_defaultsThis service has no arguments.
The definition for the response with corresponding datatypes is:
{ "name": "reset_defaults", "response": { "return_code": { "message": "string", "value": "int16" } } }Warning
By calling this service, the current parameter settings for the IOControl module are irrecoverably lost.