For connecting the Vision Sensor to the Robot Controller, follow the procedures below. 29 6.1. Connecting Vision Sensor to Robot Controller Declare internal variables. *Omitted (Refer to the source code) 1 Execute the initialization for external variables. !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ! (2) Initialize global variables !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; err no := success; _ !Set Current Coord No cur local coord no := 0; _ _ _ cur tool coord no := 0; _ _ _ 2 Set the IP address and the port number of the Vision Sensor to the var iables.
(When changing those from the default.) !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ! 2. Example: Network connection sequence !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ! (1)Set the network configuration ! You have to configure the following communication settings.
!;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ip address := "10.5.5.100"; IP address _ port _no := 9876; Port number retries connect := 2; _ timeout connect := 4; _ retries recv := 2; _ timeout recv := 4; _ 3 Set the variables as arguments for the connection function (fhconnect) to the Vision Sensor and execute it. !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !
(2)Connect to the FH server !;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WHILE bconnected = FALSE DO fhconnect fh socket,ip address, port no, retries connect, timeout connect, err no; _ _ _ _ _ _ Connection function with the Vision Sensor (FH Server) !Error check IF err no success THEN _ GOTO exit program; _ ENDIF ENDWHILE 4