with the current status of the Vortex devices that are being controlled. The host could initialize its
controls to default values and then send commands to the Vortexes to set them to the same state.
This approach has significant disadvantages since initializing the host program could undo settings
made by other host programs or by the front panel controls of one of the linked Vortex devices. A
better approach is to query the linked Vortex devices for their status and set the host program
controls based on the return values.
3.2. Wildcard Characters
The use of the wildcard character, '
*
', can make programming the host controller much easier. Be
careful when using wildcards, however, since they can generate a lot of traffic on the digital bus.
3.3. Using Acknowledgements
It is a good idea for the host program or control system to make sure that all connected Vortex
devices have acknowledgment mode enabled (see the
ACKMOD
command). When acknowledgment
mode is on, a Vortex device will send an acknowledgment for each command it receives. Proper use
of acknowledgments makes the host program more robust and makes supporting multiple hosts
effortless. The rest of this section describes how to use acknowledgments to achieve these goals.
As a convenient example, let us imagine a host program with a graphical user interface (GUI). The
user presses buttons on the GUI to enable or disable features of various linked Vortex devices. The
buttons on the GUI reflect the current status of the corresponding feature.
When the user presses a button on the GUI to enable or disable a feature, the host program should
send the corresponding command to the selected Vortex device. It may be tempting to update the
status of the GUI button at this point, but this can cause problems if there are transmission errors or
if there are multiple host controllers. The proper way to handle this is to only update the GUI controls
based on acknowledgments received from the Vortex device.
To implement this, organize your code so that the functions that send commands are totally separate
from the functions that receive responses from the Vortex devices. This also enables your host
program to support the presence of multiple host controllers. For example, consider the following
sequence of events.
1. Another host sends a command to a Vortex device.
2. The Vortex device responds with an acknowledgment that is broadcast to all of the other hosts.
3. Your host program receives the acknowledgment and updates the status of the corresponding
control.
The result of this programming model is that all hosts and linked Vortex devices will always be
synchronized.
For simple on/off features, your host program can make use of the toggle arguments to some
commands (e.g., '
SSEN2
'). By sending a toggle command when a button is pressed, and updating the
button based on acknowledgments, your host program will not have to keep track of the status of the
button.