motion.program-line issue

  • snujcnc
  • snujcnc's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
07 Sep 2016 17:03 #80136 by snujcnc
motion.program-line issue was created by snujcnc
I am looking for motion.program-line
came to out when program is running
i can get s32 out for use

i checked when non moving code came in program like
g40 g41 g42 m7 m8 m9 m100 to m199 g43 g49
line number doesn't updates
it only updates when any motion block came in program
like g0 x100

is there any perfect location from where i can get exact line number updated

i want to use line number for my application

i also face problem when i make some o-call in program that time cursor stuck on called o-call program but line number updated which is actually line number from o-subroutine

when subroutine ends line number come back to running program and it updates again

so it is very difficult to keep exact line number updated

seeking help for this issue

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar
  • Away
  • Moderator
  • Moderator
More
08 Sep 2016 19:47 #80243 by andypugh
Replied by andypugh on topic motion.program-line issue
There is no easy way round this.
Can you explain what you are trying to do? There might be another way.

Please Log in or Create an account to join the conversation.

  • snujcnc
  • snujcnc's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
09 Sep 2016 03:22 #80252 by snujcnc
Replied by snujcnc on topic motion.program-line issue
I make my own axis.py code
And I am using features of line number

When program running I want to show focus on exact line number which is running like customize m code standard m codes g code which doesn't use for axis motion ..like g94 g95

When program running in auto mode my focus behave like in bellow example is very strange

G90
M120(my customized m code)
G54
G40
Go x100

....

M30

When I start program
I get motion.program-line s32 value for line number 4 directly first three line value is not updated
So I am not able to keep focus on my current running line

And it creat confusions when long program is running

.....
I am also looking for solution for related problem issue with line number

Some time I need single block type feature to use for setup new part on machine and I am not able to use direct use of single block pin .....I tried many ways but no success

When I pun machine in single block and start auto program and above example type program is running when I pres first tyme cycle start focus on line number is not changed after three time cycle start pressed focus direct jump to line number 4 because I only get update for direct line number 4 from motion.program-line ...
And I want current line number to be focused on screen when single block feature I use (step)

.....
Similar issue I faced when I use bellow example type program

G54
G90
O12 call
G95
G0x100
...
M30

In above example my focus on current line number is behave very strange
Because first who line no line number is updated and in o12 call subroutine if I written 10 line program and if all 10 line is
Programmed for axis motion g0x100 etc I get line number from o12 call from start and when o12 call line number 4 came in execution my main program line number show focus on line number four
Which is currently line number four of o12 call
So it confuse me....and my it creat accident specially when we try to setup new component on machine

I hope you understand my issue
Because my English is not so good please tolerate ....

Please ask me if case of any doubt

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar
  • Away
  • Moderator
  • Moderator
More
12 Sep 2016 10:51 #80355 by andypugh
Replied by andypugh on topic motion.program-line issue
Let me explain why this is harder than it looks.

The G-code interprete reads through the G-code file and converts the G-code to simple movements (called canonical commands).
You can see all these canonical commands here, along with a description of what each one does:
github.com/LinuxCNC/linuxcnc/blob/master...mc/nml_intf/canon.hh
These commands are put into the real-time motion queue where they are in-turn converted to machine motions.

The G-code interpreter will often have reached the end of the G-code file and have filled the motion queue with commands before the tool even touches the work on the first cut. So the code that reads the file is of no use at all for updating the line number.

If you look you will see that some of them (like STRAIGHT_FEED) have "lineno" as their first parameter. The HAL pin motion.program-line is updated in the realtime layer when those commands are run. Sometimes many canonical commands will share the same line number, for example in the case of a canned cycle. This is why only some G-code commands update the line-number in Axis.

Even if there was a lineno parameter on every single pin, you _still_ wouldn't be able to reliably read the motion.program-line pin. This is because HAL updates once per milisecond (for motion pins) and and many canonical commands take almost no time at all to complete.Things like spindle-on and coolant off will take only microseconds at most to execute.

Please Log in or Create an account to join the conversation.

  • snujcnc
  • snujcnc's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 Sep 2016 11:03 #80356 by snujcnc
Replied by snujcnc on topic motion.program-line issue
you are right
i understand what you say
is there any other way to come out of this situation?

as you explained we try to identify this issue before one year but we also come to same conclusion
which you described .

anyway thanks for brief explanations ......

thanks

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar
  • Away
  • Moderator
  • Moderator
More
12 Sep 2016 11:07 #80357 by andypugh
Replied by andypugh on topic motion.program-line issue

is there any other way to come out of this situation?


What problem does the current situation cause for you? Some program lines take zero time to execute, you may just have to accept that.

Please Log in or Create an account to join the conversation.

  • snujcnc
  • snujcnc's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 Sep 2016 12:26 #80359 by snujcnc
Replied by snujcnc on topic motion.program-line issue
i personally don't have any issue
but when i ask my operators to run machine they ask me for this issue
but its fine to run linuxcnc with this issue

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar
  • Away
  • Moderator
  • Moderator
More
12 Sep 2016 12:30 #80360 by andypugh
Replied by andypugh on topic motion.program-line issue

but when i ask my operators to run machine they ask me for this issue

Just tell them that those lines take zero time for the machine to execute them, and that is why they don't see the highlight.

Please Log in or Create an account to join the conversation.

  • snujcnc
  • snujcnc's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 Sep 2016 12:41 #80361 by snujcnc
Replied by snujcnc on topic motion.program-line issue
:)

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum