Kawasaki as language sample – Banner PresencePLUS P4 EDGE 1.3 Series User Manual
Page 75
Kawasaki AS Language Sample
This sample AS Language code snippet will assist with the integration of a Banner PresencePLUS Vision
Sensor and a Kawasaki C/D/D+ Series Robot Controller.
In this example, the Banner Remote Command Channel (RCC) has been configured to use the Kawasaki RCC
Protocol with Ethernet Socket 1, all other settings are default (TCP port 20000, command and response frame
start delimiter is empty string (
output delimiter is comma (,).
This example assumes that a Banner PresencePLUS inspection that produces X, Y and Angle offsets has
been loaded into the PresencePLUS Vision Sensor and has been started with the PresencePLUS GUI. These
offsets will then be obtained and stored in the following variables:
• X_offset is the offset (in units set in camera) along the horizontal axis of the image, increases to
the right
• Y_offset is the offset (in units set in camera) along the vertical axis of the image, increases downward
• Rz_offset is the angular offset (in degrees) about the Z-axis, increases clockwise
This program implements the following actions:
1. Connect to the RCC.
2. Issue EXEC TRIGGER and wait for inspection to complete.
3. Determine pass/fail condition of the inspection.
4. Get the X, Y, and Rotation about Z-axis offsets.
5. Close the connection to the RCC.
If any failure occurs, such as a TCP communications failure or a RCC command error, then the connection to
the RCC will be severed within this example program.
.PROGRAM banner_vision()
; Global variables
$cmd_del = $CHR(13)+$CHR(10)
$coord_del = ","
tcp_sock_id = -1 ; TCP/IP socket id for the camera
; Local variables
.ret_val = -1
.$cmd_str = "" ; Used for commands to camera
.$rcv_str = "" ; Used for incoming data from camera
.$rsp_str = "" ; Used for response parsing from camera
;
; Open TCP socket and connect to RCC
;
75
Banner Engineering Corp. - Minneapolis, MN USA - www.bannerengineering.com
Tel: 763.544.3164
P/N 000000
System Setup Window Overview
7/2009