7.2.10.8 The SYNC statement

The SYNC statement syncs a variable, meaning that the variable's commanded value gets updated with the value recently read back from the device.

Normally, the device driver remembers a variable's value as it has been commanded from the GUI or from a logical device. When called in a PRINT or WRITE statement, this value will be used in favour of the value read back from the device. The driver uses this to check, if the commanded values has been accepted by the device.

When the device alters a commandable parameter autonomously, it may be desirable to accept this value as the new value to be commanded. For example, imagine an antenna tracking controller device which accepts the pointing angles only as a triple az/el/pol. The operator commands all three angles to find the satellite and switches on tracking. The antenna controller tracks the satellite and as a consequence alters the pointing angles. If now one of the angles will be set in the GUI by the operator, the other two angles will revert to the values which had been set before tracking was switches on.

Using the SYNC statement after reading back the pointing values will help to avoid this situation.

sync-statement.gif

For the SYNC statement, use the keyword SYNC followed by the name of the variable to be synced.