get_conveyor_obj(conv_id, timeout=None, container_type=DR_FIFO, obj_offset_coord=None)
Features
It returns the workpiece coordinate ID available for the job from the corresponding conveyor. When a function is called, it returns the workpiece present in the Watch Zone one by one according to the container rule.
Parameters
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
conv_id | int | - | Conveyor ID |
timeout | float | None | If there is no workpiece to return during this timeout, it ends standby and return the function |
container_type | int | DR_FIFO | Workpiece container type (DR_FIFO: first-in/first-out, DR_LIFO: last-in/last-out |
obj_offset_coord | posx | None | Workpiece coordinates (mm, ˚) based on conveyor lock coordinates |
list(float[6]) |
Note
- When calling this function, it returns the coordinates ID of each workpiece in the Watch Window according to the container rule. For example, if you call get_conveyor_obj() function when the workpieces are places as shown below, the workpiece ② and ③ in the Watch Window will be candidates. At this time, if the container_type is set to DR_FIFO the corrdinates ID of ③ that entered the Watch Window first. If it is set to DR_LIFO, it returns the coordinates ID of ② that entered the Watch Window later. If there is no workpieces in the Watch Window at the time of the function call, it waits until the time set in the timeout parameter and return the id if the workpiece comes in.
[Workpiece Coordinate ID Return Rule Description]
- obj_offset_coord is used when you want to apply offset to the workpiece coordinates. It is usually used for easy input of a teaching point or when you want to dynamically change the position and orientation of the workpiece coordinates in conjunction with an external sensor (ex. Vision sensor).
In the case shown below, the workpiece coordinates are created on the right side of the workpiece and the orientation is different from the base or world coord. At this time, if you want to position the workpiece coordinates at the center of workpiece and make the orientation to be same with the ones of base or world coordinates, you can apply it as obj_offset_coord = posx (-d, 0, 0, -90, 0, 0). It is not necessary to acquire a teaching point through this TP UI, but it could utilize this method if you need to use drl only or enter the teaching point directly.
[obj_offset_coord use case 1]
Next, if the workpiece changes its position in a direction that is independent of the conveying direction, or the orientation of the workpiece changes as shown below, the encoder signal alone cannot determine the position / orientation of the workpiece. In this case, you need to detect them using external vision sensor. After detecting this value, you can input the position/orientation change detected as obj_offset_coord dynamically and the workpiece coordinates are created accordingly.
[obj_offset_coord use case 2: using vision sensor]
Return
Value | Description |
---|---|
int | CONV_COORD. Conveyor user coordinate ID (121~150) |
Negative integer | If no workpiece is present even after the timeout expires |
Note
If no workpiece to return is present, no function is returned until the timeout time expires. If the timeout time expires but no workpiece is present, it returns -1. However, if a timeout time is not entered, it doesn’t return continuously.
Exception
Exception | Description |
---|---|
DR_Error (DR_ERROR_TYPE) | Parameter data error occurred |
DR_Error (DR_ERROR_VALUE) | Parameter value is invalid |
DR_Error (DR_ERROR_RUNTIME) | C Extension module error occurred |
DR_Error (DR_ERROR_STOP) | Program terminated forcefully |
Example
## One object in a cycle
CONV1 = set_conveyor(‘conveyor1’)
movel(posx(100, 100, 50, 0, 0, 0), ref=DR_BASE) # waiting position
while True:
CONV_COORD_1 = get_conveyor_obj(CONV1)
tracking_conveyor(CONV1)
# synched motion
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1)
set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
untracking_conveyor(CONV1)
movel(posx(100, 100, 50, 0, 0, 0), ref=DR_BASE) # waiting position
## Multi objects in a cycle
CONV1 = set_conveyor(‘conveyor1’)
while True:
CONV_COORD_1 = get_conveyor_obj(CONV1)
tracking_conveyor(CONV1)
# fist object
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_1)
set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
# second object
CONV_COORD_2 = get_conveyor_obj(CONV1, time_out=10)
if CONV_COORD_2 > 0: # -1 if no objects available during time_out
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_2)
movel(posx(0,0, 0, 0, 0, 0), ref=CONV_COORD_2)
set_digital_output(DO_GRIPPER, 1)
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_2)
# first object if you need
movel(posx(0,0, 50, 0, 0, 0), ref=CONV_COORD_1)
untracking_conveyor(CONV1)
movel(posx(100, 100, 50, 0, 0, 0), ref=DR_BASE)