Fanuc Robot with Cognex camera setup for serial communication 

1      Parts and Software needed

  • Cognex 7050 Camera (any model > 7000 series will work)

Link http://www.cognex.com/products/machine-vision/in-sight-7000-series-integrated-vision-systems/

  • Cognex 7000 series breakout cable

Link Contact Cognex distributor

  • Cognex Insight > v4.0 software

Link http://www.cognex.com/Support/InSight/

  • B&B Electronics 232BSS4 Smart switch (If using more than one camera)

Link http://www.bb-elec.com/Products/Serial-Connectivity/Serial-Data-Tools-Adapters/Serial-Data-Switches.aspx

  • Sola SDP 2-12-100T (Power supply for 12V Serial switch

Link http://www.solahevidutysales.com

  • 232PS 120V to 12VDC power supply (I cut off the supply part and just used the cable and plug directly to the Sola power supply) (black and white is +12VDC).

Link http://www.bb-elec.com/Products/Serial-Connectivity/Serial-Data-Tools-Adapters/Serial-Data-Switches.aspx

  • 2 x DB25 male to male cables that can be cut in half (Or 2x Male to breakout)

Link http://www.amazon.com/C2G-Cables-02665-Cable-Meters/dp/B000051189/ref=sr_1_2?ie=UTF8&qid=1425994874&sr=8-2&keywords=db25+male+to+male

  • 2 x DB9 Female connectors that can be cut in half (Or 2x Female to breakout)

Link http://www.amazon.com/StarTech-6-Feet-Straight-Through-Serial/dp/B00066HP2E/ref=sr_1_3?ie=UTF8&qid=1425994968&sr=8-3&keywords=db9+female+to+female

  • If any modification is needed to change port, The Fanuc OLPC or Roboguide software will be needed. The version of OLPC depends on what version of Robot you have. Contact Fanuc for details.

Link http://www.fanucrobotics.com

2      Installation

  • The .PC file used on the robot are declared for port 3 to read and write with the camera. Port 3 is the DB25 pin plug on the inside of the door on the Rj3 controller. The newer R-30 models do not have a port 3.
  • Save these four .PC files on a Memory card and download to the robot. Do not download switcha & switchb programs if you’re not using a serial switch.

For Instructions on downloading click here 

On Port B, the plug should be terminated as followed or straight through to serial switch.

Robot Port B (R) —– Camera or Serial switch (C)

1(R) ßà Ground

7(R) ßà Ground & 0VDC

2(R) ßà 3(C)

3(R) ßà 2(C)

4(R) ßI) Jumped back to 5 on Robot

5(R) ßI) Jumped back to 4 on Robot

6(R) ßI) Jumped back to 20 on Robot

20(R) ßI) Jumped back to 6 on Robot

From the Cognex breakout cable to the termination with the serial switch, it should be as followed:

Red ßà 24VDC Power supply

Black ßà 0VDC Power supply

Violet ßà Pin 3 on DB9 Connection

Grey ßà Pin 2 on DB9 Connection

3      Setup

3.1     Serial Switch Setup

  • Install the software for the serial smart switch. It can be found on bb-elec.com or with the purchased smart switch itself
  • Using a DB25 to DB9 Cable, hook up your computer to the Serial smart switch
  • Open up the software and follow the instructions prompted

Setting used:

3.2     Cognex Setup

  • In the software Press System, then go down to Add Sensor
  • Once it picks up the Mac address, assign an IP address to the camera and then apply change. It will ask you to manually cycle power after initiating
  • When the camera shows up in the Insight Network, double click it to open the camera
  • Click View, the choose Spreadsheet view if not already
  • Click sensor, serial port settings, then set as followed
  • Open file below by pressing File, Open, then select this program: DELETED (DID NOT WORK)
  • Press File, Save Job as, Select Insight sensor at the bottom of drives list, select the camera you are saving to, then press save. If this step is skipped, you will have no program on the camera
  • To setup image you will need to press F5 when the camera is in the position you want to capture
  • Once the picture looks good you will need to experiment for which tool your application requires. The Job I had you download was for Edge finding
  • The data is put into Cell U79 for the robot to extract, to change what data is put there, you will need to double click the cell right under “Fanuc communication” and then double click where the data is you want to capture. To prevent hang-ups in the Karel code, I point to a cell that is named ErrFree(XXX), then the cell “XXX” is pointing to where I actually have the data I want to pull

