Originally Posted by
angelw
Hi Mike,
You will have to post what you have in your current Sub Program so I and the Forum can see what the Indexer requires, but basically, you would just output the Angle data as a Local Variable #1, if the "A" address is used for the passed argument.
What is M54, is that the M code for indexing? If M54 is used in the Macro program, you will also be able to use it to Call the Macro program. You create an "M" code to call a Macro Program by registering the numeric value of the "M" code in a parameter that corresponds to a particular program number. For example, if the number "54" is registered in parameter 6080 of a late model control such as a 21, or late O series control, then Program O9020 will be called when M54 is commanded, either via MDI or in a program. However, if M54 is executed in a Macro Program called by M54, or any other "M" code, then its treated as a normal "M" code in the Macro program. I'm fairly sure that the parameters are the same for your control, but you can confirm this via the Fanuc Operator manual for your machine in the Macro Programming section.
For the sake of the explanation, lets say that the parameters for registering "M" codes to call Macro Programs is the same as stated above. If "54" is registered in parameter 6080, and "A" is the address character used to pass the angle argument, then the Call Block used each time an index is required will be as follows:
M54 A30.0
With "54" registered as a Macro Call "M" code, the above command block will have the same meaning and function as the following:
G65 P9020 A30.0
If other arguments have to be passed to the Macro Program, they can be added to the Macro Call Block, and the Macro Program written in such a way as to make use of the arguments being passed.
If you Post the Sub Program using DPRNT that currently works correctly, I, or someone from the Forum will show you an example of how arguments can be passed to, and used by the Macro program.
Regards,
Bill