codedesc#

The codedesc class holds the AI Vision Sensor Color Codes. A codedesc object can not be created unless two colordesc objects have already been created. Up to five Color Codes can be stored at once, and each Color Code can have up to five Color Signatures in them.

A Color Code is created by using the following constructor:

The codedesc(index, c1, c2, c3, c4, c5) constructor creates a codedesc object with at least 2 but up to 5 colordesc objects.

Parameter

Description

index

The codedesc object’s index, from 1 - 5. Note: Creating two codedesc objects with the same index number will cause the second created object to override the first.

c1

The name of the first colordesc object in the Color Code.

c2

The name of the second colordesc object in the Color Code.

c3

Optional. The name of the third colordesc object in the Color Code.

c4

Optional. The name of the fourth colordesc object in the Color Code.

c5

Optional. The name of the fifth colordesc object in the Color Code.

// Create a new Color Signature "Red" with the Colordesc class.
aivision::colordesc Red = aivision::colordesc(1, 207, 19, 25, 10.00, 0.20);
// Create a new Color Signature "Purple" with the Colordesc class.
aivision::colordesc Purple = aivision::colordesc(2, 98, 18, 227, 10.00, 0.20);
// Create a new Color Code "redPurple" with the Codedesc class.
aivision::codedesc redPurple = aivision::codedesc(1, Red, Purple);

By default, the ALL_CODES tag will return all codedesc objects with the AI Vision Sensor.