setting the vision system
Transcription
setting the vision system
Vision System Connection Guide (COGNEX SLMP Connection) CONTENTS SAFETY PRECAUTIONS .............................................. A-1 REVISIONS.................................................................... A-2 INTRODUCTION About This Connection Guide .................................. 1 Required Modules and Devices ............................... 1 System Configuration for Connecting the Vision System.. 2 Connecting and Wiring the System .......................... 3 BASIC OPERATIONS OF THE SLMP SCANNER Basic Operation Flow of the SLMP Scanner ............ 4 Basic Operations of the SLMP Scanner................... 5 Data Blocks .............................................................. 5 Timing Chart of the SLMP Scanner.......................... 7 SETTING THE VISION SYSTEM Setting the Vision System ........................................ 8 SETTING THE PROGRAMMABLE CONTROLLER Setting the Programmable Controller ....................... 16 STARTING THE PROGRAMMABLE CONTROLLER AND VISION SYSTEM Starting the Programmable Controller and Vision System . 18 CHECKING OPERATIONS Checking Operations................................................ 19 Setting a Trigger ....................................................... 19 Setting Values to Parameters ................................... 21 CONTENTS IN DATA BLOCKS Contents in Data Blocks ........................................... 22 APPENDIX Other Control Methods ............................................. 26 COGNEX In-Sight EZ-700 series/In-Sight EZ-100 series In-Sight Micro series/In-Sight 5000 series/In-Sight 7000 series SAFETY PRECAUTIONS (Read these precautions before using this product.) Before using the products described in this document, please read this manual and the relevant manuals carefully and pay full attention to safety to handle the products correctly. In this section, the safety precautions are classified into two levels: " WARNING" and " CAUTION". WARNING Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury. CAUTION Indicates that incorrect handling may cause hazardous conditions, resulting in minor or moderate injury or property damage. Under some circumstances, failure to observe the precautions given under " serious consequences. Always observe the instructions of both levels to ensure personal safety. A-1 CAUTION" may lead to REVISIONS No. * Revision Remarks First edition A-2 INTRODUCTION About This Connection Guide This connection guide describes the procedures for connecting the COGNEX vision system to a MELSEC programmable controller and controlling the vision system with an SLMP scanner. Required Modules and Devices Prepare the following modules and devices. Mitsubishi Electric products GX Works2 (Engineering software for programmable controllers) MELSEC-Q/L series programmable controller COGNEX products In-Sight series Ethernet cable for In-Sight Breakout cable (for 24 V DC power supply)*1 In-Sight Explorer (Vision system setup software) Commercial products HUB/PoE hub*2 Ethernet straight cable Lens USB cable *1 Used with the In-Sight EZ-700 series, In-Sight 7000 series, or In-Sight 5000 series. *2 Used with the In-Sight EZ-100 series and In-Sight Micro series. 1 24 V DC power supply*1 INTRODUCTION System Configuration for Connecting the Vision System MELSEC-Q/L series programmable controller IP address (192.168.3.2) 1) Connect the programmable controller and a personal computer with the USB cable. 2) Connect the HUB and each device with Ethernet cables. HUB* Vision system IP address (192.168.3.1) GX Works2, In-Sight Explorer IP address (192.168.3.3) 24 V DC power supply 3) Connect the power supply and I/O breakout cable to the PWR connector of the vision system. * Use a PoE hub when the In-Sight EZ-100 series or In-Sight Micro series is used as the vision system. 2 INTRODUCTION Connecting and Wiring the System (1) External power supply connection (In-Sight EZ-700 series, In-Sight 7000 series, In-Sight 5000 series) CAUTION Cut unused wires or protect them with insulating materials. Prevent them from being short-circuited with the +24 V DC wire. 1) Make sure that the switch of 24 V DC power supply is off. 2) Connect the power cable of a breakout cable and the terminal compatible with the power supply. (Check the compatible cable in the following diagram.) WARNING Do not use the voltage other than 24 V DC. Comply with the polarity as described. In-Sight 5000 series In-Sight EZ-700 or 7000 series +24 V DC power supply (white and green) Connect the positive pole of the 24 V DC power supply. Ground (brown) Connect the negative pole of the 24 V DC power supply. +24 V DC input (red) Connect the positive pole of the 24 V DC power supply. 24 V Common (black) Connect the negative pole of the 24 V DC power supply. (2) Connection of the vision system and a breakout cable (In-Sight EZ-700 series, In-Sight 7000 series, In-Sight 5000 series) Connect a power supply and I/O breakout cable to the PWR connector of the vision system. 3 BASIC OPERATIONS OF THE SLMP SCANNER Basic Operation Flow of the SLMP Scanner Programmable Vision system controller Reading control area • Reading M relay and D register Set poll interval Reading control area • Reading M relay and D register Trigger ON Reading control area Reading the control area using the vision system and accepting the trigger Updating the status block and output block Inspection While the trigger is on, communication between data import and the completion of inspection is performed regardless of the poll interval. Import Writing status Turning on the trigger command bit to M relay using a sequence program Writing status Updating the status block and output block Writing inspection results Updating the status Reading control area block and output block The vision system sends inspection results, and the "Inspection Completed" status and the "Results Valid" status. 4 BASIC OPERATIONS OF THE SLMP SCANNER Basic Operations of the SLMP Scanner In the SLMP Scanner, the vision system reads control blocks from the programmable controller at the poll interval set with In-Sight Explorer, and the processing is performed responding to the change of the bit information in the control blocks. The processing status is written to the corresponding bit in the status block. To control the vision system, assign the devices of the programmable controller to each of the defined data blocks (including control blocks) and use them. The following shows the functions of six data blocks. • Control block: • • • • • This block is used to send control commands (including triggers) to the vision system. This block uses bit information. The vision system is controlled by turning on and off the devices set to the control block using the programmable controller. Status block: This block indicates the status of the vision system, and can be checked with bit information. Input block: This block is used to input application data (including parameters for inspection) from the programmable controller, and uses word information. Output block: The vision system uses this block to output application data (including inspection results) to the programmable controller. This block uses word information. String command block: This block is used to set commands (string commands) to control the vision system. This block uses word information. String command result block: This block is used to output the results controlled by the commands. This block uses word information. The next section shows the data blocks and the timing chart of the SLMP Scanner. Data Blocks The following shows the six data blocks defined to control the vision system. Control data block Status block 5 BASIC OPERATIONS OF THE SLMP SCANNER Output block Input block String command block String result command block For details of the data block functions to control the vision system, refer to In-Sight Explorer's HELP. Set "SLMP" as a keyword in HELP and refer to the explanation of data blocks. 6 BASIC OPERATIONS OF THE SLMP SCANNER Timing Chart of the SLMP Scanner The following shows a timing chart when "Trigger" of the control block is turned on from the programmable controller. To enable the trigger from the programmable controller, turn on "Trigger Enable" of the control block. When "Trigger" of the control block is turned on from the programmable controller while "Trigger Ready" of the status block is on, the status of the vision system is output to "Trigger Ack", "Acquiring", "Inspecting", and "Inspection Completed" of the status block. "Inspection Completed" changes (toggles) the status at every completion. Trigger Enable Trigger Ready Trigger Trigger Ack Acquiring Inspecting 2) 1) 3) 1) 1) 2) 3) 1) 2) 3) 1) 2) 1) Inspection Completed Programmable controller (control block) Vision system (status block) 7 3) 2) 3) 2) 3) SETTING THE VISION SYSTEM Setting the Vision System (1) Setting an IP address to the personal computer Set the IP address 192.168.3.3 to the personal computer. (2) Connection with the vision system Start In-Sight Explorer to set the vision system. Click [Add]. Click! Add the vision system to the network. Set the sensor and device to the network as shown left. IP Address: 192.168.3.1 Subnet Mask: 255.255.255.0 Click [Connect] to connect to the vision system. Click! 8 SETTING THE VISION SYSTEM (3) Creating a new job Create a new job to detect the workpiece position. Select [New Job]. Select! Adjust the lens so that the lens captures an inspection target in [Set Up Image], and configure the settings to acquire the image. 1 2 3 1 Select [Set Up Image]. 2 Select [Live Video] to adjust the image. 3 Select [Network]. 1 Select [Locate Part]. 2 Select [PatMax® Pattern]. Set a tool. 1 2 9 SETTING THE VISION SYSTEM Set a model on the position to be detected. 1 Set the model. 2 Click [OK]. 1 Click! 2 10 SETTING THE VISION SYSTEM (4) Communication setting Configure the communication setting (SLMP scanner). Select! 1 Select [Communication]. 2 Click [Add Device]. 1 Configure the device setting as shown left. Device: PLC/Motion Controller Manufacturer: Mitsubishi Protocol: SLMP Scanner 2 Click [OK]. 1 2 Click! Add the SLMP scanner to the communication. 1 2 Click! Set the SLMP scanner. Configure the following settings. Controller Type: Q/L Series (3E Frame) IP Address: 192.168.3.2 Host Port: 12289 (the port number of the Ethernet parameter set with GX Works2) Timeout (ms): 1000 Poll Interval (ms): 100 Select! POINT 11 Shortening the poll interval also shortens the interval to monitor the programmable controller status. SETTING THE VISION SYSTEM (5) Assigning devices Select! 1 2 1 Select [Device Addressing]. 2 Set a device, offset, and the number of devices to each of the six data blocks as shown left. For control contents of when the device is assigned to each data block, refer to "DATA BLOCK CONTENTS". 12 SETTING THE VISION SYSTEM (6) Outputting to the programmable controller Set data to be output from the vision system to the programmable controller. (As an example, set the inspection count, X coordinate, Y coordinate, and angle to the output block.) Click [Add]. Click! Select the data to be output to the programmable controller. Select! Select! Select "Job.Inspection_Count". Select the X and Y coordinates and angle of the detection target. Click [OK]. Click! Display the output result to the programmable controller. Message size (words): 7 13 SETTING THE VISION SYSTEM (7) Inputting from the programmable controller Set data to be input from the programmable controller to the vision system. (As an example, set "Rotation_Tolerance"to the input block.) Click [Add]. Click! Select [Pattern_1.Rotation_Tolerance] as an input from the programmable controller, and click [OK]. Select! Click! Display the input result from the programmable controller. Message size (words): 1 14 SETTING THE VISION SYSTEM (8) Saving the job Name the created job and save it. Select! 1 Select [Save Job]. 2 Click [Save As...]. 1 Set an arbitrary name. 2 Click [Save]. 1 2 Click! 1 2 Click! 15 SETTING THE PROGRAMMABLE CONTROLLER Setting the Programmable Controller Start GX Works2 to set the programmable controller. Select! Double -click! Click! Start GX Works2 and create a new project. Select Type: Q06UDV, Project Type: Simple Project, and Language: Ladder. Double-click "PLC Parameter" in the Project window. Click [OK]. Select! The Q Parameter Setting window appears. Select the [Buit-in Ethernet Port Setting] tab. Click! Configure the setting in the [Buit-in Ethernet Port Setting] tab as shown left. IP Address: 192.168.3.2 Select "Binary Code" and "Enable online change (FTP, MC Protocol)". Click [Open Setting]. Select! Select! 16 SETTING THE PROGRAMMABLE CONTROLLER 1 2 1 Select "DEC" for "IP Address/Port No. Input Format". 2 Select "TCP" in "Protocol". 3 Select "MC Protocol" in "Open System". 4 Enter "12289" to "Host Station". Select! 3 4 Key input Click! Click [End]. The Q Parameter Setting window appears. Click [End]. Click! POINT 17 The user have to set parameters for communication, however, do not need to create a program for communication. STARTING THE PROGRAMMABLE CONTROLLER AND VISION SYSTEM Starting the Programmable Controller and Vision System (1) Starting the programmable controller Write the parameters. Select [Parameter + Program] and click [Execute]. Select! After writing the parameters is completed, reset and run the programmable controller. Click! (2) Connecting the vision system to the network Start the communication with the programmable controller. 2 1 Select [Communication]. 2 Select [Online]. Check that [Connected.] is displayed for the SLMP Scanner. Select! 1 Select! 18 CHECKING OPERATIONS Checking Operations Control the vision system using the programmable controller and check the operations. Setting a Trigger Set a trigger to the vision system to acquire inspection results. Open "Device/Buffer Memory Batch Monitor" in GX Works2 to display devices. Set devices as shown left. Device Name: D1000 D1000 to D1001: Control D1002 to D1003: Status D1005 to D1009: Input block D1010 to D1022: Output block To enable the trigger form the programmable controller, turn "ON" the "Network Trigger Enable" bit (D1000.0). Turn on the "Trigger Enable" bit. 19 When the "Network Trigger Enable" bit (D1000.0) is "OFF", the vision system does not operate even though the trigger is ON. CHECKING OPERATIONS Trigger ON Inspection Completed* Inspection count X coordinate D1016 to D1017 Y coordinate D1018 to D1019 Angle D1020 to D1021 Turn "ON" the "Trigger" bit (D1000.1) of the control block. The vision system is triggered and an inspection result is output. As the inspection result, the format output data set with the SLMP Scanner of In-Sight Explorer is output. D1015 = Inspection count, D1016 = X coordinate, D1018 = Y coordinate, D1020 = Angle When the inspection is completed, the "Inspection Completed" bit (D1002.9) changes (toggles) the status. * The "Inspection Completed" bit (D1002.9) changes (toggles) the status when the inspection is completed. The X and Y coordinates and the angle of the inspection result are output as 32-bit floating-point values. Switch the display format to [Real Number (32Bit)] and check the values. Select! Inspection Completed To set the trigger to the vision system again, turn "OFF" and "ON" D1000.1. X coordinate D1016 Y coordinate D1018 Angle D1020 Click the [Format Output Data] tab. The values output to the programmable controller can be checked with In-Sight Explorer. Click! Values output to the programmable controller 20 CHECKING OPERATIONS Setting Values to Parameters Set a value to the format input data (Pattern_1.Rotation_Tolerance) set with the SLMP scanner of InSight Explorer. Turn ON "Set User Data". D1001.0 Set 50 to "Pattern_1. Rotation_Tolerance". D1007 Set "50" to the user area D1007 of the input block. Turn "ON" "Set User Data" (D1001.0) of the control block. To change "Pattern_1.Rotation_Tolerance" again, set a new value to D1007, and turn "OFF" and "ON" D1001.0. When the "Trigger" bit (D1000.1) of the control block is turned "ON", the inspection is performed with the new "Pattern_1.Rotation_Tolerance". To check the new "Pattern_1.Rotation_Tolerance" on In-Sight Explorer, trigger the vision system from the programmable controller and check the new value. The "Rotation Tolerance" value is 50 (50.000). 21 CONTENTS IN DATA BLOCKS Contents in Data Blocks Set a start device and the number of devices to each data block with In-Sight Explorer. The start device types (such as D, M, and X) and the start devices can be changed. The number of devices, excluding the ones for the control block and status block, can be changed. The control details set to each data block are fixed in the system. The following shows the control details of the six data blocks where devices have been assigned. Type Number of Start device devices Control D1000 2 Status D1002 2 Input block D1005 5 Output block D1010 12 Command D1025 100 Command Result D1125 100 Device assignment (Control) Classification Device Control details (Application) Supplement The trigger is enabled by turning on D1000.0 Network Trigger Enable this bit and is disabled by clearing this bit. The following conditions need to be satisfied to enable the trigger. The In-Sight vision system is online D1000.1 Trigger when the Network Trigger Enable bit is on. In the setting of In-Sight Explorer, [Network] or [External] is set for the Control [Trigger] parameter. D1000.2 D1000.3 Buffer Result Enable Inspection Result ON Acknowledgment An ID of the job to be loaded to the Job D1000.4 Job Load Trigger Load ID of the input block is set and this bit turns on. D1000.5 D1000.6 D1000.7 Reserved SetOffline The vision system goes offline when this bit is turned on. 22 CONTENTS IN DATA BLOCKS Classification Device Control details (Application) Supplement D1000.8 D1000.9 D1000.A D1000.B D1000.C Reserved D1000.D D1000.E D1000.F Control D1001.0 Set User Data D1001.1 Send Native Mode Command D1001.2 Reserved D1001.3 Clear Image Complete Signal D1001.4 D1001.5 D1001.6 Reserved D1001.7 23 D1001.8 Soft Event 0 Trigger D1001.9 Soft Event 1 Trigger D1001.A Soft Event 2 Trigger D1001.B Soft Event 3 Trigger D1001.C Soft Event 4 Trigger D1001.D Soft Event 5 Trigger D1001.E Soft Event 6 Trigger D1001.F Soft Event 7 Trigger This bit turns on from off when the user data of the input block is updated. CONTENTS IN DATA BLOCKS Device assignment (Status) Classification Device D1002.0 Control details (Application) Network Trigger Ready Supplement This bit turns on when the trigger can be input. This bit notifies that the trigger ON is D1002.1 Trigger ON Acknowledgment acknowledged. This bit remains ON until the trigger bit is cleared. D1002.2 Importing Image This bit turns on while an image is being imported. This bit turns on when importing an D1002.3 Importing Failed image failed. This bit is cleared when importing an image is properly completed. D1002.4: Offline operation from a D1002.4 program D1002.5 Offline Reason D1002.6 D1002.5: Offline operation from the discrete signal input D1002.6: Offline operation from the communication D1002.7 Online D1002.8 Inspecting D1002.9 Inspection Completed D1002.A Result Buffer Overrun D1002.B Results Valid D1002.C Job Loading D1002.D Job Load Complete D1002.E Job Load Failed D1002.F Fault Status D1003.0 D1003.1 This bit turns on when the vision system is online. This bit turns on during inspection processing. This bit changes (toggles) the status when inspection is completed. Set User Data Trigger Acknowledgment Send Native Mode Command Trigger Acknowledgment D1003.2 Native Mode Command Error D1003.3 Imaging Completed D1003.4 D1003.5 D1003.6 Reserved D1003.7 D1003.8 Soft Event 0 Trigger Acknowledgment D1003.9 Soft Event 1 Trigger Acknowledgment 24 CONTENTS IN DATA BLOCKS Classification Status Device Control details (Application) D1003.A Soft Event 2 Trigger Acknowledgment D1003.B Soft Event 3 Trigger Acknowledgment D1003.C Soft Event 4 Trigger Acknowledgment D1003.D Soft Event 5 Trigger Acknowledgment D1003.E Soft Event 6 Trigger Acknowledgment D1003.F Soft Event 7 Trigger Acknowledgment Supplement Device assignment (Input block, Output block, Command, and Command result) Classification Device Control details (Application) D1005 Job Load ID D1006 User Data Length Input block User Data D1009 Output block Loaded Job ID D1011 Image Import ID D1012 Inspection Result ID D1013 Image Inspection Result Code D1014 Inspection Result String Length Inspection Result D1021 Command 25 been specified with the format output data and is to be output from the vision commands to be sent to the vision system. Result Code D1126 Result String Word Length D1127 D1224 "-1" is stored when no Job ID exists. These devices store native mode Command String D1125 to data and is to be input to the vision String Word Length D1124 Command Result been specified with the format input system. D1026 to This device stores the user data length. These devices store the data that has D1015 D1025 be loaded. system. D1010 to This device stores an ID of the job to These devices store the data that has D1007 to Supplement Command Result String APPENDIX Other Control Methods To control the vision system from the programmable controller, the following methods are provided in addition to the SLMP scanner that controls the system by turning on and off bits. Use the following methods to eliminate the trigger delay due to polling. (1) External trigger + SLMP The output of the programmable controller and the trigger input of the vision system are directly connected, the trigger is executed, and then inspection results are output using SLMP. The trigger delay due to polling does not occur because the vision system does not perform polling to the programmable controller. (2) Control command + SLMP The programmable controller sends control commands (Trigger commands) to the vision system via Ethernet and outputs inspection results using SLMP. The trigger delay due to polling does not occur because the vision system does not perform polling to the programmable controller. Since only Ethernet cables are required for the connection, the system configuration can be simplified. Ethernet is a registered trademark of Xerox Corporation in the United States. Cognex and In-Sight are registered trademarks of Cognex Corporation. All other company names and product names in this document are the trademarks or registered trademarks of the respective company. 26 Vision System Connection Guide (COGNEX SLMP Connection) Mitsubishi Electric Corporation Nagoya Works is a factory certified for ISO14001 (standards for environmental management systems) and ISO9001(standards forquality assurance management systems) SH(NA)081458ENG-A 1410<CDS> New publication, effective Oct. 2014.