3.3     Fanuc Setup

  • On the Robot TP, Press Menu, Setup, Port Init, Port B : P3, Detail
  • Setting should be:

Device: [Host Com}

Speed (Baud Rate): 19,200

Parity bit: [None]

Stop bit [1 bit]

Time out value (sec) [0]

  • Press the select key, create, name new program “YOUR_PROGRAM”
  • Once the program is created, insert blank lines and then put in a “CALL VISIONP3” Karel program
  • At this point, if all the steps above are completed, you can manually run this program. Once it has run, it should take whatever data in Cell U79 on the Cognex software and put the data into R80, R81, and R82
  • If no data is found or robot comes up with an error, see Troubleshooting guide

4      Troubleshooting

On The Fanuc TP, press Menu, User, then press Enter. This will show the troubleshooting codes for the Karel program. Only reference the last code seen.

  1. Un-Initialized data:

Problem -The program was halted and called again with no abort or something faulted it.

Remedy – Press “FCTN”, Press “Enter” or if it comes back, press “Menu”, Select “User” Then see what the last code shown was. Check Serial switch.

  1. Step 1:

Problem- the Camera is not powered up, or the serial cables are not wired correctly. Camera did not take picture and step 1 was last code displayed

Remedy- Correct wiring issue. Might be backwards on pin 2 and 3. Make sure the 0V is grounded.

  1. SW8 Failed:
  2. Problem- Camera is connected but offline.

Remedy- You will need to hook up and turn it online before exiting. If this happened after loss of power, the camera needs to have a startup job selected in the software.

  1. Problem- Camera is online and snapping pictures, but the data is not being fed back.

Remedy – The data is larger than it was setup for, reduce the decimal places for each piece of data in the serial com setup.

  1. Gvu079 Failed:

Problem- The camera failed to extract correct data

Remedy- Check that you set the correct input and output terminators selected in the serial port settings from the Cognex software

  1. Step 4A:

Problem- The data is not correctly formatted as a string the robot can recognize

Remedy- Make sure it looks as followed. To display, double click cell U79 in the Insight spreadsheet

  1. Step 8:

Problem: Everything completed and data was extracted correctly

Remedy- Nothing, Job is complete

needed

  • Cognex 7050 Camera (any model > 7000 series will work)

Link http://www.cognex.com/products/machine-vision/in-sight-7000-series-integrated-vision-systems/

  • Cognex 7000 series breakout cable

Link Contact Cognex distributor

  • Cognex Insight > v4.0 software

Link http://www.cognex.com/Support/InSight/

  • B&B Electronics 232BSS4 Smart switch (If using more than one camera)

Link http://www.bb-elec.com/Products/Serial-Connectivity/Serial-Data-Tools-Adapters/Serial-Data-Switches.aspx

  • Sola SDP 2-12-100T (Power supply for 12V Serial switch

Link http://www.solahevidutysales.com

  • 232PS 120V to 12VDC power supply (I cut off the supply part and just used the cable and plug directly to the Sola power supply) (black and white is +12VDC).

Link http://www.bb-elec.com/Products/Serial-Connectivity/Serial-Data-Tools-Adapters/Serial-Data-Switches.aspx

  • 2 x DB25 male to male cables that can be cut in half (Or 2x Male to breakout)

Link http://www.amazon.com/C2G-Cables-02665-Cable-Meters/dp/B000051189/ref=sr_1_2?ie=UTF8&qid=1425994874&sr=8-2&keywords=db25+male+to+male

  • 2 x DB9 Female connectors that can be cut in half (Or 2x Female to breakout)

Link http://www.amazon.com/StarTech-6-Feet-Straight-Through-Serial/dp/B00066HP2E/ref=sr_1_3?ie=UTF8&qid=1425994968&sr=8-3&keywords=db9+female+to+female

  • If any modification is needed to change port, The Fanuc OLPC or Roboguide software will be needed. The version of OLPC depends on what version of Robot you have. Contact Fanuc for details.

Link http://www.fanucrobotics.com

2      Installation

  • The .PC file used on the robot are declared for port 3 to read and write with the camera. Port 3 is the DB25 pin plug on the inside of the door on the Rj3 controller. The newer R-30 models do not have a port 3.
  • Save these four .PC files on a Memory card and download to the robot. Do not download switcha & switchb programs if you’re not using a serial switch.

For Instructions on downloading click here 

On Port B, the plug should be terminated as followed or straight through to serial switch.

Robot Port B (R) —– Camera or Serial switch (C)

1(R) ßà Ground

7(R) ßà Ground & 0VDC

2(R) ßà 3(C)

3(R) ßà 2(C)

4(R) ßI) Jumped back to 5 on Robot

