The text of a manual · part 33 of 41
E-terminals Programming manual: 19 Network functions in the terminal, pages 254 to 262
Pages 254 to 262 of 335, from E-terminals Programming manual
The original document is the PDF (4.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Beijer Electronics AB E200
Page 254
Network functions in the terminal
19 Network functions in the terminal The chapter is not valid for E50. This chapter describes how the functions FTP server, SMTP client, applet and WWW server works in the terminal. For settings in the functions respective we refer to the chapter Network communication.
19.1 FTP server FTP (File Transport Protocol), a standard Internet protocol, is the simplest way to exchange files between computers on the Internet. FTP is an application protocol that uses the Internet’s TCP/IP protocols. FTP is commonly used to transfer Web page files from their creator to the computer that acts as their server for everyone on the Internet. It is also commonly used to download programs and other files to your computer from other servers. Some directories shows files with the file length 0. This means that the file contain dynamic data i.e. the size of the file change. This means that the file is not empty even if the length is 0. The terminal don’t use date on the files which means that the time shown is not relevant. The file name may not contain national characters.
The ROOT directory In the root directory you will find the following directories ALARMS, HTML, RECIPE and TRENDS. Only the libraries that the user has access to is shown. You will also find the file info.txt containing information about the terminal here.
243
Page 255
Network functions in the terminal
The file info.txt The file contains information about the terminal according to the following example: E700 Boot version: 4.01 Firmware version:V5.00 Build number: 124 Driver: FX-SERIES (CPU) V1.12.0 Dynamic memory: 304237 bytes free Project memory: 184700 bytes free Nothing can be deleted from the root directory, even if you have write access. If you delete the directories HTML or RECIPE the content of the directories are deleted but the directories are still there.
The ALARMS directory The directory is only shown if there are any alarm defined in the terminal and the terminal is in run-time mode. The alarm groups are shown as SKV files with the length 0. This don’t means that there aren’t any alarms. The files can only be read. To read a file it must be opened with the attribute READ, READWRITE will cause error.
File format Each alarm is stored in a row ending with <carriage return><linefeed>. Syntax (E700 and bigger terminals) status;activedate;activetime;inactivedate;inactivetime;ackdate;acktime;alarmtext All fields are always there. If the alarm isn’t acknowledged the fields for date and time are empty. Syntax (other terminals) status;activedatue;activetime;alarmtext End the file with <carriage return><line feed>
The HTML directory The data files handled by the Web server are stored here. You can create subdirectories. The start file is always named index.htm.
244
Page 256
Network functions in the terminal
File format The file format is depending on the type of file. We use standardized file format such as HTML e.t.c.
The RECIPE directory The different recipes are shown as SKV files with the length 0 which don’t mean that the recipe is empty. You can both read and write files in this directory. But you may not create a directory.
File format Each recipe value are stored in a row ending with <carriage return><linefeed>. Syntax device;value;datatype;length The file is ending with END<carriage return><linefeed> If the data type is array (AR) one value is shown on each line. The first line will be shown as above. The following lines will only contain ;value
The TRENDS directory The directory is only available if there are trends defined in the terminal and the terminal is in run-time mode. The trend files are shown as SKV files with the length 0. The files can only be read. To read a file it must be opened with the attribute READ, READWRITE will cause error. Curve 1 in a trend must be used, otherwise the trend isn’t valid.
File format Each sampling are stored in a row ending with <carriage return><linefeed>. Syntax date;time;value1;value2;value3;value4;value5;value6;OFF End the file with END<carriage return><linefeed> 245
Page 257
Network functions in the terminal Only used curves in the trend are transferred, i.e. no empty fields. OFF is in the sample in the following cases and indicates a pause in the sampling. – When the terminal enter run-time mode. A copy of the latest stored sample is added. The copy has OFF indication. As soon as valid values reach the terminal new values without OFF indication are stored. – When the signal Trend-enable is used. If the signal is reset a sample is indicated with OFF. When the signal is set a new value is stored without OFF indication. – When you transfer stored trend values via FTP or HMI tools a sample will be stored with OFF indication. When the transfer is ready a new value is stored without OFF indication.
19.2 SMTP client SMTP (Simple Mail Transfer Protocol) is a TCP/IP protocol used for sending and receiving email. However, since it is limited in its ability to queue messages at the receiving end, it is usually used with one of two other protocols, POP3 or IMAP, that let the user save messages in a server mailbox and download them periodically from the server. In other words, users typically use a program that uses SMTP for sending email and either POP3 or IMAP for receiving messages that have been received for them at their local server. Mail-server
SMTP
POP3
PC E-terminal
SMTP client
246
POP3 client e.g. Microsoft Outlook Express
Page 258
Network functions in the terminal
19.3 Terminal reflection – applet An applet is a little application program. On the World Wide Webb, using Java, the object oriented programming language, an applet is a small program that can be sent along with a Web page to a user. Java applets can perform interactive animations, immediate calculations, or other simple tasks without having to send a user request back to the server. From a PC it is possible to reflect the terminal in a browser, e.g. Microsoft Internet Explorer or Netscape Navigator. This is done by an application program presenting a picture of the terminal on the screen. The picture is updated at continuos time interval according to stated request. It is possible to affect by clicking with the mouse on the buttons in the terminal picture or using the keyboard. On a touch screen terminal you click directly on the screen. The Applet-application is a cab-file in the terminal file system, in the HTML directory, and is transferred to the terminal via FTP. The file is unpacked when the Webb page it is linked to is activated, see the following example. The communication with the terminal is done with the function Terminal control (port 6001 predefined). The port number can be configured in the source code for the Web page via an parameter in the applet application. It is also possible to change the background color behind the terminal picture on the Web page. You connect to the WWW server in the terminal by entering the IP-address in the browser. When the Webb page is loaded you will find a terminal symbol with the text Terminal Interaction. The applet-application starts when you click on the symbol. Now a login dialog is shown. If the login is defined for the function Terminal control entered user parameters are verified with the users defined under Accounts. Otherwise you don’t need to state anything in this dialog.
Example <applet code=TERMAPPL.class name=TERMAPPL width=120 height=60 <PARAMNAME=CABBASE VALUE=”E700APPL.CAB”> <param name=TermCtrlPort value=”6001”> <param name=Background value=” ”> </applet>
247
Page 259
Network functions in the terminal
19.4 Web server A Web server is a program that, using the client/server model and the World Wide Web’s Hypertext Transfer Protocol (HTTP), serves the files form Web pages to Web users (whose computers contain HTTP clients that forward their requests). Every computer (terminal) on the Internet that contains a Web site must have a Web server program.
SSI-script (server-side include) A server-side include is a variable value (for examples a file) that a server can include in an HTML file before it is send to the requestor. If you create a Web page, you can insert an include statement in the HTML file that looks like this: <!--#echo var=”LAST_MODIFIED”-->
To show values from the terminal on Web pages we support the following SSI script. Name
248
Parameters
Description
Example get_ipaddr.fn
None
Shows the IP address for the Web server. Used in CGI script
<!--#exec cgi=”get_ipaddr.fn”--> get_domainna me.fn
None
Shows the Web server domainname
<!--#exec cgi=”get_domainname.fn”-> get_date.fn
Date format e.g. MM/DD/ YY YY-MM-DD If no format is state the terminal setting is used
Shows the date in the terminal
<!--#exec cgi=”/get_date.fn MM/ DD/YY”-->
Page 260
Network functions in the terminal Name
Parameters
Description
Example get_time.fn
Time format e.g. HH:MM:SS HH:MM If no format is state the terminal setting is used
Shows the time in the terminal
<!--#exec cgi=”/get_time.fn HH:MM”--> get_device.fn
X, Y, Z X=device Y=presentation format (see separate table) Z=length
Shows the device value from the PLCsystem.
<!--#exec cgi=”/get_device.fn D5”--> <!--#exec cgi=”/get_device.fn D5LH”--> <!--#exec cgi=”/get_device.fn M7”-> <!--#exec cgi=”/get_device.fn D9ST,30”--> <!--#exec cgi=”/get_device.fn D0AR,10”--> get_diag.fn
None
Shows the diagnostic page of the terminal
<!--#exec cgi=”/get_diag.fn”--> get_mode.fn
None
Shows the mode of the terminal: RUN/ PROG/SETUP/ TRANSFER
<!--#exec cgi=”/get_mode.fn”-->
Presentation format for get_device.fn Name
Length
Description
Example
None
None
Shows the value as signed 16-bit
<!--#exec cgi=/get_device.fn D1”-->
+
None
Shows the value as unsigned 16-bit
<!--#exec cgi=/get_device.fn D3+”-->
L
None
Shows the value as signed 32-bit
<!--#exec cgi=/get_device.fn D7L”-->
249
Page 261
Network functions in the terminal Name
Length
Description
Example
L+
None
Shows the value as unsigned 32-bit
<!--#exec cgi=/get_device.fn D2L+”-->
RB
None
Shows the value as 32-bit float BCD (MELSEC, SIMATIC)
<!--#exec cgi=/get_device.fn D10RB”-->
RF
None
Shows the value as 32-bit IEEE float
<!--#exec cgi=/get_device.fn D8RF”-->
RD
None
Shows the value as 32-bit IEEE float without exponent
<!--#exec cgi=/get_device.fn D1RD”-->
SB
None
Shows the value as 16-bit BCD
<!--#exec cgi=/get_device.fn D3SB”-->
LB
None
Shows the value as 32-bit BCD
<!--#exec cgi=/get_device.fn D7LB”-->
SH
None
Shows the value as 16-bit HEX
<!--#exec cgi=/get_device.fn D2SH”-->
LH
None
Shows the value as 32-bit HEX
<!--#exec cgi=/get_device.fn D1LH”-->
AR
Number of values to be shown
Shows the value as signed 16-bit
<!--#exec cgi=/get_device.fn D5AR,10”-->
ST
Number of characters in the string
Shows a number of registers as string
<!--#exec cgi=/get_device.fn D9ST,30”->
Automatic updating Normally the Web page is not automatically updated. But by adding the following you create automatic updating. <META HTTP-EQUIV=”Refresh”CONTENT=”5”>
CONTENT states how often the page will be updated (in seconds).
250
Page 262
Network functions in the terminal
Example of a Web page with SSI script <HTML> <HEAD> <META HTTP-EQUIV=”Refresh”CONTENT=”1”> </HEAD> <!--#exec cgi="/get_ipaddr.fn"--><BR> <!--#exec cgi="/get_domainname.fn"--><BR> <BR> Some IO:<BR> <!--#exec cgi="/get_date.fn MM/DD/YY"--><BR> <!--#exec cgi="/get_time.fn HH:MM"--><BR> D5 = <!--#exec cgi="/get_device.fn D5"--><BR> M7=<!--#exec cgi="/get_device.fn M7"--><BR> D9 (string) = <!--#exec cgi="/get_device.fn D9ST,30"--><BR> D0-D9 =<!--#exec cgi="/get_device.fn D0AR, 10"--><BR> D8013 = <!--#exec cgi="/get_device.fn D8013"--><BR> </HTML>
251