next up previous contents 5
Next: Siblings Up: Scripted Device Family Relationships Previous: Scripted Device Family Relationships   Contents

Children and Parents

A scripted device is often used to control several real motors, or a hierarchy of scripted devices and real motors. If the relationship of the devices is such that a scripted device (Device1) should reevaluate its current position with each movement of (Device2), it is likely that Device2 is a child of Device1, the parent device.

Within the script of the parent device, it is possible to declare this relationship with the following command:

set_children childDevice1 [[childDevice2] [...]]

After this command is issued, the scripting engine will automatically call the deviceName_update procedure each time a child motor moves. This procedure must be written by the script writer and should re-calculate and set the parent motor's new position. With the setting of the new position the scripting engine will then call all of the deviceName_update procedures for all scripted devices that are parents of this parent motor. Therefore, a single updated position from a child motor will cause all of the parents in the hierarchy to re-calculate their own new positions.


next up previous contents 5
Next: Siblings Up: Scripted Device Family Relationships Previous: Scripted Device Family Relationships   Contents
Scott McPhillips 2011-07-06