Skip to main content
Skip table of contents

vs_trigger()

Features

This function transmits the measurement command to the vision system. If the measurement is successful, the result is returned.(*VS_TYPE: DR_VS_COGNEX, DR_VS_SICK)

Return

ValueData TypeDescription

pos

posx

pos: measuring position of an object (posx parameter type)

var_list

list[float]

var_list: Additional measurement results entered by Users

ex) Check pass/fail, distance measurement, angle measurement, etc.

-1, []

int

failed

Example

PY
vs_set_info(DR_VS_COGNEX)             # Select type of vision sensor
vs_connect("192.168.137.10")             # Vision IP, Default port
 
vis_posx = posx (410,310,300,0,0,0)            # Define the initial posx data - vision
rob_posx = posx (400,300,300,0,180,0)     # Define the initial posx data - robot
 
vs_set_init_pos(vis_posx, rob_posx, VS_POS1) # Enter the initial posx data to Vision
 
for i in range(10):
   pos, var_list = vs_trigger()               # Execute the vision meausrement
   if var_list[0] == 1:                      # Check the inspection result
       robot_posx_meas = vs_get_offset_pos(pos, VS_POS1) # offset the robot pose
       movel(robot_posx_meas)           # move the robot pose
   else:
       tp_popup("Inspection Fail")
 
vs_disconnect()
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.