Home
"user manual"
Contents
1. COUNTRY_CODE STRING 2 Country code ISO format eg AT Austria COUNTY NAME STRING 20 Name of the country REGION CODE STRING 2 Region Code FIPS format eg 09 Vienna REGION NAME STRING 20 Name of region CITY STRING 20 Name of the city GEO LATITUDE REAL Latitude of the place GEO LONGITUDE REAL Longitude of the place TIME ZONE NAME STRING 20 Time zone name GMT _ OFFSET INT Offset from Universal Time in minutes IS DST BOOL DST active 4 12 IP_C IP_C data structure Data field Data Type Description C_MODE BYTE Type of connection C_ PORT WORD Port Number C_IP DWORD coded IP v4 address C_STATE BYTE Status of the connection C_ENABLE BOOL Connection release R_OBSERVE BOOL Receive data monitor TIME RESET BOOL Reset the monitoring times ERROR DWORD Error Code FIFO IP_ FIFO DATA Data structure of the access management No user access required MAILBOX ARRAY 1 16 OF BYTE Mailbox data area for module data exchange 23 Version 1 21 Chapter 4 Data Types of the NETWORK Library 4 13 IP_ FIFO DATA IP_ FIFO DATA data structure Data field Data Type Description X ARRAY 1 128 OF BYTE FIFO memory with registered ID s Y ARRAY 1 128 OF BYTE Number of entries per ID s ID BYTE Last assigned ID highest ID MAX_ID BYTE Maximum number of applications per ID INIT BOOL Initialization performed EMPTY BOOL FIFO is empty FUL
2. With a BASE64 DECODE STR encoded in BASE64 text can be converted back to plain text With a positive edge of RUN the process starts Here DONE is immediately reseted if it has been set by a previous conversion The BASE64 encoded text is passed on STR1 and after the conversion the plain text is available in STR2 and DONE is set to TRUE Example Text in STR1 T3BIDIBTb3VyY2UgQ29tbXVuaxXR5IGZvciBBdXRvbWFOaW9UIFRIY2hub2xv Z3k Result in STR2 Text in STR2 Open Source Community for Automation Technology 8 3 BASE64_DECODE STREAM Type Function module Input SIZE1 INT number of bytes in the BUF1 for decode Output SIZE2 INT number of bytes in BUF2 of the decoded results I O BUF1 ARRAY 0 63 OF BYTES BASE64 data for conversion BUF2 ARRAY 0 47 OF BYTES converted data With BASE64 DECODE STREAM arbitrarily long BASE64 byte streams are decoded In one pass up to 64 bytes are decoded which in turn emerged from a maximum of 48 bytes each Here the source data is passed to the 13 Version 1 21 Chapter 8 Converter decoder over BUF1 in the data stream manner as individual blocks of data and in decoded form re issued in BUF2 The user has to provide the further processing of the BUF2 data before the next block of data is con verted The number of bytes in BUF2 is issued by SIZE2 from the module 8 4 BASE64 ENCODE STR Type Function module Input RUN BOOL positive edge starts conversion
3. gt lt br gt lt b gt Current Conditions lt b gt lt br gt Mostly Cloudy 57 F lt p gt lt b gt Forecast lt b gt lt BR gt Tue Mostly Cloudy High 62 Low 45 lt br gt Wed Mostly Cloudy High 60 Low 52 lt br gt Thu Rain High 61 Low 46 lt br gt lt br gt lt a href http us rd yahoo com dailynews rss weather Sunnyvale__ CA http weather yahoo com forecast 94089 _f html gt Full Forecast at Yahoo Weather lt a gt lt BR gt provided by The Weather Channel lt br gt gt lt description gt lt yweather forecast day Tue date 29 Nov 2005 low 45 high 62 text Mostly Cloudy 209 Version 1 21 Chapter 13 Weather Data code 27 gt lt yweather forecast gt lt yweather forecast day Wed date 30 Nov 2005 low 52 high 60 text Mostly Cloudy code 28 gt lt yweather forecast gt lt item gt lt channel gt lt rss gt The XML data the required elements are processed and stored in the YAHOO WEATHER data structure 13 3 YAHOO WEATHER DESC DE Type Function module IN OUT YW YAHOO_WEATHER_DATA Weather data INPUT ACTIVATE BOOL positive edge starts the query d YAHOO WEATHER_DESC_GE ALTIVATE by Viv AN b gt The module replaces the original English texts by German weather descriptions Following a positive edge at ACTIVATE the elements texts in the YAHOO WEATHER DATA data structure is replaced After querying the weather data using YAHOO WE
4. 9 15 MB _VMAP Type Function module IN OUT VMAP ARRAY 1 10 OF VMAP_DATA VIRTUAL MAP Data INPUT FC INT function number V_ADR INT virtual address range start address V_CNT INT Virtual address space number of data points SIZE INT number of MODBUS registers in structure DATA OUTPUT P_ADR INT Real address space Start address P_ BIT INT real address range bit position ERROR DWORD error code The module allows the conversion of virtual addresses at a real address Space in the MODBUS DATA Structure Virtual address ranges are defined in the VMAP data array If the module is called and found that nothing in the VMAP data is entered automatically a block is created allowing full access to all the MODBUS data In each address block also a watchdog timer is maintained that sets each time you access this block on the timer to zero Thus simply by comparing the TIME OUT value to a cutoff value at communication error no update can be responded By the parameter FC is detected the functional code and whether the register 16 bit or individual bits must be processed The bit number corresponds to the function code This means that Bit5 1 in FC the function code 5 Write Single Coil enables By V_ADR by the virtual start address is specified At 16bit commands this is a register address and at 118 Version 1 21 Chapter 9 Network and Communication bit commands an absolute bit number within a de
5. DINT output OUT UDINT1 DINT output OUT UDINT2 DINT output OUT DWORD1 DINT output OUT DWORD2 DINT output ID BYTE ID The module NET _VAR_X8 is used for bidirectional transmission of each two REAL DINT UINT DWORD values from the master to slave and vice versa The signals IN1 8 are collected and passed to the other side control on the same module at the same position as OUT1 8 again 204 Version 1 21 Chapter 12 Network Variables vey NET va ap OUT DEA OUT REALS OUT_UDINT1 OUT_UDINT OWT DWORD OUT _DWORDEe Simultaneously the input data on the opposite side other control is passed here as BUF OUT again ID parameter indicates the current identification number of the module instance If the configuration of the master and the slave program is differently incorrectly that ID number is passed as a fault in the module NET VAR CONTROL 205 Version 1 21 Chapter 13 Weather Data 13 Weather Data 13 1 MOON PHASE Type Function module INPUT XDT DT date time SCALE BYTE scaling factor UPDATE TIME update time OUTPUT PHASE BYTE Scaled value of the lunar phase ae MOON PHASE SOT The module MOON_PHASE is used to calculate the moon phase pf the specified date At parameter XDT the current date and time is passed and always recalculated after delay of the time parameter UPDATE The default value for UPDATE is 1 hour and the scaling factor is 12
6. ID MAX USINT Number of blocks DOG modules DTI DT current Date Time Value UCB UNI CIRCULAR BUFFER DATA Data Storage NEW FILE STRING STRING New file name NEW FILE RTRIG BOOL Edge new file was created 4 2 us LOG VIEWPORT us LOG VIEWPORT Name Type Properties LINE_ARRAY ARRAY 1 40 OF INT LOG index references COUNT INT Number of visible messages UPDATE COUNT UINT Update count MOVE TO X INT Control of the message display UPDATE BOOL Data has been changed gt redraw 16 Version 1 21 Chapter 4 Data Types of the NETWORK Library 4 3 URL The Structure URL stores the individual parts of a URL URL Data field Data Type Description PROTOCOL STRING 10 Protocol USER STRING 32 User Name PASSWORD STRING 32 Passwort DOMAIN STRING 80 Domain PORT WORD Port Nummer PATH STRING 80 Pfadangabe QUERY STRING 120 Query ANCHOR STRING 40 Anker HEADER STRING 160 Header 4 4 us TN_INPUT CONTROL A variable of type us TN INPUT CONTROL can be used to parameterize and manage various INPUT CONTROL elements and as well as to repre sent the ToolTip information us TN INPUT CONTROL Data field Data Type Description bo Enable BOOL Processing enable disable bo Update all BOOL All elements redraw bo Reset Fokus BOOL set Focus on first Element in Fokus at INT Element with an active focus i
7. READY BOOL module ready DONE BOOL positive edge Transmission completed fares TELMET_PRINT 2 DUE SIZE EMABLE SEND OFTIOMN BACK COLOR FRONT COLOR 137 Version 1 21 Chapter 9 Network and Communication The module enables easy output of text to a TELNET console At the parameter TEXT is passed the desired string To unlock the module for communication ENABLE 1 must be set so that the registration takes place at IP CONTROL With parameter PORT can be defined the port number you want if not value is specified the default port 23 is activated With BACK COLOR and FRONT COLOR can be defined the colors you want if the function parameter OPTION is activated The parameters X_pos and Y_ pos pass the desired coordinates of the text If indicated in X_pos and Y_pos the value 0 the text position is inactive and the text are always appended at the current cursor position The standard Telnet console allows X_pos horizontal from 1 to 80 anda Y_pos Vertical 1 to 25 The behavior here can in turn be modified by OPTION Autowrap carriage return line feed Buf Flush etc If a large quantity of text will be issued there may be a buffering enabled so the data are written if either the buffer is full this is from the module induced independently or this is signaled by the amended OPTION parameter By SEND 1 the data is written into the buffer The parameters may only be changed again if READY is 1 and
8. Subnet Mask Default Gateway IP Parameter Assignment Redundancy Current Ylan Status Vlan Mode Port Security Access Control for Web Switch Operating Mode Web Interface Telnet Interface SNMP Interface Reset LOGOUT APPLY SAVE FL SWITCH MM HS gt Phoenix Contact Managed Switch System lt Phoenix Contact GmbH amp Co KG www Phoen xContact com 4 00 FL SWLICH MM HS 89 A9 45 B9 6E 9B 192 168 178 109 255 255 259 000 192 168 178 001 lt BootP gt d No Redundancy VLAN Transparent d VLAN Transparent lt Disable gt lt Disable gt lt Default gt lt Enable gt lt Enable gt Enable gt EE No reset CO Version 1 21 Chapter 11 Telnet Vision 11 2 TN FRAMEWORK Type Function module IN OUT Xus_TN_INPUT CONTROL Us TN INPUT CONTROL Xus_TN SCREEN Us TN SCREEN Xus_TN MENU us TN MENU S BUF NETWORK BUFFER transmit data R_BUF NETWORK BUFFER receive data IP C IP CONTROL parameterization vee TN FRAMEWORK us TN INPUT CONTROLe us TN INPUT CONTROL The module TN FRAMEWORK is a frame structure which provides a finished maturity model for TELNET Vision The following tasks and functions are treated Connection setup and breakdown with Telnet Client Send and receive data Data structures for graphics functions INPUT CONTROL elements Intelligent automatic updating of the Telnet display Menu bar display Direct acc
9. TRUE since this is a static time value and is only used for setting of pulse controlled time ERROR gives at error the exact cause See block IP CONTROL 9 20 SNTP_SERVER Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data R BUF NETWORK BUFFER receive data INPUT ENABLE BOOL Starts SNTP server STRATUM BYTE specify the hierarchical level or accuracy UDT DT Date and time input as Universal Time XMS INT millisecond of Universal Time UDT vie SMTP_SERVER The module provides the functionality of an SNTP NTP server With ENABLE TRUE the module logs in at IP CONTROL and waits for the release of the resource if it occupied by other subscribers for now Then the module is waiting for requests from other SNTP clients and answers it with the current time of UDT and XMS As long as ENABLE TRUE the Ethernet access of this resource is permanently locked for other users Exclusive Access due to passive UDP mode SNTP uses a hierarchical system of different strata As stratum 0 is defined as the exact time standard The directly coupled systems such as NTP GPS or DCF77 time Signals are called Stratum 1 Each additional dependent unit causes an additional time lag of 10 100ms and is designate with a higher number Stratum 2 Stratum 3 to 255 If no STRATUM is specified at the module STRATUM 1 is uSed as a Standard 128 Version 1 21 Chapter 9 Network and Communicat
10. 66 Cursor down 67 Cursor RIGHT 68 Cursor left 72 Pos1 75 End 80 F1 81 F2 82 F3 83 F4 8 Backspace 182 Version 1 21 Chapter 11 Telnet Vision 9 Tabulator 13 Return Enter 27 Escape 11 10 TN_SEND_ROWS Type Function module INPUT S_BUF_SIZE UINT number of bytes in S_BUF BUFFER IN_OUT IP_C IP_CONTROL Connection data S BUF NETWORK BUFFER transmit data Xus_TN SCREEN us TN SCREEN TN SEND ROWS 3 BUF SIZE e IP C IP Ce tS BUF 3 BUF pt t Zus TN SCREEN us TN SCREEN amp The module TN SEND ROWS is used to automatically update the graphical changes to the Telnet screen by send the modified lines to the Telnet client If you change the Telnet screen a color or a character in a line this line is always automatically selected for update The module checks if marked at Xus_TN SCREEN bya_ Line Update 0 23 one or more lines and generates an ANSI code byte stream which is sent to the Telnet client Furthermore when Xus_TN SCREEN bo Clear Screen TRUE a clear screen is triggered Upon detection of a new Telnet client connection automatically all the rows are marked for update so that the whole screen content is rendered If the required amount of data greater than S BUF BUFFER the data is automatically output in blocks 183 Version 1 21 Chapter 11 Telnet Vision 11 11 TN SC ADD SHADOW Type Function module INPUT lin_Y1 INT Y1 coordinate of
11. Pen 192 168 10 49 192 168 10 50 192 168 10 167 192 168 10 87 192 168 10 118 192 168 10 90 192 168 10 49 192 168 10 2 192 168 10 46 192 168 10 58 192 168 10 236 192 168 10 181 192 168 100 193 192 168 100 204 192 168 10 33 192 168 10 107 192 168 110 193 192 168 10 1 9 23 TELNET LOG Type IN OUT INPUT OUTPUT Function module Test user connected to website http 195 252 78 129 index html Test user connected to website http 194 92 215 30 index html Test user connected to website http 214 130 1 235 index html Test user connected to website http 194 222 174 211 index html Test user connected to website http 195 222 253 144 index html Test user connected to website http 204 43 103 32 index html Test user connected to website http 196 100 204 209 index html Test user connected to website http 208 63 250 162 index html Test user connected to website http 201 82 225 59 index html Test user connected to website http 200 41 187 212 index html Test user connected to website http 217 32 63 83 index html Test user connected to website http 218 59 46 225 index html Test user connected to website http 214 46 27 240 index html Test user connected to website http 202 234 139 151 index html Test user connected to website http 220 145 97 3 index html Test user connected to website http 224 59 193 203 index html Test user connected to website http 220 179 168 91 index html Test user co
12. and alternatively the port address default port is 10000 The SCAN TIME determines a data refresh interval default is T 1s With WATCHDOG the monitoring time is set default is T 2s When data exchange runs the parameter RUN TRUE If the data exchange is longer than the watchdog time not possible RUN FALSE and an error is passed The error will not be acknowledged because the module automatically tries to restore the data exchange Once no more error exists RUN TRUE and the error code is cleared ERROR regarded as a HEX value DWORD Message Type Description 199 Version 1 21 Chapter 12 Network Variables B3 B2 B1 BO XX Connection establish Connect Error See module IP_CONTROL XX Send data Transmission error See module IP_CONTROL x Receive data Receive Error See module IP_CONTROL XX Configuration error ID number of the module 12 3 NET VAR BOOL8 Type IN OUT INPUT OUTPUT Function module X NET_VAR_DATA NET_VAR data structure IN1 8 BOOL signal input OUT1 8 BOOL signal output ID BYTE ID NET_WAR_BOOLS OUT OUT OUT 3 OLIT 4 OUT OUTE GUT The module is used for bidirectional transmission of NET_VAR_BOOLS3 8 binary signals from the master to slave and vice versa The signals IN 1 8 are collected and passed to the other side control on the same module at the same position as OUT1 8 again S
13. data structure NETWORK BUFFER transmit data R_BUF data structure NETWORK_ BUFFER receive data ACTIVATE BOOL release for query WAN_IP DWORD Wide Area Network address DONE BOOL Query completed without errors ERROR _C DWORD Error code 96 Version 1 21 Chapter 9 Network and Communication ERROR_T BYTE error type The module determines the IP address that the Internet router on the Wide Area Network Internet uses This IP address is necessary for example to to make DynDNS declarations With a positive edge of the ACTIVATE the request is started After successful completion of the query DONE TRUE and the parameters WAN_IP the current WAN IP address displayed If an error occurs during the query it is reported in ERROR C in combination with ERROR T ERROR T Value Properties 1 The exact meaning of ERROR_C can be read at module DNS_ CLIENT 2 The exact meaning of ERROR_C can be read at module HTTP_GET WEB Server LAN IP 192 168 178 3 gt LAN IP 192 168 178 1 LAN IP GATEWAY 192 168 178 254 Firewall INTERNET Wide Area Network WORKSTATION Router LAN IP 192 168 178 2 WAN IP 80 10 54 13 97 Version 1 21 Chapter 9 Network and Communication 9 6 HTTP GET Type Function module IN OUT URL DATA URL data STRING TO URL IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data R BUF NETWORK BUFFER
14. hexadecimal code of the character are shown The reserved character is encoded as a 23 8 24 URL TO STRING Type Function STRING string_length Input IN STRING Unified Resource Locator Output URL URL URL_TO_STRING URL_TO_STRING 87 Version 1 21 Chapter 8 Converter URL TO STRING generates from stored data in IN with type URL a Unified Resource Locator as String A URL is as follows protokoll user passwort domain port path query anchor Example ftp nugo nono oscat de 1234 download manual html some parts of the URL are optional such as user name password Anchor Query 88 Version 1 21 Chapter 9 Network and Communication 9 Network and Communication 9 1 DNS CLIENT Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data R BUF NETWORK BUFFER receive data INPUT ACTIVATE BOOL Query start by positive edge DOMAIN STRING Domain name or IP as String IP4 DNS DWORD IPv4 address of the DNS server OUTPUT IP4 DWORD IPv4 address of the requested domain DONE BOOL IP of the domain has been queried successfully ERROR DWORD error code GE DN CUOENT DNS CLIENT determine from the given qualified DOMAIN name the associated IPv4 address eg www oscat de For this purpose a DNS query to a DNS server for configured DOMAIN name with is made With positive edge of ACTIVATE the specified DOMAIN is stored so that they no long
15. i e oscat gmx net Station 01 The email client shows as the sender then Station_01 Thus more people will use the same email address but send a own Alias At the MAILTO parameter can To Cc Bc be specified The different groups of recipients are specified by as the separator in a list Multiple addresses within the same group are divided with the separator In each group can be defined unlimited count of recipients the only limitation is the length of the mailto string To lo Cc3Cc 4 Bc 3Bc Examples ol gmx netjo2 gmx net 01 gmx net 02 gmx net defines two TO addresses one CC address and a Bc address 02 gmx net defines only one BC address With subject a subject text will be specified as well as with BODY an email text content The current Date Time value must be definded at DTI and at DTI_OFFSET the correction value as an offset in minutes from UTC Universal Time If the DTI in UTC time is passed at DTI OFFSET a must be passed 125 Version 1 21 Chapter 9 Network and Communication It can be sent files as attachment The files must be passed in list form for parameter FILES Any number of files are given only limitation is the length of the file strings and the space of the e mailbox in practice 50 30 megabytes By an additional optional information of DEL deleting the files can be triggered on the controller after the successful transfer of files via email eg FILES logl c
16. lin_Y1 INT Y1 coordinate of the area lin _X1 INT X1 coordinate of the area lin _Y2 INT Y2 coordinate of the area lin_X2 INT X2 coordinate of the area IN OUT Xus_TN SCREEN Us TN SCREEN TN SC AREA SAVE Tin i e Zus TN SCREEN Tin X1 Tin Y2 Tin X2 Zus TN SCREEN e The module TN SC AREA SAVE allows you to save of rectangular areas of the screen before it is modified by other drawing operations This is mainly done before the call from the module BAR MENU and MENU POPUP _ because these are the elements as an overlay graphic Means X1 Y1 and X2 Y2 are given the coordinates of the secured area of the screen The data are saved in the data area Xus TN SCREEN bya BACKUP x Here the coordinates and the actual characters and color information is stored The buffer can hold up half the area of the screen 185 Version 1 21 Chapter 11 Telnet Vision 11 14 TN SC BOX Type Function module INPUT lin_Y1 INT Y1 coordinate of the area lin _X1 INT X1 coordinate of the area lin _Y2 INT Y2 coordinate of the area lin_X2 INT X2 coordinate of the area lby FILL BYTE fill in the character of the area lby ATTR BYTE color code to fill the area lby BORDER BYTE type of frame IN OUT Xus_TN SCREEN Us TN SCREEN Iin Y1 Tin 1 Iin Y2 Iin X2 Iby FILL Iby ATTE Iin BORDER Zus TN SCREEN The module TN GC BOX is used to draw a rectangular area that is filled with the specified charac
17. 126 SYSTEMSERVICE_FTELL File was opened with the wrong method 140 SYSTEMSERVICE FDELETE File not found Invalid file name or file path 255 Application Position is after the end of file ERROR Error codes PCWORX Value trigger Description 0 No error 2 File open The maximum number of files already open 4 File open The file is already open 5 File_open The file is write protected or access denied 6 File open File name not specified 11 File_close Invalid file handle 30 File close File could not be closed 41 FILE READ Invalid file handle 157 Version 1 21 Chapter 10 File System 50 FILE READ End of file reached 52 FILE READ The number of characters to read is larger than the data buffer 62 FILE READ Data could not be read 71 FILE_ WRITE Invalid file handle 81 FILE WRITE There is no memory available to write the data 82 FILE WRITE The count of characters to write is larger than the data buffer 93 FILE WRITE There were no written data 0 FILE SEEK Invalid file handle 113 FILE SEEK Invalid positioning mode or the specified position is before the start of the file 124 FILE SEEK The position could not be set 131 FILE TELL Invalid file handle 142 FILE REMOVE The maximum number of files already open 143 FILE REMOVE The file could not be found 145 FILE REMOVE The file is opened readonly or access denied 146 F
18. 18 a ye KI 20 00 22 00 06 00 02 00 04 00 06 00 08 00 10 00 12 00 14 08 16 00 16 00 O Rx Insufficient Requests limiti currenti 305 72 m Average 251 54 m Maximum 935 99 m A Rx PAG Initiation Packets Current 721 20 m Average 1 82 Maximum 1 82 EB Rx PAD Request Packets Current 176 09 m Average 226 97 m Maximum 501 82 m M Rx PAD Termination Packets Current 16 59 m Average D Zb m Maximum b6 51 m El Tv PAD Message Packets Current 33 25 m Average 14 93 m Maximum 165 94 m Mix PAD Network Packets Current 0 08 Average 0 00 Maximum 0 00 Mix PAG Offer Packets Current 465 28 m Average 600 81 m Maximum 1 62 Mix PAD Session Confirmation Packets Current 176 09 m Average 228 65 m Maximum 501 52 m O Tx PAD Termination Packets Current 69 76 m Average 101 15 m Maximum 382 56 m DOi amona Interconnect Outbound lt Erlangs Inbound D Du LO 00 be Oo Egga 16 60 L3 00 20 0 Trunk Grp Forts In Use Current Lead Average Load Peak Load El LATK2exxx0 20 1 Pd Doe d Se 20 FS El LETX26xxx1 ao 1 e SH DS T2 CR ELBTZZIxxx2 a0 20 65 0 254 Ze A TETS Z ssx3 a0 i RSR 252 Ss 25 9 EI LSEX21xxx4 30 1 41 4 11 9 36 1 A LGSBEXK21xrxx5 a0 1 1 78 Paes 26 8 Total Leo 24 13 18 KR 53 3 Source http www mrtg org 58 Version 1 21 Chapter 7 Data Logger What is required hardware software tools etc PLC with Network OSCAT lib A power saving PC for the duration of operation 24 7 On the PC rrdto
19. 2 VALUE lt b gt Current Conditions lt b gt lt br gt PATH rss channel Next cycle COUNT 9 TYPE 1 OPEN ELEMENT Standard LEVEL 3 ELEMENT title PATH rss channelltitle Next cycle COUNT 10 TYPE 3 TEXT LEVEL 3 ELEMENT title VALUE XML_Reader PATH rss channelltitle Next cycle COUNT 11 TYPE 2 CLOSE ELEMENT LEVEL 2 ELEMENT title PATH rss channel Next cycle COUNT 12 TYPE 1 OPEN ELEMENT Standard LEVEL 3 ELEMENT link PATH rss channel link Next cycle COUNT 13 TYPE 3 TEXT LEVEL 3 ELEMENT link VALUE http oscat de PATH rss channel link Next cycle COUNT 14 TYPE 2 CLOSE ELEMENT LEVEL 2 ELEMENT link PATH rss channel 145 Version 1 21 Chapter 9 Network and Communication Next cycle COUNT 15 TYPE 2 CLOSE ELEMENT LEVEL 1 ELEMENT Channel PATH Tree Next cycle COUNT 16 TYPE 2 CLOSE ELEMENT LEVEL 0 ELEMENT rss PATH Next cycle COUNT 17 TYPE 99 EXIT END OF DATA 146 Version 1 21 Chapter 10 File System 10 File System 10 1 CSV PARSER BUF Type Function module IN OUT SEP BYTE devider RUN BYTE command code for current action OFFSET UDINT current file offset of the query VALUE STRING STRING LENGTH value of a key PT N
20. DEMO_1 screen page 1 LOGIN DIALOG TS ssmaintenance TN_VISION_DEMO 1 screen 2 Datei Bearbeiten nde SYSTEM CONSOLE alles kopieren ACTION LOGON USER ADMIN ACTION MENU_SELECT 41 ACTION LOGON USER ADMIN ACTION MENU SELECT 11 ACTION MENU_SELECT 31 ACTION LOG_LEVEL 85 Befehl LOG Level Selektion EEE Betriebsart 170 Version 1 21 Chapter 11 Telnet Vision The program TN VISION DEMO 2 shows the following elements Graphical representation of lines polygons texts and design the layout monchrome Elements EDIT LINE normal and hidden input and using an input mask SELECT TEXT TOOLTIP info line On the home page a LOGIN function is realized By entering the password oscat you can switch to the next page The main page can be changed using the cursor up down button and with tab between the individual elements Only the item LOGOUT leads back to the home page The two sides have shown a replica of the Telnet page of a manageable switch from PHOENIX CONTACT used to show that the TELNET VISION package can be used for for simple configuration pages 171 Version 1 21 Chapter 11 Telnet Vision TN VISION DEMO 2 screen page 1 Login Screen tata tatatatatata 8 KR MA U KORA AARAA HARAR bitt Running switch application version HEE HH EH Password TN VISION DEMO 2 screen 2 Basic Switch Configuration MAC Address IP Address
21. F st Input Data Set Input Mask st_Input_ToolTip inputline active SCROLL F1 F2 F3 F4 In Input Option INT 02 in_Title Y Offset INT 00 In Title A Offset INT 00 by_ Title Attr BYTE 16 34 st Title String command 175 Version 1 21 Chapter 11 Telnet Vision The following output das 1st ein test 11 5 TN INPUT MENU BAR Type Function module IN OUT Xus TN SCREEN Us TN SCREEN Xus TN MENU us TN MENU 309 TN INPUT MENU BAR Zus TN MENU t Zus TN MENU Zus TN SCREEN amp tb Zus TN SCREEN The module TN_INPUT MENU BAR is used to manage and view the Menu Bar The element is shown in in_X and in_Y The menu items are stored as elements within verschachelte st MENU TEXT Two different separators are used A separates the different menu lists and each menu list is further divided by into individual menu items The first menu list is the actual menu bar this implies the number of sub menus and the titles of the elements Then all the sub menu lists are follow and are separated by To devide individual sub menu items from each other or providing them with a cut line an has to submitted as text menu element By pressing the Escape key the menu bar activated and the respective sub menu is displayed using the module TN INPUT MENU POPUP Within the sub menu can be navigated with up down key Within the sub menu can be navigated with up down curs
22. I O STR STRING string_length Text for HASH creation With MD5_STR a string of the MD5 hash can be calculated by In the STR a string is passed to the module and a positive edge at input RUN the calculation starts DONE is immediately reset at startup and after the pro cess is DONE is set to TRUE Then at the parameter HASH the actual cal culated HASH value is available See module MD5 STREAM Example the MD5 hash of OSCAT is 30f33ddb9f17df7219elacdea3386743 8 15 MD5 STREAM Type Function module I O MODE INT mode 1 init 2 Data Block 3 Complete 80 Version 1 21 Chapter 8 Converter BUF ARRAY 0 63 OF BYTES source data MD5 ARRAY 0 15 OF BYTE current MD5 HASH SIZE UDINT number of data Output POS UDINT start address of the requested data block The module MD5 STREAM allows the calculation of the MD5 Mes sage Digest Algorithm 5 of a cryptographic hash function This can be created from any data stream a unique check value It is vir tually impossible to find two different messages with the same test value this is referred to as collisions free This can be used to check a configura tion file for change or manipulation With the hash algorithm MD5 a hash value is generated from 128 bits in length for any data The maximum length of the stream is on this module is limited to 2 32 4 gigabyte The result is a 16 bytes hash value at pa rameters MD5 Example There
23. INPUT lby ATTR BYTE color code font color Ist_ STRING STRING text IN OUT us TN SCREEN Us TN SCREEN TN SC WRITE Eos Iby ATTR e Xus TN SCREEN Ist STRING Zus TH SCREEN t The module TN SC WRITE EOS passes at the end position of the last with TN SC WRITE or TN SC WRITE EOS issued text the text Ist STRING with the color of Iby_ATTR This allows to continuous passes texts without the need to always pass the new coordinates 11 26 TN SC XY ERROR Type Function BOOL INPUT X INT X coordinate Y INT Y coordinate 195 Version 1 21 Chapter 11 Telnet Vision TN SC X ERROR TN SC _X ERROR The module TN SC XY ERROR checks whether the specified coordinate is within the screen area If the check fails as result is passes TRUE 11 27 TN SC XY2 ERROR Type Function BOOL INPUT X1 INT X1 coordinate of the area Y1 INT Y1 coordinate of the area X2 INT X2 coordinate of the area Y2 INT Y2 coordinate of the area TN SC X 2 ERROR TN SC X 2 ERROR The module TN SC XY2 ERROR checks whether the specified coordinates are within the screen area The area may not cross off the screen If the check fails as result is passes TRUE 196 Version 1 21 Chapter 12 Network Variables 12 Network Variables 12 1 NET VAR The modular package NET VAR enables the bidirectional process data exchange between two controllers on which network lib is available Bet ween the two co
24. Not Implemented The name server does not support the requested kind of query xx xx xx 05 DNS CLIENT Refused The name server refuses to perform the specified opera tion for policy reasons xx xx xx 06 DNS CLIENT YXDomain Name Exists when it should not xx xx xx 07 DNS CLIENT YXRRSet RR Set Exists when it should not xx xx xx 08 DNS CLIENT Nxrrset RR Set that should exist does not xx xx xx 09 DNS CLIENT Server Not Authoritative for zone xx xx xx 0A DNS CLIENT Name not contained in zone xx xx xx FF DNS CLIENT No ip address found 9 2 DNS REV_CLIENT Type Function module IN OUT IP _C IP_C parameterization S BUF NETWORK BUFFER transmit data R BUF NETWORK BUFFER receive data INPUT ACTIVATE BOOL query start by positive edge 90 Version 1 21 Chapter 9 Network and Communication DOMAIN STRING Domain name or IP as String IP4 DNS DWORD IPv4 address of the DNS server OUTPUT IP4 DWORD IPv4 address of the requested domain DONE BOOL IP of the domain has been queried successfully ERROR DWORD error code DNS REV CLIENT determine from the given IP address the officially registered domain name For this purpose a reverse DNS query on the configured IP address with a DNS server is made With positive edge of ACTIVATE the specified IP is stored so that they no longer must be present lf the query result in more matches it will always use the last record As IP4_ DNS can be used any public DNS servers
25. SIZE2 from the module 8 6 HTML DECODE Type Function STRING string_ length Input IN STRING String Output STRING string length string HTML DECODE converts reserved characters which are in the form amp name stored HTML code in the original character In addition all coded characters are converted into the corresponding ASCII code Special cha racters can be represented by the following string in HTML amp NN where NN represents the position of the character within the cha racter map in decimal notation amp xNN or amp XNN where NN represents the position of the character wi thin the character table in hexadecimal notation amp name Special characters have names like amp euro for The reserved characters in HTML are amp Is encoded as amp amp 19 Version 1 21 Chapter 8 Converter gt Is encoded as amp gt lt Is encoded as Alt is coded as amp quot Examples HTML DECODE HTML DECODE HTML DECODE HTML DECODE OSCAT lL ist amp gt als 0 1 is gt als 0 amp D79 amp D83 amp D67 amp 4 amp D605 amp D84 OSCAT amp XH4F amp xH53 amp xH43 amp xH41 amp xH54 OSCAT amp XH4F amp XH53 amp XH43 amp XH41 amp XH54 _ m _ Am 8 7 HTML ENCODE Type F unction STRING string_length Input IN STRING String M BOOL mode Output STRING string length string HTML_ENCODE HTML_ENCODE Html enc
26. Submitted values 7 2 array values plodet Svalue T echo Srrd db lt br gt Print r Sarray value echo lt br gt commando usr bin rrdtoo l update Srrd db Ns a Sval e system Scommando Sfehler echo Sfehler Scommando 2 gt chart_test_rrd php SCDE Create chart for test scores and is invoked by the browser Scommand usr bin rrdtool graph test0O png vertical label Test start end 12h width 600 height 200 alt autoscale DEF tl test rrd t1l AVERAGE DEF t2 test rrd t2 AVERAGE DEF t3 test rrd t3 AVERAGE DEF t4 test rrd t4 AVERAGE DEF t5 test rrd t5 AVERAGE DEF t6 test rrd t6 AVERAGE RZ LF FO fF cr DEF t7 test rrd t7 AVERAGE LINE1 tl FFO000 Test1 LINE1 t2 6EFFOO Test2 LINE1 t3 CDO4DB Test3 62 Version 1 21 Chapter 7 Data Logger LINEL2E2 008 000 Test4 LINE1L t5 0000FF Test5 a AA LINE1L t6 0000FF Test6 LINE1 t7 0000FF Test7 COMMENT The last 12 hours system Scommand echo lt DOCTYPE HTML PUBLIC W3C DTD XHTML 1 0 Transitional EN http www w3 org TR xhtm1l1 DTD xhtmlil transitional dtd gt n echo lt html xmlins http www w3 org 1999 xhtml gt n echo lt head gt n echo lt title gt Test lt title gt n echo lt head gt n echo lt body gt n echo lt center gt lt img Sram Ba Tr center n echo lt center gt Die letzten 12h lt center gt i
27. This is required due to the Sharing functionality because established connections remains connected and the access rights are passed here only The parameter IP serves as a possible default IP address To avoid repeating the same IP address parameters a Default IP can be used One possible use would be to specify the DNS server address When the module recognizes as C_IP the IP 0 0 0 0 it automatically uses the default IP address The same behavior 102 Version 1 21 Chapter 9 Network and Communication JUs is at the Port parameter If at the port C PORT a 0 is detected so the parameterized block port number of the module is used The error code ERROR consists of several parts see table ERROR With TIMEOUT the overall monitoring time can be specified This time value is independently used used for connection send data and receive data The transferred TIMEOUT value is automatically limited to 200 ms minimum Thus this parameter can remain free The data block is automatically sent if in a shared connection in the send buffer the transmit data and data length are entered For data reveice the data is appended to the already existing data in the buffer By setting SIZE 0 the receive data pointer is reset and the next received data is then stored at position O The module supports the blocking of data messages that means the S BUF resp R_BUF can be arbitrarily large Individual received data frames are collected in R_BU
28. Zi sd Kus TN SCREEN Iin Y1 Iin x2 Iin YZ Iby ATTR Iby BORDER Zus TN SCREEN b The module TN SC LINE is used to draw horizontal and vertical lines By means of the X1 Y1 and X2 Y2 coordinates defines the beginning and the end of the line The line type is passed by lin BORDER and the color code with Iby_ATTR If when drawing a line and another line of this type cut automatically the appropriate crossing sign is used 188 Version 1 21 Chapter 11 Telnet Vision Border types 1 line with single line 2 line with double line gt 2 line is drawn with the specified character in lin BORDER Example Horizontal line type single line Vertical line Type Double Line Horizontal and vertical lines crossed Single Line Type Horizontal and vertical lines crossed Type Double Line Horizontal line type character X BE BE ABT htt ttt ts 189 Version 1 21 Chapter 11 Telnet Vision 11 17 TN SC READ ATTR Type Function module INPUT lin_Y INT Y coordinate lin_X INT X coordinate OUTPUT Oby_ATTR BYTE color information at position A Y IN OUT Aus TN SCREEN Us TN SCREEN 729 TN SC READ ATTR Iin Y Oby ATTE Iin X b gt Zus TN SCREEN Zus TN SCREEN t The block TN SC READ ATTR is used to read the current color of the character at the specified location X Y 11 18 TN SC READ CHAR Type Function module INPUT lin_Y INT Y coordinate lin_X INT X coordinate OUTPUT
29. after appropriate conversion to DWORD there The output is TRUE because both addresses are in the same Subnet IPF4 DECODE HA DECODE G22 267008 D PA CHECK EZ str IP4_DECODE MIP IP4_ CHECK D 7 str P4_DECODE TIP tr H Shl IP4 DECODE 5 IF4_DECODE 442549674 8 9 IPA DECODE Type Function DWORD Input STR STRING 15 string that contains the IP address Output DWORD decoded IP v4 address AH IP 4_ DECODE IF4_DECODE 71 Version 1 21 Chapter 8 Converter IP4 DECODE decodes the in STR stored string as a IP v4 address and re turns it as a DWORD A return of 0 means an invalid address or an address of 0 0 0 0 was evaluated IP4 may be used for evaluating a Subnet Mask of the IP v4 format 8 10 IP4 TO STRING Type Function STRING 15 Input IP4 BOOL string that contains the IP address Output DWORD decoded IP v4 address IP4 TO STRING converts the IP4 address stored as DWORD in a string The format is NNN NNN NNN NNN 8 11 IS IP4 Type Function BOOL Input STR STRING string to be tested Output BOOL TRUE if STR contains a valid IP v4 address iS_IP4 str IS_IP4 IS_IP4 checks if the string str contains a valid IP v4 address if not FALSE is returned A valid IP v4 address consists of 4 numbers from O 255 and they are separated each with one point The address 0 0 0 0 is there clas sified as wrong IS_IP4 0 0 0 0 FALSE IS_IP4 255 255 255 255 TRUE IS
30. could block the connection request For this purpose in the firewall a corresponding exception rule has to be defined In the passive mode this problem is alleviated since the controller establishes the connection and can easily pass through the firewall The control channel is always set up on port 20 and the data channel via standard PORT21 but this is in turn is depending whether active or passive mode is used or optional PORT number in the FTP URL is specified With the parameter FILE DELETE can be determined whether the source file should be deleted after successful transfer This works on FTP and even on the control side In specifying FTP directories the behavior depends on FTP server whether they exist in this case or are created automatically Normally these should be already available The size of files is no limit per se but there are practical limits Soace on PLC FTP storage and the transmission time With dns _ip4 the IP address of the DNS server must be specified if in the FTP URL a DNS name is given alternatively an IP address can be entered in the FTP URL At parameters PLC _IP4 the own IP addresses has to be supplied If errors occur during transmission these are passed to the output ERROR C and ERROR T As long as the transfer is running BUSY 64 Version 1 21 Chapter 7 Data Logger TRUE and after an error free completion of the operation DONE TRUE Once a new transfer is started DONE ERROR_T and ERRO
31. left but with block start and block end pa rameters is reported back so that they can subsequently be evaluated yet complete The BLOCK START STOP index are is always passed parallel to the STRINGS If the PATH STRING is greater than 255 characters so the PATH tracking is disabled and only OVERFLOW is entered as text Since for very large and complex XML data is not clear how long it takes until the module find data to report back an WATCHDOG function is inte grated A maximum processing time can be parameterized When rea ching the time limit the module call is automatically canceled and the next cycle resumes at the same point The type code 98 is returned The following type codes are defined Type Data Type Description Code 141 Version 1 21 Chapter 9 Network and Communication 00 Unknown Undefined item found 01 TAG element Start of Element Data pointer for the element of BLOCK1 02 END TAG Element End of the element 03 TEXT Content of an element Data pointer for value on BLOCK1 04 ATTRIBUTE Attributes of an element Data pointer for attributes of BLOCK1 Data pointer for value on BLOCK2 05 TAG Processing Instruction Instructions for processing Data pointer for the element of BLOCK1 12 CDATA not analyzed content TEXT Data pointer for value on BLOCK1 13 COMMENT COMMENT Data pointer for value on BLOCK1 14 DTD Document Type Declaration Data po
32. library of a competitor is excluded because the libraries of the manufacturers differ greatly in scope and con tent 4 The understanding of complex modules without an insight into the source code is often very difficult Therefore the programs are ineffi cient and error prone OSCAT will create with the open OSCAT Library a powerful and compre hensive standard for the programming of PLC which is available in the Source Code and verified and tested by a variety of applications in detail Extensive knowledge and suggestions will continue to flow through a va riety of applications to the library Thus the library can be described as very practical OSCAT understands his library as a development template and not as a mature product The user is solely responsible for the tests in its application modules with the appropriate procedures and to verify the necessary accuracy quality and functionality At this point we refe rence to the license and the disclaimer mentioned in this documentation Version 1 21 Chapter 2 Introduction 2 2 Conventions 1 Direct modification in memory Functions which modify input values with pointer like Array Sort starts with an underscore Array Sort sorts an array directly in memory which has the significant advantage that a very large array may not be passed to the function and therefore memory of the size of the array and the time is saved for copying However it is only re commen
33. location city Sunnyvale region CA country US gt lt yweather location gt lt yweather units temperature F distance mi pressure in speed mph gt lt yweather units gt lt yweather wind chill 57 direction 350 speed 7 gt lt yweather wind gt lt yweather atmosphere humidity 93 visibility 1609 pressure 30 12 rising 0 gt lt yweather atmosphere gt lt yweather astronomy sunrise 7 02 am sunset 4 51 pm gt lt yweather astronomy gt lt image gt lt title gt Yahoo Weather lt title gt lt width gt 142 lt width gt lt height gt 18 lt height gt lt link gt http weather yahoo com lt link gt lt url gt http us i1 yimg com us yimg com i us nws th main_142b gif lt url gt lt image gt lt item gt lt title gt Conditions for Sunnyvale CA at 3 56 pm PST lt title gt lt geo lat gt 37 39 lt geo lat gt lt geo long gt 122 03 lt geo long gt lt link gt http us rd yahoo com dailynews rss weather lt span style font size Opx gt lt span gt Sunnyvale__CA lt span style font size Opx gt lt span gt http weather yahoo com lt span style font size Opx gt lt span gt forecast 94089 _f html lt link gt lt pubDate gt Tue 29 Nov 2005 3 56 pm PST lt pubDate gt lt yweather condition text Mostly Cloudy code 26 temp 57 date Tue 29 Nov 2005 3 56 pm PST gt lt yweather condition gt lt description gt lt CDATA lt img src http us i1 yimg com us yimg com i us we 52 26 gif
34. neutral use of Ethernet communications In order to unite the many different interfaces of the PLC companies that IP CONTROL is used as an adapter wrapper This module UDP and TCP as well as active and passive connections can be handled As in some small controls the number of simultaneous open sockets is very limited so this module also supports the sharing of sockets An integrated automatic coordination of requests allows to divide a socket to a number of client devices Here is automatically recognized whether a client uses a different connection parameters than its predecessor An existing connection is automatically terminated and established with the new connection parameters The type of connection can be set with C MODE see table With C_PORT the desired port number is given and by the C IP the IP v4 address With C_ STATE can be determined whether the connection is established closed resp the negative and positive edge on change of state C ENABLE agent will release the connection establish or close removed The send and receive data works independently of each another which means it is also possible to send and receive asynchronous such as Telnet In applications which only send data and no data receive is expected R OBSERVE must be FALSE so that no Timeout at receive occurs At the start of transmit and receive activities TIME RESET is set by the user a to TRUE once so that all timeout start over with a defined start value
35. of http weather yahooapis com down analyzes the XML data and provides the essential data processed from the YAHOO WEATHER data structure With a positive edge of ACTIVATE the query started and process a DNS query with the following HTTP GET After successful receipt of data by XML READER all elements are processed and if necessary stored in the data structure in converted form With UNITS may still be selected between Fahrenheit and Celsius as a unit By specifying the precise LOCATION_ID the location of the weather is indicated While the query is active BUSY TRUE is passed After successful completion of the query DONE TRUE is shown If occur in the query then this error is reported under ERROR _C in combination with ERROR T ERROR T 207 Version 1 21 Chapter 13 Weather Data Value Properties 1 The exact meaning of ERROR_C can be read at module DNS_ CLIENT 2 The exact meaning of ERROR_C can be read at module HTTP_GET Find the Location ID of a specific place Use your Internet browser the page http weather yahoo com and in the field Enter city or zip code and enter the name of the desired location and search Yahoo My Yahoo Mail Mores Make My Home Page New User Sign Up Sign In Help YAHOO NEWS WF Search WEB SEARCH Weather hl U S Business World Entertainment Sports Tech Politics Science Health Travel Most Popular Photos Opinion Local News Odd
36. passed in parameter FILENAME The search for elements always begins on the given depended OFFSET and hence is very easy to look only at certain positions or to repeat the search from a specific section to browse not always the entire byte array At the initial search should start default to OFFSET O but may not When querying sections and keys there are various procedures Either it is queried to a Section and evaluates all of the following keys by individual queries or to use in very large initialization file the classic enumeration listing which means it will be report serially all the elements and processed by the application 164 Version 1 21 Chapter 10 File System Section Search To determine the OFFSET of a specific Section STR must declare the name of the Section and the offset can be set to a position that is located before of the searched section Should only the nearest available section be found at STR an empty sting must be passed The search query is started by RUN 1 The search will take different time depending on the structure and size of the INI data it takes an indefinite number of cycles until a positive or negative result is achieved Once the search is finished the IN PARSER BUF sets the parameters of RUN to 0 RESULT passes the result of the search to output Upon successful search the name of the section is shown at parameters KEY And then the OFFSET parameter points to the end of the sec
37. remains constant to TRUE so always this key code sent repeated after the time T REPEAT At output KEY in active control 1 is passed KEY 0 means that the IN is not active 6 8 IRTRANS SND 4 Type Function module Input IN 0 3 BOOL TRUE Send keycode x T REPEAT TIME time to re send the key code I O IP_C data structure IP CONTROL Parameterization S BUF data structure NETWORK BUFFER SHORT Transmit data Setup DEV CODE STRING to be decoded remote control name KEY CODE_0 3 STRING key code to be sent Output KEY BYTE output of the currently active key codes 43 Version 1 21 Chapter 6 Device Driver IRTRANS SND 4 1 IRTRANS SND 4 allows users to send remote control commands to the IR Trans If IN_x is TRUE the specified device and key code in setup is sent to the IRTrans which outputs in turn as a real remote control commands With T REPEAT the repeat time for sending can be specified If IN O remains constant to TRUE so always this key code sent repeated after the time T_ REPEAT If a change to a different IN_x occures this code will send imme diately and then again delayed with T_REPEAT if it remains a long period of time At output KEY the currently controlled KEY will be displayed KEY 0 means that no IN x is active The values 1 3 are the IN 0 IN 3 6 9 IRTRANS SND 8 Type Input I O Setup Output Function module IN_0 7 BOOL TRUE Send keycode x T_REPEAT TIME tim
38. screen BACK_COLOR will be deleted 1 AUTOWRAP In AUTOWRAP 1 the write cursor is on reaching the end of line is automatically set to a next line If the text output the X Y positions are always specified with it is better when AUTOWRAP 0 2 COLOR Enables the color mode it will apply BACK COLOR and FRONT COLOR to the output 3 NEW UNE In NEW UNE 1 is automatically a carriage return and line feed added to the end of the text So the next text output starts a new line But this is only useful if no X_pos and Y_ pos be specified 4 RESERVE 5 RESERVE 136 Version 1 21 Chapter 9 Network and Communication 6 RESERVE 7 NO BUF FLUSH Prevents the data in the buffer to be sent immediately Only if the buffer is completely full or this option is disabled the data is sent Allows fast sending many texts in the same cycle 9 24 Type IN OUT INPUT OUTPUT TEAT TELNET PRINT Function module IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data TEXT STRING string_ length output text S BUF SIZE UINT Size of the buffer S BUF ENABLE BOOL enable communication SEND BOOL positive edge Send offense OPTION BYTE Send Options BACK COLOR BYTE background color FRONT COLOR BYTE foreground color X_pos BYTE X coordinate of the cursor position Y_pos BYTE Y coordinate of the cursor position PORT WORD port number
39. see the section Other functions 2 3 Test environment and conditions Available platforms and related dependencies CoDeSys Needs the libraries SysLibFile lib and SysLibSockets lib Runs on WAGO 750 841 CoDeSys SP PLCWinNT V2 4 and compatible platforms PCWORX No additional library needed Runs on all PLC iwith file system and Ethernet controllers with firmware gt 3 5x BECKHOFF Development Environment Target PLC libraries to include Platform 11 Version 1 21 Chapter 2 Introduction TwinCAT v2 8 0 or higher PC or CX TcSystem Lib x86 TcBase Lib TcSystem Lib TwinCAT v2 10 0 Build gt 1301 or CX ARM TcSystem Lib higher TcBase Lib TcSystem Lib Requires the installation of TwinCAT TCP IP Connection Server Thus needs the library Tcplp Lib Standard lib TcBase Lib TcSystem Lib is automatically included Programming environment NT4 W2K XP Xpe TwinCAT system version 2 8 or higher TwinCAT Installation Level TwinCAT PLC or higher Target platform TwinCAT PLC runtime system version 2 8 or higher PC or CX x86 TwinCAT TCP IP Connection Server v1 0 0 0 or higher NT4 W2K XP XPe CE image v1 75 or higher CX ARM TwinCAT TCP IP Connection Server v1 0 0 44 or higher CE image V2 13 or later 2 4 Releases This manual is updated by OSCAT continuously It is recommended to dow nload the latest version of the OSCAT manual unde
40. sich nicht mehr kompilieren lassen 1 1 Disclaimer The software modules included in the OSCAT library are offered with the intent to serve as a template and guideline for software development for PLC according to IEC61131 3 A functional guarantee is not offered by the programmers and is excluded explicitly As the software modules included in the library are provided free of charge no warranty is provided to the extent permitted by law As far as it is not explicitly arranged in written form the copyright owners and or third parties provide the software modules as is without any warranty explicit or implicit including but not limited to market maturity or usability for a particular purpose The full risk and full responsibility concerning quality absence of errors and performance of the software module lie with the user Should the library or parts of it turn out to contain errors the costs for service repair and or correction must be assumed by the user Should the entire library or parts of it be used to create user software or be applied in software projects the user is liable for the absence of errors performance and quality of the application Liability of OSCAT is explicitly ruled out The OSCAT library user has to take care through suitable tests releases and quality assurance measures that possible errors in the OSCAT library cannot cause damage The present license agreements and disclaimers are equally valid for
41. the colorcode to change without changing the existing character at that position 11 23 TN SC WRITE C Type Function module INPUT lin_Y INT Y coordinate fzy lin_X INT X coordinate lby AT TR BYTE color code Ier STRING STRING text lin LENGTH INT text will be adjusted to this length lin OPTION INT option length adaptation of the text IN OUT AUS IN SCREEN Us TN SCREEN 193 Version 1 21 Chapter 11 Telnet Vision TN SC WRITE C Iin Y b us TN SCREEN Iin X Iby ATTE Ist STRING Iin LENGTH Iin OPTION Zus TH SCHEEN t The module TN SC WRITE C is at the given coordinates lin_Y lin Y Ist STRING the text with the color of Iby_ATTR The text is adapted before output on the length lin LENGTH and by lin OPTION the text position is determined lin OPTION O right fill with spaces eg TEST 1 left fill with blanks eg TEST 2 center and fill with blanks eg TEST 11 24 TN SC WRITE CHAR Type Function module INPUT lin_Y INT Y coordinate lin_X INT X coordinate OUTPUT Iby CHAR BYTE sign IN OUT Xus_TN SCREEN Us TN SCREEN TN SC WRITE CHAR Tin e Zus TN SCREEN Iin Iby CHAR Zus TN SCREEN e The module TN SC WRITE CHAR passes the character Dy CHAR at the given coordinates lin_Y lin_X and does not change the color information at the specified position 194 Version 1 21 Chapter 11 Telnet Vision 11 25 TN SC WRITE_EOS Type Function module
42. the passed File name is not empty and elements can be evaluated the module returns TRUE otherwise FALSE Example c folder1 dir2 oscat txt DRIVE DIRECTORY FILE NAME 10 5 FILE SERVER Type Function module IN OUT FSD FILE SERVER_DATA file interface PT NETWORK BUFFER read write data 222 FILE SERVER Fal b t Fad PT b t FT Available platforms and related dependencies CoDeSys Does the library SysLibFile lib Runs on WAGO 750 841 CoDeSys SP PLCWinNT V2 4 and compatible platforms 154 Version 1 21 Chapter 10 File System PCWORX No library required Runs on all controllers with file system from firmware gt 3 5x BECKHOFF Development Environment Target PLC libraries to include Platform TwinCAT v2 8 0 or higher PC or CX TcSystem Lib x86 TwinCAT v2 10 0 Build gt 1301 or CX ARM TcSystem Lib higher The module FILE SERVER enables hardware and manufacturers a neutral access to the file system of PLC Since at almost every hardware and software platform the accessibility to the file system is sometimes very different it is necessary to use a uniform and simplified functional interface which is reduced to the necessary functions The module is hardware dependent and therefore it must be available for that platform are the appropriate implementation With FILE NAME the file is determined Depending on the platform may be Slightly different syntax with or wit
43. with DONE the data acquisition was displayed as a positive edge OPTION BIT Function Description 0 SCREEN INIT After connecting to the TELNET console the entire screen is cleared If the COLOR OPTION is selected the screen BACK_COLOR will be deleted 1 AUTOWRAP In AUTOWRAP 1 the write cursor is on reaching the end of line is automatically set to a next line If the text output the X Y positions are always specified with it is better when AUTOWRAP 0 2 COLOR Enables the color mode it will apply BACK COLOR and FRONT COLOR to the output 3 NEW_LINE In NEW_LINE 1 is automatically a carriage return and line feed added to the end of the text So the next text output starts a new line But this is only useful if no X_pos and Y_pos be specified 4 RESERVE 5 RESERVE 6 RESERVE 7 NO BUF FLUSH Prevents the data in the buffer to be sent immediately Only if the buffer is completely full or this option is disabled the data is sent Allows fast sending many texts in the same cycle 138 Version 1 21 Chapter 9 Network and Communication FRONT COLOR Byte Color Byte Color 0 Black 16 Flashing Black 1 Light Red 17 Flashing Light Red 2 Light Green 18 Flashing Light Green 3 Yellow 19 Flashing Yellow 4 Light Blue 20 Flashing Light Blue 5 Pink Light Magenta 21 Flashing Pink Ligh
44. 1 23 ABC 23 NEXT 44 2 ABC 23 NEXT 44 3 NEXT ABC 23 NEXT 44 4 44 0 e N A e 5 3 NETWORK VERSION Type Function DWORD Input IN BOOL if TRUE the module provides the release date Output Version of the library NETWORK _ VERSION IR NETWORK VERSION NETWORK VERSION provides if IN FALSE the current version number as DWORD If IN is set to TRUE then the release date of the current version as a DWORD is returned Example NETWORK VERSION FALSE 111 for version 1 11 DWORD TO DATE NETWORK VERSION TRUE 2011 2 3 35 Version 1 21 Chapter 6 Device Driver 6 Device Driver 6 1 IRTRANS The module IRTRANS provide an interface for infrared Transmitter Com pany IRTrans GmbH IRTrans offers transmitter for RS232 and TCP IP all of which can be operated with the following driver components The basic connection to RS232 or TCP IP must be made with the appropriate manu facturer routines The interface modules rely on a Buffer Interface to which provides in a Buffer Array of Byte data and in a Counter the length of the data packet in bytes The IRTrans devices learn the IR key codes and trans late them in ASCII Strings using a configurable database With the Ether net variant this Strings then sent over UDP and can be received from a PLC and be evaluated Thus for example the blinds are automatically Shut down when someone turns on the TV without this additional action wo
45. 111 11111111 do nothing at timeout Code 98 example Index des ersten Zeichen Index of last character Init report all elements Exit no further elements available a Evaluation of the XML elements by pressing CTRL data structure END IF 208 143 Version 1 21 Chapter 9 Network and Communication I Sonstiges sasra ZZ END CASE The following information is passed via the CTRL data structure First pass COUNT 1 TYPE 5 OPEN ELEMENT PROCESSING INSTRUCTION LEVEL 1 ELEMENT xml PATH Zem Next cycle COUNT 2 TYPE 4 ATTRIBUTE LEVEL 1 ELEMENT xml ATTRIBUTE version VALUE 1 0 PATH Zem Next cycle COUNT 3 TYPE 2 CLOSE ELEMENT LEVEL 0 ELEMENT xml PATH Next cycle COUNT 4 TYPE 1 OPEN ELEMENT Standard LEVEL 1 ELEMENT rss PATH Irss Next cycle COUNT 5 TYPE 4 ATTRIBUTE LEVEL 1 ELEMENT rss ATTRIBUTE version VALUE 2 0 PATH Irss Next cycle COUNT 6 TYPE 1 OPEN ELEMENT Standard LEVEL 2 ELEMENT Channel PATH rss channel Next cycle COUNT 7 144 Version 1 21 Chapter 9 Network and Communication TYPE 13 COMMENT ELEMENT LEVEL 2 VALUE XML Demo PATH rss channel Next cycle COUNT 8 TYPE 12 CDATA LEVEL
46. 19 XML CONTROL XML_CONTROL data structure Data field Data Type Description COMMAND WORD Control commands binary occupancy START_POS UINT Buffer index of first character STOP_POS UINT Buffer index of the last characters COUNT UINT Element number TYPE INT Type code of the current element LEVEL UINT Current hierarchy level PATH STRING STRING_ LENGTH Hierarchy as TEXT PATH ELEMENT STRING STRING_ LENGTH current item as TEXT ATTRIBUTE STRING STRING_ LENGTH Current attributes as TEXT VALUE STRING STRING_ LENGTH Current value as TEXT BLOCK1_ START UINT Start position of block 1 BLOCK1 STOP UINT Stop position of Unit 1 BLOCK2_START UINT Start position of block 2 BLOCK2 STOP UINT Stop position of Unit 2 2 Version 1 21 Chapter 4 Data Types of the NETWORK Library 4 20 WORLD WEATHER DATA WORLD_WEATHER_ DATA data structure Name Type Properties CUR WORLD_WEATHER_CUR Current weather conditions DAY ARRAY 0 4 OF WORLD_WEATHER_DAY Next 5 days of weather forecast WORLD_WEATHER_CUR data structure Name Type Properties OBSERVATION_TIME STRING 8 Observation time UTC TEMP_C INT Temperature C WEATHER_CODE INT Unique Weather Code WEATHER_DESC STRING 60 Weather description text WEATHER_ICON INT Weather Icon WIND SPEED MILES INT Wind speed in miles per hour WIND SPEED KMPH INT W
47. 20 Version 1 21 Chapter 9 Network and Communication A K O D St ZS a e e S a 23 SZ en bell T eTa F Lo coe X Read Coils 1 x Read X Read Discrete Inputs 2 x Read X Read Holding Registers 3 x Read x X X X Read Input Register 4 x Read x X X X Write Single Coil 5 x Schreiben X Write Single Register 6 x Schreiben x xX Write Multiple Coils 15 x Schreiben X Write Multiple Register 16 x Schreiben X xX Mask Write Register 22 x Schreiben Read Write Multiple Register 23 x Read Write X X X X 9 16 PRINT SF Type Function module IN OUT PRINTF DATA ARRAY 1 11 OF STRING string_ length Parameter data STR STRING String length String result 937 PRINT SF PRINTF DATA e PRINTF DATA STR b e STR With PRINT SF a STRING can be added dynamically with a part of a string The position of the substring to be inserted is indicated by tilde character and the subsequent number defines the parameter number 1 to 9 are thus processed automatically If the insert of the substring 121 Version 1 21 Chapter 9 Network and Communication reached the maximum number of characters so instead of the substring IS Inserted VAR LITER REAL ze 545 4 PUBLLZEIT gt INT lt 253 NAME STRING tank content PARA ARRAY les ll OF STRING etraing length Po PRINT SF END VAR PARA REAL TO STRING l
48. 3 Weather Data KEY STRING 30 API Key OUTPUT BUSY BOOL Query is active DONE BOOL Query completed without errors ERROR _C DWORD Error code ERROR_T BYTE error type re WORLD WEATHER BUSY The module loads the current weather data for the specified location of http worldweather com down analyzes the data and stores the essential data processed in the WORLD _WEATHER DATA data structure Following values are stored from the current day Observation time UTC Temperature C Unique Weather code Weather description text wind speed in miles per hour wind speed in kilometer per hour wind direction in degree 16 point wind direction compass precipitation amount in millimeter Humidity Visibility km Atmospheric pressure in milibars Cloud cover From the current day and the next four days the following values are stored Date For which the weather is forecasted Day and night temperature in C Celsius and F Fahrenheit Wind speed in mph miles per hour and kmph kilometers per hour 16 point compass wind direction A unique weather condition code Weather description text Precipitation Amount millimetre With a positive edge of ACTIVATE the query started and process a DNS query with the following HTTP GET After successful receiving all data elements are processed and if necessary stored in the data structure in converted form By the parameters of latitude and longitude the exact p
49. A moon phase takes about 29 53 days and goes through the typical conditions of this new moon to full moon resp increasing and decreasing moon This cycle can be scaled by SCALE to a desired value between 0 and 255 Example if 100 is given the moon phase is displayed as a percentage The real length of a single moon period is subject to relatively large variations and thjs is not included in the calculation method used Thus you can identify deviations from a few hours The viewing location geo location is a virtual point in the center of the earth If the moon phase is visualized using graphics a scaling factor of 12 is used in order to get to the steps 0 11 See Chapter visualization Moon Graphics http de wikipedia org wiki Mondphase 206 Version 1 21 Chapter 13 Weather Data 13 2 YAHOO WEATHER Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER Transmit data R BUF NETWORK BUFFER Receive data YW YAHOO WEATHER weather data INPUT ACTIVATE BOOL positive edge starts the query UNITS BOOL FALSE Celsius TRUE Fahrenheit LOCATION STRING 20 location specified by LOCATION ID OUTPUT BUSY BOOL Query is active DONE BOOL Query completed without errors ERROR _C DWORD Error code ERROR_T BYTE error type eee YAHOO WEATHER ACTIVATE UNITS LOCATION The module loads the current weather data for the specified location using an RSS feed XML data structure
50. ATHER this module should be called Subsequently It is simply the parameter DONE from the module YAHOO_WEATHER that is interconnected with ACTIVATE The following elements will be adapted YW CUR_ CONDITIONS TEXT YW FORCAST TODAY TEXT YW FORCAST_TOMORROW TEXT 210 Version 1 21 Chapter 13 Weather Data 13 4 YAHOO WEATHER ICON OSCAT Type Function module IN OUT YW YAHOO_WEATHER_DATA Weather data INPUT ACTIVATE BOOL positive edge starts the query D YAHOO _ WEATAHER_ICON_OSCAT ACTIVATE be rw CV P The module replaces the original vendor specific numbers on the weather icons by OSCAT standard icon numbers Following a positive edge at ACTIVATE the elements icon numbers in the YAHOO WEATHER DATA data structure is replaced After querying the weather data using YAHOO WEATHER this module should be called subsequently It is simply the parameter DONE from the module YAHOO WEATHER that is interconnected with ACTIVATE The following elements will be adapted YW CUR_ CONDITIONS ICON YW FORCAST TODAY_ICON YW FORCAST TOMORROW_ICON 13 5 WORLD WEATHER Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER Transmit data R BUF NETWORK BUFFER Receive data WW WORLD_WEATHER DATA Weather data INPUT ACTIVATE BOOL positive edge starts the query LATITUDE REAL latitude of the reference location LONGITUDE REAL longitude of the reference location 211 Version 1 21 Chapter 1
51. E TE EE 190 11 18 TN SC READ FE 190 11 19 _TN_SC_ SHADOW AIR euere nn 191 11 20 I 2C WEWPORT WEE 191 E21 N 2 WEITE EEN 192 1122 TN C WRITE ATIR een ernennen 193 Hoe We aE a T E EE E TT E 193 11 24 TN SC_ WRITE CHAR cccccccccccccceeeeecececeeeeueuececeeeceueesueeeeeeseeeeusuaeeeeeeeeeeesaaaneesess 194 11 5 TN SC WRITE FOS ern nn tendered am 195 TT 2G nr WE E 195 TUF DE VE nenne 196 12 Network Variables u uunuunnunnnnnunnunnunnnunnunnunnnnnnunnunnunnunn 197 DT DIET ee re 197 122 NET VAR CONTROL eeben 199 12 3 NET VAR BOOL8 200 5 Version 1 21 Chapter 124 NET VAR BE cree Se receipes tne aos Cea a ees recuse touts re are eier 201 12 5 NET VAR se a ea ee os nse wad peur eat aan Deere Heide 202 e EC WE 202 12 7 NET VAR TE 203 E oe WE 204 13 Weather d ME 206 E I le e 206 13 2 AHO WEATHER ee ee en eee 207 13 3 AHOO WEATHER DESC NE ee a ae ee 210 13 4 YAHOO WEATHER ICON OSEAT EE 211 E et MR EE 211 13 6 WORLD RR 214 13 7 WORED WEATHER ICON Be E 215 14 Vi Ual ZATION BEEN 216 e CUE TRER EE 216 14 2 KOON OE EE 219 E e te E nee ee en ee 220 6 Version 1 21 Chapter 1 Legal 1 Legal Die OSCAT Network Bibliothek definiert neben den Standard Datentypen weitere Datentypen Diese werden innerhalb der Bibliothek verwendet k nnen aber jederzeit von Anwender fur eigene Deklarationen verwendet werden Ein L schen oder ver ndern von Datentypen kann dazu f hren das Teile der Bibliothek
52. ETWORK BUFFER read data buffer OUTPUT RESULT BYTE result of query tre Loy PARSER_BUPF SEF RUN t OFFSET amp VALUE t PT The module CSV_PARSER_BUF enables the analysis of the elements contained in the buffer The number of data contained on PT SIZE specified The separator is specified in parameter SEP The search for elements that always begins depending on the given OFFSET so it is very easy to look at certain points in order to not always have to search the entire buffer At the beginning should be started with by default the OFFSET O but need not At the beginning of the default should be started OFFSET O but need not Of course this is dependent on the content or the structure of the data Evaluate elements Will specify in SEP O lines are always evaluated completely and parameter VALUE is issued If the elements in the buffer are structured as CSV Excel so at SEP the separator or something else can be specified RUN 1 startes the evaluation Since it is not foreseeable how long the search 147 Version 1 21 Chapter 10 File System takes a watchdog function is Integrated that stops the search for the current cycle then RESULT 5 and RUN remains unchanged In the next cycle the analysis proceeds automatically As soon as the next element is detected the element in VALUE is passed and RESULT is 1 If the element is also the last in a line then RESULT 2 is the output As soon as t
53. F in stream form Just the same when process data are sent The data in S BUF is sent individually as Stream allowed block size Application example CASE state OF On Wait for release LE RELEASE THEN state 10 LP OOTATE 17 ign On 9 END IF 10 Wait for clearance to access for connection and sending content ES IE SITE 2 THEN EE permitted IE eet up date traffic LPs PORT ae 7 enter port Humber 7 IP C C IP IP4 Enter IP IP C C MODE 1 Mode UDP ACTIVE Port IP zi LP Cel ENABLE TRUE Release conmmection LP Cel IME RESET TRUE Reset Lime monitoring LP CR OBSERVE TRUE Monitor data roceive R BUF SIZE 07 Reset Home lengrh Send data register 9 BOF BUFFER U f RE Le LR ECO ee ZS BUP SIZEE 2 enter send length 7 103 Version 1 21 Chapter 9 Network and Communication state 30 30 IF IP CsERROR lt gt O THEN Perform error analysis ELSIF gt BUF SIZE 0 AND R BUP SLAan gt xxx THEN evaluate received data Logout release access for other LP oles BYTE 4 state 0 0 process end END IF END CASE Kr ZK FIPO Gall ehre IP FIFO FIFO sIP Crile Tae 272 0 ID TE Uti Peal FIPA ELE IP STATE IP FIP TATE IP ID IP FIFO ID following C MODE may be used TYP TCP UDP Aktiv Passiv Port num
54. FER Network buffers for receiving data 4 16 PRINTF_DATA PRINTF_DATA data structure Data field Data Type Description 25 Version 1 21 Chapter 4 Data Types of the NETWORK Library PRINTF ARRAY 1 11 OF STRING LOG SIZE Array for passing parameters 4 17 UNI CIRCULAR BUFFER DATA The Structure UNI CIRCULAR BUFFER DATA is used for data management for the module UNI CIRCULAR BUFFER UNI CIRCULAR BUFFER DATA Data field Data Type Description D MODE INT MODE command number D HEAD WORD Header information Read Write D STRING STRING STRING_ LENGTH STRING Read Write D REAL REAL REAL Read Write D DWORD DWORD DWORD Read Write BUF SIZE UINT Number of bytes in the buffer BUF COUNT UINT Number of elements in the buffer BUF USED USINT Level 0 100 BUF NW_BUF LONG Data BUFFER _GetStart UINT Internal read pointer _GetEnd UINT Internal read pointer _Last UINT Intern Data pointer _First UINT Intern Data pointer 4 18 VMAP DATA VMAP_DATA data structure Name Type Properties FC DWORD function code release bit mask Version 1 21 Chapter 4 Data Types of the NETWORK Library V ADR INT Virtual Address Range Start address V SIZE INT Virtual address space number of WORD P ADR INT Real address space Start address TIME OUT TIME Watchdog 4
55. G STORE_ module If for example DELTA is the value 30 automatically every 30 seconds a record is saved 50 Version 1 21 Chapter 7 Data Logger Example FMT A D H N R T resuls 2011 12 22 06 12 50 7 5 DLOG REAL Type Function module IN OUT X DLOG_DATA DLOG data structure INPUT VALUE REAL process value N INT number of decimal places D STRING 1 decimal punctuation character COLUMN STRING 40 process value name DELTA REAL difference value eee DILOG_REAL The module DLOG REAL is for logging recording of a process value of type REAL and can only be used in combination with a DLOG STORE module as this coordinates of the data structure X to record the data Using parameter N defines the number of desired decimal places See documentation on the module REAL _ TO STRF The D input determines which character represents the decimal point Passed with no sign of parameter D automatically is used At recording formats that support a process value name such as at DLOG STORE FILE CSV a name can be provided at COLUMN If with DELTA parameter a value not equal 0 0 is specified the automatic data logging is enabled via differential monitoring Changing the value of VALUE to DELTA automatically stores a record This feature can be applied in parallel to the central trigger on the DLOG_STORE module 51 Version 1 21 Chapter 7 Data Logger 7 6 DLOG STRING Type
56. G_DATA DLOG data structure INPUT STATE BOOL process value TRUE FALSE 48 Version 1 21 Chapter 7 Data Logger ON STRING text for the TRUE state OFF STRING text for state FALSE COLUMN STRING 40 process value name DELTA DINT difference value i DLOG_BOOL The module DLOG_BOOL is for logging recording of a process value of type BOOL and can only be used in combination with a DOG STORE_ module as this coordinates of the data structure X to record the data At recording formats that support a process value name such as at DOG STORE FILE CSV a name can be provided at COLUMN Depending on the state of the STATE the TEXT of parameter OFF or ON is used If with DELTA parameter a TRUE is specified the automatic data logging is enabled via differential monitoring By changing the state of STATE automatically a record is stored This feature can be applied in parallel to the central trigger on the DLOG_STORE_ module 7 3 DLOG DINT Type Function module IN OUT X DLOG_DATA DLOG data structure INPUT VALUE DINT process value COLUMN STRING 40 process value name DELTA DINT difference value ore DLOG_DINT 49 Version 1 21 Chapter 7 Data Logger The block DLOG_DINT is for logging recording of a process value of type DINT and can only be used in combination with a DOG STORE _ module as this coordinates of the data structure X to record the data At recording formats that support
57. ILE REMOVE File name not specified 161 FILE REMOVE File could not be deleted 255 Application Position is after the end of file ERROR CoDeSys error codes Value trigger Description 0 No error 1 SysFileOpen Error 2 SysFileClose Error 3 SysFileRead Error 4 SysFileWrite Error 5 SysFileSetPos Error 6 SysFileGetPos Error 7 SysFileDelete Error 8 SysFileGetSize Error 158 Version 1 21 Chapter 10 File System 255 Application Position is after the end of file 10 6 INI DATEIEN An initialization file INI file in short is a text file which Windows uses to store program settings such as location of a program Re starting the program the program settings can be imported to retake the state before the last closing Due to the very simple functional structuring and handling this default Standard ist used for program settings and for similar PLC with a file sys tem An INI file can be divided into sections which must be enclosed in square brackets Information is read out as a key with an associated value When you create an ini file the following rules apply Each section must be unique Each key may appear only once per section Values are accessed by means of section and key A section may also contain no key Comments start with a Comments must not be directly behind a key or a section Comments must always start on a new line
58. IN OUT INPUT Function module X DLOG_DATA DLOG data structure STR STRING process value COLUMN STRING 40 process value name vee DLOG_STRING The module DLOG_DINT is for logging recording of a process value of type DINT and can only be used in combination with a DOG STORE_ module as this coordinates of the data structure X to record the data At recording formats that support a process value name such as at DOG STORE FILE CSV a name can be provided at COLUMN 7 7 DLOG STORE FILE CSV Type IN OUT INPUT OUTPUT Function module X DLOG_DATA DLOG data structure ENABLE BOOL release data recording TRIG_M BOOL manual trigger TRIG_T UDINT automatic trigger over time FILE NAME STRING file name DTI DT Current DATE TIME value SEP BYTE separator of the recorded elements ERROR_C DWORD Error code ERROR_T BYTE Problem type 52 Version 1 21 Chapter 7 Data Logger eg DLOG_STORE_FILE_CSW The module DLOG STORE FILE CSV is for logging recording of the process values in a CSV formatted file The data can be passed with the modules DOG DINT DOG REAL DLOG STRING DLOG DT The parameter TRIG M positive pulse is used to manually trigger start the storage of process data With Parameters TRIG _T an automatic time controlled release can be realized If the current date time value divided by the parameterized TRIG T value with residual value is 0 then a Save is perfor
59. If a request is submitted with a starting register address of 96 and a quantity of registers of 4 then this request will successfully operate address wise at least on registers 96 97 98 99 If a re quest is submitted with a starting register address of 96 and a quan tity of registers of 5 then this request will fail with Exception Code 0x02 Illegal Data Address since it attempts to operate on registers 96 97 98 99 and 100 and there is no register with address 100 XX XX XX 03 MB_CLIENT ILLEGAL DATA VALUE A value contained in the query data field is not an allowable value for server or slave This indicates a fault in the structure of the re mainder of a complex request such as that the implied length is in correct It specifically does NOT mean that a data item submitted for storage in a register has a value outside the expectation of the appli cation program since the MODBUS protocol is unaware of the sig nificance of any particular value of any particular register XX XX XX 04 MB_CLIENT SLAVE DEVICE FAILURE An unrecoverable error occurred while the server or slave was at tempting to perform the requested action XX XX XX 05 MB_CLIENT ACKNOWLEDGE Specialized use in conjunction with programming commands The server or slave has accepted the request and is processing it but a long duration of time will be required to do so This response is re turned to
60. If a write mode is called with PT SIZE 0 then in turn the file is opened if not already open and made no write command and these will remain open until a manual closing or AUTO CLOSE is carried out After every executed command that changes the position of the virtual read write pointer the current position in the data structure is written in the parameter OFFSET An automatic append function can be realized very easy The parameter FILE SIZE has to be written to the OFFSET parameter after opening the file After that all written bytes are appended to the end without changing the OFFSET parameter manually The same principle can be applied of course when reading the read pointer should be positioned first within the file usually starting at offset 0 lf a command is executed and FILE NAME differs from the current FILE NAME the old one still open file is closed automatically and the new one is opened then and continued with the normal command This can easily perform a flying change of the file without having to perform cumbersome and OPEN to CLOSE before When you delete a file with MODE 4 automatically a potentially outstanding file is closed before and then deleted in sequence After a AUTO CLOSE or manual closing by MODE 5 all data in FILE SERVER_DATA is reseted The module FILE SERVER should always be called periodically at least as long as not all requests are completed safely Since some platforms perform a file l
61. If the PLC is sitting behind a DSL router this router can be used as a DNS server through its gateway address Which ultimately leads to faster even with repeated requests response times because they are managed in the router cache With positive results DONE TRUE the DOMAIN contains the officially registered domain name until the start of the next query by positive edge of ACTIVATE ERROR gives ao error the error code See error codes Error Codes Value Source Description B3 B2 B1 BO nn nn nn xx IP_CONTROL Error from module IP_CONTROL xx xx xx 00 DNS_CLIENT No error The request completed successfully xx xx xx 01 DNS CLIENT Format error The name server was unable to interpret the query xx xx xx 02 DNS CLIENT Server failure The name server was unable to process this query due to a problem with the nameserver xx xx XxX 03 DNS CLIENT Name Error Meaningful only for responses from an authoritative 91 Version 1 21 Chapter 9 Network and Communication name server this code signifies that the domain name referenced in the query does not exist xx xx xx 04 DNS CLIENT Not Implemented The name server does not support the requested kind of query xx xx xx 05 DNS CLIENT Refused The name server refuses to perform the specified opera tion for policy reasons xx xx xx 06 DNS CLIENT YXDomain Name Exists when it should not xx xx xx 07 DNS CLIENT YXRRSet RR
62. Is given no value for a key an empty string is reported as the value Each section and each key or the following value must end with a newline In this case the type of newline character does not matter since all vari ants are accepted Most common variant is lt CR gt lt LF gt All control cha racters not printable characters are interpreted as end of line Space is always considered as part ofthe elements and is evaluated in the same manner In principle any number of section and key can be used 159 Version 1 21 Chapter 10 File System Basic structure Comment Section Comment Key value Example SYSTEM DEBUG LEVEL 10 JUIT ELE Statron 1 NAME ILC150 ETH TPH 1922164 LS 100 M2 S2 M3 C1 Station 2 NAME ILC350PN IP 192 168 15 108 M1 S1 M1 M2 S3 M2 160 Version 1 21 Chapter 10 File System 10 7 INI PARSER BUF Type Function module OUTPUT RESULT BYTE result of query IN OUT STR STRING STRING LENGTH searched item RUN BYTE command code for current action OFFSET UDINT current file offset of the query KEY STRING STRING LENGTH found item VALUE STRING STRING LENGTH value of a key PT NETWORK BUFFER read data buffer 161 Version 1 21 Chapter 10 File System The module INI PARSER BUF enables the analysis of elements of a INI file stored in a Byte Array Before queries can be processed the user must fill the byte array PT BUFFER wi
63. Kodierliste 100 Version 1 21 Chapter 9 Network and Communication The REGION CODE is coded to FIPS region code http en wikipedia org wiki List_of_FIPS region codes 9 8 IP CONTROL Type Function module IN OUT IPC IP_C parameterization S BUF NETWORK BUFFER transmit data H BUF NETWORK BUFFER receive data INPUT IP DWORD encoded IP address as the default PORT WORD port number of the IP address TIME OUT TIME monitoring time Available platforms and related dependencies CoDeSys requires the library SysLibSockets lib Runs on WAGO 750 841 CoDeSys SP PLCWinNT V2 4 and compatible platforms PCWORX No library required Runs on all controllers with file system from firmware gt 3 5x BECKHOFF 101 Version 1 21 Chapter 9 Network and Communication Requires the installation of TwinCAT TCP IP Connection Server Thus requires the Library Tcplp Lib Standard lib TcBase Lib TcSystem Lib are then automatically included Programming environment NT4 W2K XP Xpe TwinCAT system version 2 8 or higher TwinCAT Installation Level TwinCAT PLC or higher Target platform TwinCAT PLC runtime system version 2 8 or higher PC or CX x86 TwinCAT TCP IP Connection Server v1 0 0 0 or higher NT4 W2K XP XPe CE image v1 75 or higher CX ARM TwinCAT TCP IP Connection Server v1 0 0 44 or higher CE image V2 13 or later The IP_ CONTROL enables manufacturers and platform
64. L BOOL FIFO is full should not happen TOP INT Maximum number of entries in FIFO NW INT write index FIFO NR INT read index FIFO 4 14 LOG CONTROL us LOG VIEWPORT data structure Name Type Properties NEW MSG STRING STRING_LENGTH New Message Text NEW MSG OPTION DWORD New message Option BYTE 3 Reserve BYTE 2 Level BYTE 1 Backcolor BYTE 0 Frontcolor LEVEL BYTE Given log level SIZE INT Size of the array maximum index RESET BOOL Reset delete the entries PRINTF ARRAY 1 11 OF Parameter data for PRINT SF block STRING STRING_LENGTH MSG ARRAYIO N OF Array for message text 24 Version 1 21 Chapter 4 Data Types of the NETWORK Library STRING STRING_LENGTH MSG_OPTION ARRAY O N OF DWORD Array ofor messages Option BYTE 3 Reserve BYTE 2 Level BYTE 1 Back Color BYTE 0 Color front UPDATE_COUNT UINT Update counter increased with each new message IDX INT Current Issue Index RING_MODE BOOL en enabled overflow Ringmode enab e 4 15 NET_VAR_DATA NET_VAR data structure Name Type Properties CYCLE UDINT Cycle Counter STATE BYTE Operating condition INDEX INT Read write index ID_MAX USINT Number of satellite components Error_id BYTE ID number of the faulty module BUF_SIZE UINT Size of the buffer bytes S_ BUF NETWORK_BUFFER Network buffer for sending data R_BUF NETWORK_BUF
65. LE Type Function module IN OUT SEP BYTE devider FILE NAME STRING file name FSD FILE_SERVER_DATA file interface RUN BYTE command code for current action OFFSET UDINT current file offset of the query VALUE STRING STRING LENGTH value of a key PT NETWORK BUFFER read data buffer OUTPUT RESULT BYTE result of query 149 Version 1 21 Chapter 10 File System tre Cow PARSER_FILE SEP RESULT FILENAME t e FILENAME The module CSV_ PARSER FILE enables the analysis of the elements of an arbitrarily large file which is read into the read data buffer block by block for automatically processing The separator is specified in parameter SEP The name of the file is passed in parameter FILENAME The search for elements that always begins depending on the given OFFSET so it is very easy to look at certain points in order to not always have to search the entire buffer At the beginning should be started with by default the OFFSET O but need not When queried by elements of the file there are various procedures Of course this is dependent on the content or the structure of the data Evaluate elements Will specify in SEP O lines are always evaluated completely and parameter VALUE is issued If the elements in the file are structured as CSV Excel so at SEP the separator or something else can be specified RUN 1 Startes the evaluation Since it is not foreseeable how long the search takes a wat
66. LIENT is used to send of classic emails Following features are supported SMTP protocol Extended SMTP protocol Sending the subject line text and content Indication of email sender address From including Display Name Indication of the recipient s To Indication of carbon copy recipient s Cc Indication of blind copy recipient s bc Sending file s as an attachment Authentication method NO PLAIN LOGIN CRAM MD5 Specifying the port number When positive edge at ACTIVATE the transfer process is started The SERVER parameter contains the name of the SMTP server and optionally the user name and password and a port number If you pass a user name and password the procedure is according to standard SMTP 124 Version 1 21 Chapter 9 Network and Communication SERVER URL Examples username password smtp server username password smtp_server portnumber smtp server Special case If in the username is a included this must be passed as character and is then automatically corrected by the module again By specifying user and password the Extend SMTP is used and automatically the safest possible Authentication method is used If parameter is to specify the MAIL FROM sender address i e oscat gmx net Optionally an additional Display Name be added This is displayed the email client automatically instead of the real return address Therefore always an easily recognizable name to be used
67. Mask STRING Input mask st Input Data STRING STRING_LENGTH Text input current st_Input_String STRING text copy after entering St_Input_ToolTip STRING Text for ToolTip in_Input_Option INT Text Options bo Input Entered BOOL Text RETURN key pass bo Input Hidden BOOL Text hidden input with bo Input Only Num BOOL Text only allow number entry bo Focus BOOL Element has focus bo Update Input BOOL Element due to input redraw bo Update All BOOL Element draw from scratch 4 6 us TN MENU A variable of type us TN MENU can be used to parameterize a MENU item to display it and to process element related inputs us TN MENU Data field Data Type Description st_Menu_Text STRING STRING LENGTH Menu items Im Menu E Count INT Number of menu items in_Y INT Menu Y position Im A INT Menu X position by_Attr_mF BYTE Text attributes with focus by_Attr_oF BYTE Text attributes without focus in_X_SM_new INT Sub menu new X position in _Y_SM_new INT Sub menu new Y position in A DM old INT Sub menu old X Position 19 Version 1 21 Chapter 4 Data Types of the NETWORK Library in Y SM old INT Sub menu old Y position in Cur Menu Wem INT current main menu item in Cur Sub Item INT current sub menu item in State INT menu status in Menu_Selected INT selected menu item Menu number of lines BOOL action create menu bo Destr
68. N 39 6 5 IRTRANS TRO 8 en er nchendluiiantnianimiuemncivicwndesiamkbonasiauenetencantks 39 8 6 TRANS Eeer 40 6 75 NRTEAND NIE EE 42 6 8 IRTRANS OND ee 43 SE BE TER CIR 44 Fi Data LOG OCR se ctiresicccudsemnaneneveccscenassatenssducnttessessaiieneieeeseaneneecs 46 7 1 rahe EEN 46 To e ae ee E 48 1 3 TEOG DINT E 49 TA DU OB E 50 7 5 DOG BREAL ar ern En een 51 1 06 DLOG EE 52 7 7 DEI IE FETT N een ae 52 1 8 BEOGS TORE BET ae nee een ie ua 54 7 9 _DLOG_FILE TIOEIR taanu nAn L LERRA AEEEEEEERRAAEEEEEEEEER EEE EE EE EERS 63 7 10 DLOG FILE EENEG 66 7 11 UNI CIRCULAR BUFFER ee 69 o GOMPTES A 72 GL B askea neuen nnennnnnnnnnn nn nnnnn nennen nennen nenn nennen 72 8 2 ee DECODE STR een 72 8 3 BASE64 DELETE DEE 73 BA BI EI FNCODE H needed Renee 74 6 5 BASEG4 ENCODE STREAM seinen een 74 8 6 ug Be ep 75 8 7 HTML ENCODE EE 76 BO IPA CRECE rare dena tte ova cea eons einlegen ee 77 BI E DE O E tee eee TEE 77 Version 1 21 Chapter BO PALTO TRN tee an ee E ee 78 CN KE EE 78 8 12 1 URU EE 79 8 13 de EE 79 Sm de KE 80 8 15 MOS STREAM EE 80 81o MDS eer nade gs ts age pc ced oa ee res een 82 617 P d EEN E 82 8 18 SHAJI SE EE 83 8 19 GHAI STREAM epurare rni ont nen NE AANE Eee 84 8 20 SHAT On sen EE eee ee 85 8 21 TRING TO URL EE 86 0 22 URE DEC EEN 87 8 23 WR ERIC EE 87 34 URL TO erBING antn 111 tanan 1 Anun RANEA AEEEEEAEAAEEEEEEREAEEEEEEEEEERE ENEKE EERES 87 9 Network and Communication zuunu
69. News Comics Weather Full Coverage Video Audio Kevin Sites Site er aT is ee m a Ex d i Ai e Lo ee vd Fona The ked Weather weathercam MORE FROM WEATHER COM ter city or zip code Hurricane Watch DEE e Top 10 Beaches of the World fs ee Fishing Forecast deg eather a Severe Weather News Channel e Honeymoon Planner weather com After being selected in the browser window displays the current weather information of the specified location In the URL web link line is now the location ID can be seen en HERRE Weather Seen Maps wen Yahoo or Thus the desired settlement Wien Vienna returns the Location ID 551801 This code must be passed on the module as parameters Example of an RSS feed lt xml version 1 0 encoding UTF 8 standalone yes gt lt rss version 2 0 xmins yweather http weather yahooapis com ns rss 1 0 xmins geo http www w3 org 2003 0 1 geo wgs84_pos gt lt channel gt 208 Version 1 21 Chapter 13 Weather Data lt title gt Yahoo Weather Sunnyvale CA lt title gt lt link gt http us rd yahoo com dailynews rss weather Sunnyvale__CA http weather yahoo com forecast 94089_f htmi lt link gt lt description gt Yahoo Weather for Sunnyvale CA lt description gt lt language gt en us lt language gt lt lastBuildDate gt Tue 29 Nov 2005 3 56 pm PST lt lastBuildDate gt lt ttl gt 60 lt ttl gt lt yweather
70. OR_T and ERROR C are reseted The module has integrated the IP CONTROL and must not be externally linked to this as it by default would be necessary Background http de wikipedia org wiki File_ Transfer Protocol URL examples ftp username password servername portnummer directory ftp username password servername ftp username password servername directory ftp servername ftp username password 192 168 1 1 directory ftp 192 168 1 1 95 Version 1 21 Chapter 9 Network and Communication ERROR T Value Properties 1 Problem DNS_ CLIENT The exact meaning of ERROR_C can be read at module DNS_ CLIENT 2 Problem FTP control channel The exact meaning of ERROR_C can be read at module IP_CONTROL 3 Problem FTP data channel The exact meaning of ERROR_C can be read at module IP_CONTROL 4 Problem FILE_SERVER The exact meaning of ERROR_C can be read at block FILE_ SERVER 5 Problem END TIMEOUT ERROR_C contains the left WORD of the step number and the right WORD has the re sponse code received by the FTP server The parameters must be considered first as a HEX value divided into two WORDS and then be considered as a decimal value Example ERROR_T 5 ERROR_C 0x0028 O0DC End step number 0x0028 40 Response Code 0x00DC 220 9 5 GET WAN IP Type IN OUT INPUT OUTPUT Function module IP_C data structure IP CONTROL Parameterization S BUF
71. OSCAT Network LIBRARY Documentation In English Version 1 21 Chapter Table of Contents L Eigenen 7 L EE bebe 7 EE Wee Boece eng ne cata nee etait edie ca etter E EN 7 e dereen EE 8 1 4 Beer re adera er nenne ee ae ee 8 1 d nt EE 8 2 Ich dree Te TION rinnen 9 En Det dE 9 E Ee unge hore eeepc ee era a se deg A Sete cick O we bee tele eee meee eee ee eee 10 2 3 TeSt environment and conditions 11 ZA SEENEN 12 PD ON REES 13 3 Eet EEGEN neg ke a nn LA EE EE EE een 14 d Data Types of the NETWORK Libr ry usuuuuunnnunnnnnnunnnnunununnunn 16 A EI aa ee ae en a eas nee Brent esse 16 dele VE ER VE E 16 De eee D EE 17 44 uS TN INPUT CONTROL ee en eer en ee 17 Avo US TN INPUT CONTROL RT KE 18 A Me TI MEN EE 19 4 7 US IN MENU POPUP ee ee ea he 20 Aon US Ce E 21 4 9 FILE PAAR Eee EE ee ee EEE en 22 de 0 PIECE EPV ER eebe 22 Gu E We E EE 22 2 Me EE 23 AS EE 24 ds LA COG ROW BE 24 Au NET Ve E 25 4 16 PRINT DT sense era A A O E 25 4 17 UNI CIRCULAR es RE 26 dalo SAAP DA KEE 26 AES TO CT eau te EE 27 4 20 WORLD WEATHER DATA een nannten ki en een nn ee ee 28 Version 1 21 Chapter 4 21 YAHOO WEATHER Eeer 29 5 Other Ti dite Cu E 34 BT EEE CENT Ee 34 5 2 ELEMENT CF EE 34 5 3 Tele ME 35 acces seis ee ees eee era 36 6 1 IRTRANS 00 cececceccccececuececauceccueeecuececaeeeeaueeeceucessececaeceeaueeeeaeeecaeesaeeesaueeesaesesaeseraneesaaes 36 EE EE nennen 36 E TE e EE 37 BA IRTRANG VE EE
72. OW ATR 191 LOG CONTROL 24 TN SC VIEWPORT 191 222 Version 1 21 Chapter 14 Visualization TN SC WIEL 192 TN SC WRITE ATTR nennen 193 TN SC WRITE Ce 193 TN SC WRITE CHAR nennen 194 TN SC WRITE Es 195 TN SC XY ERROR 195 TN_SC_XY2_ERROR anna 196 TN SEND ROWS 183 UNI_CIRCULAR_BUFFER nennen 69 UNI CIRCULAR BUFFER DATA 26 Ee EAT en 17 URL DECODE ee 87 ORE ENCODE een 87 URL TO STRING nennen 87 us LOG VIEWPORT eege 16 US TN INPUT CONTROL een 17 us TN INPUT CONTROL DATA 18 us TN MENU era 19 US TN MENU POPUP 20 us WN SCREEN asien 21 VMAP DATA ne een 26 WORLD WEATHER een 211 WORLD WEATHER DATA 28 WORLD WEATHER DESC DE 214 WORLD WEATHER ICON OSCH 215 XML CONTROL eerren 27 XML BEADER 140 YAHOO WEATHER 207 YAHOO WEATHER DATA 29 YAHOO WEATHER DESC DE 210 YAHOO WEATHER ICON OSCAT anna 211 223 Version 1 21
73. Oby CHAR BYTE character at position X Y IN OUT Aus TN SCREEN Us TN SCREEN Ser TN SC READ CHAR Tin Oby CHAR Iin X Zus TN SCREEN Zus TN SCREEN r The module TN_SC_READ_CHAR is used to read the current character at the specified location X Y 190 Version 1 21 Chapter 11 Telnet Vision 11 19 TN SC SHADOW ATTR Type Function BYTE INPUT Iby_ATTR BYTE Color Information TN SC SHADOW ATTR Ihy ATTR TN SC SHADOW ATTR The block TN SC _ SHADOW _ATTR converts a light color to a dark color 11 20 TN SC VIEWPORT Type Function module INPUT lin_Y INT Y coordinate lin_X INT X coordinate Im Width INT width of the window the number of characters Idw_ATTR_1 DWORD color 1 2 3 and 4 Idw_ATTR_2 DWORD color 5 6 7 and 8 Iti TIME TIME update time IN OUT Xus LOG VIEWPORT LOG VIEWPORT AUS LOG CONTROL LOG CONTROL Xus_TN SCREEN us_ TN SCREEN TN SC VIEWPORT Tin X b us LOG VIEWPORT Iin Y e Zus LOG CONTROL Tin Width e Zus TN SCREEN Idw ATTR 1 Idw ATTR 2 Iti TIME Zus LOG VIEWPORT t Zus LOG CONTROL b Zus TN SCREEN t 191 Version 1 21 Chapter 11 Telnet Vision The module TN SC VIEWPORT is used to display messages from the data structure LOG CONTROL within a rectangular area on the screen The desired messages are processed before using with Block LOG VIEWPORT and if necessary with Aus LOG VIEWPORT UPDATE an update is triggered Means lin_X and lin_Y defines the
74. Output DONE BOOL TRUE if conversion is completed I O STR1 STRING 144 Text to convert STR2 STRING 192 converted text in BASE64 format With BASE64 ENCODE STR a standard text can be converted to a BASE64 encoded text With a positive edge of RUN the process starts Here DONE is immediately reseted if it has been set by a previous conversion The BASE64 encoded text is passed on STR1 and after the conversion the BA SE64 text is available in STR2 and DONE is set to TRUE Example Text in STR1 Open Source Community for Automation Technology Result in STR2 T3BIDIBTb3VyY2UgQ29tbXVuaxXR5IGZvciBBdXRvbWFOaW9UIFRIY2hub2xv Z3k 8 35 BASE64 ENCODE STREAM Type Function module Input SIZE1 INT number of bytes in the BUF1 to encode 74 Version 1 21 Chapter 8 Converter Output SIZE2 INT number of bytes in the encoded BUF2 results I O BUF1 ARRAY 0 47 OF BYTES data to convert BUF2 ARRAY 0 63 OF BYTES BASE64 converted data With BASE64 ENCODE STREAM arbitrarily long byte data stream accor ding to BASE64 can be encoded In one pass up to 48 bytes are conver ted in turn result more than 64 bytes Here the source data is passed to the encoder over BUFI in the data stream manner as individual blocks of data and in coded form re issued in BUF2 The user has to provide the fur ther processing of the BUF2 data before the next block of data is conver ted The number of bytes in BUF2 is issued by
75. Port number of the syslog server FACILITY BYTE specifies the service or component SEVERITY BYTE Classification of severity TAG STRING 32 Process name ID etc HOST NAME STRING Name or IP address of the sender MESSAGE STRING string length Message OPTION BYTE Various DONE BOOL Query completed without errors ERROR DWORD Error code 131 Version 1 21 Chapter 9 Network and Communication T7 ovo LOG SYSLOG is a standard for transmitting messages in an IP computer net work The protocol is very simple the client sends a short text message to the syslog receiver The receiver is also called syslog daemon or sys log server The messages are sent using UDP port 514 or TCP port 1468 and includes the message in plain text SYSLOG is typical used for compu ter systems management and security surveillance This enables the easy integration of various log sources to a central syslog server The server software is available for all platforms sometimes Known as free sharewa re Unix or Linux systems have a syslog server already integrated Through a positive edge at ACTIVATE from the parameters of LDT FACILI TY SEVERITY TAG HOST NAME MESSAGE a syslog message Is generated and sent to the SERVER _IP4 mail address With OPTION various properties can still be controlled See Table OPTION After successfully sending DONE gets TRUE otherwise ERROR is issued when the actual error messa ge See ERROR o
76. R C are reseted lf parameter RETRY 0 then the FTP transfer was repeated until it completes successfully If RETRY state at a value gt O the FTP transfer is just as often repeated in transmission failure Then this job is simply discarded and the process continues with the next file With RETRY TIME the waiting time between the repetitions can be defined The module has integrated the IP CONTROL and must not be externally linked to this as it by default would be necessary Background http de wikipedia org wiki File_ Transfer Protocol URL examples ftp username password servername portnummer directory ftp username password servername ftp username password servername directory ftp servername ftp username password 192 168 1 1 directory ftp 192 168 1 1 65 Version 1 21 Chapter 7 Data Logger ERROR T Value Properties 1 Problem DNS_ CLIENT The exact meaning of ERROR_C can be read at module DNS_ CLIENT Problem FTP control channel The exact meaning of ERROR_C can be read at module IP_CONTROL Problem FTP data channel The exact meaning of ERROR_C can be read at module IP_CONTROL Problem FILE_SERVER The exact meaning of ERROR_C can be read at block FILE_ SERVER Problem END TIMEOUT ERROR_C contains the left WORD of the step number and the right WORD has the re sponse code received by the FTP server The parameters must be considered first as a HEX val
77. SELECT POPUP is used to manage a Selection of texts by displaying a pop up dialogue This must be set IN TYPE 3 The item will be provided as in_X and in_Y Every entry line can be provided with a title text With in_ Title Y Offset and in_ Title sg Offset the position relative to the element coordinates is expressed The color can be determined with by_ Title Attr and the text by st_ Title String If a tool tip should appear at the element st_Input_ToolTip the text hast to be specified The selection of texts will be handed over in st_Input_Data The text element should be separated from each other by the character If the focus is on an element using the Enter Return key selection dialog can be activated With the cursor up down can be changed between the individual elements lf the beginning or the end of the list will be reachted it continues at the opposite side The text element is connected by means st_Input_Mask meaning that the output text length are affected later By pressing the Enter Return key is the text of the selected element is passed to st Input String and bo Input Entered TRUE The input flag must be reset after receive by the user An active selection selection dialog can always be canceled with the Escape key Example in _ Type 03 In Viz 20 In X 18 by Attr_mF 16 17 by Attr_oF 16 47 et Input ToolTip Change the current log leve
78. Set Exists when it should not xx xx xx 08 DNS CLIENT Nxrrset RR Set that should exist does not xx xx xx 09 DNS CLIENT Server Not Authoritative for zone xx xx xx 0A DNS CLIENT Name not contained in zone 9 3 DNS DYN Type Function module INPUT ENABLE BOOL release of the module UPDATE BOOL Launches new DNS registration immediately T UPDATE TIME waiting time for new DNS registration MODE BYTE selection of DynDNS provider HOST NAME STRING 30 own domain name USER NAME STRING 20 name for registration PASSWORD STRING 20 password for registration IP4 DWORD Optional specify the IP address OUTPUT BUSY BOOL module is active query is performed DONE BOOL performed DNS registration successful ERROR _C DWORD error code ERROR_T BYTE error type IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data R BUF NETWORK BUFFER receive data 92 Version 1 21 Chapter 9 Network and Communication With DNS DYN dynamic IP addresses are registered as domain names Many Internet providers assign a dynamic IP address when dialing into the Internet To be visible and accessible for Internet Participants one of the ways is to upgrade its current IP address via Dyn DNS The process is not Standardized unfortunately so for every Dyn DNS provider has to be created a individual solution The module can be used in conjunction with DynDNS org and Selfhost de The
79. Time value must be definded at DTI and at DTI_OFFSET the correction value as an offset in minutes from UTC Universal Time If the DTI in UTC time is passed at DTI OFFSET a must be passed The monitoring time can be specified with parameter TIMEOUT At dns_ip4 must be specified the IP address of the DNS server if in SERVER a DNS name is specified If errors occur during the transmission they are passed at ERROR_C and ERROR T As long as the transfer is running BUSY TRUE and after an error free completion of the operation DONE TRUE Once a new transfer is started DONE ERROR_T and ERROR C are reseted lf parameter RETRY 0 then the SMTP transfer was repeated until it completes successfully If RETRY state at a value gt O then the SMTP 68 Version 1 21 Chapter 7 Data Logger transfer is just as often repeated at transmission failure Then this job is Simply discarded and the process continues with the next file With RETRY TIME the waiting time between the repetitions can be defined The parameter FILE DELETE TRUE a file is deleted on the controller after successful transfer via email The module has integrated the IP CONTROL and so must not be externally linked to this as it would be at default necessary Basics http de wikipedia org wiki SMTP Auth http de wikipedia org wiki Simple Mail Transfer Protocol ERROR T Value Properties 1 Problem DNS_ CLIENT The exact meaning of ERROR_C ca
80. UP t Xus TN MENU POPUP Zus TN SCREEN e b gt Zus TN SCREEN The module TN_INPUT_MENU POPUP is used to manage and display the Menu_Bar Submenu and for the representation of TN_INPUT_SELECT_POPUP elements The element is shown in in_X and In GC The menu items are stored as elements within zer Menu_Text The individual element are devided from each other using To devide individual sub menu items from each other or providing them with a cut line an has to submitted as text menu element Within the sub menu can be navigated with up down key If a sub menu item is confirmed by pressing Enter Return key then in In Menu Selected the number of the selected menu point is passed An active Menu automatically backs up the background before it is drawn and restores the background after ending As long as a menu is display the user program may not make graphical changes This can be checked by TN SCREEN bo Menue Bar Dialog TRUE or TN _SCREEN bo Modal Dialog TRUE The module is primarily from TN INPUT MENU BAR and TN INPUT SELECT POPUP used internally and need not be executed directly by the user 11 7 TN_INPUT SELECT POPUP Type Function module IN OUT us TN SCREEN Us TN SCREEN 178 Version 1 21 Chapter 11 Telnet Vision Xus TN INPUT CONTROL us TN INPUT CONTROL 239 TN INPUT SELECT POPUP Zus TN SCREEN e b gt Zus TN SCREEN Zus TN INPUT CONTROL DATA Zus TN INPUT CONTROL DATA The module TN_INPUT
81. YTE ID ver MET VAR OW ORCOS IM OJT M OLTE IMs OUT 3 Id OLIT 4 INS OUT OLITE OJT The module NET_VAR_DWORDS is used for bidirectional transmission of eight DWORD from the master to slave and vice versa The signals DWORD IN1 8 are collected and passed to the other side control on the same module at the same position as OUT1 8 again Simultaneously the on the opposite side other control passed input datawords passed here as a OUT1 8 again ID parameter indicates the current identification number of the module instance If the configuration of the master and the slave program is differently incorrectly that ID number is passed as a fault in the module NET_VAR_CONTROL 12 6 NET VAR REAL8 Type Function module IN OUT X NET_VAR_DATA NET_VAR data structure INPUT IN 1 8 REAL input OUTPUT OUT 1 8 REAL output value ID BYTE ID 202 Version 1 21 Chapter 12 Network Variables a NET VAR REALS LIT OUT OUT 3 OUT4 OUTS OUTS OUT The module NET _VAR_REALS is used for bidirectional transmission of eight REAL values from the master to slave and vice versa The REAL values IN1 8 are collected and passed to the other side control on the same module at the same position as OUT1 8 again Simultaneously the on the opposite side other control passed input REAL values are passed here as a OUT1 8 again ID parameter indicates the current identification number of the module in
82. _ASCII_Code BYTE Key Code ASCII bo_Input _ASCII IsNum BOOL Key code is a digit in Page Number INT current page number in Cursor X INT Cursor X Position in _Cursor_Y INT Cursor Y Position in EOS Offset INT End of String Offset by Clear Screen Attr BYTE screen delete color bo Clear Screen Attr BOOL delete screen bo Modul Dialog BOOL modal dialog active bo Menu_Bar Dialog BOOL Menu dialog active 21 Version 1 21 Chapter 4 Data Types of the NETWORK Library 4 9 FILE PATH DATA The Structure FILE PATH DATA is used by the the module FILE PATH SPLIT to store each item FILE PATH DATA Data field Data Type Description DRIVE STRING 3 Drive Name DIRECTORY STRING STRING_ LENGTH Directory Name FILE NAME STRING File Name 4 10 FILE SERVER DATA FILE SERVER data structure Name Type Properties File open BOOL File is open FILE NAME STRING File Name MODE BYTE Mode command OFFSET UDINT File offset for reading and writing FILE SIZE UDINT Current size of the file in bytes AUTO_CLOSE TIME Timing for the automatic closure ERROR BYTE Error codes system dependent 4 11 IP2GEO IP2GEO data structure Name Type Properties STATE BOOL Data is valid Data is valid DWORD IP address of the geographical data 22 Version 1 21 Chapter 4 Data Types of the NETWORK Library
83. _IP4 256 255 255 255 FALSE IS_IP4 0 1 2 FALSE IS_IP4 0 1 2 3 FALSE 78 Version 1 21 Chapter 8 Converter 8 12 IS URLCHR Type Function BOOL Input IN STRING string to be tested Output BOOL TRUE if STR contains a valid IP v4 address TS_URLCHR 15_URLCHR IS URLCHR checks if the string contains only valid characters for a URL en coding If the string contains reserved characters it returns FALSE otherwi se TRUE For a URL following characters are valid A Z a z 0 9 all other characters are reserved or not allowed 8 13 MD5 AUX Type Function DWORD Input N INT internal use A DWORD Internal use B DWORD Internal use C DWORD internal use D DWORD internal use X DWORD Internal use U INT internal use T DWORD Internal use At the MD5 hash generation several cycles through the complex mathe matical calculations which are processed Thus the amount of redundant code in the module MD5 STREAM remains small periodic calculations have been displaced as a macro in the MD5 AUX This module has only in conjunction with the block MD5 STREAM a useful application 79 Version 1 21 Chapter 8 Converter MDS LUX MDS LUX MH A D i D U T 8 14 MD5 STR Type Function module Input RUN BOOL Positive edge starts the calculation Output DONE BOOL TRUE if calculations are complete MD5 ARRAY 0 15 OF BYTE current MD5 hash
84. a process value name such as at DLOG STORE FILE CSV a name can be provided at COLUMN If with DELTA parameter a value not equal 0 is specified the automatic data logging is enabled via differential monitoring Changing the value of VALUE to DELTA automatically stores a record This feature can be applied in parallel to the central trigger on the DOG STORE_ module 7 4 DLOG DT Type Function module IN OUT X DLOG_DATA DLOG data structure INPUT FMT STRING formatting parameters COLUMN STRING 40 process value name DELTA UDINT difference in seconds DLOG_OT The module DLOG DT is for logging recording of a date or time value of type STRING and can only be used in combination with a DLOG STORE module as this coordinates the record the data by the data structure X Using FMT parameter the formatting will be set In the FMT parameter can also be combined with normal text formatting parameters See documentation on the block Di TO STRF If the FMT parameter is not specified the default formatting A D H N R T is used At recording formats that support a process value name such as at DLOG STORE FILE CSV a name can be provided at COLUMN If with DELTA parameter a value greater than 0 is specified the automatic data logging is enabled via differential monitoring If time changes by the value of DELTA automatically a record is stored This feature can be applied in parallel to the central trigger on the DO
85. alization SETUP WEATHER_OSCAT 1 217 Version 1 21 Chapter 14 Visualization SETUP WEATHER_YAHOO 1 218 Version 1 21 Chapter 14 Visualization SETUP WEATHER_WORLD 1 SS ES ES ES ES 36 png 37 pn o 38 pnq 39 png 40 png 14 2 Moon Graphics SETUP MOON 1 219 Version 1 21 Chapter 14 Visualization S png d png 08 pnq UH png LU png li png 14 3 Wind charts SETUP WIND_1 220 Version 1 21 Chapter 14 Visualization rs o png nno png osc pnq H A ssw png ay A K Z wnw png d so png nw png ono png Be 5 i OG i gw G sso png y wsw png F E L D L d F ena nnw png 221 Version 1 21 Chapter 14 Visualization Index of Modules BASE64 DECODE emp 72 TOG MSG ee 111 BASE64 DECODE STREAM 73 LOG VIEWPORT 111 BASE64 ENCODE emp 74 MB CLIENT isseire 112 BASE64 ENCODE STREAM 74 MB SERVER 116 CSV PARSER BUE een 147 MB VMAP 118 CSV PARSER ELE 149 MD5 AUX cceccceseesceccserseseereserseetreenrenes 79 DLOG POOL A8 MD5 emp 80 DLOG DATA 16 MD5_ STREAM 80 DOG DINT AQ MD5 TO STmpnH 82 DLOG Dr 50 MOON PHASE 206 DLOG FILE TOETR 63 NET VAR BOOL8 200 DLOG FILE TO SMIT 66 NET VAR BUEFER 201 DLOG REAL nennen 51 NET VAR CONTROL 199 DLOG STORE FILE CN 52 NET VAR DATA 25 DLOG STORE BR 54 NET VAR DWORDS 202 DLOG STRING ccccccccecsccccesscse
86. alue is generated from 160 bits in length for any data The maximum length of the stream is on this module is limited to 2 32 4 gigabyte The result is a 20 byte hash value issued as ARRAY 0 19 OF BYTE Example There are 2000 bytes in a buffer and are read using the file system in blocks User sets MODE to 1 and SIZE to 2000 Calling the SHA1 STREAM SHA1 STREAM performs initialization and set MODE to 2 and passes at the POS the index base 0 of the desired data At SIZE the number of data to be copied into the data memory BUF Is set User copies the requested data in the BUF and calls the module SHA1 STREAM repeatedly This step is repeated until MODE remains at 2 fzy If the SHA1 STREAM has processed the last data block this set MODE to 3 It can also happen that the last block that at the SIZE length zero is set therefore so no data are copied into BUF The current hash value can then be processed as a result Example Hash value of OSCAT is 4fe4fa862f2e 7b91Lbf95abe9f2283124 7a3afd35 8 20 SHA1 TO STRH Type Function STRING 40 85 Version 1 21 Chapter 8 Converter Input MD5 ARRAY 0 19 OF BYTE SHA1 hash SHAl TO TRH SHA SHAl TO STRH The module converts the SHA1 TO STRH SHAI byte array to a hex string 8 21 STRING TO URL Type Function URL Input STR STRING string length Unified Resource Locator DEFAULT PROTOCOL STRING replacement protocol DEFAULT PATH STRING al
87. are 2000 bytes in a buffer and are read using the file system in blocks User set MODE to 1 and SIZE to 2000 Calling the MD5 STREAM MD5 STREAM performs a initialization and set MODE to 2 and passes at POS the index base 0 of the desired data At SIZE the number of data is set which are copied into the data memory BUF User copies the requested data in the BUF and calls the module MD5 STREAM repeatedly This step is repeated until MODE remains at 2 If the MD5 STREAM has processed the last data block this set MODE to 3 It can also happen that the last block that at the SIZE length zero is set therefore so no data are copied into BUF 81 Version 1 21 Chapter 8 Converter The current hash value can then be processed as a result Example the MD5 hash of OSCAT is 30f33ddb9f1 7df7219elacdea3386743 8 16 MD5 TO STRH Type Function STRING 32 Input MD5 ARRAY 0 15 OF BYTE MD5 HASH MDS _TO_STRH MDS MDS TO_STRH The module MD5 MD5 TO _STRH converts the MD5 byte array to a hex String 8 17 RC4 CRYPT STREAM Type Function module I O MODE INT mode 1 init 2 Data Block 3 Complete KEY STRING 40 320 bit long secret key BUF ARRAY 0 63 OF BYTES data block to process SIZE UDINT number of data Output POS UDINT start address of the requested data block The module RC4 CRYPT STREAM uses the RC4 data encryption to process an almost arbitrarily long data stream This standard is used for e
88. ay cause problems by security software firewall etc because these could block the connection request For this purpose in the firewall a corresponding exception rule has to be defined In the passive mode this problem is alleviated since the controller establishes the connection and can easily pass through the firewall The control channel is always set up on port 20 and the data channel via standard PORT21 but this is in turn is depending whether active or passive mode is used or optional PORT number in the FTP URL is specified With the parameter FILE DELETE can be determined whether the source file should be deleted after successful transfer This works on FTP and even on the control side In specifying FTP directories the behavior depends on FTP server whether they exist in this case or are created automatically Normally these should be already available The size of files is no limit per se but there are practical limits Soace on PLC FTP storage and the transmission time With dns _ip4 the IP address of the DNS server must be specified if in the FTP URL a DNS name is given alternatively an IP address can be entered in the FTP URL At parameters PLC_IP4 the own IP addresses has to be supplied If errors occur during transmission these are passed to the output ERROR _C and ERROR T As long as the transfer is running BUSY TRUE and after an error free completion of the operation DONE TRUE Once a new transfer is started DONE ERR
89. be found solely in chapter 1 of the user manual Deduction or acquisition of legal claims based on the content of the manual apart from the provisions stipulated in chapter 1 is completely ruled out 8 Version 1 21 Chapter 2 Introduction 2 Introduction 2 1 Objectives OSCAT is for Open Source Community for Automation Technology OSCAT created a Open Source Library referenced to the IEC61131 3 stan dard which can be dispensed with vendor specific functions and therefore ported to all IEC61131 3 compatible programmable logic controllers Alt hough trends for PLC in the use of vendor specific libraries are usually sol ved efficiently and these libraries are also provided in part free of charge there are still major disadvantages of using it 1 The libraries of almost all manufacturers are being protected and the Source Code is not freely accessible which is in case of a error and correction of the error extremely difficult often impossible 2 The graphic development of programs with vendor specific libraries can quickly become confusing inefficient and error prone because existing functions can not be adjusted and expanded to the actual needs The Source codes are not available 3 A change of hardware especially the move to another manufactur er is prevented by the proprietary libraries and the benefits that a standard such as IEC61131 offer would be so restricted A replace ment of a proprietary
90. ber required IP address required E 0 TCP Active Yes Yes 1 UDP Active Yes Yes 2 TCP Passive Yes Yes Address of the active part ner 3 UDP Passive Yes Yes Address of the active part ner 4 TCP Passive Yes No Any active partner will be ac cepted 5 UDP Passive Yes No Any active partner will be ac cepted C_STATE Value State Message 0 connection is down 104 Version 1 21 Chapter 9 Network and Communication 1 Connection has been broken down negative edge value exists only for one cycle then re turns O 254 Connection is established positive edge value exists for one cycle then returns 255 255 Connection is established lt 127 query if connections is established gt 127 query if connection is established ERROR DWORD Message Type Description B3 B2 B1 BO 00 xx xx xx Connection establish Value 00 No errors found nn xx xx xx Connection establish Value 01 252 system specific error FD xx xx xx Connection establish Value 253 Connection closed by remote FF xx xx xx Connection establish value 255 Timeout Error xx 00 xx xx Send data Value 00 No errors found xx nn xx xx Send data Value 01 252 system specific error xx FF xx xx Send data value 255 Timeout Error xx xx 00 xx Receive data Value 00 No errors found xx xx nn xx Receive data Value 01 252 system specific error xx xx FF xx Receive data value 255 Time
91. chdog function is Integrated that stops the search for the current cycle then RESULT 5 and RUN remains unchanged In the next cycle the analysis proceeds automatically As soon as the next element is detected the element in VALUE is passed and RESULT is 1 If the element is also the last in a line then RESULT 2 is the output As soon as the end of the data has been reached at RESULT 10 passed Always if yet RUN O is output RESULT defines the result If an item is longer than the maximum length string length so the characters are cut off automatically The parameter OFFSET is by the module automatically passed after each result but can be defined individually before each evaluation Example 1 evaluate Text file line by line Zeile 1 lt CR LF gt Line 2 lt CR LF gt 150 Version 1 21 Chapter 10 File System Default offset 0 SEP O and RUN 1 VALUE Line 1 RUN O RESULT 2 Default RUN 1 VALUE line 2 RUN O RESULT 2 RUN set back to 1 VALUE RUN 0 RESULT 10 Example 2 Analyze data as individual elements 10 20 lt CR LF gt a b lt CR LF gt Offset O SEP und RUN 1 VALUE 10 RUN 0 RESULT 1 RUN set back to 1 VALUE 20 RUN 0 RESULT 2 RUN set back to 1 VALUE a RUN 0 RESULT 1 RUN set back to 1 VALUE b RUN 0 RESULT 2 RUN set back to 1 VALUE RUN 0 RESULT 10 lf the file access is no longer needed the user must cl
92. d Step 60 all 60 sec a value is expected DS t1 GAUGE 120 0 100 a data source named tl is created H the type is gauge It is waiting 120sec for new data if not D the data is written into the database as UNKNOWN the minimum and maximum reading RRA AVERAGE 0 5 1 2160 this is the rrd Archiv AVERAGE average 0 5 ave rage interval deviation 36h archive every minute a value 1 2160 1h 36h 3600sec 3600 129 600 1Minute 60seconds every minute a value 129600 60 2160 Entries RRA AVERAGE 0 5 5 2016 lweek archive all 5minutes lvalue 3600 24 7 days 6 048005ec 7 5 minutes 60 sec 2016 entries RRA AVERAGE 1Values 0 5 15 2880 30Days archive all 15minutes RRA AVERAGE 1 year 0 5 60 8760 archive all 60Minuten a value It is now starting S Command rrdtool create test rrd Step 60 DS St LeGAUGE 170 0 100 4 DS2E2 GCAUGE 120203100 N DS E32GAUEB3120 0 100 DS 24 GAUGE 120303100 DS2E5 GAUGE 120 0 100 4 DS 6 GAUGE 120 0 100 4 DS2EI 2GAUGE 120 0 100 X RRA AVERAGE 0 5 1 2160 RRA AVERAGE 0 5 5 2016 RRA AVERAGE 0 5 15 2880 RRA AVERAGE 0 5 60 8760 61 Version 1 21 Chapter 7 Data Logger system Scommand gt test_rrd php lt rphp Called by control with Http mein server test rrd php rrd ob Lest rrasvalue 10 120330340 50760 gt Rrd_ db urldecode 5 _GET rrd_db Name of the RRD database Value urldecode _GET value
93. ded for experienced users to use these functions as a mi suse may lead to serious errors and crashes In the application of functions that begin with _ special care is appropriate and in parti cular to ensure that the call parameters never accept undefined va lues Naming of functions Function modules with timing manner such as the function PT1 are described by naming FT_ lt modulname gt ie FT_PT1 Functions wi thout a time reference are indicated with F lt modulename gt Logical equations Within this guide the logical links are used amp for AND for OR A for negated A and for a XOR exclusive OR Setup values for modules en SS To achieve that the application and lt o Z o peax programming remains clear and TET that complex functions can be re ee presented simply many ofthe mo Ant BUNDIME SS dules of the library OSCAT have ad DEBOUNCE_TIHE e DBL_CLK1 justable parameters that can be np Fos edited in application by dou ee ble clicking on the graphic symbol diese of the module Double clicking on E the icon opens a dialog box that al HASTER_MODE lows you to edit the Setup values If E a function is used multiple times so the setup values are set indivi dually for each module The processing by double clicking works on CoDeSys exclusively in CFC In ST all parameters including the se tup parameters may passed in the function call The setup parame ters are simply added to th
94. e today s sunrise time The time is a string in a lo 10 cal time format of h mm am pm astronomy_ sunset STRING sunset today s sunset time The time is a string in a loc 10 al time format of h mm am pm geo_latitude REAL The latitude of the location geo_longitude REAL The longitude of the location cur_conditions_ temp INT cur_conditions_ text cur_conditions_ text STRING The current weather conditions text a textual descrip 40 tion of conditions cur_conditions code INT The current weather conditions code the code for this condition forecast cur_conditions_icon INT The current weather conditions icon the condition icon for this forecast forcast_today_low_temp INT The weather conditions today forcast the forecasted low temperature for this day in the units f or c forcast_today_high_temp INT The forcast today weather conditions the forecasted high temperature for this in the day units for c forcast_today_text STRING The forcast today weather conditions text a textual de 30 Version 1 21 Chapter 4 Data Types of the NETWORK Library 40 scription of conditions forcast_today_code INT The current weather conditions code the code for this condition forecast forcast_today_icon INT The current weather conditions icon the icon condition for this forecast forcast_tomorrow_low temp INT The forcast tomorrow weather conditions the fore casted low temperature for this day in the units f
95. e normal inputs The parameters are in the graphical interface entered by double click and then processed as constants under IEC61131 It should be noted that time values has to be written with syntax T 200ms and TRUE and FALSE in ca pital letters Error and status Reporting ESR More complex components are largely contributed a Error or status output A Error Output is O if no error occurs during the execution If 10 Version 1 21 Chapter 2 Introduction however in a module a error occurs this output takes a value in the range 1 99 and reports a error with a error number A status or Er ror Collection module may collect these messages and time stam ped store them in a database or array or by TCP IP forward it to higher level systems An output of the type Status is compatible with a Error starting with identical function However a status out put reports not only errors but also leads on activities of the module log Values between 1 99 are still error messages Between 100 199 are located the reports of state changes The range from 200 255 is reserved for Debug Messages With this within the libra ry OSCAT standard functionality a simple and comprehensive option is offered to integrate operational messages and error messages in a simple manner without affecting the function of a system Modu les that support this procedure as of revision 1 4 are marked ESR ready For more information on ESR modules
96. e to re send the key code IP_C data structure IP CONTROL Parameterization S BUF data structure NETWORK_BUFFER_SHORT Transmit data DEV_CODE STRING to be decoded remote control name KEY CODE_0 7 STRING key code to be sent KEY BYTE output of the currently active key codes 44 Version 1 21 Chapter 6 Device Driver IRTRANS SND 8 allows users to send remote control commands to the IR Trans If IN_x is TRUE the specified device and key code in setup is sent to the IRTrans which outputs in turn as a real remote control commands With T REPEAT the repeat time for sending can be specified If IN O remains constant to TRUE so always this key code sent repeated after the time T_ REPEAT If a change to a different IN_x occures this code will send imme diately and then again delayed with T_ REPEAT if it remains a long period of time At output KEY the currently controlled KEY will be displayed KEY 0 means that no IN x is active The values 1 3 are the IN O IN 7 45 Version 1 21 Chapter 7 Data Logger 7 Data Logger 7 1 DATA LOGGER The data logger modules enable the collection and storage of process data in real time After triggering the storage pulse all parameterized process values are stored in a data buffer as various storage media are often not fast enough Up to 255 process values are processed in one package The calling order of the modules determines automatically the ranking of the p
97. ed WW WORLD_WEATHER_CUR WEATHER_DESC WW WORLD WEATHER DAY 0 4 WEATHER DESC 13 7 WORLD _ WEATHER ICON_OSCAT Type Function module IN OUT WW WORLD_WEATHER DATA Weather data INPUT ACTIVATE BOOL positive edge starts the query eee WORLD WEATHER_ICON_OSCAT ACTIVATE P yyy Vu P The module replaces the original vendor specific numbers on the weather icons by OSCAT standard icon numbers Following a positive edge at ACTIVATE the elements icon numbers in the WORLD WEATHER DATA data structure is replaced After querying the weather data using WORLD_WEATHER this module should be called subsequently It is simply the parameter DONE from the module WORLD_WEATHER that is interconnected with ACTIVATE The following elements will be adapted WW WORLD_WEATHER_CUR WEATHER_ICON WW WORLD_WEATHER_DAY O 4 WEATHER_ICON 215 Version 1 21 Chapter 14 Visualization 14 Visualization 14 1 VISU WEATHER With the weather module the weather data in the corresponding data structures are provided By default each service provider delivers with its own code or weather weather icons Since these differ in some totally the re are separate collections for each weather element With the modules yahoo weather icon oscat odt world weather_icon_oscat odt different weather icons and descriptive data can be reduced to a common denominator OSCAT standard so that a single ICON setup is sufficient 216 Version 1 21 Chapter 14 Visu
98. eded programs should be copied to your project and then can be adjusted to your needs Some modules require the disclosure of its own specific parameters so that they are fully functional The Codesys and Beckhoff library demo programs are hidden because they would otherwise occupy resources needlessly BASE64 DEMO CSV PARSER BUF DEMO CSV_PARSER FILE DEMO DLOG FILE CSV DLOG FILE CSV FTP DEMO DLOG FILE CSV SMTP DEMO DLOG FILE HTML_DEMO DLOG FILE XML DEMO DLOG RRD DEMO DNS DYN DEMO DNS REV DEMO DNS SNTP SYSLOG DEMO FILE BLOCK DEMO FTP_CLIENT DEMO GET WAN IP DEMO HTTP_ DEMO INI PARSER _BUF_DEMO INI PARSER FILE DEMO IP2GEO DEMO IRTRANS_ DEMO 14 Version 1 21 Chapter 3 Demo Programs MB CLIENT DEMO MB SERVER DEMO MD5 CRAM AUTH DEMO NET VAR MASTER DEMO NET VAR SLAVE DEMO RC4 CRYPT DEMO SHA MD5 DEMO SMTP_CLIENT DEMO SPIDER DEMO TELNET LOG DEMO TELNET PRINT DEMO TN VISION DEMO 1 TN_VISION DEMO 2 YAHOO WEATHER DEMO WORLD WEATHER DEMO 15 Version 1 21 Chapter 4 Data Types of the NETWORK Library 4 Data Types of the NETWORK Library 4 1 DLOG DATA The Structure DOG DATA is used for communication of the DOG mo dules DLOG DATA Data field Data Type Description STORE_TYPE BYTE Typ of DLOG STORE module ADD_HEADER BOOL Header data store ADD_DATA BOOL Cyclic data store ADD_DATA_REQ BOOL Store data from external CLOCK TRIG BOOL DTI Date Time New value
99. efault PORT WORD port number of the IP address TIME OUT TIME monitoring time Available platforms and related dependencies See module IP_ CONTROL 107 Version 1 21 Chapter 9 Network and Communication The block has basically the same functionality as IP CONTROL However S BUF and R_BUF are of type NETWORK_BUFFER_SHORT See general description IP CONTROL It is no blocking of the data supported by IP CONTROL2 The maximum data size for transmission and reception depends on the hardware platform and is in the range of lt 1500 bytes This module can always be used when no data stream mode is needed The primary advantage is that less buffer memory is required and data will not be copied between internal and external data buffer Thus the module is more economical with respect to memory consumption and system load 9 10 IP FIFO Type Function module IN OUT FIFO IP_FIFO DATA IP FIFO management data ID BYTE current ID assigned by IP_FIFO module STATE BYTE control commands and status messages 108 Version 1 21 Chapter 9 Network and Communication 109 Version 1 21 Chapter 9 Network and Communication GER IP_FIFO This module is used in combination with IP_ CONTROL for resource mana gement This makes it possible that client applications request exclusive access permissions and can also give back By the FIFO is ensured that each participant equally often gets the resource acc
100. ep number 0x0028 40 Response Code 0x00DC 250 9 19 SNTP_CLIENT Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK_BUFFER transmit data H BUF NETWORK BUFFER receive data INPUT IP4 DWORD IP address of the SNTP server ACTIVATE BOOL Starts the query OUTPUT ERROR DWORD error code DONE_P BOOL positive edge finish without error UDT DT Date and time output as Universal Time XMS INT millisecond of Universal Time UDT vr SNTP_CLIENT The SNTP_CLIENT is used to synchronize local time with an SNTP server For this the Simple Network Time Protocol is used which is designed to provide a reliable time information over networks with variable packet delay The SNTP is technically completely identical with NTP which here means no differences Therefore all known SNTP and NTP server can be used whether it be on the local network or via the Internet For IP4 a IP address of a SNTP NTP server is specified A positive edge at ACTIVATE starts the query The elapsed time between sending and receiving of the time is measured and a time correction is calculated Then the received time will be corrected by this value Upon successful completion DONE P is one positive edge and the current time is passed at UDT On XMS the associated fractional seconds as milliseconds are passed The values of 127 Version 1 21 Chapter 9 Network and Communication UDT and XMS are only valid when DONE P
101. er has refused registration 9 4 FTP_CLIENT Type Function module INPUT ACTIVATE BOOL positive edge starts the query FILE NAME STRING file path filename FTP URL STRING STRING LENGTH FTP access path FTP DOWNLOAD BOOL UPLOAD 0 DOWNLOAD 1 FTP ACTIV BOOL PASSIV 0 ACTIV 1 FILE DELETE BOOL delete files after transfer TIMEOUT TIME time Dns_ip4 DWORD IP4 address of the DNS server Dns_ip4 DWORD IP4 address of the DNS server OUTPUT DONE BOOL Transfer completed without error BUSY BOOL Transfer active ERROR _C DWORD Error code ERROR_T BYTE Problem type Ne FIF_CLENT ACTIVATE FILENAME FIF_LURL FT DOWNLOAD FIFALTIW The module FTP_CLIENT is used to transfer files from the PLC to an FTP server and to transmitted from the FTP server to the PLC A positive edge 94 Version 1 21 Chapter 9 Network and Communication at ACTIVATE starts the transfer process In FTP DOWNLOAD the transmission direction can be specified The parameter FTP URL contains the name of the FTP server and pass the optional user name and password an access path and an additional port number for the data channel If no username or password is passed the module trys automatically to register as Anonymous The parameter FTP_ACTIV determines whether the FTP server is operated in active or passive mode In the ACTIV mode the FTP server tries to establish the data channel for control however these m
102. er must be present If the query provide more IP addresses so always he highest value of the TTL Time To Live is used As IP4_ DNS can be used any public DNS servers If the PLC is sitting behind a DSL router this router can be used through its gateway address as a DNS server Which ultimately leads to faster even with repeated requests response times because they are managed in the router cache With positive results DONE TRUE the IP4 contains the requested IP address until the start of the next query by positive edge of ACTIVATE If in the DOMAIN name a valid IPv4 address is detected no more DNS query is made and it is passed in converted type to IPv4 and DONE is set to TRUE ERROR gives if an error occurs the exact cause 89 Version 1 21 Chapter 9 Network and Communication Error Codes Value Source Description B3 B2 B1 BO nn nn nn xx IP_CONTROL Error from module IP_CONTROL xx xx xx 00 DNS CLIENT No error The request completed successfully xx xx xx 01 DNS CLIENT Format error The name server was unable to interpret the query xx xx xx 02 DNS CLIENT Server failure The name server was unable to process this query due to a problem with the nameserver xx xx xx 03 DNS CLIENT Name Error Meaningful only for responses from an authoritative name server this code signifies that the domain name referenced in the query does not exist xx xx xx 04 DNS CLIENT
103. erized TRIG T value with residual value is 0 then a Save is performed This also ensures that the store is always performed at the same time Examples TRIG_T 60 every 60 sec at each new minute in second 0 a store is performed TRIG_T 10 In second 0 10 20 30 40 50 a store is performed TRIG_T 3600 At after each new hour at minute O and second 0 a store is performed The triggers TRIG_T and TRIG_M can be used in parallel independent of each other On DTI parameters the current date time value has to be transferred In SEP the ASCII code of the delimiter is given lf an error occurs during the query it is reported in ERROR_C in combination with ERROR T ERROR T 55 Version 1 21 Chapter 7 Data Logger Value Properties 1 The exact meaning of ERROR_C can be read at module DNS_ CLIENT 2 The exact meaning of ERROR_C can be read at module HTTP_GET 3 ERROR_C 1 Data from the RRD Server PHP script are not adopted 4 ERROR_C 1 The data could be passed in the URL string Number of parameters or reduce the amount of data URL data lt 250 characters With the parameter URL the access path and the php script call is passed An example URL http my_servername myhouse rrd test_rrd php rrd_db test rrd amp value DNS server or IP address Access path and name of the php script php script parameter 1 Database Name php script parameter 2 Process values The module automa
104. ernet browser to access http www mygeoposition com page and enter the name of the desired location and search the location using calculate the spatial data Then the desired location is shown on the map including the latitude and longitude needed in decimal notation The determined position has to be passed to the block parameters latitude and longitude 213 Version 1 21 Chapter 13 Weather Data Support us amp translate Geocoding e Geotags Geo Metatags e KML Google Earth MyGeoPosition com es SS KSE E Ke H Hybrid Heid Breitengrad 43 209205 48 12 33 14 Ne a 2 gt 2 L ngengrad 16 372778 16 2222 00 h 5 Verschieben Sie den Marker oder klicken Sie auf G dle Karte um die Position zu korrigieren I my An Fans 13 6 WORLD WEATHER DESC DE Type Function module IN OUT WW WORLD_WEATHER DATA Weather data INPUT ACTIVATE BOOL positive edge starts the query WORLD WEASTHER_DESC_GE Fb Aah The module replaces the original English texts by German weather descriptions Following a positive edge at ACTIVATE the elements texts in the WORLD WEATHER DATA data structure is replaced After querying the 214 Version 1 21 Chapter 13 Weather Data weather data using WORLD_WEATHER this module should be called Subsequently It is simply the parameter DONE from the module WORLD_WEATHER that is interconnected with ACTIVATE The following elements will be adapt
105. ersion 1 21 Chapter 9 Network and Communication device is not present on the network 9 14 MB SERVER OPEN MODBUS Type Function module IN OUT IP C IP _C parameterization S BUF NETWORK BUFFER_SHORT transmit data H BUF NETWORK BUFFER SHORT receive data VMAP ARRAY 1 10 OF VMAP_DATA virtual address table DATA ARRAY 0 255 OF WORD MODBUS Register INPUT DATA SIZE INT number of data words in DATA ENABLE BOOL release UDP BOOL Prefix TCP UDP UDP TRUE OUTPUT ERROR DWORD error code MB SERVER DATA SIZE The module provides access from external to local MODBUS data tables via Ethernet It supports commands in categories 0 1 2 The parameters IP _C S BUF R_BUF this form the interface to the module IP_ CONTROL and used here for processing and coordination The desired port number for MODBUS default is 502 must be specified on IP_ CONTROL centrally The IP address is not required on IP CONTROL as this one operates in the PASSIVE mode The DATA structure is designed as a WORD array and contains the MODBUS data DATA SIZE specifies the size of DATA By ENABLE the module is released and by remove of the release a possibly still active query is ended For devices that support MODBUS with UDP TRUE this mode can be activated A negative command execution is reported by ERROR see ERROR table With entries in the data structure VMAP virtual data areas are created and the access to certain
106. ess assigned In the first call of the module automatically a new unique application ID is assigned which one the administration in FIFO is managed The STATE pa rameter is changed by the application as well as from IP_FIFO module Each application may register by default only once in the FIFO STATE Value State Message 0 no action 1 Privilege request 2 Privilege request has been accepted in FIFO 3 Privilege obtained allowing resource access 4 Privilege remove 5 Privilege was again removed from FIFO Procedure 1 application set the STATE to 1 2 Access permission are required as is the STATE 2 3 If resource is free and access rights are present then STATE 3 4 If the application has the resource resp the access needs not anymore the application sets STATE to 4 Thereafter IP FIFO releases the resource again and set STATE to 0 5 Process is repeated same or other application Example is found in the module IP_ CONTROL 110 Version 1 21 Chapter 9 Network and Communication 9 11 LOG MSG Type Function module IN OUT LOG_CL LOG_CONTROL log data 237 LOG_MSG With LOG_MSG messages STRINGS are stored in a ring buffer The messages can be provided with additional parameters such as the front color and back color for the output to TELNET and a filter by specifying an entry level news Is the level of the message larger than the default log level the message i
107. ess to all data structures for user program 173 Version 1 21 Chapter 11 Telnet Vision 11 3 TN_INPUT CONTROL Type Function module IN OUT us TN SCREEN Us TN SCREEN Xus TN INPUT CONTROL us TN INPUT CONTROL 297 TN INPUT CONTROL Zus TN SCREEN t e Zus TN SCREEN Zus TN INPUT CONTROL t Zus TN INPUT CONTROL The module IN INPUT CONTROL is used to manage the INPUT CONTROL elements If Xus TN INPUT CONTROL bo Reset Fokus TRUE then the FOCUS is disabled on all elements and the first item gets to the focus Using the cursor up down buttons and tab the individual elements can be selected or changed The current element loses focus and then the next following item gets the input focus reallocated At the focus change of the elements automatically a redraw of the respective elements is triggered The image flashing cursor is always positioned at each active element and is displayed It always automatically displays and updates the ToolTip text as this has been configured It supports the following elements TN INPUT EDIT LINE TN INPUT SELECT TEXT TN INPUT SELECT POPUP 11 4 TN INPUT EDIT LINE Type Function module IN OUT us TN SCREEN Us TN SCREEN Xus TN INPUT CONTROL us TN INPUT CONTROL 174 Version 1 21 Chapter 11 Telnet Vision 279 TN INPUT EDIT LINE Zus TN SCREEN b b gt Zus TN SCREEN Zus TN INPUT CONTROL DATA t e Zus TN INPUT CONTROL DATA The module TN_INPUT EDIT LINE is used to manage a c
108. f module IP_ CONTROL A syslog message has the following structure FACILITY SEVERITY TIMESTAMP HOSTNAME TAG MESSAGE Example MAIL ERR Sep 10 08 31 10 149 100 100 02 PLANT2 PLC1 This is a test message generated by OSCAT SYSLOG The following options can be used BIT Function 0 FALSE with Facility Severity code TRUE No Facility Severity code 1 FALSE with RFC header TRUE without RFC Header only the MESSAGE alone sent 132 Version 1 21 Chapter 9 Network and Communication 2 FALSE with CR LF at end TRUE without CR LF end 3 FALSE UDP Modus TRUE TCP Modus Severity is defined as the following standard Severity Description 0 Emergency 1 Alert 2 Critical 3 Error 4 Warning 5 Notice 6 Informational 7 Debug The following facility is defined as standard Facility Description 00 Kernel message 01 user level messages 02 mail system 03 system daemons 04 security authorization messages 05 messages generated internally by syslogd 06 line printer subsystem 07 network news subsystem 08 UUCP subsystem 09 clock daemon 10 security authorization messages 11 FTP daemon 133 Version 1 21 Chapter 9 Network and Communication 12 NTP subsystem 13 log audit 14 log alert 15 clock daemon 16 local10 17 local11 18 loca
109. fined block The parameter V_CNT defines the number of data points unit 16 bit or bits depending on the function code The overall size is given by MODBUS ARRAY SIZE number WORDS By using these parameters the module searched the VMAP data table for a matching block of data and passes from the correct data block P ADR as a result The value corresponds to the real index for MODBUS DATA array At a function code with bit access in addition the bit position within P_ADR is passed as well A potential error occurring in the analysis is reported for the parameter error see error table The watchdog timer is reseted at each access to a function code from the group of write commands If no special treatment required so in VMAP are not settings required and then MODBUS ARRAY is mapped 1 1 with the access ERROR Value Description 0 No error 1 Invalid function code 2 Invalid Data Address Note the special treatment of function code 23 The Modbus Function Code 23 is a combined command because it consists of two actions First register are written and then the register are read Found that the write or read parameter is not allowed so neither of these actions is performed To distinguish between reading and writing by VMAP the read command is checked in VMAP at FC 23 as BIT23 Read Write Multiple registers and the write command on the other hand is tested in Bit16 Write multiple registers Examp
110. function codes and data regions is parameterized Thus it is very easy to map virtual address spaces into a 116 Version 1 21 Chapter 9 Network and Communication coherent Data block DATA or write data areas Or provide areas that are connected to output peripherals with a watchdog The handling of the VMAP data is described in more detail in the module MB_VMAP ERROR Value Source Description B3 B2 BO nn nn nn XX IP_ CONTROL Error from module IP_CONTROL XX XX XX 00 MB_SERVER NO ERROR XX XX XX 01 MB_SERVER ILLEGAL FUNCTION XX XX XX 02 MB_SERVER ILLEGAL DATAADDRESS XX XX XX 03 MB_SERVER ILLEGAL DATA VALUE Supported function codes and parameters used S Ki O D St 2 g c 28 3 O 6 lt 5 2 SZ 2 bk S 23 Loe O L A 1 x Coils Read Coils 2 xX Input Discrete Read Discrete Inputs 3 x Holding Register Read Holding Registers 4 x Input Register Read Input Register 5 x Coils Write Single Coil 6 x Holding Register Write Single Register 117 Version 1 21 Chapter 9 Network and Communication 15 x Coils Write Multiple Coils 16 x Holding Register Write Multiple Register 22 x Holding Register Mask Write Register 23 x Holding Register Read Write Multiple Register
111. g at the input KEY corresponds to the KEY CODE If the codes match and CMD TRUE 39 Version 1 21 Chapter 6 Device Driver Ge thAOERAIOSoGERMER set to TRUE For more information about the function of the d amp vice are under IRTRANS RCV 1 Type Function module Input UDP_TCP BOOL FALSE UDP TRUE TCP In Out IP_C data structure IP CONTROL Parameterization S BUF data structure NETWORK BUFFER SHORT Transmit data R_BUF data structure NETWORK_BUFFER_SHORT Receive data Output S ENABLE BOOL release IRTRANS data send R_ENABLE BOOL IRTRANS data receive enabled ERROR DWORD Error code Check IP_CONTROL IRTRANS SERVER can be used as both a receiver and a transmitter of IR TRANS commands Is UDP_TCP TRUE is a passive TCP connection other wise set up a passive UDP connection The type of operation must also be configured with IRTRANS device Once a data connection is available and sending commands is allowed S ENABLE TRUE In UDP mode after the initial data received from IRTRANS data can be sent since in the passive mode the UDP IP parameter is initially not known The receiving mode is indicated with R_ENABLE If data are received they are available in R_BUF for further processing for other modules Send data has to be entered by the modules in the S BUF so they are then sent automatically from IR 40 Version 1 21 Chapter 6 Device Driver TRANS SERVER If transmission errors
112. g that the output text length are affected later By pressing the Enter Return key the input text is issued at et Input String and bo Input Entered ist set to TRUE The input flag must be reset after receive by the user Example In Type 2 in_Y 20 In X 58 by Attr mF 16 17 by_Attr_oF 16 47 et Input _ToolTip selection text active press space to select In Input Option 02 in_Title Y Offset 00 In Title A Offset 00 by Title Attr 16 34 st Title String operation mode st_Input_Mask st_Input_Data lt Auto gt lt Hand gt lt Stop gt lt Restart gt The following output EE EEA tnter to select 181 Version 1 21 Chapter 11 Telnet Vision 11 9 TN RECEIVE Type Function module IN OUT Xus_TN SCREEN us TN SCREEN H BUF NETWORK BUFFER Telnet receive buffer 277 TN RECEIVE R BUF t e R BUF Zus TN SCREEN b Zus TN SCREEN The module TN RECEIVE receives input data from the Telnet client and evaluates the key codes lf the key code in the range 32 126 it shall be stored as ASCII code under Aus IN SCREEN by_Input_ASCIl Code In addition Xus_TN SCREEN bo Input ASCII IsNum TRUE if this corresponds to a number between 0 and 9 lf the key code is of the following extended code then this is filed under Aus IN SCREEN by_ Input _Exten Code Exten_code Button name 65 Cursor up
113. gion STRING 20 The location of this forecast region state territory or region if given location_country STRING 20 The location of this forecast country unit_ temperature STRING 1 temperature degree units for f c for Celsius Fahrenheit or 29 Version 1 21 Chapter 4 Data Types of the NETWORK Library unit_ distance STRING 2 distance distance units for MI for miles or km for kilo meters Un pressure STRING 2 pressure barometric pressure units of for in pounds per square inch or mb for milli bars Un speed STRING 3 speed units of speed mph for miles per hour or kilome ters per hour for kph wind_chill INT Forecast information about wind chill in degrees wind_ direction INT Forecast information about wind direction in degrees wind speed REAL Forecast information about wind speed in the units mph or kph atmosphere_humidity INT Forecast information about current atmospheric humid ity humidity in percent atmosphere_pressure INT Forecast information about current atmospheric pres sure barometric pressure in the units in or mb atmosphere_ visibility REAL Forecast information about current atmospheric visibil ity in the units mi or km atmosphere _rising INT Forecast Information about rising state of the baromet ric pressure Steady 0 rising 1 or falling 2 Inte ger 0 1 2 astronomy_sunrise STRING sunris
114. he end of the data has been reached at RESULT 10 passed Always if yet RUN O is output RESULT defines the result If an item is longer than the maximum length string length so the characters are cut off automatically The parameter OFFSET is by the module automatically passed after each result but can be defined individually before each evaluation Example 1 Analyze data by lines Zeile 1 lt CR LF gt Line 2 lt CR LF gt Default offset 0 SEP O and RUN VALUE Line 1 RUN 0 RESULT Default RUN 1 VALUE line 2 RUN O RESULT 2 RUN set back to 1 VALUE RUN 0 RESULT 10 1 2 Example 2 Analyze data as individual elements 10 20 lt CR LF gt a b lt CR LF gt Offset 0 SEP und RUN 1 VALUE 10 RUN 0 RESULT 1 RUN set back to 1 VALUE 20 RUN 0 RESULT 2 RUN set back to 1 VALUE a RUN 0 RESULT 1 RUN set back to 1 VALUE b RUN 0 RESULT 2 RUN set back to 1 VALUE RUN 0 RESULT 10 RUN Feature List 148 Version 1 21 Chapter 10 File System RUN Function 0 No function to perform and last function is complete 1 Element to evaluate RESULT Result Feedback RESULT Description 1 Element found 2 Element and the end of the line identified gt Current query is still running call module further cyclical 10 Nothing found reached the end of data 10 2 CSV_PARSER FI
115. he text DATA D_MODE 0 Example Delete element DATA D_MODE 11 command delete item module call DATA D_MODE 0 item was deleted 71 Version 1 21 Chapter 8 Converter 8 Converter 8 1 BASE64 The BASE64 encoding is a process for Encoding of 8 bit binary data into a string consisting of only 64 globally available ASCII characters Applicati on is HTTP Basic Authentication PGP signatures and keys and MIME enco ding for e mail To enable the SMTP protocol as the easy transport of bina ry data a conversion is necessary as foreseen in the original version only 7 bit ASCII characters Byte 1 Zeichen 1 Zeichen 2 Zeichen 3 Zeichen 4 When encoding always three bytes of byte stream 24 bit are devided in 6 bit blocks Each of these 6 bit blocks results in a number between O and 63 This results in the following 64 printable ASCII characters A Z a z 0 9 The encoding increases the space requirements of the data stream by 33 from 3 characters each to 4 characters each If the length of the coding is not divisible by 4 filler characters will be appended at the end In this case the sign is used 8 2 BASE64 DECODE STR Type Function module Input RUN BOOL positive edge starts conversion Output DONE BOOL TRUE if conversion is completed I O STR1 STRING 192 text in BASE64 format STR2 STRING 144 converted normal text 12 Version 1 21 Chapter 8 Converter
116. hout the path With MODE parameter the principle of access is given At MODE 1 2 and 3 with OFFSET the position can be specified in the file In the file system counting is always started with byte 0 The first step is always to check whether this file is already still open and if not they will open and the current file size is observed and passed to the FILE SIZE When specifying a time AUTO CLOSE gt Oms the file is automatically closed after each command and the expiration of the waiting time Alternatively using MODE 5 the closing of the file is done manually Each write command which change the size of the file automatically leads to a corrected FILE SIZE entry so it is always visible how large the file is right now Once a file is open this is reported on FILE OPEN TRUE Each write command at which the size of the file changes automatically leads to a corrected FILE SIZE entry so you can always how large the file is right now In PT SIZE is the actual amount of data automatically corrected or entered lf the MODE 1 2 or 3 called with PT SIZE O the file is opened the FILE SIZE determined but no read write command is performed and the file will remain open until manually closed or AUTO CLOSE 155 Version 1 21 Chapter 10 File System lf data has to be written the data has to be stored in PT BUFFER and in PT SIZE the bytes must exist This data are written to the specified relative offset in the file
117. immediately after that the key evaluation can be continued without having to manually change the OFFSET Key Search Before a Key is evaluated the OFFSET must have a correct value this can be done by manual set of OFFSET or by a previously executed Section search Before running the query at STR the name of the key must be are passed If an empty string STR is handed over the next key found is returned RUN 2 means the query can be started Once the search is 162 Version 1 21 Chapter 10 File System finished the IN PARSER BUF sets the parameters of RUN to 0 With RESULT the search results will be issued When in a query the key identified a new Section this is reported by RESULT 11 Upon successful search the output of the parameter KEY is the name of the found key and VALUE is the key value And then the OFFSET parameter points to the end of the key line Thus immediately after the next Key evaluation be continued without having to manually change the OFFSET Enumeration see next item For very large amount of data of an initialization file to be evaluated with a enumeration list the user program can be build simple and the evaluation be carried out more quickly because here no line must be used more than once Before the start OFFSET must have a reasonable value the default case to 0 With RUN 3 the evaluation is started Once a section or a key is found it is also issued immediately In a section KEY
118. imultaneously the on the opposite side other control passed input data passed here as a OUT1 8 again 200 Version 1 21 Chapter 12 Network Variables ID parameter indicates the current identification number of the module instance If the configuration of the master and the slave program is differently incorrectly that ID number is passed as a fault in the module NET VAR CONTROL 12 4 NET VAR BUFFER Type Function module IN OUT X NET_VAR_DATA NET_VAR data structure BUF_IN ARRAY 1 64 OF BYTE input data buffer BUF OUT ARRAY 1 64 OF BYTE output data buffer OUTPUT ID BYTE ID ive NET VAR_BUFFER The module NET _VAR_BUFFER is used for bidirectional transmission of 64 bytes from the master to slave and vice versa The data from BUF_IN be recorded and passed on the other side other plc on the same module at the same position as BUF OUT Simultaneously the input data on the opposite side other control is passed here as BUF OUT again ID parameter indicates the current identification number of the module instance If the configuration of the master and the slave program is differently incorrectly that ID number is passed as a fault in the module NET VAR CONTROL 201 Version 1 21 Chapter 12 Network Variables 12 5 NET VAR _ DWORDS Type Function module IN OUT X NET_VAR_DATA NET_VAR data structure INPUT IN 1 8 DWORD input DWORD OUTPUT OUT 1 8 DWORD output DWORD ID B
119. in Echo Error Siehler echo lt body gt n echo lt html gt mn ZA 7 9 DLOG FILE TO FTP Type Function module IN OUT X DLOG_DATA DLOG data structure INPUT FTP URL STRING STRING LENGTH FTP access path FTP ACTIV BOOL PASSIV 0 ACTIV 1 FILE DELETE BOOL delete files after transfer TIMEOUT TIME time RETRY INT number of repetitions RETRY TIME TIME waiting period before repetition Dns_ip4 DWORD IP4 address of the DNS server 63 Version 1 21 Chapter 7 Data Logger Dns_ip4 DWORD IP4 address of the DNS server OUTPUT DONE BOOL Transfer completed without error BUSY BOOL Transfer active ERROR _C DWORD Error code ERROR_T BYTE Problem type ver DLOt_FILE_TO_FTP FTP_URL FIF_ACTW FILE_DELETE TIMEOUT RETRY The module DLOG FILE TO FTP is used to automatically transfer the by DLOG STORE FILE CSV generated from files to an FTP server The FTP_URL parameter contains the name of the FTP server and optionally the user name and password an access path and an additional port number for the data channel If no Username or password is transferred the device automatically tries to register as Anonymous The parameter FTP_ ACTIV determined whether the FTP server is operated in active or passive mode In the ACTIV mode the FTP server tries to establish the data channel for control however these may cause problems by security software firewall etc because it
120. ination The desired IP address and port number for MODBUS default is 502 must be specified on IP CONTROL centrally The DATA structure is designed as a WORD array and contains the MODBUS data for reading and writing The size of the WORD_ARRAY is given by DATA SIZE By ENABLE the module is released and by remove of the release a possibly still active query is ended For devices that support MODBUS with UDP TRUE this mode can be activated The parameter UNIT _ID must only at use of Ethernet Modbus provided The desired function is specified by FC see function code table Depending on the function the R_xxx and W_xxx parameters has to be supplied with data By specifying the DELAY the repetition time can be specified If not specify the time an attempt is made as often as possible to execute the command The integrated access management automatically guarantees to get the other module instances also to the series A negative command execution is reported by ERROR see ERROR table If the module actively performs a query then BUSY TRUE will be passed during this time Supported function codes and parameters used 113 Version 1 21 Chapter 9 Network and Communication A Ki e o WS O 9 Si lg 5 E o E Own S O om lt Mm om lt m e 2 0 5 e E AJ tae E a a S 2 35 ee EE BSE amp En S 52 2 88 5 5 cos O a GC ee e 3233 1 x C
121. ind speed in kilometre per hour WIND_DIR_DEGREE INT Wind direction in degree WIND _DIR16POINT STRING 3 16 Point wind direction compass PRECIPMM REAL Precipitation amount in millimetre HUMIDITY INT Humidity VISIBILITY INT Visibility km PRESSURE INT Atmospheric pressure in milibars CLOUDOVER INT Cloud cover WORLD_WEATHER_DAY data structure Name Type Properties DATE_OF_DAY STRING 10 Date for which the weather is forecasted 28 Version 1 21 Chapter 4 Data Types of the NETWORK Library TEMP_MAX_C INT Day temperature in C Celcius TEMP_MAX_F INT Day temperature in F Fahrenheit TEMP_MIN_ C INT Night temperature in C Celcius TEMP_MIN_F INT Night temperature in F Fahrenheit WIND SPEED MILES INT Wind Speed in mph miles per hour WIND SPEED KMPH INT Wind Speed in kmph Kilometer per hour WIND_DIR_DEGREE INT Wind direction in degree WIND_DIR16POINT STRING 3 16 Point wind direction compass WEATHER_CODE INT A unique weather condition code WEATHER_DESC STRING 60 Weather description text WEATHER_ICON INT Weather Icon PRECIPMM REAL Precipitation Amount millimetre 4 21 YAHOO_WEATHER_DATA YAHOO_WEATHER data structure Name Type Properties TimeToLive INT Time to Live how long in minutes this feed should be cached location_city STRING The location of this forecast city city name 40 location_re
122. inter for value on BLOCK1 98 WATCHDOG Maximum processing time reached cancel 99 END No more items available Sample XML flat display lt xml version 1 0 gt lt rss version 2 0 gt lt channel gt lt XML Demo gt lt I CDATA lt b gt CurrentConditions lt b gt lt br gt gt lt title gt XML_Reader lt title gt lt link gt http oscat de lt link gt lt channel gt lt rss gt Representation of the levels without processing Instruction lt rss version 2 0 gt lt channel gt lt XML Demo gt lt b gt Current Conditions lt b gt lt br gt lt tith gt XML_Reader lt title lt link http oscat de lt link gt lt channel gt lt fss gt 142 Version 1 21 Chapter 9 Network and Communication View as tree of item types E eee CH channe l corment a EI cdata section AML Dermo lt b gt Current Conditions lt b gt lt hr r gt http oscat de El title oe E text XML Reader EL CH Link EE E forex Legend Element Comment EZ Attribute ES Processing Inetruction o Tent BR oti section EI Application CASE STATE OF 00 STATE 107 CTIRL START POS CTRL STOP POS CTRL COMMAND 102 XML data read serial CTRL XML READER CTRL XML JRE ES SES BUFFER XML READER CTRL XML READER CTRL BUFFER XML READER BUF LE CIRL TZE 99 THEN STATE Zu BLole Cla Tir lt 98 THEN HTTP GET BODY START HTTP GET BODY STOP WORD 2 11111
123. ion Atom oder Funkuhr Schicht Stratum 1 Schicht Stratum 2 Schicht Stratum 3 Schicht Stratum 4 Endanwender lf an SNTP client itself has a time with a higher stratum than an SNTP server the time of this is sometimes rejected because it is less accurate than their own reference It is therefore important to specify a logically correct STRATUM The module SNTP_CLIENT ignores deliberately the STRATUM and synchronizes in each case with the SNTP server because pretty much everyone SNTP server as a more precise time than a PLC 9 21 SPIDER ACCESS Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data R BUF NETWORK BUFFER receive data VALUE STRING Value of the variable NAME STRING 40 Variable Name INPUT MODE BYTE operating mode 1 read write 2 ERROR ERROR DWORD Error code 129 Version 1 21 Chapter 9 Network and Communication ort SPIDER_ACCESS Value Properties 1 At writing variable values an error occured gt 1 The exact meaning of ERROR is read at module HTTP_GET With SPIDER _ACCESSvariables can be read wnd written from the PLC which are provided by visualizations of web servers based on spider control from the company iniNet integrated Solution GmbH For the following PLC is this web server integration available Simatic S7 200 300 400 SAIA Burgess PCD Wago 750 841 Beckhoff CX series Phoe
124. isconnection of the host Furthermore always the information in the header Content Length is checked and with this can be clearly re cognized that all data is received If none of the previous versions is true SO a simple Receive Timeout Error detectes the end of data transmission The only downside is that this takes time Sometimes depending on the timeout value longer than desired Therefore it is not bad if a reasonable timeout value is set at IP CONTROL ERROR gives at errors the exact cau se See module IP_ CONTROL The following MODE can be used Mode Protocol Version Properties 0 HTTP 1 0 The host terminates automatically the TCP connection after the trans fer of data 1 HTTP 1 0 By applying Connection Keep Alive the host is instructed to use a persistent connection The client should end of the connection after stopping activities 2 HTTP 1 1 The host uses a persistent connection and must be stopped by client 3 HTTP 1 1 By use of Connection Close the host is instructed to stop transmissi on of data the TCP connection 9 7 IP2GEO Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data R_BUF NETWORK BUFFER receive data GEO IP2GEO Geographic Data 99 Version 1 21 Chapter 9 Network and Communication INPUT ACTIVATE BOOL release for query OUTPUT BUSY BOOL Query is active DONE BOOL Query completed without e
125. iter is given CSV file format See http de wikipedia org wiki CSV_ Dateiformat Example of a CSV delimited file and column headings Date Time Z1 Z2 seconds 2010 10 22 06 00 00 1 2 00 2010 10 22 06 00 06 1 2 06 20 10 10 22 06 00 12 1 2 12 20 10 10 22 06 00 18 1 2 18 ERROR T Value Properties 1 Problem FILE_SERVER The exact meaning of ERROR_C can be read at block FILE _ SERVER 7 8 DLOG STORE RRD Type Function module IN OUT X DLOG_DATA DLOG data structure INPUT ENABLE BOOL Enable data recording TRIG_M BOOL manual trigger TRIG_T UDINT automatic trigger over time URL STRING string length URL address of the server DTI DT Current DATE TIME value SEP BYTE separator of the recorded elements 54 Version 1 21 Chapter 7 Data Logger Dns_ip4 DWORD IP address of the DNS server TIMEOUT TIME monitoring time OUTPUT DONE BOOL Data transfer completed without error ERROR _C DWORD Error code ERROR_T BYTE Problem type rr DLOG_sSTORE_RRD ENABLE The module DLOG STORE _RRD serves for logging recording of the process values in an RRD database The data can be passed with the modules DOG DINT DOG REAL DOG STRING DLOG DT The parameter TRIG M positive pulse is used to manually trigger start the storage of process data With Parameters TRIG Tan automatic time controlled release can be realized If the current date time value divided by the paramet
126. ivers Parameter i String Ta Convert PARAL INT TO STRING I lling time Barsamerer 27 Em to ver 2 PARA 3 NAME Parameter 3 PS STR 3 1 Liter filling time 2 Min Text output mask PosFRINIF DATA t PARA 4 Bass parameter data structure PS Module version The string PS STR then has the following content Tank Capacity 545 4 liters filling time 25 min 9 17 READ_HTTP Type Function module INPUT SIZE UINT Buffer size POS INT position as of that the search is started SRC STRING Search string IN OUT PT POINTER Address of the buffer OUTPUT VALUE Parameters of the header information READ_HTTP After a successful HTTP GET Request always a HTTP header message header and a message body message body is available in the buffer In the HTTP header various information about the requested HTTP page is 122 Version 1 21 Chapter 9 Network and Communication stored The following message body contains the actual requested data With READ_HTTP the HTTP header information can be analyzed The module searches any array of bytes on the contents of a string and then evaluates the following parameters and returns that string as its result The data in the buffer are automatically converted to upper case so all search string at SRC has to be too given in capital letters With POS it can begin its search at any position The first element in the array is a
127. l Press enter to select In Input Option 00 In Title Y Offset 00 In Title A Offset 00 by Title Attr 16 34 179 Version 1 21 Chapter 11 Telnet Vision st Title String st_Input_Mask et Input Data 01 02 03 04 05 060 07 08 09 10 11 12 13 14 15 LOG Level 7 The following output 11 8 TN INPUT SELECT TEXT Type Function module IN OUT Xus TN SCREEN Us TN SCREEN Xus TN INPUT CONTROL us TN INPUT CONTROL 23 TN INPUT SELECT TEXT Zus TN SCREEN t t Zus TN SCREEN Zus TN INPUT CONTROL DATA t gt Zus TN INPUT CONTROL DATA The module TN_INPUT SELECT TEXT is used to manage a Selection of texts This must be set IN TYPE 2 180 Version 1 21 Chapter 11 Telnet Vision The item will be provided as in_X and in_Y Every entry line can be provided with a title text With in_ Title Y Offset and rm Title sg Offset the position relative to the element coordinates is expressed The color can be determined with by Title Attr and the text by st_Title String If a tool tip should appear at the element er Input ToolTip the text hast to be specified The selection of texts will be handed over in st_Input_Data The text element should be separated from each other by the character If the Element has the focus by using the spacebar space can be changed between the individual texts The text element is connected by means et Input Mask meanin
128. l and the php scripts are installed The scripts have been developed on a Linux Xubuntu PC with PHP Quick Start A sample program with some values may be recorded is found the OSCAT network lib under demo DLOG RRD_ DEMO The rrdtool installation on Xubuntu DEBIAN PC is processed either with the Synaptic package manager and select install rrdtool or in the console with apt get install rrdtool Script create_test_rrd_ db php Creates a new rrd database and once must be adapted if necessary Script test_rrd php This script is called by the PLC with the OSCAT function module via HTTP GET Must usually are not adjusted and outputs an error code If error free then output is a 0 Script chart_test php Script to create the charts from the rrd DB and display it on a website Must usually are not adjusted and outputs an error code If error free is then output a 0 Download the three php scripts in the folder to a PC ie var www rrd and do not forget to adjust the appropriate access rights 59 Version 1 21 Chapter 7 Data Logger tt p de wikipedia org wiki RRDtool Chapter 7 Data Logger php script Examples Templates create_test_rrddb php etc php5 cli q lt php error reporting HE ALL Creates a rrd database LS called once from the console 12 11 2010 by NetFritz 222 2002 202 2002 2 0022202002000 Create wp rrd creates the database test rr
129. l12 19 local13 20 local14 21 local15 22 local16 23 local17 For general syslog messages the facility values 16 23 are provided localO to local7 But it is quite permissible to use the predefined values from O to 15 for own purposes With Facility and Severity can be filtered on the SYSLOG server database according to certain reports such as Record all error messages from the mail server with severity level Example screenshot of a syslog server for Windows 134 Version 1 21 Chapter 9 Network and Communication File Edit View gene JE Display 00 Default 00 Default Help 06 05 2007 14 45 24 Syslog Info dk 96 05 2007 14 45 24 Daemon nfo E 06 05 2007 14 45 21 Local5 Debug BB 06 05 2007 14 45 16 System4 Emerg 192 168 10 77 Test user connected to website http 199 214 234 138 index html I 06 05 2007 F 06 05 2007 14 45 14 14 45 11 14 45 05 14 45 07 7 14 45 05 Local5 Debug Local Debug systemi Info syslog Info Daemon Info gt 06 05 2007 14 44 59 Local Info ab 06 05 2007 14 44 58 System Info I 06 05 2007 06 05 2007 P 06 05 2007 E 06 05 2007 06 05 2007 ak 06 05 2007 Lt 06 05 2007 06 05 2007 14 44 51 14 44 43 14 44 38 14 44 34 14 44 33 14 44 33 14 44 29 14 44 24 Kernel Notice Lpr Error System4 Debug Local Intro Syslog Info System Info System Warning Local Notice ed Version 4 2 17
130. lace geographical position of the weather is indicated While the query is active BUSY TRUE is passed After successful completion of the query 212 Version 1 21 Chapter 13 Weather Data DONE TRUE is shown If an error occurs during the query it is reported in ERROR_C in combination with ERROR_T ERROR T Value Properties 1 The exact meaning of ERROR_C can be read at module DNS_CLIENT 2 The exact meaning of ERROR_C can be read at module HTTP_GET Creating a new API KEY Use your Internet browser and call the page http www worldweatheronline com call the Free sign up registration dialog and fill out the required fields After registering an email is sent in turn has to be confirmed and subsequently secon ad e mail is sent with the personal API key This API Key must be passed to the module KEY API parameters Weather AFP Word Vreather Online offers Free and Premium Weather APL to retreive quality weather forecast in XML CM TAB or JSON format Whether you program in CZ or WG PHP Perl or JAVA our HTTP REST based Weather AFI is easy io use Check out our Weaiher API Comparison chartto find out more Premium Weather API Overview Features Local eather AH Ski Resort API surting or Marine AFI Historical Past Weather API Monthly Climate Averages AFI SEE Marine Sailing Weather API iN See NS Determine Latitude and longitude of a specific place Use your Int
131. le Configuration Virtual block 1 VMAP 1 FC lt DWORD 2700000000 10000000 00000000 OO0LII00 FC 2 3 4 23 VMAPI Lav ADB 2 1 Virtual Address Range Start address VMAP 1 V_SIZE f 4 Virtual address space number of WORD 119 Version 1 21 Chapter 9 Network and Communication VMAP LJaP ADR ze 1 Real address space Start address CSS Virtue Block 2 Si VMAP 2 FC DWORD 2 00000000 10000000 00000000 00011000 FC 3 4 23 VMAP 2 W ADR 1017 7 Virtual Address Range Start address VMAP 2 V_ SIZE 4 Virtual address space number of WORD VMAP 4 E ADR ze 5 Real address space Start address CS yviri dal Block 3 VMAP 9 FC es DWORD 27 U0000000 770000087 10000000 011711010 7 PCL 9 5 15 16 23 VMAP 2 wv ADR 20175 Virtual Address Ranger Otar address zi VMAP 3 V STAR ze 47 Virtual address space number of WORD VMAP 2 F ADR 3 Real address space Start address Virtual Block 4 Si VMAP 4 FC DWORD 2 00000000 11000001 00000000 01011000 FC 3 4 6 16 23 VMAP 4 V_ADR 3017 Virtual Address Range Start address 7 YMAP 4 VY_SIZE zs 47 Virtual address space number of WORD VMAP 4 P ADR 12 Real address space home address SPS MODBUS Server MODBUS_DATA Virtuelle Adressen Dt nn MODBUS CLIENT GG Modbus Request Cc Modbus Confirmation The configuration is following access matrix 1
132. lways made an intelligent automatic update The INPUT CONTROL items are stored and the keystrokes to the respective elements forwarded and even an optional menu bar is available As this ts a relatively complex interplay of many elements in the library under DEMO are two applications available that perform with all the possibilities It is to be advised at own projects to ocreate them based on these two templates to get as quickly as possible a working result and to understand the interaction of the individual components and modules 168 Version 1 21 Chapter 11 Telnet Vision The program TN VISION DEMO_1 shows the following elements Graphical representation of lines polygons texts and associated shadow and color scheme of the layout Representation of a Menu Bar Elements EDIT LINE normal and hidden input SELECT POPUP SELECT TEXT TOOLTIP info line Illustration of a LOG VIEWPORT with the message buffer and navigation using keys On the home page a LOGIN function is realized By entering the password oscat you can switch to the next page The main page can be changed using the cursor up down button and with tab between the individual elements The menu can be called with the Escape key The individual menu items are only for demonstration purposes and lead to a log message Only the menu item end LOGOUT leads back to the home page 169 Version 1 21 Chapter 11 Telnet Vision TN VISION
133. m the slave PLC is passed through the module NET VAR_BOOL8 and transfered by NET VAR CONTROL to another control ler PLC master and then again re issued at the same NET VAR BOOL8 element in the output data D PLC Master PLC Slave gt 27 799 NET_VAR_BOOLS NET_VAR_BOOLS NET_VAR_CONTROL NET_VAR_CONTROL ACTIVATE ZUN ACTIVATE 192 ISE L783 Network 198 Version 1 21 Chapter 12 Network Variables 12 2 NET VAR _ CONTROL Type Function module IN OUT X NET_VAR_DATA NET_VAR data structure INPUT ACTIVATE BOOL Enables the exchange of data MASTER BOOL FALSE SLAVE MASTER TRUE UDP BOOL FALSE TCP TRUE UDP REMOTE _IP4 DWORD IP4 address of the other SPS REMOTE PORT WORD PORT number of other PLC SCAN_TIME TIME update time WATCHDOG TIME monitoring time OUTPUT RUN BOOL active data exchange no error ERROR DWORD error code NET VAR CONTROL ACTIVATE The module NET VAR CONTROL coordinates the data exchange between the two controllers and the satellite components NET _VAR_ With ACTIVATE TRUE the data exchange will be released The module must be invoked on both controllers with the parameter MASTER must be assigned once with TRUE and once must be FALSE Thus determines which side the active connection will establish With UDP FALSE TRUE can be specified whether a UDP or TCP connection is used The the IP address of the other side must be specified in REMOTE IP4
134. med This also ensures that the store is always performed at the same time Examples TRIG_T 60 every 60 sec at each new minute in second 0 a store is performed TRIG T 10 In second 0 10 20 30 40 50 a store is performed TRIG _T 3600 At after each new hour at minute O and second 0 a store is performed The triggers TRIG_T and TRIG M can be used in parallel independent of each other With parameters FILENAME the file name including path if necessary is defined If the filename is changed during the recprding it will automatically on the fly changed to the new record file with no data loss This change can also be automated The parameter FILE NAME supports the use of date time parameter See documentation from the module DT TO STRF Example FILE NAME Station 01 R csv At position of R automatically the current minute number is entered This means that automatically every minute the file name changes and therefore the data is written into the file Thus within an entire hour 60 files are created and filled with data and in the ring buffer manner overwritten again and again 53 Version 1 21 Chapter 7 Data Logger A recording can be done automatically and creates every day week month etc a new file as desired If anew FILE NAME is detected a possibly existing file is erased and rewritten On DTI parameters the current date time value has to be transferred In SEP the ASCII code of the delim
135. n can have attributes with assigned values and content There are elements with and without attributes elements can consist of many other elements and those that may occur within the text only and even empty elements that may have no content The structure that emerges from these ele ments and their principles can be understood as a tree structure Ele ments always consist of tags and end tags Attributes are additional infor mation about items There are also comment elements allowed however these may not between the start and end tags are of elements in XML_READER The possible DTD Document Type Definition only be repor ted as DTD but not further evaluated and applied by XML READER With a CDATA section a parser is told that no markup follows but normal text which is reported by start end block Before the first call of the XML READER a few parameters in the CTRL data structure needs to be initialized CTRL START POS and CTRL STOP POS defines the beginning and the end of the XML data in the buffer CTRL COMMAND with one hand can be an initialization Bitl5 TRUE and with bit 0 14 can be defined which element data types are reported Here the type codes in the following table corresponds just the bit number which has to be set to True in CTRL COMMAND It is tried to pass the text of element attribute Value and Path in total length to the accompanying STRINGS In STRINGS greater than 255 cha racters this will be cut off flush
136. n Count INT Number of INPUT CONTROL elements 17 Version 1 21 Chapter 4 Data Types of the NETWORK Library in ToolTip a INT ToolTip Text X Offset in ToolTip _Y INT ToolTip Text Y Offset by ToolTip Attr BYTE ToolTip text attributes color in ToolTip Size INT ToolTip text length usa_TN_INPUT_C ARRAY 1 20 OF ONTROL_DATA us TN_INPUT CONTROL DATA 4 5 us TN INPUT CONTROL DATA A variable of type us TN INPUT CONTROL DATA can use to parameterize a INPUT CONTROL element and to process element related inputs events us TN INPUT CONTROL DATA Data field Data Type Description by_Input_Exten_Code BYTE Extended Key Code by_Input _ASCII_Code BYTE Key Code ASCIl bo_Input ASCII IsNum BOOL Key code is a digit Im Te A Offset INT Title Text X Offset Im Title Y Offset INT Title Text Y Offset by Title Attr BYTE Title text attributes St Title String STRING st Title String in Cursor A INT current cursor X position in _Cursor_Y INT current cursor Y position IN TYPE INT Element Type Im A INT Element X position in_Y INT Element Y position in Cursor Pos INT current cursor position by Attr_mF BYTE Attributes for element with focus by Attr_oF BYTE Attributes for element without focus 18 Version 1 21 Chapter 4 Data Types of the NETWORK Library in selected INT Text element is selected st Input
137. n be read at module DNS_ CLIENT 2 Problem SMTP Channel The exact meaning of ERROR_C can be read at module IP_CONTROL 4 Problem FILE_ SERVER The exact meaning of ERROR_C can be read at block FILE_ SERVER 5 Problem END TIMEOUT ERROR_C contains the left WORD the end of the step number and in the right WORD the last response code received by the SMTP server The parameters must be considered first as a HEX value divided into two WORDS and then be considered as a decimal value Example ERROR_T 5 ERROR_C 0x0028_00FA End step number 0x0028 40 Response Code 0x00DC 250 7 11 UNI CIRCULAR BUFFER Type Function module IN OUT DATA UNI_CIRCULAR_BUFFER_DATA data storage 69 Version 1 21 Chapter 7 Data Logger TTT LIN CIRCULAR BUFFER DATA t e DATA The module UNI CIRCULAR_BUFFER is a ring buffer in the FIFO first in first out principle and can process any data as a byte stream For this purpose in the data structure UNI CIRCULAR BUFFER DATA all can be processed The following commands are supported on DATA D_ MODE 01 Element to write to buffer 10 Element of Buffer read but not to remove 11 The above command 10 read with item is removed 12 read element from buffer and remove 99 Buffer is reset All data is deleted With DATA D_HEAD WORD in the right byte can be provided the element type and in the left byte optional an additional user ID D HEAD LEFT BYTE ADD I
138. nd KEY KEY has the key name and VALUE is the key value and RESULT 2 lf in a query the end of the data array is reached this will be reported by RESULT 10 165 Version 1 21 Chapter 10 File System lf the file access is no longer needed the user must close the file be either by use of AUTO CLOSE or MODE 5 close file of the FILE SERVER RUN Feature List RUN Function 0 No function to perform and last function is complete 1 Evaluate specific section or evaluate next found section 2 evaluate specific Key or Key found next 3 evaluate next found element section or key RESULT Result Feedback RESULT Description 1 Section found 2 Key found gt Current query is still running call module further cyclical 10 Nothing found reached the end of data 11 Key not found reached the end of Section 166 Version 1 21 Chapter 11 Telnet Vision 11 Telnet Vision 11 1 TELNET VISION The package TELNET VISION is a framework comprising a plurality of function modules to enable simple means with a graphical interface based on the standard TELNET The GUI Graphic User Interface uses a screen of 80 characters wide and 24 lines down At each coordinate position any displayable characters with selectable color attributes can be displayed The horizontal axis from left to right is called standard with X and includes the positio
139. ner string is too long 255 characters max 0x41 The specified IP address is not valid or could not be interpreted correctly 0x42 not valid port number 0x45 Unknown parameters to input PARTNER 0x50 Transmission attempt on invalid connection sender or receiver 0x53 All available connections are occupied 0x61 Neg confirmation of the recipient It was used an incorrect sequence number 0x62 Data type of transmitter and receiver are not equal 0x63 Receiver is at the moment not ready to receive poss Cause The recipient is disabled or is currently in the data transfer NDR TRUE 0x64 Can not find a receiver module with the corresponding R_ID 0x65 Another module instance is already working on this connection 0x70 Partner control was not configured as a time server 106 Version 1 21 Chapter 9 Network and Communication System specific error CoDeSys 0x00 No error occurred 0x01 SysSockCreate unsuccessful 0x02 SysSockBind unsuccessful 0x03 SysSockListen unsuccessful System specific error Beckhoff 0x00 No error occurred 0x01 SocketUdpCreate unsuccessful 0x03 socket listen unsuccessful 0x04 SocketAccept unsuccessful 9 9 IP_CONTROL2 Type Function module IN OUT IP_C IP_C parameterization S BUF NETWORK BUFFER SHORT transmit data R BUF NETWORK BUFFER SHORT receive data INPUT IP DWORD encoded IP address as the d
140. nix Contact ILC Reihe Selectron Berthel Tbox Beck IPC In the PLC program of target PLC the desired variables must be released for web access Since the communication is performed via HTTP port 80 the data exchange is no problem even across firewalls Global and instance variables can be processed Format of variables At global variables only the regular variable names has to be given An instance variable must be specified below instance name variable name Mode Read lf the MODE parameter is set to 1 and the variable name is quoted in NAME so cyclically a request to the HTTP to Web Server PLC is performed and the result is displayed the VLAUE as a string 130 Version 1 21 Chapter 9 Network and Communication Mode Write lf the parameter MODE is set to 2 and at VALUE the variable value and in NAME the variable name as string then cyclically an HTTP request to the Web Server PLC is performed The mode resp the variable name can be changed in the cyclic mode at any time If several variables have to be processed thus only a many module instances as needed must be called 9 22 SYS LOG Type IN OUT INPUT OUTPUT Function module IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data R BUF NETWORK BUFFER receive data ACTIVATE BOOL positive edge starts the query LDT DT local time SERVER_IP4 DWORD IP address of the syslog server PORT WORD
141. nnected to website http 222 133 21 159 index html 15 14 06 05 2007 100 568 MFH IP_C IP_C parameterization S BUF NETWORK BUFFER transmit data LOG CL LOG_CONTROL log data S BUF SIZE UINT Size of S BUF ENABLE BOOL TELNET server released OPTION BYTE Send Options PORT WORD Port Nummer READY BOOL TELNET client has established connection 135 Version 1 21 Chapter 9 Network and Communication TELNET LOG is used to pass all the messages in the ring LOG CONTROL buffer over TELNET By ENABLE the module can be activated At parameter PORT the desired port number can be defined If the parameter is not defined the default port is 23 With OPTION various properties can still be controlled See Table OPTION lf the parameter OPTION is not connected the following default is assumed OPTION BYTE 2 1000 1100 As soon as a Telnet client connects this is indicated by parameter READY Then be automatically all messages are passed to TELNET Once occurred new reports in the course in LOG CONTROL they are always passed automatically When a new connection from to rebuilds all messages will be passed again Most TELNET clients offer the opportunity to redirect the data stream to a file just to make a long term data archiving OPTION BIT Function Description 0 SCREEN INIT After connecting to the TELNET console the entire screen is cleared If the COLOR OPTION is selected the
142. nnunnnunnunnunnunnnnnnunnunnunnunn 89 RER DNS e CN WE 89 92 DNS REV D CR EE 90 GI e Ee d EN 92 GA DIE TEN eege 94 GC WEN EE 96 OG ET EC EE 98 EE EEE EEE NERV EEN 99 9 8 Seele E E raisons eroiceervosensmers E A 101 Se P CONTEE arara E EE EEE E EEE A EE N E 107 oTo E REO EEN 108 DIL ESE EE 111 OD FOG VIEWPORT EN 111 9 13 MB CLUENT OPEN MODBUS are ee ee ee 112 9 14 _MB_ SERVER OPEN MODBUS 116 OS E 118 9 16 OR RE EE 121 OT READ HTTP ee 122 os EE eebe 123 t Fe e RE E 127 9 20 _SNTP AE 128 0 21 SPIDER EE Een 129 922 ee re ee RN 131 0 232 TELNET E e EE 135 9 24 TELNET PRINT EE 137 9 25 ERT ee ee tele ee een 140 A Version 1 21 Chapter 10 ENG 5 vereinen 147 101 CSV PARSER E 147 10 2 CSV PARSER RE 149 TS BLO E 152 wA E FT SET ee 153 105 E ee nern ee le ded ee een 154 10 6 IM DATERR EN 159 10 7 _INI_ E EUR E 161 10 creme US E IE E 164 Li e e lg eee ene ee eee ee 167 11 1 _TELNE SIT ON EE 167 11 2 TE FRRMEWOTE EE 173 11 TN INPUT CONTROL EEN 174 11 2 IN A EE LINE E E E E E are 174 11 5 TN_INPUT MENU BAR 176 11 6 _TN_INPUT_ MENU Eege 178 11 7 _TN_INPUT SELECT OF RI 178 11 8 TN_INPUT SELEC OE E 180 CO TN Re ae nee 182 11 10 TN e tae ee eier 183 11 11 _TN_SC_ADD_ SGHADOWW narr kk ttan a tn n11 ttnan AAAEEEEEEEEEAEEEEEEEAEEEEEEEEEEEE EEE EEE 184 11 12 _TN_SC_AREA BESTORE gege aud accede diveueucmapaess 184 11 Mu EE 185 11 14 N BIN EEN 186 11 15 TI 7 IR E 187 11 16 ENEE 188 Dk Gan E B
143. no RIGHT BYTE Type ID Type codes 1 STRING For DATA D_ STRING the string must be provided 2 REAL For DATA D_REAL the REAL value is passed 3 DWORD In the DWORD the DATA D_DWORD must be passed X header information without data In DATA BUF_SIZE the number of bytes output to show the dropped items in total With DATA BUF_COUNT the number of in Buffer contained elements is provided And on BUF_USED will issue the occupancy of the buffer as a percentage value When an item is written in the buffer and the required free space memory does not exist after calling the module the DATA D_ MODE remains unchanged The command was successfu only if D MODE contains 0 after module call When reading elements the same operation is essential 70 Version 1 21 Chapter 7 Data Logger Only if D MODE subsequently is 0 in D HEAD the data type can be found and if necessary the data from D STRING D REAL D DWORD can be read After successful reading step the deletion of the element to be performed with command 11 Example Writing element DATA D MODE 1 command to write data DATA D HEAD 1 element type STRING DATA D_STRING This is the text module call if DATA D_MODE 0 then the element was successfully saved Example Reading element DATA D_MODE 10 read command element module call result DATA D_HEAD 1 Element Type STRING DATA D_STRING This is t
144. ns 00 79 The vertical axis from top to bottom is called by default to Y and includes the positions 00 23 For pure coordinates specify the location with X and Y If an area rectangle are indicated the upper left corner and lower right corner X1 Y1 with X2 Y2 defined The individual characters can be equipped with color attributes A color attributes consist of a byte where the left nibble 4 bits the ink color foreground color and the right nibble 4 bits the background color defines Example BYTE 16 74 foreground white and blue background The following color attributes are defined Foreground color Nibble Color Byte Color 0 Black 8 Flashing Black 1 Light Red 9 Flashing Light Red 2 Light Green 10 Flashing Light Green 3 Yellow 11 Flashing Yellow 4 Light Blue 12 Flashing Light Blue 5 Pink Light Magenta 13 Flashing Pink Light Magenta 6 Light Cyan 14 Flashing Light Cyan 7 White 15 Flashing White 167 Version 1 21 Chapter 11 Telnet Vision Background color Nibble Color 0 Black 1 Red 2 Green 3 Brown 4 Blue 5 Purple Magenta 6 Cyan 7 Gray For easy handling of the package the module TN FRAMEWORK is responsible it must be called cyclically in the application as it manages the whole system and executes it This communication with the telnet client is processed at graphic changes the system a
145. ntrols a point to point P2P connection is established The process data can by means of the modules NET VAR BOOL8 NET VAR DWORD NET VAR BUFFER NET VAR STRING NET VAR_REAL be collected or passed Each of these modules has input and output pro cess data which are automatically exchanged with the other party other plc IN data on the one side are output as the OUT data on the other side again In this way process data can be exchanged easily between the same con trols but also between different controllers and platforms WAGO Beck hoff Phoenician CONTACT Approach to the creation of the master module First all required process data can be parameterized or transferred by means of NET VAR modules instances Finally once the NET VAR _CON TROL must be passed the process data are then automatically exchanged with the other side The IP address of the second plc and MASTER TRUE must be set Approach to create the slave module The previously created master device must simply be copied 1 1 The IP address must be replaced by the opposite side and be set at MASTER FALSE 197 Version 1 21 Chapter 12 Network Variables Example See diagram below The input data A from the master PLC will pass through by module NET VAR _BOOL8 and transferred by NET VAR_CONTROL to another con troller PLC SLAVE and then again re issued at the same NET VAR _BOOL8 element in the output data B The input data C fro
146. occurs they are issued with ER ROR see module IP_CONTROL2 Existing errors are acknowledged auto matically every 5 seconds by the module UDP server mode In the IRTRANS Web configuration the IP address of the PLC is entered as a broadcast address IRTRANS Web Configuration LEO D d Broadcast A Relay UDF Broadcast Target 192 168 1241 UDF Broadcast Port 2000 Store Senge The following example shows the application of IRTRANS Devices 41 Version 1 21 Chapter 6 Device Driver IRTRANS_SND_ a KEY amp gt IP_C E 5_BUF IF_CONTROLZ IRTRANS_SERWER t IF_C ID Th zo ENABLE S amp S ENABLE P_ENABLE R_ENABLE ERROR e S BUF te R_BUF 6 7 IRTRANS SND 1 Type Function module Input IN BOOL TRUE Send key code T REPEAT TIME time to re send the key code I O IP_C data structure IP CONTROL Parameterization S BUF data structure NETWORK BUFFER SHORT Transmit data Setup DEV CODE STRING to be decoded remote control name 42 Version 1 21 Chapter 6 Device Driver KEY CODE STRING key code to be decoded Output KEY BYTE output of the currently active key codes IRTRANS SND 4 1 IRTRANS SND_1 allows you to send a remote command to the IRTrans If IN TRUE the specified device and key code in setup is sent to the IRTrans which outputs in turn as a real remote control commands With T REPEAT the repeat time for sending can be specified If IN
147. ock eg CoDeSys and do not always allow an asynchronous use FILE SERVER should run in a separate task so that the default application is not influenced in the time behavior The FILE SERVER provides the following commands in MODE MODE Properties 1 An existing file is opened for reading and reading data optional 2 An existing file is opened for write access and optional data is written 3 A file will be created for writing and data will be written optional 4 Delete file 5 Close file ERROR Error codes Beckhoff Value trigger Description 156 Version 1 21 Chapter 10 File System 0 No error 19 SYSTEMSERVICE_ FOPEN Unknown or invalid parameter 28 SYSTEMSERVICE_FOPEN File not found Invalid file name or file path 38 SYSTEMSERVICE_FOPEN SYSTEMSERVICE_FOPEN 51 SYSTEMSERVICE FCLOSE unknown or invalid file handle 62 SYSTEMSERVICE_FCLOSE File was opened with the wrong method 67 SYSTEMSERVICE FREAD unknown or invalid file handle 74 SYSTEMSERVICE_FREAD No memory for read buffer 78 SYSTEMSERVICE_ FREAD File was opened with the wrong method 83 SYSTEMSERVICE FWRITE unknown or invalid file handle 94 SYSTEMSERVICE_FWRITE File was opened with the wrong method 99 SYSTEMSERVICE FSEEK unknown or invalid file handle 110 SYSTEMSERVICE _FSEEK File was opened with the wrong method 115 SYSTEMSERVICE FTELL unknown or invalid file handle
148. ode converts in HTML reserved characters to form amp Name If the input M is set to TRUE also all the characters with the code 160 255 and 128 are implemented in the amp Name convention Caution should be exercised in the use of character sets because they are not the same on all systems and deviations are common in special charac ters Thus for example not all systems the character at position 128 in the character map The reserved characters in HTML are amp Is encoded as amp amp gt Is encoded as amp gt lt Is encoded as lt is coded as amp quot Html encode converts the string 1 gt than 0 into 1 is amp gt than 0 76 Version 1 21 Chapter 8 Converter 8 8 IPA CHECK Type Function BOOL Input NIP DWORD network IP address LIP DWORD Local IP address SM DWORD Subnet Mask Output BOOL TRUE if NIP and LIP are in the same Subnet IP4 CHECK 0 NIP IP4 CHECK LIP SM IP4 CHECK checks if a network address of the NIP and the local address LIP are in the same Subnet lie Both addresses will be first masked with the Subnet mask and then tested for equality Only the bits which are in the Subnet Mask TRUE are examined for equality The network addresses must correspond to the IPv4 format and presented as a DWORD If IP ad dresses must be tested that are String they are to be converted to DWORD before The following example shows 2 IP addresses and a Subnet Mask as String are tested
149. oils Read Coils x x X x 2 xX Input Discrete Read Discrete Inputs xX X X x 3 x Holding Register Read Holding Registers X X X 4 x Input Register Read Input Register X X 5 x Coils Write Single Coil X X xX 6 x Holding Register Write Single Register X X 15 x Coils Write Multiple Coils xX X X X 16 x Holding Register Write Multiple Register X X X 22 x Holding Register Mask Write Register X X 23 x Holding Register Read Write Multiple Register x x x X X X ERROR Value Source Description B3 B2 B1 BO nn nn nn xx IP_CONTROL Error from module IP_CONTROL xx xx xx 00 MB CLIENT No Error xx xx xx 01 MB CLIENT ILLEGAL FUNCTION The function code received in the query is not an allowable action for the server or slave This may be because the function code is only applicable to newer devices and was not implemented in the unit selected It could also indicate that the server or slave is in the wrong state to process a request of this type for example because it is unconfigured and is being asked to return register values xx xx xx 02 MB CLIENT ILLEGAL DATA ADDRESS The data address received in the query is not an allowable address for the server or slave More specifically the combination of refer ence number and transfer length is invalid For a controller with 100 114 Version 1 21 Chapter 9 Network and Communication registers the PDU addresses the first register as 0 and the last one as 99
150. ommand line This must be set in_TYPE 1 The item will be provided as in_X and in_Y Every entry line can be provided with a title text With in_ Title Y Offset and rm Title X Offset the position relative to the element coordinates is expressed The color can be determined with by_ Title Attr and the text by st_ Title String If a tool tip should appear at the element er Input ToolTip the text hast to be specified lf the item has focus using the keyboard cursor left right the flashing cursor can be moved within the line The backspace key can delete entered character By pressing the Enter Return key the input text is issued at st_Input String and bo Input Entered ist set to TRUE The input flag must be reset after receive by the user Using bo Input Hidden TRUE the hidden input is activated thus all input characters represented with a Using st_Input_Mask determines at which position and how many characters can be entered At each position which a space character can be entered During initialization st_Input_Mask must be copied once to et Input Data Is bo Input_Only Num TRUE only numeric keys are accepted and adopted Example in Type INT 01 in_Y INT 16 in X INT 09 by Attr_ mF BYTE 16 72 white green by Attr_oF BYTE 16 74 white blue in_Cursor Pos INT 0 bo Input Only Num FALSE bo Input Hidden FALSE et Input Mask
151. or If a sub menu item is confirmed by pressing Enter Return key then in in Menu_Selected the number of the selected menu point is passed The calculation of the menu item number is as following Main menu index 10 Submenu index The entry in in _ Menu_Selected needs set again to O after acceptance by users Thus a maximum of 9 main menu items and each 9 Submenu items are executable Means of escape key at any time the menu can be hided again 176 Version 1 21 Chapter 11 Telnet Vision Active Menu automatically backs up the background before it is drawn and restores the background after ending As long as a menu is display the user program may not make graphical changes This can be checked by TN_SCREEN bo Menue _Bar_Dialog TRUE Example in X INT 00 In Y INT 00 by Attr_mF BYTE 16 33 yellow brown by Attr oF BYTE 16 0F black grey st MENU TEXT File Edit View End et MENU TEXT CONCAT st_MENU_TEXT oeffnen speichern beenden loeschen einfuegen kopieren et MENU TEXT CONCAT st_MENU TEXT alles detail kopieren Logout bo Create TRUE The following output Datei Bearbeiten Ans cht Ende SYSTEM CONSOLE Ansicht Ende 177 Version 1 21 Chapter 11 Telnet Vision 11 6 TN INPUT MENU POPUP Type Function module IN OUT us TN SCREEN Us TN SCREEN Xus TN MENU us TN MENU a TN INPUT MENU POPUP Zus TN MENU POP
152. or c forcast_tomorrow_high_temp INT The forcast tomorrow weather conditions the fore casted high temperature for this day in the units for c forcast_tomorrow_text STRING The forcast tomorrow weather conditions text a textual 40 description of conditions forcast_tomorrow_code INT The current weather conditions code the code for this condition forecast forcast_tomorrow_icon INT The current weather conditions icon the icon condition for this forecast Condition Codes The fields cur_conditions code forcast today code and forcast tomorrow code describe the weather in text form by Condition Codes Description tornado tropical storm hurricane severe thunderstorms Temp mixed rain and snow mixed rain and sleet mixed snow and sleet freezing drizzle drizzle freezing rain 31 Version 1 21 Chapter 4 Data Types of the NETWORK Library 11 showers 12 showers 13 Snow Flurries 14 Light snow showers 15 blowing snow 16 snow 17 hail 18 sleet 19 0 20 foggy 21 haze 22 smoky 23 blustery 24 windy 25 cold 26 cloudy 27 mostly cloudy night 28 mostly cloudy day 29 partly cloudy night 30 partly cloudy day 31 clear night 32 sunny 33 fair night 34 fair day 35 mixed rain and hail 36 hot 3 isolated thunderstorms 38 scattered thunderstorms 32 Version 1 21 Chapter 4 Data Types of the NETWORK Library scattered thunderstorms scattered sho
153. ose the file be either by use of AUTO CLOSE or MODE 5 close file of the FILE SERVER RUN Feature List RUN Function 0 No function to perform and last function is complete 1 Element to evaluate RESULT Result Feedback RESULT Description 1 Element found 2 Element and the end of the line identified gt Current query is still running call module further cyclical 10 Nothing found reached the end of data 191 Version 1 21 Chapter 10 File System 10 3 FILE BLOCK Type Function module INPUT PT SIZE UINT number of bytes in the buffer FILE NAME STRING file name POS UDINT current file reading position OUTPUT ERROR BYTE error code See module FILE SERVER DATA BYTE BYTE of the requested file position IN OUT MODE BYTE Current mode FD FILE SERVER DATA File Interface PT NETWORK BUFFER read data FILE BLOCK PT SIZE FILENAME The module FILE BLOCK provides access to files of any size by a data block that is always kept in a read buffer If the requested byte of a file is not stored in last block of data automatically a matching new data block is read and the desired byte is putted out The greater the read buffer is the less frequently a block must be read again Optimally it is a linear access to the bytes so that as seldom as possible a data block must be read anew 152 Version 1 21 Chapter 10 File System Sliding Windo
154. out Error xx xx FE xx Receive data Value 254 Receive buffer is full overflow Buffer size is automatically set to 0 xx XX xx nn Application Error In IP_CONTROL always 00 ERROR is transferred originally from the client appli cation and optionally at this point an application error is reported This error code is entered but only by the client devices System specific error PCWorx MULTIPROG Value State Message 0x00 No error occurred 105 Version 1 21 Chapter 9 Network and Communication 0x01 Creation of at least one task has failed 0x02 Initialization of the socket interface failed only WinNT 0x03 Dynamic memory could not be reserved 0x04 FB can not be initialized because at start the asynchronous communication tasks an error has occurred 0x10 Socket initialization failed 0x11 Error at sending a message 0x12 Error when receiving a message 0x13 Unknown service code in the message header 0x21 Invalid state transition upon connection 0x30 No more free channels available 0x31 The connection was canceled 0x33 General timeout receiver or transmitter does not answer or sender has not completed transmission 0x34 Connection request has been negatively acknowledged 0x35 Recipient did not confirm transfer possibly overloaded receivers repeat transfer 0x40 Part
155. oy BOOL action remove menu bo Update BOOL action refresh menu 4 7 us TN MENU POPUP A variable of type us TN MENU POPUP can be used to parameterize a PO PUP item to display it and to process element related inputs us TN MENU POPUP Data field Data Type Description st_Menu_Text STRING STRING LENGTH Menu items Im Menu E Count INT Number of menu items Im A INT Menu X position in_Y INT Menu Y position in_Cols INT INT INT INT Menu number of lines in_Cur_ltem INT Current menu item by Attr_mF BYTE Text attributes with focus by Attr_oF BYTE Text attributes without focus by Input Exvten Code BYTE keycode special keys Menu number of lines BOOL action create menu bo Destroy BOOL action remove menu bo Update BOOL action refresh menu 20 Version 1 21 Chapter 4 Data Types of the NETWORK Library bo Activ BOOL Menu Is active 4 8 us TN SCREEN A variable of type us TN SCREEN can be used to manage display the gra phical user interface GUI us TN SCREEN Data field Data Type Description bya CHAR ARRAY 0 1919 OF BYTE Screen character bya COLOR ARRAY 0 1919 OF BYTE screen color codes bya BACKUP ARRAY 0 1919 OF BYTE screen backup memory bya_Line Update ARRAY 0 23 OF BYTE screen lines update by_Input_Exten_Code BYTE Key code special keys by_Input
156. prevent a timeout error from occurring in the client or master The client or master can next issue a Poll Program Com plete message to determine if processing is completed XX XX XX 06 MB_CLIENT SLAVE DEVICE BUSY Specialized use in conjunction with programming commands The server or slave is engaged in processing a long duration program command The client or master should retransmit the message later when the server or slave is free XX XX XX MB_CLIENT MEMORY PARITY ERROR Specialized use in conjunction with function codes 20 and 21 and reference type 6 to indicate that the extended file area failed to pass a consistency check The server or slave attempted to read record file but detected a parity error in the memory The client or master can retry the request but service may be required on the server or slave device XX XX XX 0A MB_CLIENT GATEWAY PATH UNAVAILABLE Specialized use in conjunction with gateways indicates that the gateway was unable to allocate an internal communication path from the input port to the output port for processing the request Usually means that the gateway is misconfigured or overloaded XX XX XX 0B MB_CLIENT GATEWAY TARGET DEVICE FAILED TO RESPOND Specialized use in conjunction with gateways indicates that no re sponse was obtained from the target device Usually means that the 115 V
157. prints the name of the Section and RESULT 1 With a found KEY KEY has the key name and VALUE is the key value and RESULT 2 lf in a query the end of the data array is reached this will be reported by RESULT 10 RUN Feature List RUN Function 0 No function to perform and last function has finished 1 Specific section or evaluate next found section 2 evaluate specific Key or Key found next 3 evaluate next found element section or key RESULT Result Feedback RESULT Description 1 Section found 2 Key found gt Current query is still running call module further cyclical 10 Nothing found reached the end of data 163 Version 1 21 Chapter 10 File System 11 Key not found reached the end of Section 10 8 INI PARSER FILE Type Function module OUTPUT RESULT BYTE result of query IN OUT FILE NAME STRING file name FSD FILE_SERVER_DATA file interface STR STRING STRING LENGTH Searched item RUN BYTE command code for current action OFFSET UDINT current file offset of the query KEY STRING STRING LENGTH found item VALUE STRING STRING LENGTH value of a key PT NETWORK BUFFER read data buffer ae INT PARSER FILE The module INI PARSER FILE enables the analysis of the elements of an arbitrarily large INI file which is read into the read data buffer block by block for automatically processing The name of the file is
158. r_www OSCAT DE Here the most current Manual is available for download In addition to the Ma nual OSCAT prepared a detailed revision history The OSCAT revisionhistory lists all revisions of Individual modules with amendments and at what re lease the library of this component is included 12 Version 1 21 Chapter 2 Introduction 2 5 Support Support E given by the users in the forum WWW OSCAT DE A claim for support does not exists even if the library or parts of the library are faulty The support in the forum under the OSCAT is provided for users voluntarily and with each other Updates to the library and documentation are usually made available once a month on the home page of OSCAT under WWW OSCAT DE A claim for maintenance troubles hooting and software maintenance of any kind is generally not existing from OSCAT Please do not send support requests by email to OSCAT Re quests can be processed faster and more effectively when the inquiries are made in our forum 13 Version 1 21 Chapter 3 Demo Programs 3 Demo Programs 3 1 Demo programs The OSCAT Network Library contains components and functions that deal with the issue of file handling and ethernet communications and someti mes require enhanced base knowledge In order to allow the user easy access are possible for many theme demo programs are prepared The demo programs are in network lib in the folder DEMO included If they are used the ne
159. rd smtp server username password smtp_server portnumber smtp_server Special case 67 Version 1 21 Chapter 7 Data Logger If in the username is a included this must be passed as character and is then automatically corrected by the module again By specifying user and password the Extend SMTP is used and automatically the safest possible Authentication method is used If parameter is to specify the MAIL FROM sender address Le oscat gmx net Optionally an additional Display Name be added This is displayed the email client automatically instead of the real return address Therefore always an easily recognizable name to be used i e oscat gmx net Station 01 The email client shows as the sender then Station 01 Thus more people will use the same email address but send a own Alias At the MAILTO parameter can To Cc Bc be specified The different groups of recipients are specified by as the separator in a list Multiple addresses within the same group are divided with the separator In each group can be defined unlimited count of recipients the only limitation is the length of the mailto string To lo Cc3Cc 4 Bc 3Bc Examples ol gmx net o2 gmx net ol gmx net o2 gmx net defines two TO addresses one CC address and a Bc address 02 gmx net defines only one BC address With subject a subject text will be specified as well as with BODY an email text content The current Date
160. receive data INPUT IP4 DWORD IP address of the HTTP server GET BOOL Starts the HTTP query MODE BYTE version of the HTTP GET query UNLOCK BUF BOOL release of the receive data buffer OUTPUT HTTP STATUS STRING HTTP status code HTTP START UINT start position of the message header HTTP STOP UINT stop position of the message header BODY START UINT start position of the message body BODY STOP UINT stop position of the message body DONE BOOL task performed without error ERROR DWORD error code HTTP_GET HTTP GET does at positive edge of Get a GEI command on an HTTP ser ver With MODE the HTTP protocol version can be specified The reques ted URL web link must be submitted completely processed in the URL_DATA structure The full URL should therefore be processed before the module call by STRING TO URL After a successful query DONE TRUE and the parameters HTTP START and HTTP STOP point to the data area in which the message header data for further processing and evaluation are to be found Normally a message body is present which in turn is trans 98 Version 1 21 Chapter 9 Network and Communication mitted via BODY START and BODY STOP Also on HTTP_STATUS is reported the HTTP status code as a string One of the difficulties in receiving the HTTP data is the end of the data stream This module pursued multiple strategies In the process of the HTTP 1 0 the end of receiving data is de tected by d
161. rocess values take care of data flow order Fore storing the various data types the following modules are provided DLOG STRING DLOG REAL DLOG DINT DLOG DT DLOG BOOL Other data types convert first manually and transferred as STRING The collected data can then be forwarded to a data target DLOG STORE FILE CSV store data as csv file DLOG STORE FILE HTML store data as HTML file DLOG STORE FILE XML store data as XML file DOG STORE RRD store data on RRD server The files that are stored on the controller can then be forwarded to exter nal data targets DLOG FILE TO SMTP File as Email DLOG FILE TO FTP copy file to an external FTP server 46 Version 1 21 Chapter 7 Data Logger The modules above can be combined with each other The following example shows the recording of a time stamp a REAL and DINT counter Here the process data is stored after each minute in a new CSV formatted file Once a file is ready it will be moved automatically to an FIP server 47 Version 1 21 Chapter 7 Data Logger x CLOCK_TRIG bX DLOG_FILE_TO_FTP DLOG_FILE_TO_FTP RESCH art DONEI fp_done fp fip_activ FTP_ACTIV BUSY itp busy _ttp_delete_ FILE_DELETE m 2 _fp_imeaut TIMEOUT ERROR_T __fip_retry RETRY ge RETRY_TIME DNS_IP4 ic pe d x IP4_DECODE a 192 168 178 25 str IP4_DECODE IP4_DECODE 192 168 178 1 str IP4_DECODE 7 2 DLOG BOOL Type Function module IN OUT X DLO
162. rrors ERROR _C DWORD Error code ERROR_T BYTE error type Prr IFZGEO The device supplies because of the wide area network IP address the geographic information of the Internet access As the WAN IP addresses are registered worldwide therefore can be determined the approximate geographical position of the PLC Should access runs through a proxy server so its geographic position is determined and not the PLC Usually but normally it is in the nearness of the PLC and thus the deviation is not relevant This results in calculated positions differ only a few miles from the true position and is relatively accurate lf the parameter IP specifies no IP address automatically the current WAN IP is used otherwise the information of the configured IP delivered With a positive edge of the ACTIVATE the request is started As long as the query is not complete BUSY TRUE is passed After successful completion of the query DONE TRUE and the parameters WAN IP the current WAN IP address displayed If an error occurs during the query it is reported in ERROR_C in combination with ERROR_T ERROR T Value Properties 1 The exact meaning of ERROR_C can be read at module DNS_ CLIENT 2 The exact meaning of ERROR_C can be read at module HTTP_GET The country_code is coded according to ISO 3166 country code ALPHA 2 http www iso org iso english_country_names_and_code_ elements http de wikipedia org wiki ISO 3166 1
163. s discarded Furthermore with Enable the logging will be disabled in general Thus it is not a problem to archive many messages per PLC cycle The message buffer can be passed to a telnet client with the module TELNET LOG Details on the interface are shown in the table below lf messages are applied from various module instances to the same LOG BUFFER then the LOG CL data structure has to be created Global 9 12 LOG VIEWPORT Type Function module IN OUT LC LOG CONTROL LV us LOG VIEWPORT ff LOG VIEVYPORT LC t gt Li Ap gt The module LOG _ VIEWPORT is used to index a list of LOG CONTROL messages which are currently in the virtual view To move around within the message list scroll a scroll offset can be specified by LV MOVE TO X A positive value scroll in direction of newer reports and a negative value in the direction of the earlier messages The number of lines in the 111 Version 1 21 Chapter 9 Network and Communication message list of the virtual view is given by LV COUNT The current messages in the virtual view are stored in LV LINE ARRAY x and are available for further processing A change in the message list is always announced with LV UPDATE TRUE and the user has to reset The following LV MOVE TO_X values produce a special behavior 30000 display previous Messages beginning of the ring buffer 30001 display latest messages end of the ring buffer 30002 one full page in direc
164. se providers offer in addition to paid also free DynDNS services lf ENABLE is set to TRUE then the module is active Using a positive edge to UPDATE any time an update can be started If at T UPDATE a time is specified always an update is done after that time Caution most DynDNS providers rates a frequent or unnecessary update as an attack and block the account for a certain time The time T_ UPDATE should not be set below an hour If the parameter T_ UPDATE is not connect it is assumed as an update time of 1 hour If no update is needed on time then T 0ms should be passed The MODE parameter allows the selection of DynDNS Provider 0 DynDNS org 1 SELFHOST DE The own domain name must be passed by the hostname For security reasons USERNAME and PASSWORD as authorization data must be specified to the DynDNS provider If the parameter IP4 is not used so DynDNS provider automatically adopts the current registration IP as WAN IP with which the update is performed By specifying an IP address also an individual IP address may be assigned With flawless execution the parameter DONE TRUE else ERROR C and ERROR_T passes the error code and error type See error codes ERROR T Value Properties 93 Version 1 21 Chapter 9 Network and Communication 1 The exact meaning of ERROR_C can be read at module DNS_ CLIENT 2 The exact meaning of ERROR_C can be read at module HTTP_GET 3 The DynDNS provid
165. seseeerenseenrenrens 52 NET VAR REALB nennen 202 DNS CUENT rreren 89 NET VAR STRING 203 DINIDA AN 92 NET VAR 8 204 DNS REV CUENT cececceececeeeeeeereeerenreees 90 NETWORK VERSION 35 ELEMENT COUNT 34 PRINT St 121 ELEMENT GET 24 PRINTF DATA 25 FILE BLOCK 152 RCA_CRYPT_STREAM een 82 FILE PATH DATA 22 READ HTTP 122 FILE PATH SPLIT 153 SHAL emp 83 FILE SERVER 154 SHAIL STREAM 84 FILE SERVER DATA 22 SHALL TO ST 85 FTP CUENT 94 SMTP CUENT 123 GET WAN Ip 96 SNTP CUENT 127 HTML DECODE 75 SNTP SEBWVER 128 HTML ENCODE 76 SPIDER ACCESS 129 HTTP GET 98 STRING TOURL 86 INI PARSER BUE 161 SYS Loo 131 INI PARSER ELE 164 TELNET LO 135 IEN 23 TELNET PRINT 137 IP CONTROL iair 101 TELNET MISION 167 IP CONTROL2 eccecsecceseseerseretessersereesereen 107 TN FRAMEWORK 173 IP 21 MEN 108 TN_INPUT CONTROL 174 IP FIFO DATA 24 TN INPUT EDIT UNE 174 Jee ee ne elle 22 99 TN INPUT MENU BAR 176 IPA CHECK 77 TN INPUT MENU BOPUp 178 IPA DECODE 77 TN_INPUT SELECT POPUP 178 IPA TO STRING reren 78 TN_INPUT SELECT TEST 180 IRTRANS DECODE 36 TN BECEIME reenen 182 IRTRANS RCV 1 37 TN SC ADD SHADOW nennen 184 IRTRANS RCV A 39 TN SC AREA RESTORE een 184 IRTRANS RCV 8 39 TN SC AREA SAVE 185 IRTRANS SERVER acc 40 TN SC BON 186 IRTRANS_SND 1 A3 TN SC ol re 187 IRTRANS SND A Ee Re TEEN 188 IRTRANS SND 8 44 TN SC READ ATTR 190 IS PA 78 TN SC READ CHAR nennen 190 IS UBLCHR 79 TN SC SHAD
166. stance If the configuration of the master and the slave program is differently incorrectly that ID number is passed as a fault in the module NET VAR CONTROL 12 7 NET VAR STRING Type Function module IN OUT X NET MAR DATA NET_VAR data structure IN STRING string length input string OUT STRING string length output string OUTPUT ID BYTE ID TY NET MAR STRING The module NET VAR_STRING is used for bidirectional transmission of STRING from the master to slave and vice versa The STRING in the parameters IN will be 203 Version 1 21 Chapter 12 Network Variables recorded and passed on the other side control on the same module at the same position as OUT parameter At the same time the input String on the opposite side of the other control is passed here as a OUT value again ID parameter indicates the current identification number of the module instance If the configuration of the master and the slave program is differently incorrectly that ID number is passed as a fault in the module NET VAR CONTROL 12 8 NET VAR X8 Type Function module IN OUT X NET WAR DATA NET_VAR data structure INPUT IN REAL1 REAL input IN REAL2 REAL input IN DINT1 DINT input IN DINT2 DINT input IN UDINT1 DINT input IN UDINT2 DINT input IN DWORDI DINT input IN DWORD2 DINT input OUTPUT OUT_REALI REAL ouput OUT REAL2 REAL output OUT DINT1 DINT output OUT DINT2
167. sv log2 csv DEL The two files are deleted after successful transfer The monitoring time can be specified with parameter TIMEOUT At dns _ip4 must be specified the IP address of the DNS server if in SERVER a DNS name is specified If errors occur during the transmission they are passed at ERROR_C and ERROR T As long as the transfer is running BUSY TRUE and after an error free completion of the operation DONE TRUE Once a new transfer is started DONE ERROR_T and ERROR C are reseted The module has integrated the IP CONTROL and must not be externally linked to this as it by default would be necessary Basics http de wikipedia org wiki SMTP Auth http de wikipedia org wiki Simple Mail Transfer Protocol ERROR T Value Properties 1 Problem DNS_ CLIENT The exact meaning of ERROR_C can be read at module DNS_ CLIENT 2 Problem SMTP Channel The exact meaning of ERROR_C can be read at module IP_CONTROL 4 Problem FILE_SERVER The exact meaning of ERROR_C can be read at block FILE_ SERVER 5 Problem END TIMEOUT ERROR_C contains the left WORD the end of the step number and in the right WORD the last response code received by the SMTP server The parameters must be considered first as a HEX value divided into two WORDS and then be considered as a decimal value Example ERROR T 5 126 Version 1 21 Chapter 9 Network and Communication ERROR_C 0x0028 OOFA End st
168. t Magenta 6 Light Cyan 22 Flashing Light Cyan 7 White 23 Flashing White 8 Black 24 Flashing Black 9 Red 25 Flashing Red 10 Green 26 Flashing Green 11 Brown 27 Flashing Brown 12 Blue 28 Flashing Blue 13 Purple Magenta 29 Purple Magenta 14 Cyan 30 Flashing Cyan 15 Gray 31 Flashing Gray BACK COLOR Byte Color 0 Black 1 Red 2 Green 3 Brown 4 Blue 5 Purple Magenta 6 Cyan 139 Version 1 21 Chapter 9 Network and Communication 7 Gray ddd HyperTerminal Datei Bearbeiten Ansicht Anrufen bertragung 7 OSCAT Telnet_Print Test Color Yerbunden 00 00 12 AST yy TCP IP 9 25 XML READER Type Function module IN OUT CTRL XML_CONTROL Control and status data BUF NETWORK BUFFER Receive data 299 XML READER 140 Version 1 21 Chapter 9 Network and Communication XML_READER means it is possible to parse so called well formed XML do cuments Here not as usual at high level languages the whole XML data is read as a data structure and stored in memory but a very resource fri endly version is used The XML_READER reads XML data as a sequential data stream from the buffer and signals the in COMMAND defined element types automatically back With XML is a strict distinction between upper and lower case An XML do cument consists of just elements attributes their assignments and the contents of the elements that can be text or child elements which in tur
169. t RUN BOOL Positive edge starts the calculation 83 Version 1 21 Chapter 8 Converter Output DONE BOOL TRUE if calculations are complete HASH ARRAY 0 19 OF BYTE actual SHA1 HASH I O STR STRING string_length Text for HASH creation With SHA1_STR the SHA1 hash can be calculated in a string In the STR a string is passed to the module and a positive edge at input RUN the calculation starts DONE is immediately reset at startup and after the pro cess is DONE is set to TRUE Then at the parameter HASH the actual cal culated HASH value is available See module SHAI STREAM Example Hash value of OSCAT is 4fe4fa862f2e7b91bf95abe9f22831247a3afd35 8 19 SHA1 STREAM Type Function module I O MODE INT mode 1 init 2 Data Block 3 Complete BUF ARRAY 0 63 OF BYTES source data SHA1 ARRAY 0 19 OF BYTE current SHA1 HASH SIZE UDINT number of data Output POS UDINT start address of the requested data block The module SHA1_ STREAM allows the calculation of standard cryptogra phic hash function SHA 1 Secure Hash Algorithm 84 Version 1 21 Chapter 8 Converter This can be created from any data stream a unique check value It is vir tually impossible to find two different messages with the same test value this is referred to as collisions free This can be used to check a configura tion file for change or manipulation With the secure hash algorithm SHA1 a hash v
170. t position number 1 Example of an HTTP response header information HTTP 1 0 200 OK lt CR gt lt LF gt Content Length 2165 lt CR gt lt LF gt Content Type text html lt CR gt lt LF gt Date Mon 15 Sep 2008 16 59 08 GMT lt CR gt lt LF gt Last Modified Wed 18 Jun 2008 12 35 52 GMT lt CR gt lt LF gt Mime Version 1 0 lt CR gt lt LF gt lt CR gt lt LF gt lf SRC does not include a search term automatically the HTTP version and the HTTP status code in the buffer is searched and evaluated As a result according to the above example 1 0 200 OK is returned If SRC is ina search term this header information is searched in the buffer and the value as a string eg Content Length 2165 is returned 9 18 SMTP CLIENT Type Function module IN OUT SERVER STRING URL of the SMTP server MAIL FROM STRING return address MAILTO STRING string length recipient address SUBJECT STRING subject text SUBJECT STRING subject text FILES STRING string length attached files INPUT ACTIVATE BOOL positive edge starts the query TIMEOUT TIME time DTI DT current date time 123 Version 1 21 Chapter 9 Network and Communication DTI OFFSET INT time zone offset from UTC Dns_ip4 DWORD IP4 address of the DNS server OUTPUT DONE BOOL Transfer completed without error BUSY BOOL Transfer active ERROR _C DWORD Error code ERROR_T BYTE Problem type ee SMTF_LLIEMNT The module SMTP_C
171. ter in Iby_ FILL With parameter Iby_ATTR fill color can be specified The fill area is drawn with a border that is given by lin BORDER Border types O no border 1 frame with a single line 2 frame double line 3 frame with spaces Example Box with leaders X and white color to blue 186 Version 1 21 Chapter 11 Telnet Vision Representation with lin BORDER value 0 1 2 and 3 from left to right 11 15 TN SC FILL Type Function module INPUT lin_Y1 INT Y1 coordinate of the area lin _X1 INT X1 coordinate of the area lin _Y2 INT Y2 coordinate of the area lin_X2 INT X2 coordinate of the area lby CHAR BYTE character to fill in the the area lby ATTR BYTE color code to fill the area IN OUT AUS IN SCREEN Us TN SCREEN TN SC FILL Tin Y1 sd Kus TN SCREEN Tin Xi Iin YZ Iin Ze Iby CHAR Iby Attr zus TH SCREEN b The module TN_SC FILL is used to draw a rectangular area that is filled with the specified character in Iby_FILL Example Box with leaders X and white color to blue 187 Version 1 21 Chapter 11 Telnet Vision 11 16 TN SC LINE Type Function module INPUT lin_Y1 INT Y1 coordinate of the line lin_X1 INT X1 coordinate of the line lin_Y2 INT Y2 coordinate of the line lin_X2 INT X2 coordinate of the line Iby_ATTR BYTE color code of the line Iby_BORDER BYTE type of line IN OUT AUS IN SCREEN Us TN SCREEN TN SC LINE Tin
172. ternate path Output URL URL DECODE_URL STR DECODE_URL DEFAULT PROTOCOL DEFAULT_PATH STRING TO URL split a URL Uniform Resource Locator into its com ponents and stores it in the data type URL If in STR no path or protocoll is specified so the function sets the missing values automatically with the specified replacement values A URL is as follows Protocol user Password domain port path query anchor Example ftp nhugo nono oscat de 1234 download manual html some parts of the URL are optional such as user name password Anchor Query 86 Version 1 21 Chapter 8 Converter 8 22 URL DECODE Type Fu FUNCTIONS STRING string_length Input IN STRING String Output STRING string length string URL DECODE converts the in HH encoded special characters in the String IN in the appropriate ASCII code In a URL encoding only the charac ters IA Z a Z found O 9 can occur Other characters with a character followed by 2 characters long Hexadecimal of the character are shown The reserved character is encoded as a 23 8 23 URL ENCODE Type Function STRING STRING LENGTH Input IN STRING String Output STRING STRING LENGTH string URL ENCODE converts reserved characters in the string IN in the string Y HH In a URL encoding only the characters A Z a Z found 0 9 can occur Other characters with a sign followed by the two character
173. th the ini data and the number of bytes has to be stored in PT SIZE The search for elements always begins on the given depended OFFSET and hence is very easy to look only at certain positions or to repeat the search from a specific section to browse not always the entire byte array At the initial search should start default to OFFSET O but may not When querying sections and keys there are various procedures Either it is queried to a Section and evaluates all of the following keys by individual queries or to use in very large initialization file the classic enumeration listing which means it will be report serially all the elements and processed by the application Section Search To determine the OFFSET of a specific Section STR must declare the name of the Section and the offset can be set to a position that is located before of the searched section Should only the nearest available section be found at STR an empty sting must be passed The search query is started by RUN 1 The search will take different time depending on the structure and size of the INI data it takes an indefinite number of cycles until a positive or negative result is achieved Once the search is finished the IN PARSER _ BUF sets the parameters of RUN to 0 RESULT passes the result of the search to output Upon successful search the name of the section is shown at parameters KEY And then the OFFSET parameter points to the end of the section line Thus
174. the software library and the descriptions and explanations given in this manual even when this is not mentioned explicitly 1 2 License Terms The use of the OSCAT library is free of charge and it can be utilized for private or business purposes Distribution of the library is expressly encouraged however this has to be free of charge and contain a reference to our webpage WWW OSCAT DE If the library is offered in electronic form for download or distributed on data carriers it has to be ensured that a clearly visible reference to OSCAT and a link to WWW OSCAT DE are included accordingly 7 Version 1 21 Chapter 1 Legal 1 3 Intended Use The software modules included in the OSCAT library and described in this documentation were exclusively developed for professionals who have had training in PLC The users are responsible for complying with all applicable standards and regulations which come into effect with the use of the software modules OSCAT does not refer to these standards or regulations in either the manual or the software itself 1 4 Registered trademarks All the trademarks used in this description are applied without reference to their registration or owner The existence of such rights can therefore not be ruled out The used trademarks are the property of their respective owners Therefore commercial use of the description or excerpts of it is not permitted 1 5 Other All legally binding regulations can
175. the area lin _X1 INT X1 coordinate of the area lin _Y2 INT Y2 coordinate of the area lin_X2 INT X2 coordinate of the area lin OPTION INT kind of the shadow IN OUT AUS IN SCREEN Us TN SCREEN TN SC ADD SHADOW Tin Y1 e Zus TN SCREEN Tin X1 Iin Y2 Iin X2 Iin OPTION Zus TN SCREEN e The module TN SC ADD SHADOW allows you to add optical shadow to rectangular glyphs By specifying a rectangular area by means of the parameters X1 Y1 and X2 Y2 a basic framework is defined at which at the right and bottom color darkened lines are drawn shadow The Shadow coordinates X1 Y1 and X2 Y2 are always given 1 for proper primitive OPTION means you can choose between two shadow variations lf OPITION O then the shadow is reached by pure color adjustment darkening of the character If an OPTION gt O in the area of the shadow all the characters replaced by black filled characters 11 12 TN SC AREA RESTORE Type Function module IN OUT Xus TN SCREEN Us TN SCREEN 184 Version 1 21 Chapter 11 Telnet Vision 737 TN SC AREA RESTORE Zus TN SCREEN e e Zus TN SCREEN The module TN SC AREA RESTORE enables recovery of previously saved screen area The screen data in Xus TN SCREEN bya BACKUP x is restored using the stored coordinates This is done mainly done after the call from the module MENU BAR amd MENU POPUP to restore the modified screen 11 13 TN SC AREA SAVE Type Function module INPUT
176. tically copies all process values behind amp value so that then the following data example used http my_servername myhouse rrd test_rrd php rrd_db test rrd amp value 10 20 30 40 50 60 70 The individual process data are using the parameter SEP separator separated from each other It is important that the passed URL string and the process data are not longer than 250 characters The structure of the URL is only an example and can in principle be designed with own free server applications and scripts in conjunction with their What are the possibilities for and benefits rrdtool rrdtool is a program that saves the time related measurement data and summarizes and visualizes the data The program was originally developed by Tobias Oetiker and under the GNU General Public License GPL By publishing a free software now many other authors new functionality and bug fixes have contributed rrdtool is available as source code and an executable program for many operating systems Source http de wikipedia org wiki RRDtool 56 Version 1 21 Chapter 7 Data Logger 57 Version 1 21 Chapter 7 Data Logger Sample graphs Blagoevgrad R BRAS PPPoE Statistics PPPoE2 0 2311 g a Lee r REN ai P ef ul a a Oe CR VE u Teer I IE BE Llp att aware ui d GE A j ER et RE Ge yr x ma i N N Sg 0 0 enden wn eh aa ee ei ee a enger S de Ee EE NP Ee E e EEN z EL am d
177. tion line Thus immediately after that the key evaluation can be continued without having to manually change the OFFSET Key Search Before a Key is evaluated the OFFSET must have a correct value this can be done by manual set of OFFSET or by a previously executed Section search Before running the query at STR the name of the key must be are passed If an empty string STR is handed over the next key found is returned RUN 2 means the query can be started Once the search is finished it sets the parameters of RUN to 0 With RESULT the search results will be issued When in a query the key identified a new Section this is reported by RESULT 11 Upon successful search the output of the parameter KEY is the name of the found key and VALUE is the key value And then the OFFSET parameter points to the end of the key line Thus immediately after the next Key evaluation be continued without having to manually change the OFFSET Enumeration see next item For very large amount of data of an initialization file to be evaluated with a enumeration list the user program can be build simple and the evaluation be carried out more quickly because here no line must be used more than once Before the start OFFSET must have a reasonable value the default case to 0 With RUN 3 the evaluation is started Once a section or a key is found it is also issued immediately In a section KEY prints the name of the Section and RESULT 1 With a fou
178. tion of recent Messages 30003 One full page in direction of older messages 9 13 MB CLIENT OPEN MODBUS Type Function module IN OUT IP C IP _C parameterization S BUF NETWORK BUFFER SHORT transmit data R_BUF NETWORK_BUFFER_SHORT receive data DATA ARRAY 0 255 OF WORD MODBUS Register INPUT DATA SIZE INT number of data words in structure MP DATA ENABLE BOOL release UDP BOOL Prefix TCP UDP UDP TRUE FC INT function number UNIT ID BYTE Device ID R_ADDR INT Read command MODBUS data point address H POINTS INT Read command MODBUS number of data points H DATA ADR INT Read command DATA data point address R_DATA_BITPOS INT read command DATA data point bitpos W_ADDR INT Read command MODBUS data point address W_POINTS INT Read command MODBUS number of data points W_DATA_ADR INT Read command DATA data point address 112 Version 1 21 Chapter 9 Network and Communication W_DATA _BITPOS INT read command DATA data point bit pos DELAY TIME repetition time OUTPUT ERROR DWORD error code BUSY BOOL module is active T7 MA CLIENT The module provides access to Ethernet devices the MODBUS TCP or MODBUS UDP supported or MODBUS RS232 485 devices are connected via Ethernet Modbus gateway There commands from Classes 0 1 2 are supported The parameters IP_C S BUF R_BUF this form the interface to the module IP CONTROL and used here for processing and coord
179. trolled which enables the remote control to switch the output with each received log If multiple Key Codes are to be evaluated alternatively the modules IR TRANS RCV A or IRTRANS RCV_8 can be used or more of these modules can be used in parallel mode IRTRANS DECODE IRTRANS RCV 4 1 IRTRANS DECODE IRTRANS RCV A 38 Version 1 21 Chapter 6 Device Driver 6 4 IRTRANS RCV 4 Type Function module Input CMD BOOL TRUE if data for evaluating are available I O DEV STRING name of the remote control KEY string name of button Setup DEV_CODE STRING to be decoded remote control name KEY CODE_0 3 STRING key code to be decoded Output Q0 Q3 BOOL output IRTRANS RCV_ 4 checkes when CMD TRUE if the string matches the input DEV corresponds to DEV_CODE device code and the string at the input KEY corresponds to the KEY CODE If the codes match and CMD TRUE then the output Q for a cycle is set to TRUE For more information about the function of the device are under IRTRANS RCV 1 6 5 IRTRANS RCV 8 Type Function module Input CMD BOOL TRUE if data for evaluating are available I O DEV STRING name of the remote control KEY string name of button Setup DEV_CODE STRING to be decoded remote control name KEY CODE_0 7 STRING key code to be decoded Output 00 07 BOOL output IRTRANS RCV_8 checkes when CMD TRUE if the string matches the input DEV corresponds to DEV_CODE device code and the strin
180. ue divided into two WORDS and then be considered as a decimal value Example ERROR_T 5 ERROR_C 0x0028 O0DC End step number 0x0028 40 Response Code 0x00DC 220 7 10 Type IN OUT DLOG FILE TO SMTP Function module SERVER STRING URL of the SMTP server MAIL FROM STRING return address MAILTO STRING string length recipient address SUBJECT STRING subject text SUBJECT STRING subject text FILES STRING string length files to be sent X DLOG_DATA DLOG data structure 66 Version 1 21 Chapter 7 Data Logger INPUT FILE DELETE BOOL delete files after transfer TIMEOUT TIME time DTI DT current date time DTI OFFSET INT time zone offset from UTC RETRY INT number of repetitions RETRY TIME TIME waiting period before repetition Dns_ip4 DWORD IP4 address of the DNS server OUTPUT DONE BOOL Transfer completed without error BUSY BOOL Transfer active ERROR _C DWORD Error code ERROR_T BYTE Problem type vere DLOG_FILE_TO_SMTP The module DLOG FILE TO SMTP is used to automatically transfer the of DLOG STORE FILE CSV generated files as e mail to an e mail server The module uses internally the SMTP_CLIENT for sending The SERVER parameter contains the name of the SMTP server and optionally the user name and password and a port number If you pass a user name and password the procedure is according to standard SMTP SERVER URL Examples username passwo
181. uld be necessary The PLC can listen in this manner any number of re mote controls in different areas and derive appropriate actions from it Conversely of course the release of key codes on the Transmitter modu les is possible 6 2 IRTRANS DECODE Type Function module I O IP_C data structure IP_CONTROL Parameterization R BUF data structure NETWORK BUFFER SHORT Receive data Output CMD BOOL TRUE if valid data are present at the output DEV STRING name of the remote control KEY STRING name of the key codes ERROR BOOL TRUE if a invalid data packet is present 36 Version 1 21 Chapter 6 Device Driver IRTRANS DECODE receives the data from the module IRTRANS SERVER present in BUFFER checks if a valid data package is available and deco des the name of the remote control and the name of the button form the data packet If a valid data packet has been decoded the name of the re mote control is passed at the output DEV and the name of the button on the output KEY The output CMD signals that the new output data are pre sent The ERROR output is then set when a data packet was received that is not in the correct format The format is defined as follows Name of the remote control Name of the key code R N A data packet consists of the name of the remote control followed by a comma and then the name of the key codes The data packet is a comple ted by Carriage Return and a Line Feed To ens
182. upper left corner of the window and with lin Width the width if of the viewing window is defined The number of rows to be displayed is determined by Aus LOG VIEWPORT COUNT The color information is stored in Xus LOG CONTROL MSG OPTION x per message It is converted to the configured color codes from Idw_ATTR_1 and Idw_ATTR2 automatically so the colors in the presentation can always be adjusted individually The messages are always automatically reduced to the width of the window or cut off 11 21 TN SC WRITE Type Function module INPUT lin_Y INT Y coordinate fzy lin_X INT X coordinate lby AT TR BYTE color code font color Ier STRING STRING text IN OUT Xus_TN SCREEN Us TN SCREEN 727 TN SC WRITE Iin Y b gt Zus TN SCREEN GE Iby ATTR Ist STRING Zus TN SCREEN b The module TN SC WRITE passes the text Ist STRING at the coordinates lin_Y lin _Y and the color of Iby_ATTR Is specified color code O then the string is displayed without change the existing old color information at he respective character positions 192 Version 1 21 Chapter 11 Telnet Vision 11 22 TN SC WRITE ATTR Type Function module INPUT lin_Y INT Y coordinate fzy lin_X INT X coordinate lby AT TR BYTE color code IN OUT Xus_TN SCREEN Us TN SCREEN TN SC WRITE ATTR Tin e Zus TN SCREEN Iin F Iby ATTR Zus TN SCREEN e The module TN SC WRITE _ATTR changes at the given coordinates lin_Y lin Y
183. ure that IRTRANS DECODE works in the IRTrans configuration the Check box BROADCAST IR RELAY must be checked and in the correspon ding Device database under the DEFAULT ACTION the String r c r n must be registered IRTRANS DECODE evaluates just this String and deco des r as the name and c as pressed a button of the remote control 6 3 IRTRANS RCV 1 Type Function module Input CMD BOOL TRUE if data for evaluating are available I O DEV STRING name of the remote control KEY string name of button Setup DEV_CODE STRING to be decoded remote control name KEY CODE STRING key code to be decoded Output Q BOOL output IRTRANS RCV_1 checkes when CMD TRUE if the string matches the input DEV corresponds to DEV_CODE device code and the string at the input 3 Version 1 21 Chapter 6 Device Driver KEY corresponds to the KEY CODE If the codes match and CMD TRUE then the output Q for a cycle is set to TRUE The following example shows the application of IRTRANS_RCV 1 DRIVER 1 IRTRANS DECODE IRTRANS RCW 4 1 DRIVER 1 IRTRANS DECODE IRTRANS RCY 1 In this example the receive data buffer to IRTRANS DECODE is passed The decoder determines from the valid data packets String DEV and KEY and passes them with CMD to IRTRANS RCV 1 IRTRANS RCV_1 or alternatively IRTRANS RCV_ 4 and IRTRANS RCV_ checks whether DEV and KEY match and then switches the output Q for a cycle to TRUE in the example a DRIVER_1 is con
184. w Datenbytes einer Datel The Parameter FILENAME specifies the name of the file to be read and with PT SIZE the size of the read buffer is specified in bytes The value for parameter POS is the exact data position within the file which has to be read The process is triggered by setting MODE to 1 Then the system automatically checks whether the desired data byte is already in the read buffer If not then a new matching block of data is copied into the read buffer and the desired data byte is passed on the parameter DATA As long as this operation is not finished yet MODE remains at 1 and only after completion of the operation of module is reset to MODE Q If a specified data position is larger than the current length of the file or the file has length 0 so the output at ERROR is 255 See ERROR codes from block FILE SERVER Datenbytes im Lesebuffer Procedure If the file access is no longer needed the user must close the file be either by use of AUTO CLOSE or MODE 5 close file of the FILE SERVER 10 4 FILE PATH SPLIT Type Function BOOL INPUT FILE NAME STRING string_length IN OUT X FILE PATH DATA Single path elements 153 Version 1 21 Chapter 10 File System FILE_FATH_SFLIT FILENAME FILE_PATH_SPLIT etc be The module split a file path into its component elements The drive path and file name are extracted and stored in the data structure X As directory separator and will be accepted If
185. wers heavy snow scattered snow showers heavy snow mostly cloudy 6 snow showers isolated thundershowers not available 33 Version 1 21 Chapter 5 Other Functions 5 Other Functions 5 1 ELEMENT COUNT Type Function INT Input SEP BYTE Separation character of the elements I O ELEMENT STRING ELEMENT LENGTH input list Output INT number of items in the list ELEMENT COUNT SEP ELEMENT COUNT ELEMENT F e ELEMENT ELEMENT COUNT determines the number of items in a list lf the parameter ELEMENT is an empty string O is passed as result If at least one character is in ELEMENT it is evaluated as a single element and ELEMENT COUNT 1 is passed to output Examples ELEMENT COUNT 0 1 2 3 44 4 ELEMENT COUNT 44 0 ELEMENT COUNT x 44 1 5 2 ELEMENT GET Type Function STRING ELEMENT LENGTH Input SEP BYTE Separation character of the elements POS INT of the item I O ELEMENT STRING ELEMENT LENGTH input list Output STRING String output 34 Version 1 21 Chapter 5 Other Functions ELEMENT GET ELEMENT GET F ELEMENT ELEMENT F ELEMENT GET passes the item at the position POS from a list The list con sists of strings which are separated by the separation character SEP The first element of the list has the position OU Examples ELEMENT GET ELEMENT GET ELEMENT GET ELEMENT GET ELEMENT GET ELEMENT GET ABC 23 NEXT 44 0 ABC ABC 23 NEXT 44
186. xample in an SSH HTTPS and WEP or WPA and is thus widely used The algorithm can in principle operate at up to 2048 bit key but this is limited to the mo 82 Version 1 21 Chapter 8 Converter fe ROA CRYPT STREAM dule on a 40 character key but it can always be adjusted to up to 250 characters Thus it presents a key length of 320 bits which are designed for applications on a PLC more than adequate The maximum length of the stream is on this module is limited to 2 32 4 gigabyte The module can be used for encryption as well as to decrypt RC4 data 64 bytes per cycle can still be processed they will be processed in serial block mode The data been encrypted or decrypted remains in the module BUF for further processing and must of course processed previously by the user before each new block of data Example There are 2000 bytes in a buffer and are read using the file system in blocks User sets mode is to 1 and SIZE to 2000 Calling the RC4 CRYPT STREAM RC4 CRYPT STREAM performs initialization and set MODE to 2 and passes at the POS the index base 0 to the desired data At SIZE the number of data to be copied into the data memory BUF is set User copies the requested data in the BUF and calls the module RC4 CRYPT STREAM repeatedly This step is repeated until MODE remains at 2 If the RC4 CRYPT STREAM has processed the last data block this set MODE to 3 8 18 SHA1 STR Type Function module Inpu
Download Pdf Manuals
Related Search
Related Contents
KEI 595 Quick Reference Guide LG Electronics LPXS30866D Instructions / Assembly Kenmore 4.3 cu. ft. Front-Load Washer w/Steam - Metallic Silver ENERGY STAR Energy Guide Bedienungsanleitung Drucksensor für Datenblatt - Beamer vacuvide SEA GATE 2 24V PLUS Cliquez ici pour visionner MS-series-user manual-German171010 ZVK-22D - Meyertech Casio 5275 User's Manual Copyright © All rights reserved.
Failed to retrieve file