Page 1 of 1

Issue with Getcurrentgcodelinenumber()

PostPosted: Wed Sep 27, 2023 2:39 pm
by kig23
Hi,
i'm using in plugin the method Getcurrentgcodelinenumber(), but returns 0 when there is a gcode file loaded and the line number DRO shows not 0. I tested with version 1.2113 and 1.2115 with realy simple code that handles button press and should display the line number using Getcurrentgcodelinenumber(), but the method returns 0. Am i missing something?

Re: Issue with Getcurrentgcodelinenumber()

PostPosted: Fri Sep 29, 2023 10:17 am
by kig23
Thanks. No need to replay. Solved

Re: Issue with Getcurrentgcodelinenumber()

PostPosted: Fri Sep 29, 2023 3:10 pm
by tau
what was the problem?!

Re: Issue with Getcurrentgcodelinenumber()

PostPosted: Fri Sep 29, 2023 4:14 pm
by kig23
Hi tau,
when you load gcode file and without start it scroll the gcode to go to certain line and execute Getcurrentgcodelinenumber (), the function will return 0 instead of the number writen in gcode line dro. But if you start the gcode and then stop it the function returns the correct value (the line that the gcode was stoped). I suppose the function works that way by design.

Re: Issue with Getcurrentgcodelinenumber()

PostPosted: Fri Sep 29, 2023 8:01 pm
by cncdrive
Yes, it works that way by design.
Or you can press the run from here after scrolling the code if you don't want to start the code.