I want to check the workpiece id (name).


I have a question about the works process of visual components.

Work processes are used to create workpiece. At this time, I want to process only the desired material in the robot or machine.

We need to be able to identify the id (name) of the material in question and how to do it.

(The count of the workpiece can be grasped using ‘Task: assign’, but id is unknown.)

A simple example is shown below.

  1. Workpiece ID 1, 2, 3 M is created and sent to the conveyor.
  2. The middle robot grabs the desired Workpiece ID 2.
  3. The remaining id 1, 3 pass by.
If you know how to solve it, please answer it.

**I used a translator, so the contents may be wrong.


Often ProdID is used to do conditinal tasks such as picking only certain objects on the line. You can set different materials for different ProdID at the creation phase. Check the attached example on how ProdID can be used for conditional picking.

You can read other component properties with syntax #PropertyName. So for example you can create a task “Print:Material is #Material:True:True” which looks for property named “Material” and prints it on the console. Only problem is that Material property is of type vcMaterial and not string so the output will print “Material is <vcMaterial object at 0x00000249B4591150>”. So you would need to be able to read Material.Name which is a property within a property. That is not supported on Works by default so you would need to customize the works tasks on python.

I hope this was helpful.


Works_selective_picking.vcmx (1.3 MB)

You could write a python script attached to a sensor on the conveyor, that checks the ID/Material of the current part. If the ID is the desired one you can call a pick-function.

For example:

while app.Simulation.IsRunning:
    triggerCondition(lambda: sensor_signal.Value != None)
    part = sensor_signal.Value
    ID = part.getProperty("ProdID")
    if ID = "2":

Hope that helps!

BR Dubsepp