background image

 

35 

 

6.2.

 

Switching Scenes on the Vision Sensor 

For a processing to switch scenes on the Vision Sensor, follow the procedures below. 

Set a scene number for the switching destination to a variable.   

'(1) Change the scene of the FH 

 '   You have to select a scene No. for your application. 

  fh_sceneno_input = 0  

 

Set the variables as arguments to the scene switching command execution 
sample function (fhsample_chgscn) to the Vision Sensor and execute it. 
 

 CallProc fhsample_chgscn(fh_sceneno_input) 

 'Error check 

 If fh_err_number <> fh_success  

  GoTo *CLOSE_SAMPLE 

 ENDIF      

 

 

 

6.3.

 

Moving Robot to Robot Image Position 

For a processing to move the robot to the robot image position, follow the procedures 
below. 

Move the robot to the imaging 
position. 
 
 
 
Check the current robot 
position (Precautions unit of 
the Rotation Vector). 

 

Set the referenced imaging position to the variables. 

'(2) Move the robot to the imaging position 

 '   You have to configure the following robot position for your application. 

 

 fh_move_position[1] = 0       'std_img_pos_x 

 fh_move_position[2] = -240    'std_img_pos_y 

 fh_move_position[3]  =  600     'std_img_pos_z 

 fh_move_position[4] = -180    'std_img_pos_w 

 fh_move_position[5] = 0        'std_img_pos_p 

 fh_move_position[6]  =  90       'std_img_pos_r 

 

 

 

Scene number 

Scene switching command execution sample function 

Set the robot imaging position to the variables. 

Summary of Contents for Vision Sensor FH Series

Page 1: ...Robot Connection Guide NACHI FUJIKOSHI CORP Edition Vision Sensor FH Series Vision System Z464 E1 01 ...

Page 2: ... trademarks of OMRON Corporation in Japan and other countries for OMRON factory automation products This software is based in part on the work of the Independent JPEG Group Microsoft Windows Windows Vista Excel and Visual Basic are either registered trademarks or trademarks of Microsoft Corporation in the United States and other countries Intel Core and Pentium are trademarks of Intel Corporation ...

Page 3: ... 16 2 1 Cautions for Robot Equipment 16 2 2 When using Vision Sensor FH Series 3D Vision Sensor 16 3 Connecting Vision Sensor to Robot Controller 18 3 1 Setting Communications for Robot Controller 19 3 2 Connecting and Checking Vision Sensor and Robot Controller 21 3 3 Verify Commands Sent Received 23 4 Coordinate System 27 4 1 Name of Coordinate System 27 5 How to Start the Setup Program 29 6 Des...

Page 4: ... Measurement Results 38 6 7 Moving Robot to Robot Approach Position at Measurement 39 6 8 Moving Robot to Robot Command Position at Measurement 41 6 9 Disconnecting Vision Sensor from Robot Controller 41 7 Function Reference 42 7 1 List of Functions 42 7 2 Error Message 42 7 3 List of global variables 42 7 4 Function Details 44 ...

Page 5: ...on that is necessary to use the FH Series Please read this manual and make sure you understand the functionality and performance of the FH Series before you attempt to use it in a control system Keep this manual in a safe place where it will be available for reference during operation ...

Page 6: ...chase price of the non complying Product provided that in no event shall Omron be responsible for warranty repair indemnity or any other claims or expenses regarding the Products unless Omron s analysis confirms that the Products were properly handled stored installed and maintained and not subject to contamination abuse misuse or inappropriate modification Return of any Products by Buyer must be ...

Page 7: ...oducts Omron Companies shall not be responsible for the user s programming of a programmable Product or any consequence thereof Disclaimers Performance Data Data presented in Omron Company websites catalogs and other materials is provided as a guide for the user in determining suitability and does not constitute a warranty It may represent the result of Omron s test conditions and the user must co...

