Banner PresencePLUS Pro COLOR—PROII Camera User Manual

Page 75

Advertising
background image

;
; Handle new coordinate offsets
;
PRINT X_offset, Y_offset, Rz_offset
POINT pick = frame1+TRANS(X_offset, Y_offset, ,Rz_offset)
HOME
LAPPRO pick,100
LMOVE pick
CLAMP 1
LDEPART 100
HOME

; Part not found error
notfnd_error:
PRINT "The part was not found"
GOTO all_done

; TCP error
tcp_error:
PRINT "Error during send or receive via TCP:", .ret_val
GOTO all_done

; RCC Command error
cmd_error:
PRINT "Error during command to camera:", .ret_val
GOTO all_done

; Done with program
all_done:
CALL tcp_close
.END

;
; Open a TCP connection to the RCC using specified TCP port number
;
.PROGRAM tcp_open(.ret_val, .port)

.ret_val = 0 ; Initialize the return value
.retry_count = 0 ; Initialize the retry count

; Set the IP address to 192.168.0.1
ip[1] = 192
ip[2] = 168
ip[3] = 0
ip[4] = 1

connect:

; Connect to the RCC port
TCP_CONNECT tcp_sock_id, .port, ip[1]

; Check whether connection was established
IF tcp_sock_id < 0 THEN
IF .retry_count >= 5 THEN
; Number of retries exceeds 5, exit with error
PRINT "Unable to establish connection with camera"
.ret_val = -1
GOTO connect_error
ELSE
; Increment the retry count and try again

75

Minneapolis, MN USA

Banner Engineering Corp.

System Setup Dialog

2/2010

Advertising