This function allows the sending of randomly structured data via a TCP/IP connection as well as the evaluation of response data. Sending and receiving is not limited to pure text (e.g. HTTP commands), but rather also enables working with binary data.
Data can be evaluated in two different ways:
Data can be evaluated in two different ways:
- Simple evaluation, evaluation through definition of individual data blocks.
- Complex evaluation, evaluation using a regular expression and assignment of data blocks.
1.Application
- Controlling external IP devices and evaluating the response
- Calling up web pages and evaluation of content, e.g., weather pages or for displaying RSS feeds.
- Control of serial devices via serial IP converter.
1.2.Importing and exporting libraries
Completed queries can be saved as libraries and used again in other projects with the functions Library -> Import library (right-click on the root element in the tree view, left) and Library -> Export library (right-click on an element in the tree view, left). Optionally, you can export individual queries or a complete folder including subfolder. If a library contains several requests, these are always imported with a maximum depth from one folder. This means one folder at maximum is created, and all the requests that may be underneath in further subfolders are assigned to it. All queries can then be found in this folder.
During import, the possibility exists of entering the IP/host address, the IP-port, user names and passwords for all queries. For this, the data is suggested that is found in the library to be imported from the HS/FS-Expert. All the imported elements are pre-assigned these values. Different fields can be active depending on the content of the library. The fields "User name" and "Password" are, for example, only active in the cases where an HTTP query with password protection is available in the library.
If further objects are used in the library (e.g. communication objects, sequences, etc.), a project-specific implementation has to be carried out in the "Objects" tab. On the basis of the object description and the type, you can recognise which function the object has.
During import, the possibility exists of entering the IP/host address, the IP-port, user names and passwords for all queries. For this, the data is suggested that is found in the library to be imported from the HS/FS-Expert. All the imported elements are pre-assigned these values. Different fields can be active depending on the content of the library. The fields "User name" and "Password" are, for example, only active in the cases where an HTTP query with password protection is available in the library.
If further objects are used in the library (e.g. communication objects, sequences, etc.), a project-specific implementation has to be carried out in the "Objects" tab. On the basis of the object description and the type, you can recognise which function the object has.
1.3.Important notes
The HS/FS can receive and evaluate data up to a maximum size of 500,000 bytes. Data outside this range cannot be utilised.
The debug page supplies information to test a web query. In the section Event-BiDir, all the queries/evaluations carried out are listed with the following information:
The debug page supplies information to test a web query. In the section Event-BiDir, all the queries/evaluations carried out are listed with the following information:
- Date and time of the query (Host IP address) (Host IP port)
- Send: The number of characters sent, including display of the first character as hex values, afterwards in plain text (ASCII values)
- Recv: The number of characters received, including display of the first character as hex values, afterwards in plain text (ASCII values)
- Total: The number of defined data blocks
- Work: The number of data blocks to be processed.
- Type:
- List: simple evaluation was configured
- RegExp: complex evaluation was configured - OK:
- 1 = evaluation successful
- 0 = evaluation failed.
2.Data
Telegram type
There are two selection options:
- TCP: The connection via the port specified above requires a connection via the TCP protocol.
- TCP/TLS: The connection via the port specified above requires an encrypted connection according to the TLSv1.2 protocol.NoteThis setting is independent of the project setting for security!
End connection after a certain amount of data is received
Yes: The HS/FS ends the connection prematurely after receiving the number of characters specified in the field Max. length of the response.
No: The HS/FS waits until the other party ends the connection or the maximum possible size of bytes has been received.
No: The HS/FS waits until the other party ends the connection or the maximum possible size of bytes has been received.
Note
We recommend this option if the other party does not terminate the connection, or, for example, in a web page only the first n-characters are of significance and the rest of the data can be discarded.
Important
If this option is not activated, the HS/FS sets the value automatically to the maximum size of 500,000 bytes.
3.Send
The following options are available in order to send data to the other party:
- Send HTTP call
- Send data blocks
Send HTTP call
Calls a web page from the other party. The HS/FS Expert automatically creates the suitable data blocks, whereby a GET command is always generated.
Note
If "TCP/TLS" is selected as Telegram type, an encrypted connection (HTTPS) is used.
On the debug page, the last telegrams sent and the respective response can be viewed in the section "Event-BiDir". See also the chapter Important information.
On the debug page, the last telegrams sent and the respective response can be viewed in the section "Event-BiDir". See also the chapter Important information.
URL (path only)
Path of the web page (e.g. /countries.html). You can integrate placeholders for communication objects in the URL. You can structure the entries variably in this way. Instead of a value, apply the group address of a communication object, enclosed by curly brackets.
Example: In order to read out the country from the communication object with the group address 100/1, instead of making a fixed entry, write
Example: In order to read out the country from the communication object with the group address 100/1, instead of making a fixed entry, write
"/countries?name={100/1}"
.Note
If you require curly brackets in your URL, instead of wanting to enter a placeholder, use the following HTML codes instead of the brackets:
- For '{' (Open) =
- For '}' (Close) =
- For '{' (Open) =
'{'
- For '}' (Close) =
'}'
Convert URL
Yes: The specified URL is coded in accordance with the HTTP standard.
Example: The URL
No: The data is sent to the web server in the same way as it is entered.
Example: The URL
/tic tac toe.html
then becomes /tic%20tac%20toe.html
No: The data is sent to the web server in the same way as it is entered.
Password protection
Yes: The web page is secured by a HTTP password protection.
No: The web page can be called up without user name and password.
No: The web page can be called up without user name and password.
User name
User name for authentication. Only necessary if the password protection option is activated.
3.1.Send data blocks
Data blocks can be defined in this list. The data blocks are sent to the other party in the defined sequence.
4.Receive
The following information differs depending on whether a simple or complex evaluation should be carried out:
4.1.Receive (simple evaluation)
The result of the sent request is evaluated in this mask. The data blocks to be received are defined in this list.
4.2.Receive (complex evaluation)
If a complex telegram was defined during saving, the definition of a regular expression is necessary. The following field is used for this. The defined data blocks are dependent on the regular expression.
5.Commands
Commands can be executed in conjunction with the evaluation of the response data. A difference is made between successful and failed evaluations.
Note
The commands for failed evaluations are especially suited as an indication of changed structures within a web page.
No commands are executed in the case of a failed connection. For troubleshooting, the section Event-BiDir is available on the debug page. See also the chapter Important information.
No commands are executed in the case of a failed connection. For troubleshooting, the section Event-BiDir is available on the debug page. See also the chapter Important information.