buildbotics / bbctrl-firmware

Buildbotics CNC Controller Firmware
https://buildbotics.com/
Other
67 stars 26 forks source link

Limit to number of conditional statements on one line? #232

Closed kwince closed 4 years ago

kwince commented 4 years ago

As per Camotics page attached as an image, I test a variable that I pass between a probing program and if all three axis are zeroed:

o1000 if [  [ #5000 eq 0 ] OR [ #<_x_homed>  EQ 0] OR [ #<_y_homed> EQ 0]  OR [ #<_z_homed> EQ 0]  ]
   (msg, MACHINE NOT HOMED using 'zero.nc' program! PROGRAM EXITING!)
     m2
o1000 endif

I get the following error at the o1000 line:

Expected CBRACKET_TOKEN found ID_TOKEN At: /var/lib/bbctrl/upload/notch_and_drill_drawer.nc:336:55

I counted the number of brackets over and over again, and my syntax and it seems correct. Screenshot_20191130-162749

After playing around for awhile, I found that I could test two expressions with OR but at line position 55, it will always fail when adding additional expressions

kwince commented 4 years ago

Line 336 is the line beginning with o1000

I will include that in my big report later today

jcoffland commented 4 years ago

Note, one way to work around this problem is to add more brackets. I.e.

o1000 if [  [ #5000 eq 0 ] OR [ [ #<_x_homed>  EQ 0] OR [ [ #<_y_homed> EQ 0]  OR [ #<_z_homed> EQ 0]  ] ] ]
   (msg, MACHINE NOT HOMED using 'zero.nc' program! PROGRAM EXITING!)
     m2
o1000 endif
jcoffland commented 4 years ago

This has been fixed in v0.4.12-rc21.

kwince commented 4 years ago

Nice work thx 🙃

On Fri, Jan 10, 2020, 1:37 PM Joseph Coffland notifications@github.com wrote:

Closed #232 https://github.com/buildbotics/bbctrl-firmware/issues/232.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/buildbotics/bbctrl-firmware/issues/232?email_source=notifications&email_token=AADFKNYWLJ6T5VJDE6CWJO3Q5DTAXA5CNFSM4JTN4YOKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOV4565IA#event-2939940512, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADFKN6DRWWI2KJSM52SQP3Q5DTAXANCNFSM4JTN4YOA .