5(R) ßI) Jumped back to 4 on Robot

6(R) ßI) Jumped back to 20 on Robot

20(R) ßI) Jumped back to 6 on Robot

From the Cognex breakout cable to the termination with the serial switch, it should be as followed:

Red ßà 24VDC Power supply

Black ßà 0VDC Power supply

Violet ßà Pin 3 on DB9 Connection

Grey ßà Pin 2 on DB9 Connection

3      Setup

3.1     Serial Switch Setup

  • Install the software for the serial smart switch. It can be found on bb-elec.com or with the purchased smart switch itself
  • Using a DB25 to DB9 Cable, hook up your computer to the Serial smart switch
  • Open up the software and follow the instructions prompted

Setting used:

3.2     Cognex Setup

  • In the software Press System, then go down to Add Sensor
  • Once it picks up the Mac address, assign an IP address to the camera and then apply change. It will ask you to manually cycle power after initiating
  • When the camera shows up in the Insight Network, double click it to open the camera
  • Click View, the choose Spreadsheet view if not already
  • Click sensor, serial port settings, then set as followed
  • Open file below by pressing File, Open, then select this program: DELETED (DID NOT WORK)
  • Press File, Save Job as, Select Insight sensor at the bottom of drives list, select the camera you are saving to, then press save. If this step is skipped, you will have no program on the camera
  • To setup image you will need to press F5 when the camera is in the position you want to capture
  • Once the picture looks good you will need to experiment for which tool your application requires. The Job I had you download was for Edge finding
  • The data is put into Cell U79 for the robot to extract, to change what data is put there, you will need to double click the cell right under “Fanuc communication” and then double click where the data is you want to capture. To prevent hang-ups in the Karel code, I point to a cell that is named ErrFree(XXX), then the cell “XXX” is pointing to where I actually have the data I want to pull

3.3     Fanuc Setup

  • On the Robot TP, Press Menu, Setup, Port Init, Port B : P3, Detail
  • Setting should be:

Device: [Host Com}

Speed (Baud Rate): 19,200

Parity bit: [None]

Stop bit [1 bit]

Time out value (sec) [0]

  • Press the select key, create, name new program “YOUR_PROGRAM”
  • Once the program is created, insert blank lines and then put in a “CALL VISIONP3” Karel program
  • At this point, if all the steps above are completed, you can manually run this program. Once it has run, it should take whatever data in Cell U79 on the Cognex software and put the data into R80, R81, and R82
  • If no data is found or robot comes up with an error, see Troubleshooting guide

4      Troubleshooting

On The Fanuc TP, press Menu, User, then press Enter. This will show the troubleshooting codes for the Karel program. Only reference the last code seen.

  1. Un-Initialized data:

Problem -The program was halted and called again with no abort or something faulted it.

Remedy – Press “FCTN”, Press “Enter” or if it comes back, press “Menu”, Select “User” Then see what the last code shown was. Check Serial switch.

  1. Step 1:

Problem- the Camera is not powered up, or the serial cables are not wired correctly. Camera did not take picture and step 1 was last code displayed

Remedy- Correct wiring issue. Might be backwards on pin 2 and 3. Make sure the 0V is grounded.

  1. SW8 Failed:
  2. Problem- Camera is connected but offline.

Remedy- You will need to hook up and turn it online before exiting. If this happened after loss of power, the camera needs to have a startup job selected in the software.

  1. Problem- Camera is online and snapping pictures, but the data is not being fed back.

Remedy – The data is larger than it was setup for, reduce the decimal places for each piece of data in the serial com setup.

  1. Gvu079 Failed:

Problem- The camera failed to extract correct data

Remedy- Check that you set the correct input and output terminators selected in the serial port settings from the Cognex software

  1. Step 4A:

Problem- The data is not correctly formatted as a string the robot can recognize

Remedy- Make sure it looks as followed. To display, double click cell U79 in the Insight spreadsheet

  1. Step 8:

Problem: Everything completed and data was extracted correctly

Remedy- Nothing, Job is complete

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s