A
system and method for configuring a
graphical user interface (GUI) element to publish data to a data target and / or subscribe to data from a
data source. During program development, a developer may associate a GUI element with a program, e.g., a GUI element for receiving
user input data or indicating data to the user, such as a graph,
text box, check box, knob, etc. The developer may then configure the GUI element to publish data associated with the GUI element to a data target and / or to subscribe to data from a
data source. In the preferred embodiment, the developer is not required to specify any
source code for the program in performing this configuration. For example, the developer may simply invoke a
dialog box and choose from a set of options, such as “Publish”, “Subscribe”, and “Publish and Subscribe” in order to specify a
data connection type for the GUI element. The developer may also specify a
data source or target for the
data connection, e.g., by specifying a
uniform resource locator (URL). The developer may specify various types of data sources / targets for the
data connection, such as files, HTTP servers, FTP servers, OPC servers, and DataSocket servers. Once the developer has created the GUI element and configured the GUI element with a data connection to a data source and / or target, the program may be executed. During program execution, the program is operable to automatically determine and use an appropriate protocol for
interfacing with the data source / target, such as HTTP, FTP, etc. If the developer configured the GUI element to subscribe to data from a data source, then the program may connect to or open the data source and receive data from the data source. This data may then be provided to the GUI element, which is operable to display the data to the user. If the developer configured the GUI element to publish data to a data target, then the program may connect to or open the data target and send or write data associated with the GUI element to the data target. The developer may also configure a GUI element to both publish and subscribe to a data target / source.