Page 8: ...6 Safety Precautions For details on Safety Precautions refer to Safety Precautions in the Vision System FH Series 3D Robot Vision Application Construction Guide Cat No Z446 ...

Page 9: ...7 Waring For details on Waring refer to Waring in the Vision System FH Series 3D Robot Vision Application Construction Guide Cat No Z446 ...

Page 10: ...8 Precautions for Safe Use For details on Precautions for Safe Use refer to Precautions for Safe Use in the Vision System FH Series 3D Robot Vision Application Construction Guide Cat No Z446 ...

Page 11: ...9 Precautions for Correct Use For details on Precautions for Correct Use refer to Precautions for Correct Use in the Vision System FH Series 3D Robot Vision Application Construction Guide Cat No Z446 ...

Page 12: ...10 Regulations and Standards For details on Regulations and Standards refer to Regulations and Standards in the Vision System FH Series 3D Robot Vision Application Construction Guide Cat No Z446 ...

Page 13: ...RUCTION MANUAL SETUP MANUAL TCFEN 159 MZ07 01 CFD controller When User want to know how to setup the robot Describes basic operations setup and programming of the robot CFD CFDL CONTROLLER INSTRUCTION MANUAL BASIC OPERATIONS MANUAL TCFEN 160 CFD MZ07 01 When User want to know how to operate the robot Describes basic operations of the robot by teach pendant FD CONTROLLER INSTRUCTION MANUAL Robot la...

Page 14: ...12 ...

Page 15: ... History A manual revision code appears as a suffix to the catalog number on the front and back covers of the manual Revision code Rev Code Rev Date Revision Contents 01 Dec 2021 Original product Cat No Z464 E1 01 ...

Page 16: ...Instructions for Building a 3D Robot Vision Application Please follow the flow below for constructing 3D robot vision applications Procedure Reference Creating Data Set for Robot Vision 3D Robot Vision Application Construction Guide Chapter 6 System Settings for Vision Sensors 3D Robot Vision Application Construction Guide Chapter 7 Setting Communications for Robot controller Refer to Chapter 3 1 ...

Page 17: ...Sensor Sample Program fhsample_main This program is a sample of the basic program flow for a pick application In this program the robot gives control instructions to the Vision Sensor The program consists of the following functions Connecting to the Vision Sensor Scene switching of the Vision Sensor Moving to the measurement position Registering the current robot position to the Vision Sensor Exec...

Page 18: ...er 6 40 or later Controllers other than FH 5050 are not supported 3D Camera OMRON 3D Vision Sensor FH SMDA GS050B Camera Cable OMRON Ethernet cable super bending resistance FHV VNBX M FHV VNLBX M Camera I O cable OMRON I O cable super bending resistance FH VSDX BX M FH VSDX LBX M Calibration target OMRON Handeye Calibration Target FH XCAL R OMRON Camera Calibration Target FH XCAL S Switching Hub R...

Page 19: ... for 3D robot vision Ver 1 30 or later Please contact us for how to obtain it Switching Hub OMRON Switching Hub for industrial W4S1 Recommended product USB memory OMRON USB memory FZ MEM8G Recommended product Precautions for Correct Use Do not use any device except mentioned above for each device of the system configuration Additional Information This manual does not provide operations installatio...

Page 20: ... 1 Setting communications for the robot controller Modify the default IP address of the robot controller with the teaching pendant to fit the communication settings in the Vision Sensor 3 2 Verifying Ethernet Communication Check the connection status of Ethernet using PING command 3 3 Verify Commands Sent Received Run a robot program for startup to establish the TCP IP connection between the Visio...

Page 21: ...2 Copy a robot program outputted from the data all of three set output tool to the USB memory stick Change the source code in MZ07 01 A 990 routine based on the actual installation environment Initial setting values of communication are as follows IP address 4th octet 100 Port number 9876 Change the file name of source code MZ07 01 A 990 based on the actual mechanism environment Set network parame...

