Hi,
I'm trying to implement software to simulate Fanuc macro B. I read many Fanuc documentation however none gave much information about constructing valid conditional expressions in formal way. Can anybody who has access to Fanuc controller check if expressions such are valid?
IF [#2 - #3 GT 5 * #4] GOTO 1
IF [#2 - #3 GT 5 ] GOTO 1
IF [ #3 GT 5 * #4] GOTO 1
I know that if the 1st expression is written as [[#2 - #3] GT [5 * #4]] it would sure be valid. I'm asking just in attempt to decipher the underlying format rules which Fanuc keeps as top secret!
In my limited macro-b experience, Fanuc is very particular on syntax, especially the proper use of brackets. I don't think your non-bracketed examples would be allowed by the control. Personally, if I was writing an interpreter or simulator I'd enforce strict syntax so when the program is moved to the machine it is guaranteed to run.
Do you have a copy of the book Fanuc CNC Custom Macros by Peter Smid?
Thanks for the response and advice. I have Smid's book and a few others however I can't find a source that documents the syntax precisely like programming languages' docs. Fanuc docs lacks a lot of detail about macro programming. For example how AND, OR, XOR deal with negative arguments or argument that is bigger than can be fit in 32-bit integer..etc