- Posts: 19306
- Thank you received: 0
Reading value of pin in g code
9 years 7 months ago #90367
by andypugh
Replied by andypugh on topic Reading value of pin in g code
It can't be stopping at line 4. It is executing line 8.
Please Log in to join the conversation.
9 years 7 months ago #90393
by Sjdc1982
Replied by Sjdc1982 on topic Reading value of pin in g code
just my two cents
but for me, i noticed when i tried to describe variables or use any of them i need to put them in this format
#<_variable>
or they won't work, IE maybe if you try
#<_4> = 0
(fyi i'm using nightly builds / pre releases as well and installed from the DVD image.)
but for me, i noticed when i tried to describe variables or use any of them i need to put them in this format
#<_variable>
or they won't work, IE maybe if you try
#<_4> = 0
(fyi i'm using nightly builds / pre releases as well and installed from the DVD image.)
Please Log in to join the conversation.
9 years 7 months ago #90399
by andypugh
Replied by andypugh on topic Reading value of pin in g code
LinuxCNC supports two sorts of parameters (what might be called variables in an actual programming language, which G-code probably isn't).
#4 is a conventional mumerical parameter
#<myvariable> is a named parameter, an extension to the G-code standard supported by LinuxCNC
#<_myvariable> is a named paramter with global scope (which means that it has a value which can be used outside of the subroutine it is defined in)
#<4> is a named parameter. It will not necessarily have the same value as #4
#<_4> is another named parameter with global scope. It can have a different value to both #4 and #<4>
#4 is a conventional mumerical parameter
#<myvariable> is a named parameter, an extension to the G-code standard supported by LinuxCNC
#<_myvariable> is a named paramter with global scope (which means that it has a value which can be used outside of the subroutine it is defined in)
#<4> is a named parameter. It will not necessarily have the same value as #4
#<_4> is another named parameter with global scope. It can have a different value to both #4 and #<4>
Please Log in to join the conversation.
9 years 7 months ago #90402
by Sjdc1982
Replied by Sjdc1982 on topic Reading value of pin in g code
and my idea does nothing lol, sorry just spit balling thought it was a issue with values/params not communication inside...
Please Log in to join the conversation.
9 years 7 months ago #90419
by Radek
Yes, you're right. I made a test, just left one if and programme missed this loop. It goes from 8th step to 30th... altough that P11=%Q11=s1 has a high state. What's wrong ?
Replied by Radek on topic Reading value of pin in g code
andypugh wrote: It can't be stopping at line 4. It is executing line 8.
Yes, you're right. I made a test, just left one if and programme missed this loop. It goes from 8th step to 30th... altough that P11=%Q11=s1 has a high state. What's wrong ?
Attachment not found
Please Log in to join the conversation.
9 years 7 months ago #90423
by andypugh
Replied by andypugh on topic Reading value of pin in g code
Can you attach the G-code file, so far we have only seen it as a screen-shot.
Can you have a halmeter look at the actual value of motion.digital-in-11 (and 12, and 13) rather than assuming that the HAL net is working?
Did you increase the number of digital inputs in the loadrt motmod line?
Can you have a halmeter look at the actual value of motion.digital-in-11 (and 12, and 13) rather than assuming that the HAL net is working?
Did you increase the number of digital inputs in the loadrt motmod line?
Please Log in to join the conversation.
9 years 7 months ago #90424
by Radek
Replied by Radek on topic Reading value of pin in g code
Hal meter shows that Q11 etc. is TRUE.
I changed L0 to L3 for some tests.
I changed L0 to L3 for some tests.
Attachment not found
Attachment not found
Attachment not found
Please Log in to join the conversation.
9 years 7 months ago #90426
by andypugh
Replied by andypugh on topic Reading value of pin in g code
Can you insert a (debug, line-no #5399) before each "if" to see what the actual value being used is?
Please Log in to join the conversation.
9 years 7 months ago #90427
by Radek
Replied by Radek on topic Reading value of pin in g code
I saw that when the 4th line is running then one of chosen pins P11,12,13 works correct, but only once and after this i can't do anything.
Attachment not found
Please Log in to join the conversation.
9 years 7 months ago #90429
by Radek
Replied by Radek on topic Reading value of pin in g code
That's how my code looks like at this moment. Loop works ONLY when the last step is running. It means that when line 23, 43, 62 is executed i need to set high state on P11,12 or 13 and then it works...
Attachment not found
Please Log in to join the conversation.
Time to create page: 0.318 seconds