Page 22: ...ct File 1 File Copy and press Enter on the teaching pendant Select the robot program all of three which copied from the USB memory to WORK PROGRAM Additional Information This manual does not provide operation installation and wiring methods for each device For details refer to manuals noted in Related Manuals ...

Page 23: ... Vision Sensor Move the mouse cursor to lower left of the window to display Start Select Start All Programs Accessories Command Prompt to launch Command Prompt 2 Operation of the Vision Sensor Execute PING command to the IP address of the robot controller 3 Operation of the Vision Sensor When 32 byte data could be successfully sent received four times as shown in the figure on the right that means...

Page 24: ...ernet is correctly done When 32 byte data cannot be sent received four times and PING command timed out check whether the robot controller is turned on the wiring was correctly done or communication settings are correct ...

Page 25: ... name Set network parameter fh_ip_address 100 fh_port_no 9876 fh_retries_connect 2 fh_timeout_connect 4 Set the user task do nothing fh_usertaskfunc_no 0 Start User Task FORKMCR 990 10000 CallProc fhsetup_main CallProc fhsample_main CallProc fhsample_calaos 2 Operation of the Teaching pendant Press Service Utilities Select 9 Program conversion 8 Language and press Enter on the teaching pendant Sel...

Page 26: ...Priority of function Change the operator qualification to EXPERT 5 Set the length of TOOL32 it is used as the flange coordinate Operation of the Teaching pendant Select Constant Setting 3 Machine Constants 1 Tool Constants Align the cursor with the desired position input a number such as 1 and then press the Enter key Set the length x y and z as 0 0 Upon completion of the settings press the Comple...

Page 27: ...Operation of the Teaching pendant and the Vision Sensor As shown on the right when Get is clicked on the Main Window of the Vision Sensor and the current position Monitor2 3 Axis Position of the robot on the teaching pendant is displayed at the same position on the Main Window of the Vision Sensor commands have been successfully sent and received between the devices Robot Controller operate panel ...

Page 28: ... Teaching Pendant 9 Operation of the Teaching pendant The connection between the Vision Sensor and the robot controller was completed successfully Stop the playback operation of the program by press ENABLE STOP Select the status of user task 990 in User Task Monitor press ENABLE OFF to stop the user task Additional Information This manual does not provide operation installation and wiring methods ...

Page 29: ...obot base as the origin Local Coordinate System User defined coordinate system Flange Coordinate system Coordinate system defined on the flange surface of the robot Tool Coordinate System The coordinate system is defined in the tool center point by offsetting the origin of the flange coordinates system Camera Coordinate System With the optical center of the camera as the starting point the X and Y...

Page 30: ...instruction manual for each robot There are the following differences between the names of the coordinate system in the Vision Sensor and the coordinate system in NACHI FUJIKOSHI CORP Vision Sensor NACHI FUJIKOSHI CORP Local Coordinate System User Coordinate System Tool Coordinate System Tool Coordinate System ...

Page 31: ...to be executed Modify the function name Set the user task do nothing fh_usertaskfunc_no 0 Start User Task FORKMCR 990 10000 CallProc fhsetup_main CallProc fhsample_main CallProc fhsample_calaos 2 Change the IP Port in source code routine based on the actual installation environment Initial setting values of communication are as follows IP address 4th octet 100 Port number 9876 Set network paramete...

Page 32: ...ect 9 Program conversion 8 Language and press Enter on the teaching pendant Select Source exe as the conversion type Select source code files in Device src Memory PROGRAM and press Enter 4 Confirm the compile file XXXX 01 A 990 and press Execute 5 The same as step 4 to compile the user task USERTASK A 990 ...

