Send GCode via serial line

Hi everybody,

I am working on a computer project and I have to send codes (M105 for example) to my 3D printer.
I work in C Sharp but I have some problems:
Whenever I send a code, I have a response of the type "Resend". I think that what I send should not be correct!

To send the code M105, what to send exactly on the serial port?

serial.WriteLine ("M105"); ??

need checksum, or /n or ....

I am in 115200, n, 8.1

Where can i found a documention on the protocole to use

Please, i really need help.

Thank's for all

Comments

  • http://www.reprap.org/wiki/Gcodes

    shows how it should work.
    Checksum is not required. You can simply use the arduino ide serial monitor for testing with that baud rate.
    Ascii commands have to be terminated by \n or \r\n. The resend comes only if you used line numbers before and that had problems. So with own software only happens if printer does not reset on connect and was in error state when deconnecting.
  • Thank's for your response.

    Now it's ok but i dont no why !!

    Just below my code : (in bold, the instructions associated with "ResetOnConnect" in RepetierHost)

    What is exactly what is the usefulness of these instructions and the ResetOnConnect



    //Port Setings
    _PortCom.BaudRate = 115200;
    _PortCom.Parity = Parity.None;
    _PortCom.DataBits = 8;
    _PortCom.StopBits = StopBits.One;
    _PortCom.PortName = "COM7";


    //if (resetOnConnect == 2)
        _PortCom.DtrEnable = false;
        _PortCom.RtsEnable = false;
    }

    //Open Port
     _PortCom.Open();

    //if (resetOnConnect == 2)
    {
        Thread.Sleep(200);
        _PortCom.DtrEnable = true;
        _PortCom.RtsEnable = true;
        Thread.Sleep(1000);
        _PortCom.DtrEnable = false;
       _PortCom.RtsEnable = false;
    }



    Thank's again.

    Nicolas

  • Reset is always useful as you see - but does not work on all printers. That way you know it is fresh initialized and even if firmware was hanging it starts responding due to reset.
Sign In or Register to comment.