How do you disable and enable the hardware limit switches of a Motion Control TO of an S7-1500 via the user program?
To enable and disable the hardware end positions you have to set the tag "<TO>.PositionLimits_HW.Active" to FALSE or TRUE. This tag enables or disables both (negative and positive) hardware limit switches.
Use the extended instruction "WRIT_DBL" to change the start values. With this instruction you transfer the contents of a DB area in the main memory into a DB area in the load memory (MMC). This means that the changes in the technology data block are retained even after a power off of the CPU or a restart.
Fig. 1 shows an example of how with the DB tag "DB.activeValue" you can change the tag "PositioningAxis.PositionLimits_HW.Active" for the hardware limit switch.
- You may use the data block function "WRIT_DBL" in combination with the tags of the technology object only on individual tags and not parameterize on data structures of the technology object.
- The changes in the technology data block are effective only after restarting the technology object. Restart the technology object with the Motion Control instruction "MC_RESET"; the new configuration data is then applied in the technology data block.
This is how you do a restart of a technology object:
- Set the input parameter "Restart" of the "MC_RESET" instruction to True to define the reinitialization of the technology object.
- Start the reinitialization of the start values with a positive edge at the input parameter "Execute".
- When the restart is completed, the value at the output parameter "Done" changes from False to True.
- If the restart at the output parameter "Done" is not confirmed with True, the output parameter "Error" receives the value True and an error code is displayed at the parameter "ErrorID". Information about the error ID is available in the manual.
More information is available in the manual "SIMATIC S7-1500 S7-1500T Motion Control in the TIA Portal", under
- Variable PositionLimits_HW (Positioning axis/Synchronous axis)
- Error ID Motion Control Instructions
The screens in this FAQ response were created with STEP 7 (TIA Portal) V14 SP1.