Warning

You are reading an old version of this documentation. If you want up-to-date information, please have a look at 5.0 .

get_part

Important

This section is only relevant when a dualfeeding recipe is used in production. Refer to get_part for standard, single part recipe.

Parameters

  • None

Returns

  • 200 x=<x> y=<y> rz=<rz> p=<part>, where <x>, <y>, <rz> are coordinates and orientation of the part and <part> is either a or b depending on the part else refer to error codes.

Note

The coordinates have 5 decimal digits (e.g. x = 10.00000) and the angle has 2 (e.g. rz = 1.00).

Description

Request one or more parts of a specific type or not.

In the context of dual feeding, this command can be used to retrieve the position of one or more specific parts (e.g. one part a and one part b) or any pickable parts (e.g. part a or part b). This behavior is control by the part_quantity parameter and the dual feeding specific multi_part_quantity parameter.

By default, these parameters are set to:

If multi_part_quantity a and multi_part_quantity b are set to zero, any pickable part will be returned, either of type a or type b. The system will try to return positions in an alternating way (e.g. a, b, a, b, etc). As for single part recipes, the number of part returned can be changed using the part_quantity parameter (refer to Table 31).

As soon as multi_part_quantity is set to a value greater than zero, part_quantity will be ignored and the number of specific parts requested will be returned by get_part. This can be used e.g. to only retrieve parts of type a or get positions for both a and b at the same time.

Note

Notice that changing part_quantity or multi_part_quantity while a get_part is pending will not affect it. Only subsequent get_part will consider the newly set values.

Note

This command will block until the requested parts are found and can be returned. A 30-second timeout is set by default. The command returns an error if the requested number of parts cannot be found after the time period. The timeout can be adjusted before calling get_part (refer to set_parameter).

Default working principle

Parameters set to:

The command get_part will give back the coordinates of a good candidate, be it of type a or type b. The behavior is similar to the single part use case. However, the command will return part of alternating types if possible.

  • Suppose the image analysis is completed and the system found 2 parts of type a and 3 parts of type b. Calling get_part 5 times will likely return the following sequence: a, b, a, b, b. There is no guarantee that the sequence begins with a so the output could be b, a, b, a, b. The system will not trigger a new feeding sequence until all good candidates have been returned.

  • Suppose now the system found 3 parts of type a and none of type b. Calling get_part 3 times will return a, a, a. Calling get_part a fourth time will trigger a feeding sequence and a new image analysis.

Working principle with part_quantity = n

Parameters set to:

It changes the minimum number of good candidates of any type that must be found each time the get_part command is called. The quantity of parts can be changed with the command set_parameter.

The get_part command will not stop until getting at least n good candidates on the Asycube or reaching the timeout.

  • Suppose the image analysis is completed and the system found 2 parts of type a and 3 parts of type b. Calling get_part 2 times will likely return the following sequence: (a, b), (a, b). Again, there is no guarantee that the sequence begins with a so the output could be (b, a), (b, a). A third call to get_part will trigger a feeding sequence and new image analysis since only a single part would be available and we requested a part_quantity of 2.

Working principle with multi_part_quantity = n

Parameters set to:

In this case, since one of the multi_part_quantity is different than zero, part_quantity is ignored. Here the system will return only part of type a.

  • Suppose again the image analysis is completed and the system found 2 parts of type a and 3 parts of type b. Calling get_part 2 times will return the following sequence: a, a. Even though there are good candidates for type b, none will be return and a third call to get_part will trigger a feeding sequence and new image analysis to return a new candidate of type a.

Parameters set to:

Again here part_quantity is ignored since multi_part_quantity are different than zero. One part of type a and one part of type b are requested at the same time now.

  • Taking our previous example where the image analysis is completed and the system found 2 parts of type a and 3 parts of type b. Calling get_part 2 times will return the following sequence: (a, b), (a, b). A third call to get_part will trigger a feeding sequence and new image analysis to return (a, b).

Note

As for part_quantity, it is possible to set multi_part_quantity to values higher than 1. For example, if 2 parts a and 1 part b are needed in the same get_part call, multi_part_quantity a must be set to 2 and multi_part_quantity b to 1.

Usage example

set_parameter part_quantity 2
set_parameter multi_part_quantity a 0
set_parameter multi_part_quantity b 0
get_part
200 x=0.12345 y=0.11111 rz=0.99 p=a x=0.42420 y=0.75311 rz=0.75 p=b
get_part
200 x=0.78951 y=0.96514 rz=0.42 p=b x=0.23554 y=0.14587 rz=0.51 p=b

set_parameter part_quantity 1
set_parameter multi_part_quantity a 1
set_parameter multi_part_quantity b 0
get_part
200 x=0.12345 y=0.11111 rz=0.99 p=a
get_part
200 x=0.67894 y=0.12341 rz=0.79 p=a

set_parameter part_quantity 1
set_parameter multi_part_quantity a 1
set_parameter multi_part_quantity b 1
get_part
200 x=0.12345 y=0.11111 rz=0.99 p=a x=0.42420 y=0.75311 rz=0.75 p=b
get_part
200 x=0.78951 y=0.96514 rz=0.42 p=a x=0.23554 y=0.14587 rz=0.51 p=b