;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (2)Connect to the FH server
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WHILE bconnected == 0 DO
CALL fhconnect($ip_address, $port_no, retries_connect, timeout_connect, socket_no,
err_no)
; Error check
IF err_no <> success THEN
TYPE "ERROR: fhsample_main(): Connection failed. Exit:", err_no
GOTO 11
END
END
TYPE "Connection Done."
Set the variables as arguments for the connection function (fhconnect) to the
Vision Sensor (FH server) and execute it.
7.2. Switching Scenes on Vision Sensor
For a processing to switch scenes on the Vision Sensor, follow the procedures below.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; (1)Change the scene of the FH
; You have to select a scene No. for your application.
; 0 : Workpiece picking scene
; 1 : Grasp adjustment scene
; 2 : Workpiece picking scene
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
scene_no = 0
Set a scene number for the switching destination to a variable.
For scene numbers for each application, refer to the following.
Pick: Scene 0
Grip Correction: Scene 1
Place: Scene 2
CALL fhsample_chgscn(socket_no, retry_count, time_out, scene_no, err_no)
; Error check
IF err_no <> success THEN
TYPE "ERROR: fhsample_main(): Connection failed. Exit:", err_no
GOTO 10
END
TYPE "Change scene No. Done."
Set the variables as arguments to the scene switching command execution
sample function (fhsample_chgscn) to the Vision Sensor and execute it.
Scene switching command execution sample function
Connection function with the Vision Sensor (FH server)