Page 33: ...ng the Vision Sensor to the robot controller 6 2 Switching scenes on the Vision Sensor 6 3 Moving the Robot to the Image Position 6 4 Register the Current Robot Position in the Vision Sensor 6 5 Executing Measurements on the Vision Sensor 6 6 Getting the Measurement Results 6 7 Moving the Robot to the Robot Approach Position at Measurement 6 8 Moving the Robot to the Robot Command position at Meas...

Page 34: ... Sensor check that the Output of the current layout is ON If the setting were OFF the Vision Sensor will not output measurement values Connect to the Vision Sensor by user task 990 Set the priority number as 5 in Priority of function when used this user task It is used as the flange coordinate system in sample program with No 32 tool coordinate which was set by Teaching pendant Please set the leng...

Page 35: ...ect 2 fh_timeout_connect 4 4 Start the user task for Connect to FH server Set the user task do nothing fh_usertaskfunc_no 0 Start User Task FORKMCR 990 10000 CallProc fhsample_main 5 Set the variables as coordinate number No 0 as local coordinate Robot coordinate system No 32 as tool coordinate Flange coordinate system Execute the function fhreflectcoord to change the coordinate Set the coordinate...

Page 36: ...ion function fhconnect to the Vision Sensor FH server and execute it 1 Connect to the FH server WHILE fh_bconnected 0 Connect CallProc fhconnect IF fh_err_number fh_success GoTo EXIT_SAMPLE ENDIF ENDW Connection function with the Vision Sensor FH server ...

Page 37: ...6 3 Moving Robot to Robot Image Position For a processing to move the robot to the robot image position follow the procedures below 1 Move the robot to the imaging position Check the current robot position Precautions unit of the Rotation Vector 2 Set the referenced imaging position to the variables 2 Move the robot to the imaging position You have to configure the following robot position for you...

Page 38: ...ng the Emergency stop button can stop its motion anytime 6 4 Register the Current Robot Position in the Vision Sensor To register the current robot position to the Vision Sensor use fhsample_regpos 1 Before executing measurements execute the current position registration command execution function fhsmaple_regpos to the Vision Sensor 3 Register the current position of the robot to the FH before me...

Page 39: ...input_arg 3 fh_cmd_input_arg 4 fh_cmd_input_arg 5 CallProc fhrunsendcmd fh_para_cnt fh_res_string fh_cmd_input_arg 1 5 Error check IF fh_err_number fh_success GoTo CLOSE_SAMPLE EndIF 2 To receive the response to the measurement command from the Vision Sensor execute fhrunrecvres L3 0 Recv Command Response CallProc L3 fhrunrecvres Error check IF fh_err_number fh_success GoTo CLOSE_SAMPLE EndIF Comm...

Page 40: ...Z W P R 1 In order to receive the measurement results from the Vision Sensor we execute fhrunrecvval and check the received overall judgment value Get the Measurement Result CallProc fhrunrecvval Error check IF fh_err_number fh_success GoTo CLOSE_SAMPLE EndIF Total Judge Check IF fh_param 1 1 GoTo CLOSE_SAMPLE EndIF numerical sequence receiving function If the overall judgment is not OK exit the p...

Page 41: ...pproach distance to the workpiece 3 Set the referenced robot approach distance to the variable and add the robot approach distance to the measurement results acquired at step 1 in Chapter 6 6 5 Move the robot to the approach position You have to configure the following robot approach distance for your application L1 30 fh_move_position 1 fh_param 2 fh_move_position 2 fh_param 3 fh_move_position 3 ...

Page 42: ...tion 1 fh_move_position 2 fh_move_position 3 fh_move_p osition 4 fh_move_position 5 fh_move_position 6 Error check IF fh_err_number fh_success GoTo CLOSE_SAMPLE ENDIF WARNING These operations drive the robot Operate the robot in the state whereby pressing the Emergency stop button can stop its motion anytime Robot motion sample function ...

