.PROGRAM PLIDCAM2() ; Use your own unique program name, 8 characters or less. ; The program will run as one of two main programs, NOT as a subroutine. ; ; Execute the program continuously via. "EX 2 yourprogram" ; Start here with a lebel ; Set the output signals to (0, 0) to receive input signals. ; ; Wait for signals from PLC for camera 2 data. Use TIMER function, not DELAY. ; Upon receiving, Wait 2 seconds for the camera to settle down ; ; Type a message on the monitor ; ; Define the parameter values in AOI 2001. ; ; Define a rectagular AOI around the bar code. ; ; Display gray scale image from Camera 2. ; ; Take a Camera 2 picture. Quick window frame grab. No limit on object find. ; ; Set Window around Camera 2 AOI. ; ; ; Set the initial scan weight to 8. ; Start a FOR loop ; ; Do VRULERI on Camera 2. The first parameter must be 1. ; Increment the X position vertical scan line inside the window. ; If the edge count is a certain range, a black bar has been scanned. ; Accumulate the weight value and halve the weight for the next scan line. ; END of the loop ; ; TYPE the pallet ID on the monitor. ; ; The ID determines its fate = To be or Not to Be. ; If To Be, signal (1, 1) ; If Not To Be, signal (1, 0) ; ; Wait until Input signal 2 goes to zero. ; Then, wait for a brief moment. ; Loop back to the top of the program.