One simple gcode expression question.
- pferrick
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 89
- Thank you received: 3
25 Jun 2020 19:35 #172747
by pferrick
One simple gcode expression question. was created by pferrick
I can hardly believe that I'm even asking this, but....why does the following gcode not print a message consisting of '2' :
(MSG, [1+1])
M30
I have tried every permutation of MSG, DEBUG, brackets, parentheses, #, and god-only-knows what else that I can think of, and all I seem to be able to get is the message [1+1]. Basically I cannot get expressions to be evaluated, and it's making me bonkers.
The real pisser is that this is not even close to the actual mystery that I am trying to solve! If someone could point out the painfully obvious I would really appreciate it.
tnx,
Patrick
(MSG, [1+1])
M30
I have tried every permutation of MSG, DEBUG, brackets, parentheses, #, and god-only-knows what else that I can think of, and all I seem to be able to get is the message [1+1]. Basically I cannot get expressions to be evaluated, and it's making me bonkers.
The real pisser is that this is not even close to the actual mystery that I am trying to solve! If someone could point out the painfully obvious I would really appreciate it.
tnx,
Patrick
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
Less
More
- Posts: 405
- Thank you received: 163
25 Jun 2020 19:42 #172748
by MaHa
Replied by MaHa on topic One simple gcode expression question.
If you calculate outside of (debug, ) , as
it will success
#100 = [1 + 1]
(debug, #100)
Please Log in or Create an account to join the conversation.
- pferrick
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 89
- Thank you received: 3
25 Jun 2020 19:58 #172749
by pferrick
Replied by pferrick on topic One simple gcode expression question.
I tried it, and you're right. Thanks. But I wonder why on Earth would debug NOT evaluate expressions?
I guess that's why I couldn't figure it out...it doesn't say anywhere in the gcode reference that expressions are only evaluated OUTSIDE of things like debug, msg etc. which is not what I think anyone would expect.
Patrick
ps1 - I think you meant to say 'it will succeed'.
ps2 - I'm still wrestling with the G38 stuff, although I'm close. I may have another question about that later!!!
I guess that's why I couldn't figure it out...it doesn't say anywhere in the gcode reference that expressions are only evaluated OUTSIDE of things like debug, msg etc. which is not what I think anyone would expect.
Patrick
ps1 - I think you meant to say 'it will succeed'.
ps2 - I'm still wrestling with the G38 stuff, although I'm close. I may have another question about that later!!!
Please Log in or Create an account to join the conversation.
- pferrick
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 89
- Thank you received: 3
25 Jun 2020 20:02 #172750
by pferrick
Replied by pferrick on topic One simple gcode expression question.
Oh, and it doesn't work either way with msg, only with debug. Just to make things even more interesting...!
Patrick
Patrick
Please Log in or Create an account to join the conversation.
- phillc54
- Offline
- Platinum Member
Less
More
- Posts: 5713
- Thank you received: 2089
26 Jun 2020 07:29 #172776
by phillc54
Replied by phillc54 on topic One simple gcode expression question.
I guess that would be possible but it would require a way to determine whether the user meant the characters an expression or if they meant them as text.But I wonder why on Earth would debug NOT evaluate expressions?
I wouldn't expect that expressions would be evaluated in MSG, the the docs do say "The rest of the characters before the right parenthesis are considered to be a message". I read that as meaning "the rest of the characters are text".I guess that's why I couldn't figure it out...it doesn't say anywhere in the gcode reference that expressions are only evaluated OUTSIDE of things like debug, msg etc. which is not what I think anyone would expect.
That seems to be what is stated in the docsOh, and it doesn't work either way with msg, only with debug. Just to make things even more interesting...!
Please Log in or Create an account to join the conversation.
Time to create page: 0.077 seconds