Page 43: ...tor control depart path motion etc CallProc fhsample_move fh_param 2 fh_param 3 fh_param 4 fh_param 5 fh_param 6 fh_param 7 Error check IF fh_err_number fh_success GoTo CLOSE_SAMPLE ENDIF WARNING These operations drive the robot Operate the robot in the state whereby pressing the Emergency stop button can stop its motion anytime 6 9 Disconnecting Vision Sensor from Robot Controller For a processin...

Page 44: ...cedure command to the Vision Sensor Chapter 7 4 8 fhrunrecvres Receive a command response from the Vision Sensor Chapter 7 4 9 fhrunrecvval Receive numerical data from the Vision Sensor Chapter 7 4 10 7 2 Error Message The error message was stored in variables fh_err_message L11 To confirm the error message it will be displayed on the Monitor of the teaching pendant 7 3 List of global variables Se...

Page 45: ...x_socket_no V73 Max of socket number fh_min_socket_no V74 Min of socket number fh_err_scene_no V75 Scene number is out of range fh_err_con_input V76 Parameters of connection is out of range fh_err_recv_input V77 Parameters of receive is out of range fh_err_recv V78 Receive error number fh_err_decode_input V82 Parameters of decode is out of range fh_err_overlimit V83 Set speed is out of range fh_er...

Page 46: ...tax fhdefglobal Parameters None Remarks Define the global variables that are necessary to use the robot application Return Value None Precautions Be sure to call this function before using any other function Example The following example defines a global variable CallProc fhdefglobal ...

Page 47: ...Number 1 to 16 fh_err_number Output Variable Integer Error Number 0 normal Except 0 abnormal Remarks Connects to the Vision Sensor specified in the IP address Port number and socket Number Request a connection every hour specified in the Connection Timeout Time parameter Request a connection as many times as specified in the connection retry count parameter Return an error if the connection fails ...

Page 48: ...out time is over 1900 ERROR fh_connect CREATE_SOCKET 1900 Failed to create socket Precautions Only one Vision Sensor can be connected to the robot controller If you want to connect to another Vision Sensor disconnect from the connected Vision Sensor Example In the following example we will connect to the Vision Sensor with IP address 10 5 5 100 port number 9876 and socket number 1 fh_ip_address 10...

Page 49: ...mal Except 0 abnormal Remarks Disconnects from the socket name of connect to Vision Sensor Return Value Err No Error Message Description 0 normal termination 1901 ERROR fh_close NO_CONNECT 1901 Set the nonconnected socket number Precautions None Example The following example closes the connection to the Vision Sensor connected by fhconnect fh_ip_address 100 fh_port_no 9876 fh_retries_connect 2 fh_...

Page 50: ... the scene number specified in the parameter It returns an error if this command is not connected to the Vision Sensor Return an error is returned if the scene number specified in the parameters is out of the input range Returns an error if a response is received from the Vision Sensor indicating that the scene change command failed Return value Err No Error Message Description 0 normal terminatio...

Page 51: ...49 Example In the following example we will switch to scene 0 fh_sceneno_input 0 CallProc fhsample_chgscn fh_sceneno_input ...

Page 52: ...led while the Vision Sensor is not connected Returns an error if a response of current robot position registration failure is received from the Vision Sensor Return value Err No Error Message Description 0 normal termination 1505 ERROR fhsample_regpos LOCAL_COORDINATE_NO 1505 Out of the range of Local Coordinate ERROR fhsample_regpos TOOL_COORDINATE_NO 1505 Out of the range of Tool Coordinate 1601...

Page 53: ...umber 0 normal Except 0 abnormal Remarks Sends measurement commands to the Vision Sensor Receives the measurement results from the Vision Sensor and get the robot position Returns an error if called while not connected to the Vision Sensor Returns an error if a measurement command failure response is received from the Vision Sensor Returns an error if the Vision Sensor s overall judgment is NG Ret...

