Reading value of pin in g code
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23279
- Thank you received: 4933
27 Mar 2017 13:30 #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 or Create an account to join the conversation.
- Sjdc1982
-
- Offline
- New Member
-
Less
More
- Posts: 11
- Thank you received: 3
27 Mar 2017 21:06 #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 or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23279
- Thank you received: 4933
27 Mar 2017 21:47 #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 or Create an account to join the conversation.
- Sjdc1982
-
- Offline
- New Member
-
Less
More
- Posts: 11
- Thank you received: 3
27 Mar 2017 22:35 #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 or Create an account to join the conversation.
- Radek
- Offline
- Junior Member
-
Less
More
- Posts: 27
- Thank you received: 0
28 Mar 2017 07:07 - 28 Mar 2017 07:19 #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
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 ?
Last edit: 28 Mar 2017 07:19 by Radek.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23279
- Thank you received: 4933
28 Mar 2017 09:04 #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 or Create an account to join the conversation.
- Radek
- Offline
- Junior Member
-
Less
More
- Posts: 27
- Thank you received: 0
28 Mar 2017 09:34 - 28 Mar 2017 09:36 #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.
Last edit: 28 Mar 2017 09:36 by Radek.
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 23279
- Thank you received: 4933
28 Mar 2017 10:06 #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 or Create an account to join the conversation.
- Radek
- Offline
- Junior Member
-
Less
More
- Posts: 27
- Thank you received: 0
28 Mar 2017 10:16 - 28 Mar 2017 10:57 #90427
by Radek
Replied by Radek on topic Reading value of pin in g code
Last edit: 28 Mar 2017 10:57 by Radek.
Please Log in or Create an account to join the conversation.
- Radek
- Offline
- Junior Member
-
Less
More
- Posts: 27
- Thank you received: 0
28 Mar 2017 11:22 #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...
Please Log in or Create an account to join the conversation.
Time to create page: 0.138 seconds