Converting to pmac_motorhome.py

Introduction

This section gives details for converting from the old DLS homing PLC generator that came in the support module pmacUtil which provided additional features to the turbo pmac support in tpmac.

Users of pmac support module only can ignore this section

Conversion

To convert the plc generating python script (typically named generate_homing_plcs.py) from using the motorhome.py module to using the pmac_motorhome.py module, a conversion tool is available.

The command homing_convert can be used to convert either a single v1.0 homing PLC generator script, or scan a DLS motion area for homing PLC generator scripts to convert. Using the ‘motion’ command is encouraged, especially for the case of generator scripts for individual motion controllers.

The process will create two copies of the motion area given as one of the ARGS, in the /tmp directory of your machine; an old_motion and a new_motion. The old_motion directory will contain generated PLCs from the original generator script, and the new_motion directory from the converted generator script.

A comparison between the generated PLCs is performed, and any discrepancies are summarised and a meld command is provided to inspect the differences.

At this point, no changes are made to the original motion area. To complete the conversion step, use the provided command to replace the old generator script with the new one.

An example use of the homing_convert command is shown below:

xfz39520@ws306:motion$ homing_convert motion BL23I/Settings
07-29-21 19:02:51 INFO     trying homing conversion for BL23I/Settings in /tmp/motorhome48265
07-29-21 19:03:00 INFO     generating: /tmp/motorhome48265/new_motion/motorhome.py
07-29-21 19:03:33 INFO     verifying matches ...
07-29-21 19:03:33 WARNING  Failure: 1 of 20 PLC files do not match for /dls_sw/work/xfz39520/motion/BL23I/Settings
review differences with:
meld /tmp/motorhome48265/old_motion /tmp/motorhome48265/new_motion

07-29-21 19:03:33 INFO     The following PLCs did not match the originals:
/tmp/motorhome48265/old_motion/BL23I-MO-STEP-99/PLCs/PLC10_ARVINDER_HM.pmc /tmp/motorhome48265/new_motion/BL23I-MO-STEP-99/PLCs/PLC10_ARVINDER_HM.pmc

07-29-21 19:03:33 WARNING  To copy the new generating script, use the following command:
mv /tmp/motorhome48265/new_motion/motorhome.py /dls_sw/work/xfz39520/motion/BL23I/Settings/configure/motorhome.py

1 of 20 PLC files do not match for/dls_sw/work/xfz39520/motion/BL23I/Settings