Banner PresencePLUS Pro COLOR—PROII Camera User Manual

Page 74

Advertising
background image

; Determine whether the inspection passed or failed
;

; Send command to camera to determine if the inspection passed
; the inspection and found the desired part
.$cmd_str = "GET PASSFAILFLG"+$cmd_del
CALL tcp_send(.ret_val,.$cmd_str)
IF .ret_val < 0 GOTO tcp_error

; Read command response from camera
.$rcv_str = ""
CALL tcp_recv(.ret_val, .$rcv_str)
IF .ret_val < 0 GOTO tcp_error ; Get command failed

; Decode command response
.$rsp_str = $DECODE(.$rcv_str, $cmd_del, 0)
.ret_val = VAL(.$rsp_str)
IF .ret_val < 0 GOTO cmd_error ; Get Pass/Fail failed
$temp = $DECODE(.$rcv_str, $cmd_del, 1) ; Remove frame delimiter

; Decode the Pass/Fail status data returned by the Get command
.$rsp_str = $DECODE(.$rcv_str, $coord_del, 0)
.passfail = VAL(.$rsp_str)
IF .passfail <> 1 GOTO notfnd_error

;
; Obtain the X, Y, and Rz offset data
;

; Send command to camera to acquire the Communication Tool
; result data
.$cmd_str = "GET COORDTOOL"+$cmd_del
CALL tcp_send(.ret_val,.$cmd_str)
IF .ret_val < 0 GOTO tcp_error

; Read command response from camera
.$rcv_str = ""
CALL tcp_recv(.ret_val, .$rcv_str)
IF .ret_val < 0 GOTO tcp_error

; Decode command response
.$rsp_str = $DECODE(.$rcv_str, $cmd_del, 0)
.ret_val = VAL(.$rsp_str)
IF .ret_val < 0 GOTO cmd_error ; Get Commtool failed

$temp = $DECODE(.$rcv_str, $cmd_del, 1) ; Remove frame delimiter

; Decode the X offset data
.$rsp_str = $DECODE(.$rcv_str, $coord_del, 0)
X_offset = VAL(.$rsp_str)
$temp = $DECODE(.$rcv_str, $coord_del, 1) ; Remove field delimiter

; Decode the Y offset data
.$rsp_str = $DECODE(.$rcv_str, $coord_del, 0)
Y_offset = VAL(.$rsp_str)
$temp = $DECODE(.$rcv_str, $coord_del, 1) ; Remove field delimiter

;Decode the Rz offset data -- rotation about the Z axis
.$rsp_str = $DECODE(.$rcv_str, $coord_del, 0)
O_offset = VAL(.$rsp_str)
$temp = $DECODE(.$rcv_str, $coord_del, 1) ; Remove field delimiter

Banner Engineering Corp.

Minneapolis, MN USA

74

2/2010

System Setup Dialog

Advertising