How to access macros stored in the drive using registers

How to access macros stored in the drive using registers

In this How to article we will explain how we can access/run/stop (and many other functionalities) macros that are stored in the drive by the use of registers of the EMCL dictionary.

Problem

It is quite common to have applications in which the Ingenia drive has some macros stored in its memory that need to run in a certain moment during the cycle time. A very common option is to use macro 0 since it is the one that will always run after the system is powered ON but there are other systems that might need to perform certain things before running the macros, therefore making this option is not a possibility.

Solution

As we have seen, there is a real need to be able to access the stored macros and make them run/start/stop appears whenever the application does not allow the macros to run directly after power on. This can be easily done by using the following sets of registers: 
  • Macro commands --> these registers refer to functionalities such as "macro calling", "macro resetting", "macro jumping", "macro returning" and some more.
  • Macro debug --> these registers are mainly used to provide information about the actual command and macro being executed or pending of execution by the controller.
  • Sequence commands --> here we are mainly looking to subindex 0x03 in order to stop the macros from running anymore.