
Therefore, as only bit 3 in the two bytes above are true, then: If #j=10 and #k = 8, then #i would equal 8 Looking at the Fanuc example #i=#j AND #k further, its not an example of a BOOLEAN expression, but a bit-wise comparison of #j and #k. Whenever I have time, I will repeat the experiments and report back.


Therefore, these cannot be stored in a variable. I had done some experiments 10 years back to conclude that logical TRUE/FALSE are not equivalent to arithmetic 1/0. It's possible that I'm still bothering you I thank you once again for helping me better understand writting of macro. It is true that this can be problematic, I will replace them with volatile variables as you advise me I wrote a subroutine that will set the variables = EMPTY after the end of the comparison sub program. You had already warned me of volatile and nonvolatile variables at the very beginning of this thread.

Or any other Local Variable that will have no conflict within the Local Scope. Notwithstanding their use in the program, any one of those Local Variables could be used as follows: In the scope of your O9001 program example in a previous Post, Local Variables #1, #2 and #3 have been used (their values have not been set in the O9001 program, therefore, they must have been passed a value as an argument by the Calling Command Block). Taken in the context of the program in which it appears, the following example only requires a Variable of Local Scope. Scope when one having Local Scope will suffice, is poor programming practice. Irrespective of the Programming Language being used, using a Variable that has a Global Accordingly, care should be taken when using a #500 Series Variable in a new program, that its not being used by another Macro Program where having its value altered may have an adverse effect on the program's operation.

The Nonvolatile attribute means that the value registered is not affected by Reset, or by the power to the control being cycled. #500 Series Variables are what is referred to as Common, Nonvolatile Variables, meaning that their scope is Global (when used and their value changed in any one Macro Program, their registered value is updated in all other Macro Programs using the same Variable - that is the basic definition for Common).
