Because, from the
same program, you can access different data sources, each data source has to be named. The
first parameter names our data source TestHTTP. The second parameter defines the protocol
used by the DataServer to access the remote data source (in our case the Web server). The
content of the third parameter depends on the protocol. Here, it names the URL (relative
to the HTML file) which holds the values. It can be a normal file, but in many cases it
will be some kind of CGI program. The next parameter, TAGS_IN_URL, is only relevant for
the http protocol. If it is set to TRUE, then the names of the tags to be read are
appended to the URL in the following way: http://MYURL?tags=name1,name2,... Because in our
example we access a text file, this parameter is set to false. The parameter FREQUENCY
gives the time in seconds between two accesses to the URL (here Values.txt). If you look
in the file Values.txt, you will see the expected format for the file. For example, the
line level1=2.1 means that the variable named level1 has been set to 2.1 .
When the applet starts, it will open a new
window, the database viewer. It is empty for the time being. 
We will now define a variable by hand.
Enter the name level1 in the input field of the database viewer and press the New button.
The variable level1 will appear in the list without any value. If you double click on it,
you will see the name of the variable appearing in the input field of the menu bar of the
applet main window. This is because, in RView, whenever you point an object, an event is
sent to all the software objects which have subscribed to this kind of event.
Click now on the limits button and enter the following limits for this variable:
Min 0.0
Max 10.0
Low limit 0.0
High limit 10.0
Press the OK button and go to the main
window.

From there, we will read and write this
variable. If the name level1 is not written in the input field of the menu bar, write it
and then press the insert button. A dialog box will open. For the first test, just keep
the defaults and press the insert component button. Then, from the list of declared
components, choose HSlider and enter the following values:
X = 0
Y = 110
Width = 100
Height = 40
Press the insert component button once
more and close the dialog box. By moving the cursor of the horizontal slider, you can now
change the value of level1.

Click now on the new button of the main window. The New View dialog box appears,
presenting some predefined components (the ones for which it makes sense to open a new
window). Click on the chart to select chart view and on the OK button. A new window with
the frame of the chart appears. Click on one of the representation of level1 (for example
on the horizontal slider previously created). The name level1 should then appear in the
input field of the chart window (you can also just enter manually the name). Click on the
insert button of the chart window. Now you can see the trend curve of level1.
Go back to the database window and change the high limit of level1 to 8 (via the limits
button). If you move the slider so that the value of level1 goes over 8, you should hear a
beep and you should see in the Java console an alarm message. This is how the default
alarm handler works (it is quite easy to develop your own alarm handler as it is described
in the developer guide).
Now, we will fetch the value of level1
from the network. Click once again on the limits button. In the bottom of the dialog box,
there is a text field named "Process Name" (remember the parameters of the
applet ?). Enter TestHTTP in this field and press OK. Go to the main window and press the
Enable DataServer button. The value of level1 should be set accordingly to what is written
in the file Values.txt. You can now change the value of level1 in Values.txt on the Web
server and see how it is refreshed in RView (if you want to reload the file more quickly,
change the FREQUENCY parameter of the HTML file but remember that this DataServer is as
efficient as your Web server and your connection to it and not more).
Our last step is to save the example
window you have just created. In the main window, click on the Save button, enter a name
for your configuration and press enter. This can only work if you made the programs
Rv_save and Rv_add callable from the Web server (see "Installing
the package"). You should now have a new file on your Web server in the
/RView/SYNOPTICS/Desc directory. The name of the file is composed of the date and
time of creation. You should also have a new line added to the file ConfigList which
contains all the configurations (you can have several lists of configurations, the name of
the list being passed to the applet as a parameter).