3.7.1. For OMRON Viper Series Connecting Vision Sensor to Robot Controller The following describes a program that connects the vision system to the robot controller. 43 1 * Description omitted (Refer to the source code.) Declare internal variables. 2 Execute the global variable initialization function (fhdefglobal). CALL fhdefglobal() Initialization function for external variables socket_no = 0 err_no = success cur_local_coord = 0 cur_tool_coord = 0 cmd_res = 0 warmup_flg = 0 TYPE "Initialization Done." 3 Set the IP address and port number of the vision system as variables (if the default values need to be changed).
;Set the network configuration IP address $ip_address = "10.5.5.100" Port number $port_no = "9876” retries_connect = 2 ;times timeout_connect = 4 ;sec retry_count = 2 ;times time_out = 4 ;sec 4 With the variables set as arguments, execute the connection function (fhconnect). ;Connect to the FH server WHILE bconnected == 0 DO CALL fhconnect($ip_address, $port_no, retries_connect, timeout_connect, socket_no, err_no) Connection function with the Vision Sensor (FH server) ; Error check IF err_no success THEN TYPE "ERROR: fhsample_main(): Connection failed. Exit:", err_no GOTO 11 END END TYPE "Connection Done."