Author Topic: Error message for '#' symbol  (Read 2127 times)

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2383
    • View Profile
Error message for '#' symbol
« on: July 26, 2019, 11:10:39 am »
I am using a modified PP for generating code to do fine thread tapping with CB and Mach3. (Basically peck drilling is replaced with calling a Mach3 macro.)
I use MOP header function to set some Mach3 variables in the G-code - thread pitch, rotation speed, depth from which the macro calculates the actual turns the tap must do and sets the speed.
However I am getting status messages "Unexpected token '#' at line xxx".
The code is generated correctly and the header is inserted into it. Simply CB does not recognize the '#' symbol.
Maybe in future releases this could be corrected.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Error message for '#' symbol
« Reply #1 on: July 26, 2019, 12:14:43 pm »
DF,
All you have shown us is that you're getting the error you said you were getting.

Without the macro code, I doubt we'll be able to help more than just to say, "Yep! There's the error!"

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2383
    • View Profile
Re: Error message for '#' symbol
« Reply #2 on: July 27, 2019, 09:34:32 am »
Lloyd, either I didn't explain it clear enough, or you didn't read carefully.
I have no problem posting the macro but it is a Mach3 macro and has nothing to do with CB.
The '#' (hash) symbol is used to define a variable in G-code. So when I prepare a MOP I write a MOP header containing
#501 = 0.35 (thread pitch)
#502 = -5 (depth)
#503 = 10000 (speed in deg/min)
CamBam includes those lines in the generated G-code (giving a warning about the '#' symbol).
The macro, when called from the G-code, reads those values and calculates the actual turns the tap must do to reach the set depth.
I repeat. The code runs fine. There are only warning messages about unexpected token and only when the actual code is generated - written to a file. On tool path generation there are no warning messages.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8360
    • View Profile
Re: Error message for '#' symbol
« Reply #3 on: July 27, 2019, 12:24:59 pm »
Ah... OK... I did misunderstand, although upon re-reading your post, it seems you described it adequately.

Yeah... one of those irritating 'cosmetic' bugs.  It should be fixed.

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4565
    • View Profile
Re: Error message for '#' symbol
« Reply #4 on: July 27, 2019, 14:19:32 pm »
I don't think there is anything to correct in CamBam, it's just informing the user that an unexpected symbol was found but it still went on to generate the code.

It looks to me like a 'sanity check' regarding the text entered in 'MOP Header' so that you don't go on to cause a problem at the cutting stage.
Made in England

Offline Dragonfly

  • CNC Jedi
  • *****
  • Posts: 2383
    • View Profile
Re: Error message for '#' symbol
« Reply #5 on: July 27, 2019, 19:24:12 pm »
That's right, Eddy. Because the warning appears only on actual file generation it's almost certain  CB does a sanity check.
I don't know how it works internally but if it is a range of allowed symbols the '#' can be added as it is used in real world G code text.
Either way, as long as the user header is included correctly, not a big problem. Just an observation from me.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6209
    • View Profile
    • Cambam V1.0 French Doc
Re: Error message for '#' symbol
« Reply #6 on: July 27, 2019, 20:17:58 pm »
Hello

Quote
Simply CB does not recognize the '#' symbol.

same for the '=' .... (but the warning appears only for the first "wrong" char so it do not appears with the # before)

++
David