Sending GCODE to com port
Hello Java programmers,
My name is Pascal Jacobs , I'm 20 years old (today birthday haha) and for my internship I have to prove a concept wich is based on controlling a robot. The first concepts are already proved and some parts rest confidentiality.
The first step was to prove if I was able to get the exact coordinates from a sensor wich is based on IR lights. The next step was the format them into GCODE so a CNC machine can read this and moves the that specific position. The CNC machine is using a mantis interface board. If sending a single Gcode to the interface it will move.
Now my problem is, sending a single Gcode. Using the arduino seriele monitor to send a single Gcode, it works great. When I use my program to send a single string, the CNC doesnt move. I know what the problem is, but searching for the right answer is very hard. So I hope you people could help me out with it.
The way outputStream.write(messageString.getBytes()); is sending data might be in the wrong format. Does anybody know what can send a string in probably ASCII? Getbytes is formating them into bytes like: [B@5ac2480b but has to be exact the string.
messageString = "G0 X20 Y20" . This is a direct command for the CNC machine
I hope its a bit clear. My english is very blurry:).
Thanks in advance.