05-27-2024, 11:49 AM (This post was last modified: 07-30-2024, 09:16 AM by Albert.)
To anyone interested
I encountered a problem when parsing the .gcode file with Gcode.
For example, if I input a .gcode file with the command 'M104 T0 S260'. This command means to heat the hot end of the printer 0 to 260 degrees Celsius. However, the program generated by RoboDK will contain three instructions: 'Call M_RunCode(104)', 'Call SetRPM(260)', and 'SetTool(0)'. I don't know if there is a problem with my settings or something else. I will attach my .rdk and .gcode files. Besides, due to the limit of file type, I changed the file suffix to .nc.
What would you expect to see?
For the advice, this is not a CNC with a subset of gcodes built in. I use M to call different sub programs that will run a spindle, start welding or set a trigger for temperature.
For M_command 'M104 T0 S260', I hope that it can be interpreted as 'Call M_RunCode(104 T0 S260)' with 'Call M_RunCode(%2)'.
Extra instructions can lead to misunderstandings. For example, in the .gcode file I attached, I will first activate Tool_0 using 'SetTool (0)' generated by the 'T0' command in line 14 of the .gcode file, and then set the temperature of Tool_1 with the command 'M104 T1 S260'. However, the additional command 'SetTool(1)' generated by RoboDK based on 'M104 T1 S260' will cause me to activate Tool_1 incorrectly.
In short, each line of instruction is a separate instruction and does not require further analysis.
(06-03-2024, 07:52 AM)Zhang Guoquan Wrote: Thank you for your reply!
For M_command 'M104 T0 S260', I hope that it can be interpreted as 'Call M_RunCode(104 T0 S260)' with 'Call M_RunCode(%2)'.
Extra instructions can lead to misunderstandings. For example, in the .gcode file I attached, I will first activate Tool_0 using 'SetTool (0)' generated by the 'T0' command in line 14 of the .gcode file, and then set the temperature of Tool_1 with the command 'M104 T1 S260'. However, the additional command 'SetTool(1)' generated by RoboDK based on 'M104 T1 S260' will cause me to activate Tool_1 incorrectly.
In short, each line of instruction is a separate instruction and does not require further analysis.
Well, the way I solved this was to post out everything NOT in gcode, as M code from whatever program I use.
In the Program Event window I change to M%1 as you can see. I use subprograms named; lets say M104. Inside M104(not the mcode but program) I would write T1 S260.
This is my solution of "not bothering to properly setup my robots", but as we change our setups quite alot ( as in prototyping) I do not bother fixing everything more than I have to and it works very well as robots do not care if I call my programs for M***
I agree with you. In my case, the one instruction I need is T0/1. Temperature settings and head-changing movements can be built into the T0/1 subprogram. So I delete some unnecessary code in advance, like M104. However, the initial .gcode files are generated by widely used commercial software, which conforms to the common 3DP standard. Although we can circumvent this problem through some not-so-difficult means, I believe that it can be solved by RoboDk officials from the source.