As described in section 8.1 above, Device Sharing can be used to route TCP traffic to/from a WebNet serial port. Thus, via a TCP connection from the applet to the WebNet, the applet can reach the serial ports of the WebNet, and hence communicate with an attached device. For instance, in a temperature surveillance system, the WebNet is connected to a temperature sensor via the serial port. The sensor outputs temperature data every 10 secs. to the serial port, from which it is routed on to the ethernet interface. Here, an applet is listening for data, and plots a point in a graph for each value received.
8.4Application distributed on the WebNet and the PC
Often, it is necessary to split the application, so that some of the code runs on the WebNet and some on the PC. Consider the above mentioned temperature surveillance system, but where the PC only connects once in a while and wants to see the actual temperature, plus a temperature curve for the last few hours. Then, the WebNet has to keep a history of the temperature, that it can send to the PC upon connection, but the applet is still best suited to present the data. So the data accumulation part of the application is put on the WebNet and the data presentation part is put in the applet.
Also, electronic devices often use a more complex protocol than the above mentioned (where the sensor just outputs data at a regular interval) to communicate over the serial interface. This protocol will then most likely be implemented in the WebNet.
8.5Architecture Considerations
The differences in architecture can be expressed by three questions, which should be con- sidered before designing a WebNet solution:
1.Does the WebNet process data or does it merely act as a gateway?
2.Does the WebNet generate dynamic web pages, serve an applet to the PC or does the PC need to have a dedicated application?
3.Does the WebNet store a data history or not?
The answer to question 1 depends mainly on the “intelligence level” of the attached device. It may be useful to let the WebNet encapsulate very “raw” and
Also, if the device should be able to deliver data when a PC is not connected, some intelli- gence should be in the webnet software, buffering data for later reading by the PC.
The answer to question 2 depends mainly on the complexity of the data presentation needs. A dynamic webpage is suitable for presentation of simple textual/numeric data, while an applet is more suitable if graphical representation is needed. A dedicated PC application will probably only be used if it existed before the device was
36 | WebNet User’s Guide |