Which requirements have to be fulfilled before a technology object can be enabled via "MC_Power"?
Using the Motion Control instruction "MC_POWER" you can enable or lock a technology object via the "Input" parameter. Before setting the "Enable" parameter to True, the parameterized sensors (encoders) and actuators (drives) should be available for the technology object. Since the CPU usually starts up faster than the connected IOs, in most cases the technology object cannot be enabled immediately after the CPU startup.
Checking the availability of the technology objects
You can check the complete availability of a technology object via the variable "CommunicationOK" (data type: Bool) in the following structured data types:
- Sensors (encoders) TO_Struct_StatusSensor
- Actuators (drives) TO_Struct_StatusDrive
- TO_ExternalEncoder: There is no actuator (drive) on this TO.
- TO_SpeedAxis: There is no sensor (encoder) on this TO.
The following example shows a technology object opened in the DB editor with the two structured variables "statusSensor" and "statusDrive" and the "CommunicationOK" signals contained in them.
Programming example for triggering "MC_Power"
Triggering of the input "Enable" of the Motion Control instruction "MC_Power" can then be done as follows:
The technology object is enabled only when the enable signal ("DB".enable) is set and the corresponding sensor (encoder) and actuator (drive) are available for the technology object.
Before calling the instruction (for the used axis) you still have to copy the data (enabling of the sensors and actuators) into the data block variables.
If the technology object is enabled via the "MC_Power" instruction before the sensor and actuator interfaces (".CommunicationOK") have the True signal, then, depending on the configuration, there might be alarm messages like "Encoder driver/actuator driver not initialized during startup" or "Adjustment cannot be restored", for example.
More information about the Motion Control instruction "MC_Power" is available in the manual under MC_Power.