13 thoughts on “FANUC Robot RS232 communication

  1. I want to make a project similar to yours, but I have not been able to configure the serial port, since if I change the device it returns to the previous one and does not let me select the “Sensor” one. Could you guide me on this?

    1. Happy to try and help out! I know it can be a bit frustrating, each Fanuc is a bit different so it may be a challenge. Some Serial ports are ‘hard baked’ and can not be changed, but if you try another com port it may let you change its settings and have them save! I think mine was on the 2nd com port. If you use my contact form here, I can email you back and we can chat!
      https://www.djdlabs.com/about/

      1. Tony,
        Thanks for reaching out! I have my comunication code, for the robot and PC on this project thread,
        https://www.djdlabs.com/fanuc-robot-g-code-project/

        The PC side was written in processing, if I remember correctly it is almost identical to arduino. IF not Chat GPT can convert it for you. I have used Arduino for a lot of projects in the past, so let me know if you would like me to try and make some test code to send commands from an arduino to the robot via serial.

        The hardest part is the hand shaking of the data, and doing it quickly. Plus the checksum calculation. Let me know if you have any questions along the way!

        Best of luck with your project! There seems to be very few of us out there doing this.

          1. Would be happy to help! Can I ask what you are trying to do? That may help me with a basic code example. Do you just want the PC program to change a variable on the robots contreoller? OR send a number?

          2. The error you are getting may be related to your COM port, you will need to set this number to match the number of the port on your PC. For example COM1 or COM2… You can check this in the device manager in windows, under com ports. In my code check this line,

            // Setup the serial port for FANUC sensor input. The ‘O’ is of odd parity.
            myPort1 = new Serial(this, “COM3”, 4800, ‘O’, 8, 1);
            //Serial(parent, portName, baudRate, parity, dataBits, stopBits)

            Make sure your COM number is the same as the one in the code, as well as the Baud rate and Parity and Stop bits, those need to match the same number in your fanuc robot com port setup.

            I copied the code you linked the video of here for you to try as well.

            https://www.djdlabs.com/Slideplusserial7.txt

            Let me know what questions you may have!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

×