The mechanism of serial communication in HelloDevice IDE Applet or Application.


Note : HD1100 and HD1200 accept multiple socket connections at a time and it keeps the socket connection alive until the applet or application terminates. Say it sends data to the device when the operator changes switch value and receives data periodically from the device without any user intervention and all of these communications will be done through the same socket connection that was generated initially. However, HD13xx series does not accept multiple socket connections at a time. Instead, it accepts connection when it is free. Once a connection is established, it will not accept any other connections until the current connection is closed. The current connection will be closed automatically when  there is no data transmission between two connected network elements. Please refer to the manual of HelloDevice for more information.

Abbreviation : ACK is a signal for 'Acknowledge' response and NAK is a signal for 'Negative Acknowledge' response.

Read the followings to figure out the picture of HD13xx series (or other Ethernet-serial devices) communication.

Client mode (Applet or application both)

HelloDevice IDE applet and application, when it is made for HD13xx series (Ethernet-serial device), establishes a new connection and sends data to target network device when a 'Serial Gate Button' has been pressed. Serial gate button has four properties that determine the behavior of client networking

- Send protocol symbol : the serial protocol which will be composed and sent when this component is pressed
- Receive protocol symbol : the serial protocol which is to be submitted after above Send Protocol has been successfully transmitted
- Event repeat : repeat sending (sending and receiving) event
- Event repeating period : the repeat interval of event sending (sending and receiving) in milliseconds

If the 'send protocol symbol' of the pressed button is 'NONE', nothing happens. Else, according to this protocol, the applet (or application) will compose a serial data and send it to the target device. After sending the serial data, if the 'receive protocol symbol' of this button is 'NONE', it closes the current connection immediately. Else, it will wait for a data to be transmitted from the connected device. And the received data is to match this serial protocol. After the data has been successfully retrieved, the connection will be closed. The connection will be lost automatically even when there is no data transmissions during the 'timeout' of receive protocol, or received data does not match the expected protocol. Before closing the connection, if ACK or NAK data is set for the 'receive protocol', this applet or application will reply to the server with the this ACK or NAK data. Sends ACK when the data retrieving has been successful or sends NAK when failed or timed out. If 'Event repeat' property of this button is 'true', above sending (or sending and receiving) event will be repeated with the period of 'Event repeating period'.

You can use multiple Serial gate buttons in single applet or application and each of them has different send/receive serial protocols so that various serial communications can be covered in a single applet or application. However, each of serial communications will be executed one by one at a time. If one of Serial gate button is pressed (repeating event), the other buttons will not respond to user operation because of the networking mechanism of HD13xx series.

In case of application, it will check the network connectivity to the pre-assigned host address at the start up.

Server mode (Application only)

If a HelloDevice IDE application is deployed to become a network server, at the initialization, it constructs a server socket at an assigned port that listens to socket connections from a remote side. This server socket will accept a socket connection request from a client and will not accept additional connection request while it is occupied. Once a client is connected, the server waits for data to be submitted from the connected device. And the received data is to match the serial protocol(s) that is assigned at the moment of deploying application. After the data has been successfully retrieved, the connection will be closed. The connection will be lost automatically even when there is no data transmissions during the 'timeout' of receive protocol, or received data does not match the expected protocol. Before closing the connection, if ACK or NAK data is set for the 'receive protocol', the server application will reply to the client  with the this ACK or NAK data. Sends ACK when the data retrieving has been successful or sends NAK when failed or timed out.

While running server mode application, it is always possible to switch the mode to client and server mode by setting a host IP address and pressing Serial gate button.

Note : Please read the tutorial sample page for the concrete example of how to define serial protocols.

Take a look at adding/removing a serial protocol in serial protocol list.
Overview of serial protocol edition panel set

rview of serial protocol edition panel set