Page 54: ...tion Y 1 fh_param 2 Output data 4 Robot command position Z 1 fh_param 3 Output data 5 Robot command position W 1 fh_param 4 Output data 6 Robot command position P 1 fh_param 5 Output data 7 Robot command position R 1 fh_param 6 1 The output data format should be set as follows Data type Number Digits of integer 6 Digits of decimal 4 Example In the following example a measurement command is sent to...

Page 55: ...inates W pos_p Input parameter Single Moving target robot coordinates P pos_r Input parameter Single Moving target robot coordinates R fh_err_number Output Variable Integer Error Number 0 normal Except 0 abnormal Remarks Moves the robot to the position specified by the parameter Returns an error if the target robot position is out of the movement range Return Value Err No Error Message Description...

Page 56: ...ase stop the user task program 990 before you run the robot program Example In the following example Move the robot to the X Y Z W P R 0 240 600 180 0 90 pos_x 0 pos_y 240 pos_z 600 pos_w 180 pos_p 0 pos_r 90 CallProc fhsample_move pos_x pos_y pos_z pos_w pos_p pos_r ...

Page 57: ... to the Vision Sensor cmd_arg 1 parameter1 cmd_arg 2 parameter2 cmd_arg 3 parameter3 cmd_arg 4 parameter4 cmd_arg 5 parameter5 fh_socket_no Input Variable Integer Connected Socket Number 1 to 16 fh_err_number Output Variable Integer Error Number 0 normal Except 0 abnormal Remarks Sends a no procedure command to the Vision Sensor concatenating the parameters according to the following format If the...

Page 58: ...ilure Precautions The length of the string of the no stepping command that can be sent is 127 bytes not including the delimiter Set the parameters of cmd_name and cmd_arg1 to cmd_arg5 so that the length of the string of the no procedure command to be sent does not exceed 127 bytes Example The following example shows how to send the measurement command MEASURE to the Vision Sensor fh_res_string MEA...

Page 59: ... normal Except 0 abnormal Remarks Receive the response command response to the no procedure command sent to the Vision Sensor If the command response is OK a return value is 1 If the command response is not OK a return value is 1 Return Value Err No Error Message Description 0 normal termination 1301 ERROR fh_recv NO_CONNECTION 1301 Calling in the unconnected state ERROR fh_recv NO_DATA 1301 Recei...

Page 60: ...nse is received from the Vision Sensor and if the received command response is not OK 0 the program is terminated CallProc L3 fhrunrecvres IF fh_err_number fh_success GOTO CLOSE_SAMPLE EndIF IF L3 1 GOTO CLOSE_SAMPLE EndIF CLOSE_SAMPLE CallProc fhclose ...

Page 61: ...he double type of the global variable fh_param This function outputs up to 10 values If there are more than 11 numbers this function outputs only the first 10 If the length of the segmented string is longer than 12 bytes this function returns an error of abnormal parameter length Returns an error if the number of numeric data is zero The following is an example of the output when a string is inclu...

Page 62: ...he settings must be as follows Result Output Message Processing Item The destination of the received measurement results Setting Target Setting details Output device IoModule2 Serial Ethernet Termination string r Carriage Return Delimiter string x20 Space Output Data 1 10 numerical data 1 fh_param 1 to fh_param 10 1 The output data format should be set as follows Data type Number Digits of integer...

Page 63: ......

Page 64: ... 60169 U S A Tel 1 847 843 7900 Fax 1 847 843 7787 Regional Headquarters OMRON EUROPE B V Wegalaan 67 69 2132 JD Hoofddorp The Netherlands Tel 31 2356 81 300 Fax 31 2356 81 388 Contact www ia omron com Kyoto JAPAN OMRON ASIA PACIFIC PTE LTD No 438A Alexandra Road 05 05 08 Lobby 2 Alexandra Technopark Singapore 119967 Tel 65 6835 3011 Fax 65 6835 2711 OMRON CHINA CO LTD Room 2211 Bank of China Towe...

Reviews: