Wago Linux
Wago Linux
Manual
Technical description, installation and configuration
Version 1.1.1
ii General
WAGO Kontakttechnik GmbH Hansastrae 27 D-32423 Minden Phone: +49 (0) 571/8 87 0 Fax: +49 (0) 571/8 87 1 69 E-Mail: [email protected] Web: http://www.wago.com
Technical Support Phone: +49 (0) 571/8 87 5 55 Fax: +49 (0) 571/8 87 85 55 E-Mail: [email protected]
Every conceivable measure has been taken to ensure the correctness and completeness of this documentation. However, as errors can never be fully excluded we would appreciate any information or ideas at any time. E-Mail: [email protected]
We wish to point out that the software and hardware terms as well as the trademarks of companies used and/or mentioned in the present manual are generally trademark or patent protected. This product includes software developed by the University of California, Berkley and ist contributors.
Table of Contents
iii
TABLE OF CONTENTS
1 Important Comments.................................................................................. 8 1.1 Legal Principles........................................................................................ 8 1.1.1 Copyright ............................................................................................. 8 1.1.2 Personnel Qualification ....................................................................... 8 1.1.3 Intended Use ........................................................................................ 9 1.2 Symbols .................................................................................................... 9 1.3 Font Conventions ................................................................................... 10 1.4 Number Notation.................................................................................... 10 1.5 Safety Notes ........................................................................................... 11 1.6 Scope ........................................................................................................ 8 1.7 Abbreviation............................................................................................. 8 2 The WAGO-I/O-SYSTEM 750 .................................................................. 9 2.1 System Description................................................................................... 9 2.2 Technical Data........................................................................................ 10 2.3 Manufacturing Number .......................................................................... 16 2.4 Component Update................................................................................. 17 2.5 Storage, Assembly and Transport .......................................................... 17 2.6 Mechanical Setup ................................................................................... 18 2.6.1 Installation Position ........................................................................... 18 2.6.2 Total Expansion ................................................................................. 18 2.6.3 Assembly onto Carrier Rail ............................................................... 19 2.6.3.1 Carrier Rail Properties .................................................................. 19 2.6.3.2 WAGO DIN Rail .......................................................................... 20 2.6.4 Spacing .............................................................................................. 20 2.6.5 Plugging and Removal of the Components ....................................... 21 2.6.6 Assembly Sequence ........................................................................... 22 2.6.7 Internal Bus/Data Contacts ................................................................ 23 2.6.8 Power Contacts .................................................................................. 24 2.6.9 Wire Connection................................................................................ 25 2.7 Power Supply ......................................................................................... 26 2.7.1 Isolation ............................................................................................. 26 2.7.2 System Supply ................................................................................... 27 2.7.2.1 Connection .................................................................................... 27 2.7.2.2 Alignment ..................................................................................... 28 2.7.3 Field Supply....................................................................................... 30 2.7.3.1 Connection .................................................................................... 30 2.7.3.2 Fusing............................................................................................ 31 2.7.4 Supplementary Power Supply Regulations ....................................... 34 2.7.5 Supply Example................................................................................. 35 2.7.6 Power Supply Unit............................................................................. 36
iv Table of Contents
2.8 Grounding............................................................................................... 37 2.8.1 Grounding the DIN Rail .................................................................... 37 2.8.1.1 Framework Assembly ................................................................... 37 2.8.1.2 Insulated Assembly....................................................................... 37 2.8.2 Grounding Function........................................................................... 38 2.8.3 Grounding Protection ........................................................................ 39 2.9 Shielding (Screening) ............................................................................. 40 2.9.1 General............................................................................................... 40 2.9.2 Bus Conductors.................................................................................. 40 2.9.3 Signal Conductors.............................................................................. 40 2.9.4 WAGO Shield (Screen) Connecting System..................................... 41 2.10 Assembly Guidelines/Standards............................................................. 41 3 Linux Fieldbus Coupler 750-860.............................................................. 42 3.1 View ....................................................................................................... 43 3.2 Power Supply ......................................................................................... 44 3.3 Fieldbus Connection via the Ethernet Interface ..................................... 45 3.4 Display Elements.................................................................................... 46 3.5 Configuration Interface .......................................................................... 47 3.6 Selector Switch....................................................................................... 48 3.7 Hardware Address (MAC ID) ................................................................ 49 3.8 Memory Map .......................................................................................... 49 3.9 Linux System Start ................................................................................. 50 3.10 Error Indication (IO LED)...................................................................... 51 3.11 Technical Data........................................................................................ 53 4 Board Support Package (BSP)................................................................. 55 4.1 Scope of delivery.................................................................................... 55 4.2 File System (Root File System).............................................................. 58 4.3 The Console of the Linux Fieldbus Coupler .......................................... 62 4.3.1 Shells ................................................................................................. 63 4.3.2 Busybox ............................................................................................. 64 4.3.3 User Administration (Tinylogin) ....................................................... 67 4.3.4 Terminal Program (getty) .................................................................. 68 4.3.5 Setting the Hardware and System Clock ........................................... 68 4.4 Web-Based Management (WBM).......................................................... 71 4.5 Ethernet Interface Services..................................................................... 81 4.5.1 Telnet Server...................................................................................... 81 4.5.2 FTP Server (ftpd)............................................................................... 82 4.5.3 FTP Client.......................................................................................... 84 4.5.4 SNTP Client (msntp) ......................................................................... 85 4.5.5 HTTP Server (BOA).......................................................................... 87 4.5.6 Netflash.............................................................................................. 89 4.6 Ethernet Interface Services..................................................................... 91 4.6.1 Temporary Assignment of the IP Address (ifconfig) ........................ 91 4.6.2 Permanent Assignment of the IP Address (wagoset) ........................ 92 4.6.3 Dynamic IP Address Assignment during Runtime............................ 93 4.6.4 Checking the Network Connection.................................................... 95
Table of Contents
5 Step-by-Step Guide to your own Linux Application.............................. 96 5.1 Installation of the Development Toolchain ............................................ 96 5.2 Unpack the Source Code ........................................................................ 97 5.3 Linux Kernel Compilation...................................................................... 98 5.4 Setup of the Development Environment .............................................. 100 5.4.1 PC Terminal Program Configuration (serial) .................................. 101 5.4.2 PC Terminal Program Configuration (Ethernet) ............................. 103 5.5 Setting the IP address of the Linux Fieldbus Coupler.......................... 104 5.6 Create your own User Space Application ............................................ 105 5.7 Transferring the User Space Application to the Linux Coupler........... 107 5.8 Running the new Program .................................................................... 108 5.9 Automatic start of new Programs (inittab/startwago) .......................... 108 5.10 File System and Linux Kernel Update ................................................. 110 5.10.1 TFTP Server Setup .......................................................................... 111 5.10.2 TFTP Client Setup ........................................................................... 112 5.11 NFS Server Setup ................................................................................. 116 5.12 Debugging of User Space Programs .................................................... 117 5.12.1 Description of the GDB ................................................................... 117 5.12.2 Preparation for Using the Debugger ................................................ 118 5.12.3 Creating a Testable User Space Application ................................... 119 5.12.4 Creating an Example Application for Debugging ........................... 121 5.12.5 Debugging via the GDB Console .................................................... 122 5.12.6 Debugging via the Graphical Interface DDD .................................. 125 6 Process Image .......................................................................................... 127 6.1 Basic Structure ..................................................................................... 127 6.2 Example for an Input Process Image.................................................... 128 6.3 Example for an Output Process Image ................................................. 129 6.4 Application Example for a Mixed Node: ............................................. 130 6.5 Internal Bus Driver (kbus.ko)............................................................... 131 6.6 Process Image Analysis via the /proc Directory .................................. 135 7 I/O Modules ............................................................................................. 136 7.1 Overview .............................................................................................. 136 7.1.1 Digital Input Modules...................................................................... 136 7.1.2 Digital Output Modules ................................................................... 138 7.1.3 Analog Input Modules ..................................................................... 139 7.1.4 Analog Output Modules .................................................................. 141 7.1.5 Special Modules............................................................................... 142 7.1.6 System Modules .............................................................................. 144 7.2 Process Data Architecture for MODBUS/TCP .................................... 145 7.2.1 Digital Input Modules...................................................................... 145 7.2.2 Digital Output Modules ................................................................... 147 7.2.3 Analog Input Modules ..................................................................... 151 7.2.4 Analog Output Modules .................................................................. 152 7.2.5 Specialty Modules ........................................................................... 153 7.2.6 System Modules .............................................................................. 165
vi Table of Contents
8 Application Examples ............................................................................. 166 8.1 LED Indication Example...................................................................... 167 8.2 Example kbusdemo .............................................................................. 171 8.3 Example of a Modbus TCP Server....................................................... 175 8.4 Example Program for a CGI Application............................................. 177 8.5 Example of Reading and Writing from the NVRAM .......................... 183 9 Bootloader (U-Boot) ................................................................................ 186 9.1 Boot Loader Toolchain......................................................................... 186 9.2 TFTP Server Setup ............................................................................... 187 9.3 Unpack the Source Code ...................................................................... 188 9.4 Compile Boot Loader ........................................................................... 188 9.5 Environment Variables......................................................................... 189 10 Fieldbus Communication........................................................................ 191 10.1 ETHERNET ......................................................................................... 191 10.1.1 General............................................................................................. 191 10.1.2 Network Architecture Principles and Regulations ....................... 192 10.1.2.1 Transmission Media.................................................................... 193 10.1.2.2 Network Topologies.................................................................... 195 10.1.2.3 Coupler Modules......................................................................... 198 10.1.2.4 Transmission Mode..................................................................... 198 10.1.2.5 Important Terms.......................................................................... 200 10.1.3 Network Communication................................................................. 202 10.1.3.1 Protocol layer model ................................................................... 202 10.1.3.2 Communication Protocols........................................................... 204 10.1.3.3 Channel access method ............................................................... 205 10.1.3.4 Administration and Diagnosis Protocols .................................... 212 10.1.3.5 Application Protocols.................................................................. 217
Table of Contents
vii
11 Use in Hazardous Environments ........................................................... 218 11.1 Foreword .............................................................................................. 218 11.2 Protective Measures ............................................................................. 218 11.3 Classification Meeting CENELEC and IEC ........................................ 218 11.3.1 Divisions .......................................................................................... 218 11.3.2 Explosion Protection Group ............................................................ 220 11.3.3 Unit Categories ................................................................................ 221 11.3.4 Temperature Classes........................................................................ 222 11.3.5 Types of Ignition Protection ............................................................ 223 11.4 Classifications Meeting the NEC 500 .................................................. 224 11.4.1 Divisions .......................................................................................... 224 11.4.2 Explosion Protection Groups........................................................... 224 11.4.3 Temperature Classes........................................................................ 225 11.5 Identification ........................................................................................ 226 11.5.1 For Europe ....................................................................................... 226 11.5.2 For America ..................................................................................... 227 11.6 Installation Regulations........................................................................ 228 12 Glossary.................................................................................................... 230 13 Literature List ......................................................................................... 241 14 Index ......................................................................................................... 242
1 Important Comments
To ensure fast installation and start-up of the units described in this manual, we strongly recommend that the following information and explanations are carefully read and abided by.
1.2 Symbols
Danger Always abide by this information to protect persons from injury. Warning Always abide by this information to prevent damage to the device. Attention Marginal conditions must always be observed to ensure smooth operation. ESD (Electrostatic Discharge) Warning of damage to the components by electrostatic discharge. Observe the precautionary measure for handling components at risk. Note Routines or advice for efficient use of the device and software optimization. More information References on additional literature, manuals, data sheets and INTERNET pages
10
Names of path and files are marked italic i.e.: C:\programs\WAGO-IO-CHECK Menu items are marked as bold italic i.e.: Save A backslash between two names marks a sequence of menu items i.e.: File\New Press buttons are marked as bold with small capitals i.e.: ENTER Keys are marked bold within angle brackets i.e.: <F5> Program code is printed with the font Courier. i.e.: END_VAR
Example
100 0x64 '100' '0110.0100'
Note
normal notation C notation Within ', Nibble separated with dots
11
1.6 Scope
This manual describes the Linux fieldbus coupler, item no. 750-860, WAGO-I/O-SYSTEM 750
Item.-No. 750-860 Description Linux fieldbus coupler
1.7 Abbreviation
AI AO DI DO I/O ID Linux-FBK Analog Input Analog Output Digital Input Digital Output Input/Output Identifier Programmable Linux fieldbus coupler
g0xxx00x
Couplers/controllers for field bus systems such as PROFIBUS, INTERBUS, ETHERNET TCP/IP, CAN (CANopen, DeviceNet, CAL), MODBUS, LON and others are available. The coupler/controller contains the field bus interface, electronics and a power supply terminal. The field bus interface forms the physical interface to the relevant field bus. The electronics process the data of the bus modules and make it available for the field bus communication. The 24 V system supply and the 24 V field supply are fed in via the integrated power supply terminal. The field bus coupler communicates via the relevant field bus. The programmable field bus controller (PFC) enables the implementation of additional PLC functions. Programming is done with the WAGO-I/O-PRO in accordance with IEC 61131-3. Bus modules for diverse digital and analog I/O functions as well as special functions can be connected to the coupler/controller. The communication between the coupler/controller and the bus modules is carried out via an internal bus. The WAGO-I/O-SYSTEM 750 has a clear port level with LEDs for status indication, insertable mini WSB markers and pullout group marker carriers. The 3-wire technology supplemented by a ground wire connection allows for direct sensor/actuator wiring.
10 "
- 51 mm x 65 mm x 100 mm - 50 mm x 65 mm x 100 mm - 62 mm x 65 mm x 100 mm - 12 mm x 64 mm x 100 mm - 24 mm x 64 mm x 100 mm - 48 mm x 64 mm x 100 mm on DIN 35 with interlock double featherkey-dovetail any position standard marking label type group marking label 8 x 47 mm
Contacts Power jumpers contacts Current via power contacts max Voltage drop at I max Data contacts Climatic environmental conditions Operating temperature
Maximum pollutant concentration at SO2 # 25 ppm relative humidity < 75% H2S # 10 ppm Special conditions Ensure that additional measures for components are taken, which are used in an environment involving: dust, caustic vapors or gases ionization radiation
The WAGO-I/O-SYSTEM 750 Technical Data Safe electrical isolation Air and creepage distance Degree of pollution acc. To IEC 61131-2 Degree of protection Degree of protection Electromagnetic compatibility Immunity to interference for industrial areas acc. to EN 61000-6-2 (2001) Test specification EN 61000-4-2 ESD EN 61000-4-3 electromagnetic fields EN 61000-4-4 burst EN 61000-4-5 surge Test values 4 kV/8 kV (contact/air) 10 V/m 80 MHz ... 1 GHz 1 kV/2 kV (data/supply) Data: DC supply: AC supply: EN 61000-4-6 RF disturbances Test specification EN 55011 (AC supply, conducted) EN 55011 (radiated) -/- (line/line) 1 kV (line/earth) 0.5 kV (line/line) 0.5 kV (line/earth) 1 kV (line/line) 2 kV (line/earth) 2 1 1 2 3 3 A B B Strength class 2/3 3 2/3 IP 20 acc. to IEC 60664-1 2
11
Evaluation criteria B A B B
Emission of interference for industrial areas acc. to EN 61000-6-4 (2001) Limit values/[QP]*) Frequency range 79 dB (!V) 73 dB (!V) 40 dB (!V/m) 47 dB (!V/m) Test specification EN 55022 (AC supply, conducted) 150 kHz ... 500 kHz 500 kHz ... 30 MHz 30 MHz ... 230 MHz 230 MHz ... 1 GHz 10 m 10 m Distance Distance
Emission of interference for residential areas acc. to EN 61000-6-3 (2001) Limit values/[QP]*) Frequency range 66 ... 56 dB (!V) 56 dB (!V) 60 dB (!V) EN 55022 (DC supply/data, conducted) EN 55022 (radiated) 40 ... 30 dB (!A) 30 dB (!A) 30 dB (!V/m) 37 dB (!V/m) 150 kHz ... 500 kHz 500 kHz ... 5 MHz 5 MHz ... 30 MHz 150 kHz ... 500 kHz 500 kHz ... 30 MHz 30 MHz ... 230 MHz 230 MHz ... 1 GHz 10 m 10 m
12 "
The WAGO-I/O-SYSTEM 750 Technical Data Mechanical strength acc. to IEC 61131-2 Test specification IEC 60068-2-6 vibration Frequency range 5 Hz # f < 9 Hz 9 Hz # f < 150 Hz Limit value 1.75 mm amplitude (permanent) 3.5 mm amplitude (short term) 0.5 g (permanent) 1 g (short term)
Note on vibration test: a) Frequency change: max. 1 octave/minute b) Vibration direction: 3 axes IEC 60068-2-27 shock 15 g Note on shock test: a) Type of shock: half sine b) Shock duration: 11 ms c) Shock direction: 3x in positive and 3x in negative direction for each of the three mutually perpendicular axes of the test specimen IEC 60068-2-32 free fall *) QP: Quasi Peak 1m (module in original packing)
Note: If the technical data of components differ from the values described here, the technical data shown in the manuals of the respective components shall be valid.
13
For Products of the WAGO-I/O-SYSTEM 750 with ship specific approvals supplementary guidelines are valid:
Electromagnetic compatibility Immunity to interference acc. to Germanischer Lloyd (2003) Test specification IEC 61000-4-2 ESD IEC 61000-4-3 electromagnetic fields IEC 61000-4-4 burst IEC 61000-4-5 surge IEC 61000-4-6 RF disturbances Test values 6 kV/8 kV (contact/air) 10 V/m 80 MHz ... 2 GHz 1 kV/2 kV (data/supply) AC/DC Supply: 0.5 kV (line/line) 1 kV (line/earth) Strength class 3/3 3 2/3 1 2 3 A A Evaluation criteria B A A A
Type test AF disturbances 3 V, 2 W (harmonic waves) Type test high voltage 755 V DC 1500 V AC Limit values
Emission of interference acc. to Germanischer Lloyd (2003) Test specification Frequency range 10 kHz ... 150 kHz 150 kHz ... 350 kHz 350 kHz ... 30 MHz 150 kHz ... 300 kHz 300 kHz ... 30 MHz 30 MHz ... 2 GHz 156 MHz ... 165 MHz Limit value 1.6 mm amplitude (permanent) 4 g (permanent) 3m 3m 3m 3m Distance Type test 96 ... 50 dB (!V) (EMC1, conducted) allows for ship bridge control 60 ... 50 dB (!V) applications 50 dB (!V) Type test 80 ... 52 dB (!V/m) (EMC1, radiated) allows for ship bridge control 52 ... 34 dB (!V/m) applications 54 dB (!V/m) except: 24 dB (!V/m) Test specification IEC 60068-2-6 vibration (category A D) Frequency range 2 Hz # f < 25 Hz 25 Hz # f < 100 Hz
Note on vibration test: a) Frequency change: max. 1 octave/minute b) Vibration direction: 3 axes
14 "
The WAGO-I/O-SYSTEM 750 Technical Data Range of application Industrial areas Residential areas Required specification emission of interference EN 61000-6-4 (2001) EN 61000-6-3 (2001)*) Required specification immunity to interference EN 61000-6-2 (2001) EN 61000-6-1 (2001)
*) The system meets the requirements on emission of interference in residential areas with
the field bus coupler/controller for: ETHERNET LonWorks CANopen DeviceNet MODBUS 750-342/-841/-842/-860 750-319/-819 750-337/-837 750-306/-806 750-312/-314/ -315/ -316 750-812/-814/ -815/ -816
With a special permit, the system can also be implemented with other field bus couplers/controllers in residential areas (housing, commercial and business areas, smallscale enterprises). The special permit can be obtained from an authority or inspection office. In Germany, the Federal Office for Post and Telecommunications and its branch offices issues the permit. It is possible to use other field bus couplers/controllers under certain boundary conditions. Please contact WAGO Kontakttechnik GmbH & Co. KG.
Maximum power dissipation of the components Bus modules Field bus coupler/controller 0.8 W / bus terminal (total power dissipation, system/field) 2.0 W / coupler/controller
Warning The power dissipation of all installed components must not exceed the maximum conductible power of the housing (cabinet). When dimensioning the housing, care is to be taken that even under high external temperatures, the temperature inside the housing does not exceed the permissible ambient temperature of 55 C.
15
01 02
A
C
B
C
B B
C
B
C
B
C D
D
24V 0V
+ +
35
51
12
24
65
Side view
Dimensions in mm
g01xx05e
Note: The illustration shows a standard coupler. For detailed dimensions, please refer to the technical data of the respective coupler/controller.
64
100
16 "
24V DC AWG 28-14 55C max ambient LISTED 22ZA AND 22XM
GL
72072
NO DS SW HW FWL
PATENTS PENDING
750-333
Manufacturing Number
01030002 03-B 060606 72072
0 1 0 3 0 0 0 2 0 3 - B 0 6 0 6 0 6
Calendar week
Year
Software version
Fig. 2-3:
The manufacturing number consists of the production week and year, the software version (if available), the hardware version of the component, the firmware loader (if available) and further internal information for WAGO Kontakttechnik GmbH & Co. KG.
17
If the update of a component took place, the current version data are registered into the columns of the matrix. Additionally with the update of a field bus coupler or controller also the cover of the configuration and programming interface of the coupler or controller is printed on with the current manufacturing and production order number. The original manufacturing data on the housing of the component remain thereby.
18 "
19
20 "
2.6.3.2 WAGO DIN Rail WAGO carrier rails meet the electrical and mechanical requirements.
Item Number 210-113 /-112 210-114 /-197 210-118 210-198 210-196 Description 35 x 7.5; 1 mm; steel yellow chromated; slotted/unslotted 35 x 15; 1.5 mm; steel yellow chromated; slotted/unslotted 35 x 15; 2.3 mm; steel yellow chromated; unslotted 35 x 15; 2.3 mm; copper; unslotted 35 x 7.5; 1 mm; aluminum; unslotted
2.6.4 Spacing
The spacing between adjacent components, cable conduits, casing and frame sides must be maintained for the complete field bus node.
g01xx13x
The spacing creates room for heat transfer, installation or wiring. The spacing to cable conduits also prevents conducted electromagnetic interferences from influencing the operation.
21
g01xx12e
It is also possible to release an individual I/O module from the unit by pulling an unlocking lug.
p0xxx01x
Danger Ensure that an interruption of the PE will not result in a condition which could endanger a person or equipment! For planning the ring feeding of the ground wire, please see chapter 2.6.3.
22 "
23
p0xxx07x
Warning Do not touch the gold spring contacts on the I/O modules in order to avoid soiling or scratching!
ESD (Electrostatic Discharge) The modules are equipped with electronic components that may be destroyed by electrostatic discharge. When handling the modules, ensure that the environment (persons, workplace and packing) is well grounded. Avoid touching conductive components, e.g. data contacts.
24 "
g0xxx05e
Recommendation With the WAGO ProServe Software smartDESIGNER, the structure of a field bus node can be configured. The configuration can be tested via the integrated accuracy check.
25
g0xxx08x
The operating tool is inserted into the opening above the connection. This opens the CAGE CLAMP. Subsequently the conductor can be inserted into the opening. After removing the operating tool, the conductor is safely clamped. More than one conductor per connection is not permissible. If several conductors have to be made at one connection point, then they should be made away from the connection point using WAGO Terminal Blocks. The terminal blocks may be jumpered together and a single wire brought back to the I/O module connection point. Attention If it is unavoidable to jointly connect 2 conductors, then a ferrule must be used to join the wires together. Ferrule: Length 8 mm Nominal cross section max. 1 mm2 for 2 conductors with 0.5 mm2 each WAGO Product 216-103 or products with comparable properties
26 "
g0xxx01e
Attention The ground wire connection must be present in each group. In order that all protective conductor functions are maintained under all circumstances, it is recommended that a ground wire be connected at the beginning and end of a potential group. (ring format, please see chapter 2.8.3). Thus, if a bus module comes loose from a composite during servicing, then the protective conductor connection is still guaranteed for all connected field devices. When using a joint power supply unit for the 24 V system supply and the 24 V field supply, the electrical isolation between the internal bus and the field level is eliminated for the potential group.
27
g0xxx02e
The direct current supplies all internal system components, e.g. coupler/controller electronics, field bus interface and bus modules via the internal bus (5 V system voltage). The 5 V system voltage is electrically connected to the 24 V system supply.
g0xxx06e
28 "
Attention Resetting the system by switching on and off the system supply, must take place simultaneously for all supply modules (coupler/controller and 750-613). 2.7.2.2 Alignment Recommendation A stable network supply cannot be taken for granted always and everywhere. Therefore, regulated power supply units should be used in order to guarantee the quality of the supply voltage. The supply capacity of the coupler/controller or the internal system supply module (750-613) can be taken from the technical data of the components.
Internal current consumption*) Current consumption via system voltage: 5 V for electronics of the bus modules and coupler/controller Available current for the bus modules. Provided by the bus power supply unit. See coupler/controller and internal system supply module (750-613) Coupler 750-301: internal current consumption:350 mA at 5V residual current for bus modules: 1650 mA at 5V 2000 mA at 5V sum I(5V) total :
Example
The internal current consumption is indicated in the technical data for each bus terminal. In order to determine the overall requirement, add together the values of all bus modules in the node. Attention If the sum of the internal current consumption exceeds the residual current for bus modules, then an internal system supply module (750-613) must be placed before the module where the permissible residual current was exceeded.
The WAGO-I/O-SYSTEM 750 Power Supply Example: A node with a PROFIBUS Coupler 750-333 consists of 20 relay modules (750-517) and 10 digital input modules (750-405). Current consumption: 20* 90 mA = 1800 mA 10* 2 mA = 20 mA Sum 1820 mA
29
The coupler can provide 1650 mA for the bus modules. Consequently, an internal system supply module (750-613), e.g. in the middle of the node, should be added.
Recommendation With the WAGO ProServe Software smartDESIGNER, the assembly of a field bus node can be configured. The configuration can be tested via the integrated accuracy check. The maximum input current of the 24 V system supply is 500 mA. The exact electrical consumption (I(24 V)) can be determined with the following formulas:
Coupler/Controller I(5 V) total = Sum of all the internal current consumption of the connected bus modules + internal current consumption coupler/controller
750-613 I(5 V) total = Sum of all the internal current consumption of the connected bus modules
5 V / 24 V * I(5 V) total / %
Note If the electrical consumption of the power supply point for the 24 V-system supply exceeds 500 mA, then the cause may be an improperly aligned node or a defect. During the test, all outputs, in particular those of the relay modules, must be active.
30 "
g0xxx03e
The supply voltage for the field side is automatically passed to the next module via the power jumper contacts when assembling the bus modules . The current load of the power contacts must not exceed 10 A on a continual basis. The current load capacity between two connection terminals is identical to the load capacity of the connection wires. By inserting an additional power supply module, the field supply via the power contacts is disrupted. From there a new power supply occurs which may also contain a new voltage potential.
31
Attention Some bus modules have no or very few power contacts (depending on the I/O function). Due to this, the passing through of the relevant potential is disrupted. If a field supply is required for subsequent bus modules, then a power supply module must be used. Note the data sheets of the bus modules. In the case of a node setup with different potentials, e.g. the alteration from DC 24 V to AC 230V, a spacer module should be used. The optical separation of the potentials acts as a warning to heed caution in the case of wiring and maintenance works. Thus, the results of wiring errors can be prevented. 2.7.3.2 Fusing Internal fusing of the field supply is possible for various field voltages via an appropriate power supply module.
750-601 750-609 750-615 750-610 750-611 24 V DC, Supply/Fuse 230 V AC, Supply/Fuse 120 V AC, Supply/Fuse 24 V DC, Supply/Fuse/Diagnosis 230 V AC, Supply/Fuse/Diagnosis
g0xxx09x
32 "
Warning In the case of power supply modules with fuse holders, only fuses with a maximum dissipation of 1.6 W (IEC 127) must be used. For UL approved systems only use UL approved fuses. In order to insert or change a fuse, or to switch off the voltage in succeeding bus modules, the fuse holder may be pulled out. In order to do this, use a screwdriver for example, to reach into one of the slits (one on both sides) and pull out the holder.
p0xxx05x
p0xxx03x
p0xxx04x
After changing the fuse, the fuse carrier is pushed back into its original position.
33
Alternatively, fusing can be done externally. The fuse modules of the WAGO series 281 and 282 are suitable for this purpose.
pf66800x
Fig. 2-19: Fuse modules with pivotable fuse carrier, series 281
pe61100x
pf12400x
34 "
750-624
Supply filter
Therefore, the following power supply concept must be absolutely complied with.
g01xx11e
Note Another potential power terminal 750-601/602/610 must only be used behind the filter terminal 750-626 if the protective earth conductor is needed on the lower power contact or if a fuse protection is required.
35
750-400
750-410
750-401
750-613
750-616
750-612
750-512
750-512
750-513
750-616
750-610
750-552
750-630
750-600
2)
System Supply
230V 24V
Field Supply
230V 24V
Field Supply
10 A
10 A
1) Separation module recommended 2) Ring-feeding recommended a) Power Supply on coupler / controller via external Supply Module b) Internal System Supply Module c) Supply Module passive d) Supply Module with fuse carrier/ diagnostics
g0xxx04e
36 "
787-904
787-912
37
2.8 Grounding
2.8.1 Grounding the DIN Rail
2.8.1.1 Framework Assembly When setting up the framework, the carrier rail must be screwed together with the electrically conducting cabinet or housing frame. The framework or the housing must be grounded. The electronic connection is established via the screw. Thus, the carrier rail is grounded. Attention Care must be taken to ensure the flawless electrical connection between the carrier rail and the frame or housing in order to guarantee sufficient grounding. 2.8.1.2 Insulated Assembly Insulated assembly has been achieved when there is constructively no direct conduction connection between the cabinet frame or machine parts and the carrier rail. Here the earth must be set up via an electrical conductor. The connected grounding conductor should have a cross section of at least 4 mm2. Recommendation The optimal insulated setup is a metallic assembly plate with grounding connection with an electrical conductive link with the carrier rail. The separate grounding of the carrier rail can be easily set up with the aid of the WAGO ground wire terminals.
Item No. 283-609 Description 1-conductor ground (earth) terminal block make an automatic contact to the carrier rail; conductor cross section: 0.2 -16 mm2 Note: Also order the end and intermediate plate (283-320).
38 "
g0xxx10e
Attention Care must be taken to ensure the direct electrical connection between the carrier rail contact and the carrier rail. The carrier rail must be grounded. For information on carrier rail properties, please see chapter 2.6.3.2.
39
g0xxx07e
Attention The regulations relating to the place of assembly as well as the national regulations for maintenance and inspection of the grounding protection must be observed.
40 "
41
p0xxx11x
42 "
43
3.1 View
LINUX LINK
A
01 02
C
B
fieldbus connection RJ 45
STATUS
status voltage supply - system - power jumper contacts data contacts supply 24V 0V supply via power jumper contacts 24V
I/O USR
750-860
0V
flap open
g086000d
The Linux fieldbus coupler comprises "$ Power supply for the system supply as well as power jumper contacts for the field side supply via I/O modules "$ Fieldbus interface with fieldbus connection "$ LEDs for status indication, i.e. operational status, fieldbus communication, operating voltages, error message and diagnostics "$ Configuration Interface "$ Selector switch "$ Electronics for communication with the I/O modules (internal bus) and the fieldbus interface
44 "
24 V
1 5
24 V /0 V 0V
10 nF
DC DC
I/O MODULES
FiELDBUS INTERFACE
24 V
ELECTRONIC
ELECTRONIC
0V
4 8
0V
10 nF
750-841
FiELDBUS INTERFACE
24 V
g086001d
The integrated power supply provides the required power to the electronics and to the I/O modules. An electrically isolated power supply is provided to the fieldbus interface.
Linux Fieldbus Coupler 750-860 Fieldbus Connection via the Ethernet Interface
45
Attention The bus connection is only approved for use in LAN networks, not for the connection of telecommunication lines!
46 "
01 02
C D
A B
+ +
Fig. 3-4: Display elements of the fieldbus coupler LED LINK Color Green Off STATUS Green/Re d Off SERVICE Green/Re d Off TxD/RxD IO Green Off Red Green Off USR Green/Re d Off A B Green Green Status of operating voltage 24 V supply voltage of the Linux coupler. Status of operating voltage Power jumper contacts (field side supply) Data is being exchanged via Ethernet. No data is being exchanged via Ethernet. Internal bus error or fieldbus coupler error. Linux fieldbus coupler operational, no internal errors. Linux fieldbus coupler not operational. Function can be defined by the user. Function can be defined by the user. Meaning Physical connection to the Ethernet network established. Fieldbus node has no physical connection to the Ethernet network. Function can be defined by the user.
g086002x
More information The evaluation of the LED signals is described in chapters 3.10 and 8.1.
47
g86001d
The communication cable 750-920 is connected to the four pole header. Caution The communication cable 750-920 must not be connected or removed when energized, i.e. the coupler/controller must be voltage free!
Contact 1 2 3 4
Attention The level adjustment from RS232 (+15 V/-15 V) to TTL (0V/5V) is done in the plug of the communication cable (750-920). There is no hardware handshake (CTS/RTS).
48 "
Selector switch
g01xx10d
The selector switch is a pressure switch/slide switch with three different positions and one pressure switch function. You can control the behavior of the serial interface or the boot process via the selector switch. The number of operations of the selector switch complies with EN61131T2.
Selector switch Upper position Middle position Lower position Pressed down (e.g. using a screwdriver) Function The Linux coupler is started with a Linux console on the serial interface (38400-8-N-1- NoFlowControl). WAGO program IO update is supported. Linux coupler starts Bootstrap Loader (BSL). Hardware reset
The boot loader analyzes the position of the selector switch, changes the Linux kernel start parameters and adds or deletes the wago_console=yes parameter. The serial interface driver and the boot code in the /etc/startwago file evaluate the start parameter. In the /etc/startwago file it will be decided whether or not to start the /bin/io-check or the /bin/getty program.
49
Attention Do not delete the contents of the BSL/FWL memory addresses. Otherwise the Linux fieldbus coupler will become inoperative! Hence, 0x00290000 bytes (approx. 2.69 Mbyte) are available to the file system. After a successful start of the Linux kernel, the memory map in the RAM looks as follows:
RAM address 0x00400000 0x00040000 0x0003FFFF 0x00000000 Name Linux kernel Reserved Size (approx.) 3.8 MB 256 kB
50 "
The boot loader switches to its shell environment. If, after three seconds, no password has been entered, the boot loader (U-Boot) loads the Linux kernel from the flash memory, unpacks it into the RAM starting at address 0x0040000 and then starts it with the specified boot parameters. The kernel startup scripts will then perform the following actions: "$ Set timer IRQ "$ Initialize RAM memory "$ Embed the JFFS2 file system "$ Start serial driver "$ Embed LED driver "$ Create partitions in the flash memory "$ Load I2C driver: embed real-time clock chip/embed EEPROM
51
"$ Load network driver, IP configuration "$ Start init process and any other required process "$ Load internal bus driver During start-up, the "I/O" LED (red) flashes fast. After approximately 20 seconds, the "I/O" LED lights up green and the Linux fieldbus coupler is operational and the internal bus driver is loaded. If an error occurs during start-up, it is indicated via the blinking "I/O" LED (red).
01 02
C D
+ +
g08603x
A blink code consists of three blink sequences with a pause between each sequence: "$ The error display starts with the first blink sequence (approx. 10 Hz). "$ After a break, the second blink sequence starts (approx. 1 Hz). The number of light pulses indicates the Error Code. "$ After another break, the third blink sequence starts (approx. 1 Hz). The number of light pulses indicates the Error Argument.
52 "
The blink code is repeated cyclically until the error is corrected and/or the Linux fieldbus coupler is rebooted. The following table lists the types of errors with the associated blink codes:
Error arError description gument 1 Overflow of the internal buffer memory for the inline code. Remedy
Fault Code 1: Hardware and Configuration Fault Turn off the supply voltage of the Linux fieldbus coupler, reduce the number of modules and turn on the supply voltage again. If the error remains, replace the coupler Switch off the supply voltage of the Linux fieldbus coupler, replace the coupler and switch on again. Switch off the supply voltage of the Linux fieldbus coupler, replace the coupler and switch on again. Restart the Linux fieldbus coupler by turning the power supply off and on again.
The I/O module configuration after an internal bus reset differs from the one after the last I/O-IPC start-up. Maximum number of gateway modules or mailbox modules exceeded
14
Error code 4: Physical error of the internal bus n* Interruption of the internal bus Turn off the supply voltage of the Linux behind the nth I/O module with fieldbus coupler, replace the (n+1)th I/O process data. module with process data and turn on the supply voltage again.
Error code 6: Node configuration error 8 Error during process image generation Reduce the number of I/O modules on the node
53
Baud rate Protocols CPU RAM 1 RAM 2 (NOVRAM) FLASH memory EEPROM
Standards and guidelines (see chapter 2.2 ) EMC CE Immunity to interference Acc. to EN 61000-6-2 (1999) EMC CE Emission of interference Acc. to EN 50081-2 (1994) Approvals (see chapter 2.2)
CULUS (UL508) CULUS
(UL1604)
54 "
Linux Fieldbus Coupler 750-860 Technical Data Technical data Number of I/O modules Number of I/O modules with bus extension Per node Digital signals Analog signals Configuration possibility Max. number of socket connections 64 250
Max. 2040 (inputs and outputs) Max. 1020 (inputs and outputs) Via PC 1 HTTP, 1 FTP, 8 Telnet, 8 NFS Powerfail RTC buffer Min. 6 days Voltage supply DC 24 V (-15 %/+ 20 %) Input current max 500 mA at 24 V Efficiency of the power supply 87 % Internal current consumption 300 mA bei 5 V Total current for I/O modules 1700 mA bei 5 V Isolation 500 V system/supply Voltage via power jumper contacts DC 24 V (-15 % ... + 20 %) Current via power jumper contacts DC 10 A
max
55
56 "
The /images directory The /images directory contains the following files: "$ jffs2.img Image of the file system in JFFS2 format. JFFS2 stands for Journalling Flash File System, Version 2. Copying the image is started from uboot using the TFTP protocol or netflash. "$ linux.flashme Image of the operating system. Copying the image is started from uboot using the TFTP protocol or netflash. "$ ub.bin Image of the boot loader (uboot). Copying the image is started from uboot using the TFTP protocol or netflash. "$ image.hex Complete base image consisting of the file system, operating system, boot loader and firmware loader. Transfer to the Linux fieldbus coupler is done using the WAGO-IOUpdate windows program. You will find further information on uboot in chapter 9 and on netflash in chapter 4.5.6
The /IO-Update directory You will find here the setup to install the WAGO-IO-Update windows program.
57
The /linux directory This directory contains the 2.6 Linux source code as well as the ARM toolchain for x86 systems "$ sources The source code for the 2.6 Linux kernel. The source code is unpacked by the install.sh script into the home directory of the current user. "$ toolchain ARM toolchain for x86 systems. The install.sh script requires super user privileges.
The /uboot directory This directory contains the source code as well as the toolchain of the boot loader (uboot) for x86 systems. Changes to the boot loader should only be made in some rare exeptions.
"$ sources
The uboot source code. The source code is unpacked by the install.sh script into the home directory of the current user. "$ toolchain Uboot toolchain. The install.sh script requires super user privileges.
58 "
The following gives a detailed description of the directories /proc, /etc and /bin.
59
The /proc directory The entries in the /proc directory provide information on the status of the Linux fieldbus coupler. You can find entries for every started process as well as from the drivers or the kernel. The entries can be read and copied like a text file. However, the entries are not in the flash memory but in the RAM. For example, the entry
cat meminfo
provides information on the used system memory. The following is a list (not complete) that shows the most important entries: "$ loadavg Information on processor utilization "$ meminfo Information on the used RAM memory "$ modules Overview of the embedded kernel modules "$ devices Used device drivers "$ interupts Used interrupts with counter "$ cmdline Command line when starting the Linux kernel "$ kmsg Kernel messages since system start "$ driver/kbus Information on the internal bus driver and its process image "$ mtd Partitioning of the flash memory "$ stat CPU status "$ cpuinfo Information on the processor type
60 "
The /etc directory The configuration files of the Linux system are stored in the /etc directory. The boot process is kept simple and requires fewer files than a commercially available distribution for a PC. The files are described according to the boot sequence:
"$
rc "$ Starts startwago once during system start "$ Sets the Host name of the Linux console "$ Links the /proc directory to the file system "$ Starts inetd (for Telnet, FTP)
"$ inittab "$ Starts and monitors getty, if process stops, it retries to start getty (up to 5 times) "$ startwago "$ Starts internal bus driver "$ Starts IO-Check driver "$ Starts the Web server (BOA) "$ Changes the link to getty, depending on the entry in the Linux kernel command line "$ boa Configuration of the Web server "$ fstab Configuration of the file system "$ motd Start logo of the console "$ resolv.conf Contains the entries of the name servers "$ passwd User password file "$ services The port numbers are assigned to their corresponding services "$ group Configuration of the known user groups "$ TZ Time zone setting for all consoles
61
The /bin directory Files in the /bin directory can be run from any directory like shell commands. This directory contains all programs that can generally be accessed. In order to save memory resources in the file system, different programs are used that are especially adapted to embedded systems. The following programs are available (condition upon delivery): "$ busybox Combines the common Linux console programs for system administration "$ tinylogin Combines the common user administration programs "$ boa Compact and safe web server "$ mkfs.jffs2 Used to create the JFFS2 file system in the flash memory "$ telnetd Telnet server "$ inetd Inet server for the connection with Telnet and FTP "$ ftpd Ftp server "$ msntp SNTP client to query an NTP time server "$ leds Example for controlling the LEDs of the Linux fieldbus coupler (see chapter 8) "$ wagoset Example for setting/reading the Ethernet configuration in the higher flash memory area (see chapter 4.6.2) "$ kbusdemo Demo program for reading or writing process data to the IO modules (see chapter 8)
62 "
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
"$ gdbserver Server program for debugging in user space (see chapter 5.12) "$ netflash Program for copying a complete area (block) of the flash memory via TFTP (see chapter 4.5.6) All the other files in the /bin directory are links that refer to the busybox or tinylogin program.
p086009d
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
63
The following table shows the different users accounts that are stored by default (conditions may change upon delivery):
User root admin user guest Password Authorization wago wago user guest Super user Super user User has rights for HTML files Read rights
The users "root" and "admin" are Superusers and have all rights to change the system completely. The user "user" has a home directory in /var/www/ and only has rights to change or to delete files there. This directory contains the files that are used for the Web server. More users or user groups to which you can assign any rights can be created using the Busybox programs adduser and addgroup (see chapter 4.3.2).
4.3.1 Shells
The Linux console provides the basic functions to start a program or to execute scripts. The console of the Linux fieldbus coupler is the shell that is provided by the busybox. It is a minix shell that supports more extensive script processing functions. The shell contains builtin commands, such as cd. Furthermore, the Shell provides the environment variables and allows to navigate the file system as well as to run programs.
64 "
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
4.3.2 Busybox
Busybox combines many standard Linux distribution programs in one single program in order to minimize memory requirements of the file system. The program is only started via symbolic links. Busybox evaluates the name and can in this way implement different functions in one program. When compiling Busybox you can choose the programs to be integrated. It is thus possible to adapt the size of the program to the required functions. The Linux fieldbus coupler implements all the required functions for a minimum system. The following call lists the implemented programs: make menuconfig: Customize Vendor/User Settings By changing the Busybox settings during compilation they can be changed arbitrarily (see chapter 5). The list contains the following programs: "$ mount Linking file system to the kernel "$ reboot Rebooting the Linux fieldbus coupler "$ insmod Linking kernel modules "$ chroot Sets the root directory in which programs are run "$ killall Deletes programs (killall + program name) "$ pivot_root Changes the root file system "$ ifconfig View/change the current Ethernet settings. Changes are not accepted. Please use the wagoset program. "$ hostname Changes the local host name "$ syslogd Creates the log file /var/log/messages "$ modprobe Loads kernel modules
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
65
"$ touch Updates the creation date of a file/directory "$ rmmod Unloads kernel module "$ rmdir Deletes directory "$ reset Deletes screen content "$ mount Links directory "$ mknod Creates a device entry in the /dev directory "$ mkdir Creates a directory "$ lsmod Shows an overview of the linked kernel modules "$ klogd Sets settings to log kernel messages "$ clear Clears the screen "$ chown Changes a file/directory owner "$ chgrp Changes the group that owns the file/directory "$ tail Shows the last lines of a file "$ ping PING service (Ethernet diagnostics service) "$ more Shows text files (page by page) "$ kill Unpacks a file in the user space "$ init Main process generates and manages all processes "$ grep Searches characters/strings in text files/directories
66 "
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
"$ date Showing and setting the real time clock (RTC) "$ msh Minix shell to execute simple scripts "$ cat Shows text files "$ vi Editor to change text files "$ rm Deletes file "$ ps Shows all loaded programs in the user space "$ mv Moves files "$ ls Lists all files of the current directory "$ ln Creates links "$ df Shows file system information (free memory) "$ cp Copies files "$ top Shows the system capacity occurring through each individual process (in %)
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
67
68 "
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
The difference between system clock and hardware clock is that the time will still be stored in the hardware clock after a system reboot whereas the system clock needs to be synchronized via the hardware clock after every system reboot. Standard time of the hardware clock is "Greenwich Main Time" (GMT or UTC), the system time corresponds to the local time. The system variable TZ determines the system time (local time). The system variable is stored in the file /etc/TZ and describes the time difference between a time zone and the "Greenwich Main Time". The system variable TZ is defined as follows: TZ = MEZ-1MESZ-2,M3.5.0,M10.5.0 "$ MEZ: Abbreviation for Central European Time "$ -1: Information to calculate the standard time (time zones to the east of the prime meridian are subtracted, time zones to the west of it are added) "$ MESZ: Abbreviation for Central European Daylight Time "$ -2: Information to calculate the daylight saving time (time zones to the east of the prime meridian are subtracted, time zones to the west of it are added) "$ M: 3: 5: 0: 10: 5: 0: Month, in which time is set to daylight saving time. Week, in which time is set to daylight saving time. Day (0 = Sunday), on which time is set to daylight saving time. Month, in which time is set to standard time. Week, in which time is set to standard time. Day (0 = Sunday), on which time is set to standard time.
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
69
Options for the hardware clock The hardware clock time can be set using the system time or the system time can be set using the hardware clock time. The general syntax to set the hardware clock is:
hwclock [-r | --show] [-s | --hctosys] [-w | --systohc] [-l | --localtime] [-u | --utc]
The options for the hardware clock are: "$ hwclock -r or hwclock --show: Reads the hardware clock and displays it on the console. This time is always indicated in local time, even if the hardware clock is set to Greenwich Time (UTC). "$ hwclock -s or hwclock --hctosys: System time is set using the hardware clock time. "$ hwclock -w or hwclock --systohc: Hardware clock is set using the current system time "$ hwclock -l or --localtime: The hardware clock time is the local time "$ hwclock -u or --utc The hardware clock time is Greenwich Time Example:
hwclock -r
70 "
Board Support Package (BSP) The Console of the Linux Fieldbus Coupler
Options for the system clock The general syntax to set the system clock is:
date [Option] [MMDDhhmm[[CC]YY][.ss]] [+Format]
The options for the system clock are: "$ date -R Outputs an RFC-822 compliant data string that consists of date and system time "$ date -d STRING Converts a STRING (e.g. "01241040") into an RFC compliant data string and outputs it. It consists of the delivered data and time, "$ date -s STRING Sets the system time that is delivered with STRING (e.g. "01241045") "$ date -r FILE Shows the last modification in the file FILE "$ date -u Sets the system time to Greenwich Time and displays it Example:
date -d 05131045
71
p086005d
The status page shows the following values: Coupler details "$ Order description Description of the Linux fieldbus coupler "$ Order number Item number of the Linux fieldbus coupler "$ Firmware version Version of the implemented firmware
72 "
"$ FWL version Version of the implemented firmware loader "$ Serial number Wago serial number
Network details "$ MAC address MAC address of the Linux fieldbus coupler "$ IP address The IP address which is currently used or assigned
73
On the TCP/IP configuration page you have the opportunity to change relevant parameters of the Ethernet configuration:
p086006d
DNS "$ Name server 1 IP address of the first name server in the network "$ Name server 2 IP address of the second name server in the network "$ Hostname Name of the Linux fieldbus coupler in the dynamic network (DHCP, BootP) "$ Default Search Domain Name of the local domain You require the local domain name if you want the Linux coupler to access other network participants via the DNS server using short network names. For example: ping pc1234 would not work since the complete name is pc1234.localdomain. If one or several "Default Search Domains" are entered, the address pc1234 will automatically change to pc1234.localdomain.
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
74 "
Without Ethernet "$ Disable Ethernet Ist die Checkbox aktiviert, dann wird die Ethernetschnittstelle beim Neustart deaktiviert.
p086006d
Static IP Configuration "$ Static IP address Activate the Ethernet device to use a static IP address "$ IP address Static IP address (if activated) "$ Subnet Mask Subnet mask (with static IP address) "$ Gateway Default gateway (with static IP address)
75
Dynamic Configuration "$ BootP Activates configuration via BootP "$ DHCP Activates configuration via DHCP
Save Configurations If a user with root rights enters his name and the correct password and then clicks on the SAVE CONFIGURATION button, the corresponding CGI file will save the changed values in several different places of the Linux fieldbus coupler. The new values will only be activated after a reboot of the Linux fieldbus coupler because theEthernet interface is only initialized during a boot process.
Note If wrong values are entered, they cannot possibly be corrected again after a reboot of the Linux fieldbus coupler since it is no longer possible to access the Linux coupler. A correction of the values is then only possible via the serial interface using the Linux console (see chapter 4.3, 4.6.1 and 4.6.2).
76 "
On the kernel message page you can see the logged kernel messages that have been entered into the /proc/kmsg file since the Linux coupler system start.
p086002d
Among other things, you can find information on the hardware, on the installed Linux version, the drivers or on the IO modules that are connected to the Linux fieldbus coupler.
77
On the EEPROM messages page you can see the messages that are stored in the EEPROM of the Linux fieldbus coupler.
p086001d
Messages are, for example, error messages after an interruption of the internal bus or messages due to a Linux fieldbus coupler reset. "$ Date Date of the EEPROM message "$ Time Time of the EEPROM message "$ Error source The cause for the EEPROM message (Hex value) "$ Error value Value of the EEPROM message (Hex value) "$ Description Description of the EEPROM message The EEPROM can be erased. A user with root rights enters his name and the correct password in both text fields and clicks on the RESET EEPROM button. After successful authentication the EEPROM will be erased. If the authentication was not successful, an error message will be displayed behind the text fields.
78 "
The HTML page Read Config lists all the IO modules that are connected to the Linux fieldbus coupler and their properties.
Fig. 4-7: Screen view of the IO modules that are connected to theLinux coupler
p086003d
I/O Modules "$ Color The IO module color indicates the module type. For example, yellow modules are digital input modules "$ Slot number Slot number indicates the position of the IO module behind the Linux fieldbus coupler "$ Article number Item number of the IO module "$ Type The type of I/O module is indicated once more (see Color) "$ Number of channels Number of channels of the I/O module "$ Button R Button to open the register tables
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
79
Sub-table entries (click on the "+" button on the left side to the color entry) "$ First column Type of I/O module + offset of the I/O module channel in the process image of the Linux fieldbus coupler "$ Second column (for digital I/O modules: colored background, same color as LEDs) Value of the channel in the memory (Hex value) Light green: channel set Dark green: channel not set Gray: the LEDs only indicate readiness for operation, no channels set
80 "
On the reboot page you can reboot the Linux fieldbus coupler by entering the name of a user with root rights and the correct password.
p086004d
The Root passord for the user "root" is stored in encoded form in the passwd file and is initially wago (condition upon delivery). Note The password is not transmitted via an encrypted connection. It can thus be seen and used by any other network participant.
81
82 "
FTP File Exchange between PC and Fieldbus Coupler via Ethernet An FTP client is required in order to exchange FTP files between a PC and the Linux fieldbus coupler via Ethernet. The Windows Explorer also offers the possibility to do that, however, we do not recommend this approach since the Explorer has many disadvantages (very slow communication, wrong interpretation of the directory structure, view is not updated which confuses the user). To use the Explorer, the following entry is made in the data record: ftp://username:password@hostname. Example: ftp://user:[email protected]. The user administration is analogous to the Linux console password and user administration and is described in chapter 4"Board Support Package". To use FTP, run the FTP program via the DOS console when using the Windows operating system or via the Linux console when using Linux. To do so, enter ftp <hostname/IP> in the console and answer the questions about user and password (see following figure):
83
g086007d
After logging in, you can select the help menu via help, which describes the available commands (examples):
put Datei.html
Switches to the root directory The most convenient way to use FTP is to use an FTP client program such as Filezilla (http://sourceforge.net/projects/filezilla), which is distributed under the GPL. The FTP connection is established via port 21 which needs to be registered in some FTP clients .
84 "
FTP Client Operation In order to be able to use the FTP client, an FTP server and a user for the FTP access must be installed on the remote PC. It is started by: ftp <IP/hostname> Example: ftp 192.168.1.11 The FTP server asks for user and password. You can then execute commands on the server. What commands are supported by the server can be queried by the command:
help.
The server shows a list with all available FTP commands. By help <command> you get a description of the queried command from the server. Example: help cd
85
First, the date and the time of the time server are shown. The following number is the deviation (in this case -94.504 seconds). The last number indicates the jitter. The more the network is loaded or the farer away the time server is, the bigger the jitter becomes. Msntp can also directly change the time of the local system: msntp -r <Hostname/IP-Adresse> Example: msntp -r 192.168.1.11 The output is, for example:
The correction time is 94.493 +/-0.33+0.045seconds Do you want correct the time anyway?
If you enter y, the time in the RTC chip and in the Linux kernel is changed via the internal function settimeofday() using the correction value of the previous query.
86 "
In order to provide for cyclic time monitoring via SNTP, MSNTP can also be started as a daemon. Additionally, MSNTP should be registered as respawn process in the /etc/inittab file in order to automatically activate time monitoring when starting the Linux fieldbus coupler and to restart the process automatically if the program crashes. The entry in the file /etc/inittab looks as follows:
/etc/inittab:
::respawn:/bin/msntp r P no x <minutes> <IP/Hostname> Example: ::respawn:/bin/msntp r P no x 10 192.168.1.11 This would mean that the time would be checked every 10 minutes. The entry "$ r means that the process sets the time via settimeofday(). "$ P no means that any time error is corrected "$ x 10 means that the process is a daemon and that it will take at least 10 minutes before it repeats its query. Further information on the parameters can be found on the msntp main page (e.g. under: http://pigtail.net/LRP/msntp.html).
87
The BOA web server is preloaded on the Linux fieldbus coupler. BOA is a program under GPL. You can find the official web site for this project under http://www.boa.org. The web server version is 0.94. The BOA web server will run on startup (condition upon delivery). It provides a second graphical user interface via the web-based management system. The HTML and CGI pages that is described in chapter 4.4 are already stored.
88 "
Relevant web server directories The root directory of the web server is in the /var/www/ directory. There you can find the Index.html file. More subdirectories are possible and are addressed accordingly. Examples for addressing a Linux fieldbus coupler with the IP address 192.168.1.12 in a network : "$ 192.168.1.12 Launches /var/www/Index.html "$ 192.168.1.12/start.html Launches /var/www/start.html "$ 192.168.1.12/picture.gif Shows a GIF picture /var/www/picture.gif
CGI files are in the /var/www/cgi-bin directory. They are activated by adding the extension /cgi-bin/. Examples for activating CGI files: "$ 192.168.1.12/cgi-bin/ether Activates CGI file /var/www /cgi-bin/ether "$ 192.168.1.12/cgi-bin/restart Activates CGI file /var/www/cgi-bin/restart
CGI files The BOA web server can execute files in the /var/www/cgi-bin directory. These files will output HTML code via the standard console "stdout" which will be transmitted via the WWW by the web server. Binary files are stored for the WAGO pages (delivery status) that write on standard output. The files are written using the C programming language. See also the example program in chapter 8. Other types of CGI files such as Perl scripts can also be used, however, it is necessary to install the appropriate interpreters / auxiliary programs. Please read more about the web server in the BOA documentation on the Internet.
89
4.5.6 Netflash
Netflash is a utility program that serves to load image files to your PC via a
network and to write them to the flash memory. The possibility to update the system via the network offers a great advantage in terms of system maintenance and usability, especially in embedded systems.
Netflash supports to download image files with different protocols such as
http, tftp and ftp. If no options are enabled (see next page), the flash memory will be updated in the following way: "$ All processes are terminated "$ The indicated file is loaded "$ The checksum of the loaded file is verified "$ If the checksum is correct, the image is written to the flash memory of the Linux fieldbus controller "$ The Linux fieldbus controller is rebooted
Options "$ -b No restart after the flash memory update "$ -C Checks if the image was written correctly "$ -f Uses FTP as load protocol "$ -F Forces all areas (blocks) of the flash memory to be overwritten "$ -h Opens the help menu "$ -i Ignores all version information "$ -H Ignores the hardware type information
90 "
"$ -j The image to be written contains the JFFS2 file system "$ -k Processes are not terminated (will be ignored if the Root file system is in the flash memory) "$ -l Protects the areas of the flash memory after writing data "$ -n Image has no checksum (image without version information) "$ -p Contains the blank areas of the flash memory "$ -s Stops deleting and writing at the end of the input data "$ -t Checks the image and deletes it if it is faulty "$ -u Enables the areas of the flash memory before data is written "$ -v Indicates the version number
Example: After the log-in on the buscoupler via Telnet, an example application with netflash could look like the following:
netflash k n j r /dev/mtd3 192.168.1.11 jffs2.img netflash: fetching file "jffs2.img" from 192.168.1.11 ............................................................... ............................................................... netflash: got "jffs2.img", length=1159368 netflash: flashing root filesystem, kill is forced Connection closed by foreign host.
91
Please use the wagoset program for a permanent configuration of the Ethernet interface.
92 "
To view the current settings use ./wagoset -v To start the Linux fieldbus coupler with IP address 192.168.1.4 during the next boot use the following command ./wagoset -m static i 192.168.1.4 s 255.255.255.0 g 0.0.0.0
93
Dynamic IP address assignment via DHCP during the next boot of the Linux fieldbus coupler is achieved by:
./wagoset -m dhcp
If you want to assign the IP address using a BootP server, do the following: ./wagoset m bootp After that, reboot the Linux fieldbus coupler. Attention If automatic configuration via DHCP or BootP is selected, the values for IP address and subnet mask are reset to default values, since they are not used and no longer stored. Consequently, if DCHP or BootP is changed to a static IP address, it is necessary to set the IP address and subnet mask values again.
94 "
wagoset (start without network connection) If the Bootp or DHCP server is supposed to be searched during runtime, it is reasonable, in most cases, to start the kernel without Ethernet configuration. Start wagoset using the option -m none.
~ # wagoset -h Usage: wagoset OPTION [VALUE] ... WAGO ETHERNET BOOT CONFIGURATION. OPTION: -v, --view View Configuration -m, --mode Ethernet Mode; VALUE: static, dhcp, bootp, none -i, --ip Static IP; VALUE: x.x.x.x -s, --subnet Subnet-Mask; VALUE: x.x.x.x -g, --gateway Gateway IP; VALUE: x.x.x.x -o, --hostname Hostname: VALUE [String hostname] -h, --help Print this message. Proprietary. Send bug reports to [email protected] ~ # wagoset -m none No ethernet at bootup: Configuration value saved! IP_Mode is: none IP-Address configuration: 192.168.1.10 Subnet Mask configuartion: 255.255.255.0 Gateway IP configuartion: 192.168.1.1 Hostnameconfiguartion: WagoLFBC
Dynamic assignments via bootpc In order to get an IP address and other relevant information from a Bootp server via the network, also after the start of the Linux kernel, use the bootpc program. You can find the program in the /sbin directory. In order to make the use of the Bootp client easier, the /sbin directory also provides a Linux script, that executes the call of the bootpc. In order to run the script in the background, execute the following call:
bootpc-startup &
The Bootp client is started in the background and sends a Bootp request approx. every two seconds. With a correct reply, the Ethernet interface is parameterized automatically (IP address, netmask, gateway). The program and the script are terminated as soon as a valid Bootp server has sent a reply. The call can also be a part of the boot script /etc/inittab, of course.
95
Dynamic assignments via dhcpcd If a DHCP server is supposed to be requested after the start of the Linux kernel, the dhcpcd program can beused. The program is in the /sbin directory and can hence be started by any user. The call is dhcpcd & The DHCP client is started in the background and sends DHCP requests regularly. With a correct reply, the client automatically configures the Ethernet interface. The program is not terminated if a valid response is received from a DHCP server. The call can also be a part of the boot script /etc/inittab, of course.
p012910d
3. After pressing the return key, your PC gets a response from the Linux fieldbus coupler which is shown in the DOS promt. Should the error message: "Request timeout, appear, please verify your input and compare it with the IP address you assigned. After a successful test, you can close the DOS prompt. The node is now ready to communicate.
96 "
Step-by-Step Guide to your own Linux Application Installation of the Development Toolchain
Change directory (in S.U.S.E, a CD drive is mounted in /media/cd-rom if it was linked via Konqueror, for example)
># sh install.sh
Step-by-Step Guide to your own Linux Application Unpack the Source Code
97
(in S.U.S.E, a CD drive is mounted in /media/cd-rom if it was linked via Konqueror, for example)
> sh install.sh
Call installation script The installation is done automatically. During the installation a/uclinux-dist directory is created in the home directory of the user in which are stored the files required for the compilation of the Linux kernel, for the creation of the file system and for the compilation of the application programs.
98 "
Starts a graphical configuration tool to set the kernel options. (Exit the dialog with EXIT and end the program without saving changed settings.) Note If the graphical interface to configure the distribution cannot be opened, please install the NCURSES components from your PC Linux distribution on your host PC
> make
Note In some versions of S.U.S.E, make aborts during the first compilation. In this case, please restart make. Make works correctly if kernel information is shown after the compilation process. Make calls the program to execute Makefile, make is the short form of make all, all being the argument. The following attributes can be used: "$ all Synonym for: linux uClibc user romfs image "$ linux Kernel compilation "$ romfs Creates the root file system in the /romfs directory
99
"$ user User program compilation "$ image Creates the HEX images: linux.flashme (Linux kernel), jffs2.img (file system with user programs) "$ menuconfig Invokes a menu-driven configuration of the Linux kernel, of the modules and of the application programs "$ clean Deletes all files that were created by compilation "$ distclean Deletes all files created by configuration and compilation
100 " Step-by-Step Guide to your own Linux Application Setup of the Development Environment
The installation of the following programs adds to the convenience: "$ ncurses Part of S.U.S.E installation if all development packages are installed "$ FTP client/server For file exchange with the FTPserver/ client of the Linux coupler "$ NFS server For easy file exchange with the Linux fieldbus coupler In order to update images for Bootloader, firmware and file system on the Linux fieldbus coupler you require a TFTP server. Please see chapter 9.2.
Step-by-Step Guide to your own Linux Application Setup of the Development Environment
101
If minicom is not communicating, check if the right interface has been configured. To do so, start the program with the option "-s" and verify the settings in the menu item "Serial port setup".
p0860011d
Press the <Strg> + <a><z> key combination to view a list with available functions.
102 " Step-by-Step Guide to your own Linux Application Setup of the Development Environment
Press the <Strg> + <a><x> kex combination to terminate minicom. In order that the backspace key functions properly, the option "Backspace sends Del(ete) needs to be set. In minicom, this is done via the <Strg> + <a><t><b> key combination. In the Windows operating systems Hyperterminal is the recommended program for the serial terminal communication. The following figure shows the required settings.
p0860010d
Step-by-Step Guide to your own Linux Application Setup of the Development Environment
103
g086008d
In the "Connect to" dialog, select TCP/IP in the " Connect via" selection field. In the next window, enter the IP address (see also chapter 4.6) or the host name of the Linux fieldbus coupler and the port number 23 for Telnet.
104 " Step-by-Step Guide to your own Linux Application Setting the IP address of the Linux Fieldbus Coupler
Please use the wagoset program for a permanent configuration of the Ethernet interface. This program writes the settings to the flash memory of the Linux coupler. In this way the settings are also available after the next start-up.
> wagoset i 192.168.1.8 (sets permanent IP address)
Dynamic IP address assignment via DHCP for the next start of the Linux filedbus coupler can be set as follows:
> wagoset m dhcp
Step-by-Step Guide to your own Linux Application Create your own User Space Application
105
A minimum project consists of a source code file and a make file. Create the source code file newProg.c, e.g. using EMACS, KATE or JOE.
> emacs newProg.c
Call EMACS editor Insert the following code into the emacs and press CTRL-X CTRL-S to save it.
int main (int argc, char **argv) { printf(Hello World\n); }
106 " Step-by-Step Guide to your own Linux Application Create your own User Space Application
Call EMACS editor Insert the following code into the emacs and press CTRL-X CTRL-S to save it.
all: newProg newProg: newPorg.o $(CC) $(LDFLAGS) -o $@ newProg.o $(LDLIBS$(LDLIBS$(@))) cp newProg /targetfs/ romfs: $(ROMFSINST) /bin/newProg clean: rm f newProg *.elf *.gdb *.o
In order to connect the make file to the global make file of the cross compiler, you have to paste the new directory into the ~/uclinux-dist/user/Makefile make file in the dir_y variable:
> emacs ../Makefile
Tippen Sie den folgenden Code in den emacs und speichern Sie ihn CTRL-X CTRL-S.
... dir_y = kbusapi ... newProg ...
The program, along with all other user space programs, is compiled if make in the /uclinux-dist directory is executed with the following option (see chapter 5.3).
> cd ~/uclinux-dist > make user
A binary file "newProg" is created which can be copied into the Linux fieldbus coupler via NFS or FTP, for example.
> cd ~/uclinux-dist > make user romfs image
This will also create a binary file newProg. At the same time, the romfs directory is updated and the new image of the file system jffs2.img is created which can be loaded via the boot loader (U-Boot) (see 5.10.2).
Step-by-Step Guide to your own Linux Application Transferring the User Space Application to the Linux Coupler
107
Screenshot:
p0860012
108 " Step-by-Step Guide to your own Linux Application Running the new Program
The Konqueror is another FTP client. Start the program and change to the /targetfs root directory. Start another instance of the program instance and change to the target directory of the Linux fieldbus coupler using ftp://<IP address>/bin. Now you can drag and drop files between the directories.
HelloWorld!
In this file, the startwago file with the attribute sysinit is run, among others. This means, the startwago script is started once during the system start-up. The getty program which also supports the serial interface is started as a respawn process. This process is thus restarted automatically if it is terminated. The attributes are: "$ sysinit Is started once during system start-up. "$ bootwait Is started once after all sysinit processes. "$ respawn Is restarted automatically if the process was terminated. Please refer to the initab manpage for more attributes.
Step-by-Step Guide to your own Linux Application Automatic start of new Programs (inittab/startwago)
109
inittab calls the startwago script. startwago includes further program calls. Since this file is a shell script, it is also possible to use conditional queries and other shell commands. The startwago file on the Linux fieldbus coupler looks as follows:
#!/bin/msh # change setuid/setgid-Bit for tinylogin(su) chmod +s /bin/tinylogin # start the KBus-Driver insmod kbus # start modbus tcp server /bin/mb_tcp & # start web server (BOA) boa -c /etc/boa & # if it is configured, start the IOCheck-Driver /-Application if grep -q "wago_console=yes" /proc/cmdline then rm /etc/inittab ln -s /etc/wago_console/inittab.nottys0 /etc/inittab insmod iocheck else rm /etc/inittab ln -s /etc/wago_console/inittab.ttys0 /etc/inittab /bin/iocheck & insmod iocheck fi exit 0
During the start-up of the Linux fieldbus coupler, different programs are started or file attributes are changed. For example, the BOA web server and the Modbus program mb_tcp are started.
110 " Step-by-Step Guide to your own Linux Application File System and Linux Kernel Update
To restore the Linux coupler default values, use the image files of the Bord Spport Package (BSP). The image files jffs2.img and linux.flashme are created in the /tftpboot directory. The image files are transferred to the Linux fieldbus coupler via TFTP. For that purpose, you have to set up and start a TFTP server, which has /tftpboot as a base directory, on the development computer. The boot loader (U-Boot) on the Linux coupler provides a TFTP client. It is controlled via a separate console. To open the console, enter the password geheim during the Linux coupler start-up. The boot process is aborted and the Linux fieldbus coupler opens the boot loader communication interface. You can use the update-kernel and update-rootfs macros for the update.
Step-by-Step Guide to your own Linux Application File System and Linux Kernel Update
111
gestartet werden. You have to install inetd and atftp via yast2 (S.U.S.E) before you can install a TFTP server on the development PC. After the installation, make the following entry in the /etc/inetd.conf: <host-ip>:tftp dgram udp wait root /usr/sbin/in.tftpd -s /tftpboot inetd starts automatically after a reboot or it can be started manually with
> /etc/init.d/inetd start
or restarted with
> /etc/init.d/inetd stop > /etc/init.d/inetd start
112 " Step-by-Step Guide to your own Linux Application File System and Linux Kernel Update
you have to enter the password geheim (on the serial console) to abort the boot loader boot process and to change to the U-Boot environment. The boot loader switches to its shell environment. If after three seconds the password has not been entered, the boot loader loads the Linux kernel. The printenv command outputs the environment variables:
LFBK # printenv bootargs=root=/dev/mtdblock3 rw mem=16769120 bootdelay=3 baudrate=38400 ipaddr=192.168.1.3 netmask=255.255.255.0 update-rootfs=tf 0x40000 jffs2.img;protect off 01:11-51;era 01:11-51;cp.b 0x40000 0x20040000 $(filesize) update-kernel=tf 0x40000 linux.flashme;protect off 01:52-69;era 01:52-69;cp.b 0x40000 0x202d0000 $(filesize) update-ub=tf 0x40000 ub.bin;protect off 01:08-9;era 01:089;cp.b 0x40000 0x20010000 $(filesize) bootA=setenv bootargs $(bootargs) wago_console=yes ip=$(ipmode) $(output);bootm bootB=setenv bootargs $(bootargs) ip=$(ipmode) $(output);bootm
Step-by-Step Guide to your own Linux Application File System and Linux Kernel Update
113
serverip=192.168.1.5 ipmode=192.168.1.03:00.0.0.00:00.0.0.0:255.255.255.0:WagoLFBC
bootcmd=setenv bootargs $(bootargs) wago_console=yes ip=$(ipmode) $(output);boot m ethaddr=00:30DE:00:F00:09 stdin=serial stdout=serial stderr=serial Environment size: 787/65532 bytes LFBK #
The IP addresses of the Linux fieldbus coupler and the TFTP server must be checked. If the IP addresses are not conclusive, they possibly need to be adapted using the following call:
setenv ipaddr <IP-Linux-FBK>; setenv serverip <IP-Host-PC>).
See also chapter 9.5 "Environment Variables". An update of the Linux kernel or of the entire file system can be started via the calls
LFBK # run update-kernel LFBK # run update-rootfs
These macros execute the following U-Boot commands: 1. 2. 3. 4. Load image file into the memory via TFTP. Disable write protection on flash memory. Delete designated area of the flash memory. Copy image file into flash memory.
114 " Step-by-Step Guide to your own Linux Application File System and Linux Kernel Update
Un-Protect Flash Sectors 52-70 in Bank # 1 Erase Flash Sectors 52-70 in Bank # 1 Erasing sector 52 ... ok. Erasing sector 53 ... ok. Erasing sector 54 ... ok. Erasing sector 55 ... ok. Erasing sector 56 ... ok. Erasing sector 57 ... ok. Erasing sector 58 ... ok. Erasing sector 59 ... ok. Erasing sector 60 ... ok. Erasing sector 61 ... ok. Erasing sector 62 ... ok.
Step-by-Step Guide to your own Linux Application File System and Linux Kernel Update Erasing sector 63 ... ok. Erasing sector 64 ... ok. Erasing sector 65 ... ok. Erasing sector 66 ... ok. Erasing sector 67 ... ok. Erasing sector 68 ... ok. Erasing sector 69 ... ok. Erasing sector 70 ... ok. Copy to Flash... done LFBK #
115
The host computer, which will provide the new image files, needs to incorporate a TFTP server in order to allow an update. In order to eliminate confusion, every file is given an unambiguous name. A JFFS2 image of the file system is called jffs2.img and the kernel file with bootloader header is called linux.flashme. The files are available on the WAGO Linux distribution CD under CD:/images/ and must be copied into the /tftpboot/ directory first or be generated in the uClinux directoty using make. Note You can get additional information on the interface with the help command. Example: LFBK # help
116 " Step-by-Step Guide to your own Linux Application NFS Server Setup
The Linux user ID/group ID must be entered as UID and GID. One way to determine the number is
> id uid=501(u04711) gid=100(users) Gruppen=100(users),14(uucp)...
Linux coupler NFS client configuration NFS is integrated into the Linux kernel and is used as a file system. In order to link a directory of a remote system it has to be assigned to the Linux directory structure using the mount call, just like a partition on the hard drive. In order to be able to use the NFS service, a NFS server and an enabled directoty must be available on the remote PC. The remote directory is linked to the Linux fieldbus coupler file system by the call
mount -t nfs -o nolock <IP/hostname>:/<Directory> /<local directory>
Example: > mount t nfs o nolock 192.168.1.12:/targetfs /nfs To serve this purpose, the Linux coupler provides the /nfs drive (delivery status). The drive can be accessed like a local drive. If drives are to be linked automatically during system start-up, they must be entered in the /etc/rc file.
Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
117
118 " Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
119
A window opens. Select the menu path Kernel " Library " Default Settings and press the Enter key. The following window will open:
1. Select Customize Vendor/User Settings and press the space bar. 2. Quit the menu and the following menus by clicking the EXIT button. 3. The following question appears "Do you wish to save your kernel configurations?". Click on YES. 4. Another menu opens. Select Debug Builds and press the Enter key. 5. Select Build debuggable applications and press the space bar.
120 " Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
1. Quit the menu and the following menus by clicking the EXIT button. 2. The following question appears "Do you wish to save your kernel configurations?". Click on YES. After the above-described settings are done, the compiler is ready to compile user space applications without optimization. The compiled programs become bigger and will likely operate at a slower speed. For final release versions of the programs, it is advisable to cancel the above setting (Build debuggable applications) and completely compile the program once more. To do so use the following calls:
> make clean > make (or make user).
Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
121
Enter the following code into the emacs and save it via CTRL-X, CTRL-S:
void printfunc(void) { int i = 3; printf("WAGO world\n"); printf("%d..", i); i--; printf("%d..", i); i--; printf("%d..\n", i); return; } int main(int argc, char **argv) { printf("Hallo\n"); printfunc(); return 0; }
A subfunction with a counter variable is added to the code in order to be able to test the functions of the debugger better. The makefile of section 5.6 is not modified. Recreate the program. Enter the following calls into the console:
> cd ~/uclinux-dist > make user
Copy the program to the Linux fieldbus controller, as described in section 5.7.
122 " Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
To simplify the operation of GDB, a script needs to be generated that creates defined starting conditions for the debugger. Use the following call to generate the script:
> emacs gdb.script
Enter the following code into the emacs and save it via CTRL-X, CTRL-S:
If the default IP address of the Linux fieldbus controller has been changed, it is necessary to also change the IP address that is in the first line of the abovementioned script. In the first line of the script, a remote connection is automatically established to the GDB server of the Linux fieldbus controller with the IP address 192.168.1.3 using port number 1234. The second line sets a breakpoint to the main routine and the third line starts the program that runs until the breakpoint is reached.
Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
123
The GDB server will now wait for a connection request (Listening) of the GDB client via port 1234 of IP address 192.168.1.4. Port 1234 is chosen arbitrarily, another port can also be used, of course. To start GDB on the Linux PC, enter the following calls:
> cd ~/uclinux-dist/user/newProg > arm-uclinux-elf-gdb newProg.gdb --command=gdb.script
The program is executed until the next program line is reached. Also steps into subroutines if it is the next code line. The program is executed until the next assembler code line. The program is executed until the next program line is reached. Skips subroutines. The program is executed until the next assembler code line. Skips subroutines. Continues to execute the program. The next breakpoint or pressing STRG+C tops the execution.
continue
124 " Step-by-Step Guide to your own Linux Application Debugging of User Space Programs GDB command Description
break
Sets a breakpoint.
break newProg.c:20 break main break *0x00dd8080
Sets a breakpoint at line 20 in the main.c file Sets a breakpoint at the main function start Sets a breakpoint at the indicated address in the program code
list
Lists ten code lines around the current position of the program counter. Another list call will list the next ten lines. list newProc.c:15 lists ten lines around line 15 in the newProg.c file Displays the current value of the i variable. print *pi displays the content of the memory area the pointer pi points to. Displays the current value of the i variable. The value or the values are updated after every execution of code (step, next, continue). Undisplays the value that was displayed via the display call before Displays the data type of the i variable. Displays the calling functions and their parameter values from the stack. Displays the content of the stack like backtrace. set var i = 5 sets the i variable to 5. Displays help texts for the available commands. help continue, for example, displays a help text for continue, help set displays the help text for set Terminates the remote program Exit the debugger. run call is not possible. The program counter is set to 0x00000000 which, with the type of CPU used (without MMU), will lead to a restart of the Linux fieldbus controller.
Debugging via the console is not a very convenient way of doing it, however, it offers a very good opportunity to control user space programs of the Linux fieldbus controller via a PC.
Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
125
The GDB server will now wait for a connection request via port 1234 of IP address 192.168.1.4. The graphical interface DDD and the debugger GDB will be started on the Linux PC when you enter the following calls into the console:
> cd ~/uclinux-dist/user/newProg > ddd newProg.gdb --command=gdb.script --degugger arm-uclinux-elf-gdb --gdb
126 " Step-by-Step Guide to your own Linux Application Debugging of User Space Programs
DDD now offers all the features of an integrated development environment. The operation is not described further in this manual.
127
6 Process Image
6.1 Basic Structure
After being started, the Linux fieldbus coupler automatically loads the internal bus driver. It recognizes all the IO modules of the node that send or receive data (data width/bit width > 0). The node can consist of a mixed arrangement of a maximum of 64 analog and digital I/O modules. Note The use of the WAGO module bus extension coupler module 750-628 and end module 750-627 makes it possible to connect up to 750 modules to the Linux fieldbus coupler 841-250.
Note For the number of input and output bits or bytes of the individual IO modules please refer to the corresponding description of the IO modules. The coupler generates an internal local process image from the data width and the type of I/O module as well as the position of the I/O modules in the Linux fieldbus coupler node. This is divided into an input and an output area. The data of the IO modules is separated for the local input and output process image in the sequence of their position after the Linux fieldbus coupler in the individual process image. First, all the byte-oriented I/O modules are filed in the process image, then the bit-oriented I/O modules. The bits of the digital modules are grouped into bytes. Once the number of digital I/Os exceeds 8 bit, the coupler automatically starts another byte. Note If a node is changed, this may result in a new process image structure. In this case the process data addresses also change. In the event of adding modules, the process data of all previous modules has to be taken into account.
128
Process Image
DI
AI AI
DI
AI
DI
AI
I/O
Input modules
Process input image (Byte)
Addresses 0x0000 0x0001 0x0002 0x0003 0x000C 0x000D 0x000E 0x000F
Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4 Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4
750-341
750- 402
Bit 1 Bit 4 4
402
1
472
Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4
472
Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4
402
1 4
476
Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4
402
1 4
476
Byte1 Byte 1 Byte2 Byte 2 Byte1 Byte 3 Byte2 Byte 4
0x0011
0x0010
129
I/O
Output modules
750-341
750 - 501
550
550
Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4
Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4 Byte 1 Byte 2 Byte1 Byte 3 Byte2 Byte 4
0x0008
g086058d
130
Process Image
AI DO AO
I/O USR
W AGO - I /O - SY STE M
I/O Modules
Process input image (Byte)
Addresses
750-842
750- 402
472
501
550
600
Bit 1 Bit 1 Byte 1 Byte 1 Bit 4 Byte 2 Bit 2 Byte 2 Byte1 Byte1 Byte 3 Byte 3 Byte2 Byte2 Byte 4 Byte 4
0x0004
0x0004
DI : Digital Input Module AI : Analog Input Module DO: Digital Output Module AO: Analog Output Module
g086058d
131
Function Description The internal bus driver can be used with the following functions: "$ open(/dev/kbus, O_WRONLY) Opens the kbus driver. "$ ioctl(iFD, IOCTL_KBUSUPDATE, &ulTmp) Writes the modified data of the output process image to the modules and simultaneously reads the current data of the input modules back in. "$ ioctl(iFD, IOCTL_GETBINOUTPUTOFFSET, &ulOutputOffset) Reads out the Offset value. The first digital output module in the output process image has the Offset value. It is therefore easier to access the digital I/O modules. "$ ioctl(iFD, IOCTL_GETBININPUTOFFSET, &ulInputOffset) Reads out the Offset value. The first digital input module in the input process image has the Offset value. It is therefore easier to access the digital I/O modules.
132
Process Image
"$ ioctl(iFD, IOCTL_CHANGE_UPDATE_SPEED, ulValue) [ulValue from 1-10 is valid] Used to set the polling interval to poll ioctl(iFD, IOCTL_KBUSUPDATE, &ulTmp. The default value is 3. This value can be reduced to 1 in order to achieve the highest possible speed of the application. However, this only makes sense with very fast I/O modules and a very small user program. The value can also be increased to 10 if only very slow analog I/O modules are involved and fast updates of the process image are not desired. "$ close(iFD) Closes the KBus driver
Using predefined structures, it is possible to access the input or output process image byte by byte via the following lines:
pstPabIn->uc.Pab[byteNo] pstPabOut->uc.Pab[byteNo]
Before the input process image can be analyzed, ioctl(iFD, IOCTL_KBUSUPDATE,...) must be called. After changing the output process image, it is also required to call ioctl(iFD, IOCTL_KBUSUPDATE,...) in order to send the new values to the modules.
133
Note The ioctl(iFD, IOCTL_KBUSUPDATE,...) function writes data to the I/O modules via the internal bus and simultaneously reads in the I/O module data. The function waits and blocks the system until the new data has been read out from the I/O modules. The time for that depends on the length (number of bytes) of the I/O modules connected to the internal bus and may take up to 50ms if the maximum number of modules is involved. Note In order not to reduce the performance of the program, call ioctl(iFD, IOCTL_KBUSUPDATE,...)only once during a cyclic program run. Note The internal bus driver does not control if several programs change data in the process image and then call ioctl(iFD, IOCTL_KBUSUPDATE,...). Therefore, if two application programs access the process image, make sure that the output data to be written is not overwritten by the other program. The programs should block each other.
Example: bit query The following example shows how to query a bit: Using the
if (pstPabIn->uc.Pab[0] & 0x08) { ...
} code, allows you to check the third bit of the first element (0000.1000) in the process array to determine if the bit at address 0.3 is set to TRUE.
Example: how to set a bit The following example shows how to set a bit: Using the
pstPabOut->uc.Pab[0]|= 0x08;
sample code allows you to perform a boolian OR operation of the value 0x08 with the output process image which sets the bit 0.3 ('0000.10') to TRUE.
134
Process Image
Example: how to reset a bit The following example shows how to reset a bit: Using the
pstPabOut->uc.Pab[0] &= ~0x08;
sample code allows you to perform a boolian AND operation with the inverted value of 0x08 ('1111.0111') with the output process image to set the bit 0.3 to FALSE.
Example: byte query The following example shows how to query a byte: Using the
if (pstPabIn->uc.Pab[0] == 38) { ...
} code allows you to check whether byte 0 has the value 38 by using the equal conditional operatior.
Example: word query The following example shows how to query a word: Using the
if (pstPabIn->us.Pab[0] == 0x0008) { ...
} sample code allows you to check whether the 0-bit process array (us) has the value 0x0008
135
Slot
Terminal
8 9
750-553/000-000 750-559/000-000
0.0 6.0
x.x x.x
--------------------------------------------------------1 2 3 4 5 6 7 750-4xx 750-4xx 750-4xx 750-4xx 750-4xx 750-4xx 750-4xx x.x x.x x.x x.x x.x x.x x.x 0.0 0.4 0.6 1.0 1.2 1.4 1.6
--------------------------------------------------------PAB In: PAB Out: 00ffe060 00ffe858 PAB Size: 2040 bytes PAB Size: 2040 bytes
Position after the Linux coupler Item number No data in the input process image Base addresses of the process images
136
I/O Modules
7 I/O Modules
7.1 Overview
All listed bus modules, in the overview below, are available for modular applications with the WAGO-I/O-SYSTEM 750. For detailed information on the I/O modules and the module variations, please refer to the manuals for the I/O modules. You will find these manuals on CD ROM ELECTRONICC Tools and Docs (Item No.: 0888-0412) or at http://www.wago.com under Documentation. More Information Current information on the modular WAGO-I/O-SYSTEM is available at http://www.wago.com.
I/O Modules Overview 750-432, 753-432 750-403, 753-403 750-433, 753-433 750-422, 753-422 750-408, 753-408 750-409, 753-409 750-430, 753-430 750-431, 753-431 750-436 750-437 DI AC/DC 24 V 750-415, 753-415 750-423, 753-423 DI AC/DC 42 V 750-428, 753-428 DI DC 48 V 750-412, 753-412 DI DC 110 V 750-427, 753-427 DI AC 120 V 750-406, 753-406 DI AC 120(230) V 753-440 DI AC 230 V 750-405, 753-405 2 Channel, AC 230 V, 2- to 4-conductor connection; high-side switching 4 Channel, AC 120(230) V, 2-conductor connection; high-side switching 2 Channel, AC 120 V, 2- to 4-conductor connection; high-side switching 2 Channel, DC 48 V, 3.0ms, 2- to 4-conductor connection; high-side switching 4 Channel, AC/DC 42 V, 2-conductor connection 4 Channel, AC/DC 24 V, 2-conductor connection 4 Channel, AC/DC 24 V, 2- to 3-conductor connection; with power jumper contacts 4 Channel, DC 24 V, 3.0 ms, 2-conductor connection; high-side switching 4 Channel, DC 24 V, 0.2 ms, 2- to 3-conductor connection; high-side switching 4 Channel, DC 24 V, 0.2 ms, 2-conductor connection; high-side switching 4 Channel, DC 24 V, 2- to 3-conductor connection; high-side switching; 10 ms pulse extension 4 Channel, DC 24 V, 3.0 ms, 2- to 3-conductor connection; low-side switching 4 Channel, DC 24 V, 0.2 ms, 2- to 3-conductor connection; low-side switching 8 Channel, DC 24 V, 3.0 ms, 1-conductor connection; high-side switching 8 Channel, DC 24 V, 0.2 ms, 1-conductor connection; high-side switching 8 Channel, DC 24 V, 3.0 ms, 1-conductor connection; low-side switching 8 Channel, DC 24 V, 0.2 ms, 1-conductor connection; low-side switching
137
138
I/O Modules
DI NAMUR 750-435 750-425, 753-425 750-438 750-424, 753-424 1 Channel, NAMUR EEx i, proximity switch acc. to DIN EN 50227 2 Channel, NAMUR, proximity switch acc. to DIN EN 50227 2 Channel, NAMUR EEx i, proximity switch acc. to DIN EN 50227 2 Channel, DC 24 V, intruder detection
DI Intruder Detection
I/O Modules Overview DO AC/DC 230 V 750-509, 753-509 750-522 DO Relay 750-523 750-514, 753-514 750-517, 753-517 750-512, 753-512 750-513, 753-513 1 Channel, AC 230 V, AC 16 A, potential-free, 1 make contact 2 Channel, AC 125 V , AC 0.5 A , DC 30 V, DC 1 A, potential-free, 2 changeover contacts 2 Channel, AC 230 V, 1 A, potential-free, 2 changeover contacts 2 Channel solid state relay, AC/DC 230 V, 300 mA 2 Channel solid state relay, AC/DC 230 V, 500 mA, 3 A (< 30 s)
139
2 Channel, AC 230 V, DC 30 V, AC/DC 2 A, non-floating, 2 make contacts 2 Channel, AC 230 V, DC 30 V, AC/DC 2 A, potential-free, 2 make contacts
140
I/O Modules
AI 0 - 10 V 750-467, 753-467 750-477, 753-477 750-478, 753-478 750-459, 753-459 750-468 AI DC 10 V 750-456, 753-456 750-479, 753-479 750-476, 753-476 750-457, 753-457 AI DC 0 - 30 V 750-483, 753-483 750-461, 753-461 750-481/003-000 750-460 AI Thermocouples 750-462 750-469, 753-469 AI Others 750-491 1 Channel for resistor bridges (strain gauge) 2 Channel, thermocouples, line break detection, sensor types: J, K, B, E, N, R, S, T, U 2 Channel, thermocouples, line break detection, sensor types: J, K, B, E, N, R, S, T, U, L 2 Channel, DC 0 -30 V, differential measurement input 2 Channel, resistance sensors, PT100 / RTD 2 Channel, resistance sensors, PT100 / RTD, EEx i 4 Channel, resistance sensors, PT100 / RTD AI Resistance Sensors 2 Channel, DC 10 V, differential input 2 Channel, DC 10 V, differential measurement input 2 Channel, DC 10 V, single-ended 4 Channel, DC 10 V, single-ended 2 Channel, DC 0 - 10 V, single-ended 2 Channel, AC/DC 0 - 10 V, differential input 2 Channel, DC 0 - 10 V, single-ended 4 Channel, DC 0 - 10 V, single-ended 4 Channel, DC 0 - 10 V, single-ended
141
142
I/O Modules
Frequency Measuring
Pulse Width Module 2-channel pulse width module, DC 24 V, short-circuit-protected, high-side switching SSI transmitter interface Incremental encor interface, differential inputs Incremental encor interface, DC 24 V Incremental encor interface RS 422, cam outputs Digital pulse interface, for magnetostrictive distance sensors Serial interface RS 232 C Serial interface RS 485 TTY-Serial interface, 20 mA Current Loop Data exchange module DALI / DSI master module AS interface master module Radio receiver EnOcean MP bus (multi point bus) master module 2 Channel vibration velocity / bearing condition monitoring VIB I/O
Distance and Angle Measurement Modules 750-630 750-631 750-634 750-637 750-635, 753-635 Serial Interfaces 750-650, 753 750-653, 753 750-651 750-654 750-641 750-655 750-642 750-643 750-645
DALI / DSI Master Module AS interface Master Module Radio Receiver Module MP Bus Master Module Vibration Monitoring
I/O Modules Overview PROFIsafe Modules 750-660/000-001 750-665/000-001 750-666/000-001 RTC Module 750-640 750-646 RTC module KNX / EIB /TP1 module device mode / router mode KNX / EIB TP1 Module 8FDI 24V DC PROFIsafe; PROFIsafe 8 channel digital input module 4FDO 0.5A / 4FDI 24V DC PROFIsafe; PROFIsafe 4 channel digital input and output module 1FDO 10A / 2FDO 0.5A / 2FDI 24V PROFIsafe; PROFIsafe power switch module
143
144
I/O Modules
DC 24 V Power Supply Modules with bus power supply AC 120 V Power Supply Modules AC 230 V Power Supply Modules
Separation Modules
145
146
I/O Modules
2 Channel Digital Input Modules 750-400, -401, -405, -406, -410, -411, -412, -427, -438, (and all variations), 753-400, -401, -405, -406, -410, -411, -412, -427
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Data bit DI 2 Channel 2 Bit 0 Data bit DI 1 Channel 1
2 Channel Digital Input Modules with Diagnostics 750-419, -421, -424, -425, 753-421, -424, -425
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Diagnostic bit S 2 Channel 2 Bit 2 Diagnostic bit S 1 Channel 1 Bit 1 Data bit DI 2 Channel 2 Bit 0 Data bit DI 1 Channel 1
2 Channel Digital Input Module with Diagnostics and Output Process Data 750-418, 753-418 The 750-418, 753-418 digital input module supplies a diagnostic and acknowledge bit for each input channel. If a fault condition occurs, the diagnostic bit is set. After the fault condition is cleared, an acknowledge bit must be set to re-activate the input. The diagnostic data and input data bit is mapped in the Input Process Image, while the acknowledge bit is in the Output Process Image.
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Diagnostic bit S 2 Channel 2 Bit 2 Diagnostic bit S 1 Channel 1 Bit 1 Data bit DI 2 Channel 2 Bit 0 Data bit DI 1 Channel 1
Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Acknowledge Acknowledg ment bit ement bit Q2 Q1 Channel 2 Channel 1 Bit 1 0 Bit 0 0
147
750-402, -403, -408, -409, -414, -415, -422, -423, -428, -432, -433, 753-402, -403, -408, -409, -415, -422, -423, -428, -432, -433, -440
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Data bit DI 4 Channel 4 Bit 2 Data bit DI 3 Channel 3 Bit 1 Data bit DI 2 Channel 2 Bit 0 Data bit DI 1 Channel 1
8 Channel Digital Input Modules 750-430, -431, -436, -437, 753-430, -431, -434
Input Process Image Bit 7 Data bit DI 8 Channel 8 Bit 6 Data bit DI 7 Channel 7 Bit 5 Data bit DI 6 Channel 6 Bit 4 Data bit DI 5 Channel 5 Bit 3 Data bit DI 4 Channel 4 Bit 2 Data bit DI 3 Channel 3 Bit 1 Data bit DI 2 Channel 2 Bit 0 Data bit DI 1 Channel 1
Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 not used Bit 0 controls DO 1 Channel 1
2 Channel Digital Output Modules 750-501, -502, -509, -512, -513, -514, -517, -535, (and all variations), 753-501, -502, -509, -512, -513, -514, -517
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
148
I/O Modules
Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 controls DO 2 Channel 2 Bit 0 controls DO 1 Channel 1
2 Channel Digital Input Modules with Diagnostics and Input Process Data 750-507 (-508), -522, 753-507 The 750-507 (-508), -522 and 753-507 digital output modules have a diagnostic bit for each output channel. When an output fault condition occurs (i.e., overload, short circuit, or broken wire), a diagnostic bit is set. The diagnostic data is mapped into the Input Process Image, while the output control bits are in the Output Process Image.
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Diagnostic bit S 2 Channel 2 Bit 0 Diagnostic bit S 1 Channel 1
Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 controls DO 2 Channel 2 Bit 0 controls DO 1 Channel 1
750-506, 753-506 The 750-506, 753-506 digital output module has 2-bits of diagnostic information for each output channel. The 2-bit diagnostic information can then be decoded to determine the exact fault condition of the module (i.e., overload, a short circuit, or a broken wire). The 4-bits of diagnostic data are mapped into the Input Process Image, while the output control bits are in the Output Process Image.
149
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Diagnostic bit S 3 Channel 2 Bit 2 Diagnostic bit S 2 Channel 2 Bit 1 Diagnostic bit S 1 Channel 1 Bit 0 Diagnostic bit S 0 Channel 1
Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 not used Bit 2 not used Bit 1 controls DO 2 Channel 2 Bit 0 controls DO 1 Channel 1
4 Channel Digital Output Modules 750-504, -516, -519, -531, 753-504, -516, -531, -540
Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 controls DO 4 Channel 4 Bit 2 controls DO 3 Channel 3 Bit 1 controls DO 2 Channel 2 Bit 0 controls DO 1 Channel 1
4 Channel Digital Output Modules with Diagnostics and Input Process Data 750-532 The 750-532 digital output modules have a diagnostic bit for each output channel. When an output fault condition occurs (i.e., overload, short circuit, or broken wire), a diagnostic bit is set. The diagnostic data is mapped into the Input Process Image, while the output control bits are in the Output Process Image.
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Diagnost Diagnost Diagnost Diagnosti ic bit S 3 ic bit S 2 ic bit S 1 c bit S 0 Channel Channel Channel Channel 4 3 2 1
150
I/O Modules
Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 controls DO 4 Channel 4 Bit 2 controls DO 3 Channel 3 Bit 1 controls DO 2 Channel 2 Bit 0 controls DO 1 Channel 1
8 Channel Digital Output Modules with Diagnostics and Input Process Data 750-537 The 750-537 digital output modules have a diagnostic bit for each output channel. When an output fault condition occurs (i.e., overload, short circuit, or broken wire), a diagnostic bit is set. The diagnostic data is mapped into the Input Process Image, while the output control bits are in the Output Process Image.
Input Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Diagnost Diagnost Diagnost Diagnost Diagnost Diagnost Diagnost Diagnosti ic bit S 7 ic bit S 6 ic bit S 5 ic bit S 4 ic bit S 3 ic bit S 2 ic bit S 1 c bit S 0 Channel Channel Channel Channel Channel Channel Channel Channel 8 7 6 5 4 3 2 1 Diagnostic bit S = '0' Diagnostic bit S = '1' Bit 7 controls DO 8 Channel 8 Bit 6 controls DO 7 Channel 7 no Error overload, short circuit, or broken wire Output Process Image Bit 5 controls DO 6 Channel 6 Bit 4 controls DO 5 Channel 5 Bit 3 controls DO 4 Channel 4 Bit 2 controls DO 3 Channel 3 Bit 1 controls DO 2 Channel 2 Bit 0 controls DO 1 Channel 1
151
2 Channel Analog Input Modules 750-452, -454, -456, -461, -462, -465, -466, -467, -469, -472, -474, -475, -476, -477, -478, -479, -480, -481, -483, -485, -492, (and all variations), 753-452, -454, -456, -461, -465, -466, -467, -469, -472, -474, -475, -476, 477, -478, -479, -483, -492, (and all variations)
Input Process Image Offset 0 1 Byte Destination High Byte D1 D3 Low Byte D0 D2 Remark Measured Value Channel 1 Measured Value Channel 2
152
I/O Modules
4 Channel Analog Input Modules 750-453, -455, -457, -459, -460, -468, (and all variations), 753-453, -455, -457, -459
Input Process Image Offset 0 1 2 3 Byte Destination High Byte D1 D3 D5 D7 Low Byte D0 D2 D4 D6 Remark Measured Value Channel 1 Measured Value Channel 2 Measured Value Channel 3 Measured Value Channel 4
153
4 Channel Analog Output Modules 750-553, -555, -557, -559, 753-553, -555, -557, -559
Output Process Image Offset 0 1 2 3 Byte Destination High Byte D1 D3 D5 D7 Low Byte D0 D2 D4 D6 Remark Output Value Channel 1 Output Value Channel 2 Output Value Channel 3 Output Value Channel 4
Counter Modules 750-404, (and all variations except of /000-005), 753-404, (and variation /000-003) The above Counter Modules have a total of 5 bytes of user data in both the Input and Output Process Image (4 bytes of counter data and 1 byte of control/status). The counter value is supplied as 32 bits. The following tables illustrate the Input and Output Process Image, which has a total of 3 words mapped into each image. Word alignment is applied.
154
I/O Modules
Input Process Image Offset 0 1 2 Byte Destination High Byte D1 D3 Low Byte S D0 D2 Remark Status byte Counter Value
Output Process Image Offset 0 1 2 Byte Destination High Byte D1 D3 Low Byte C D0 D2 Remark Control byte Counter Setting Value
750-404/000-005 The above Counter Modules have a total of 5 bytes of user data in both the Input and Output Process Image (4 bytes of counter data and 1 byte of control/status). The two counter values are supplied as 16 bits. The following tables illustrate the Input and Output Process Image, which has a total of 3 words mapped into each image. Word alignment is applied.
Input Process Image Offset 0 1 2 Byte Destination High Byte D1 D3 Low Byte S D0 D2 Remark Status byte Counter Value of Counter 1 Counter Value of Counter 2
Output Process Image Offset 0 1 2 Byte Destination High Byte D1 D3 Low Byte C D0 D2 Remark Control byte Counter Setting Value of Counter 1 Counter Setting Value of Counter 2
750-638, 753-638
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
155
The above Counter Modules have a total of 6 bytes of user data in both the Input and Output Process Image (4 bytes of counter data and 2 bytes of control/status). The two counter values are supplied as 16 bits. The following tables illustrate the Input and Output Process Image, which has a total of 4 words mapped into each image. Word alignment is applied.
Input Process Image Offset 0 1 2 3 Byte Destination High Byte D1 D3 Low Byte S0 D0 S1 D2 Remark Status byte of Counter 1 Counter Value of Counter 1 Status byte of Counter 2 Counter Value of Counter 2
Output Process Image Offset 0 1 2 3 Byte Destination High Byte D1 D3 Low Byte C0 D0 C1 D2 Remark Control byte of Counter 1 Counter Setting Value of Counter 1 Control byte of Counter 2 Counter Setting Value of Counter 2
Pulse Width Modules 750-511, (and all variations) The above Pulse Width modules have a total of 6 bytes of user data in both the Input and Output Process Image (4 bytes of channel data and 2 bytes of control/status). The two channel values are supplied as 16 bits. Each channel has its own control/status byte. The following table illustrates the Input and Output Process Image, which has a total of 4 words mapped into each image. Word alignment is applied.
156
I/O Modules
Input and Output Process Image Offset 0 1 2 3 Byte Destination High Byte D1 D3 Low Byte C0/S0 D0 C1/S1 D2 Remark Control/Status byte of Channel 1 Data Value of Channel 1 Control/Status byte of Channel 2 Data Value of Channel 2
Serial Interface Modules with alternative Data Format 750-650, (and the variations /000-002, -004, -006, -009, -010, -011, -012, -013) 750-651, (and the variations /000-002, -003) 750-653, (and the variations /000-002, -007) Note: With the freely parametrizable variations /003 000 of the serial interface modules, the desired operation mode can be set. Dependent on it, the process image of these modules is then the same, as from the appropriate variation. The above Serial Interface Modules with alternative data format have a total of 4 bytes of user data in both the Input and Output Process Image (3 bytes of serial data and 1 byte of control/status). The following table illustrates the Input and Output Process Image, which have a total of 2 words mapped into each image. Word alignment is applied.
Input and Output Process Image Offset 0 1 Byte Destination High Byte D0 D2 Low Byte C/S D1 Data byte Remark Control/Status byte Data bytes
157
Serial Interface Modules with Standard Data Format 750-650/000-001, -014, -015, -016 750-651/000-001 750-653/000-001, -006 The above Serial Interface Modules with Standard Data Format have a total of 6 bytes of user data in both the Input and Output Process Image (5 bytes of serial data and 1 byte of control/status). The following table illustrates the Input and Output Process Image, which have a total of 3 words mapped into each image. Word alignment is applied.
Input and Output Process Image Offset 0 1 2 Byte Destination High Byte D0 D2 D4 Low Byte C/S D1 D3 Data byte Remark Control/Status byte Data bytes
Data Exchange Module 750-654, (and the variation /000-001) The Data Exchange modules have a total of 4 bytes of user data in both the Input and Output Process Image. The following tables illustrate the Input and Output Process Image, which has a total of 2 words mapped into each image. Word alignment is applied.
Input and Output Process Image Offset 0 1 Byte Destination High Byte D1 D3 Low Byte D0 D2 Remark
Data bytes
158
I/O Modules
SSI Transmitter Interface Modules 750-630, (and all variations) The above SSI Transmitter Interface modules have a total of 4 bytes of user data in the Input Process Image, which has 2 words mapped into the image. Word alignment is applied.
Input Process Image Offset 0 1 Byte Destination High Byte D1 D3 Low Byte D0 D2 Remark
Data bytes
Incremental Encoder Interface Modules 750-631 The above Incremental Encoder Interface modules have 5 bytes of input data and 3 bytes of output data. The following tables illustrate the Input and Output Process Image, which have 4 words into each image. Word alignment is applied.
Input Process Image Offset 0 1 2 3 Byte Destination High Byte D1 D4 Low Byte S D0 D3 not used Remark Status byte
Output Process Image Offset 0 1 2 3 Byte Destination High Byte D1 Low Byte C D0 not used Remark Control byte
159
750-634 The above Incremental Encoder Interface module has 5 bytes of input data (6 bytes in cycle duration measurement mode) and 3 bytes of output data. The following tables illustrate the Input and Output Process Image, which has 4 words mapped into each image. Word alignment is applied.
Input Process Image Offset 0 1 2 3
)
* If cycle duration measurement mode is enabled in the control byte, the cycle duration is given as a 24-bit value that is stored in D2 together with D3/D4.
Output Process Image Offset 0 1 2 3 Byte Destination High Byte D1 Low Byte C D0 not used Remark Control byte
750-637 The above Incremental Encoder Interface Module has a total of 6 bytes of user data in both the Input and Output Process Image (4 bytes of encoder data and 2 bytes of control/status). The following table illustrates the Input and Output Process Image, which have 4 words mapped into each image. Word alignment is applied.
Input and Output Process Image Offset 0 1 2 3 Byte Destination High Byte D1 D3 Low Byte C0/S0 D0 C1/S1 D2 Remark Control/Status byte of Channel 1 Data Value of Channel 1 Control/Status byte of Channel 2 Data Value of Channel 2
160
I/O Modules
750-635, 753-635 The above Digital Pulse Interface module has a total of 4 bytes of user data in both the Input and Output Process Image (3 bytes of module data and 1 byte of control/status). The following table illustrates the Input and Output Process Image, which have 2 words mapped into each image. Word alignment is applied.
Input and Output Process Image Offset 0 1 Byte Destination High Byte D0 D2 Low Byte C0/S0 D1 Data byte Remark Control/Status byte Data bytes
RTC Module 750-640 The RTC Module module has a total of 6 bytes of user data in both the Input and Output Process Image (4 bytes of module data and 1 byte of control/status and 1 byte ID for command). The following table illustrates the Input and Output Process Image, which have 3 words mapped into each image. Word alignment is applied.
Input and Output Process Image Offset 0 1 2 Byte Destination High Byte ID D1 D3 Low Byte C/S D0 D2 Remark Command byte Control/Status byte
Data bytes
DALI/DSI Master Module 750-641 The DALI/DSI Master module has a total of 6 bytes of user data in both the Input and Output Process Image (5 bytes of module data and 1 byte of control/status). The following tables illustrate the Input and Output Process Image, which have 3 words mapped into each image. Word alignment is applied.
161
Input Process Image Offset 0 1 3 Byte Destination High Byte D0 D2 D4 Low Byte S D1 D3 Remark DALI Response Message 3 Message 1 Status byte DALI Address Message 2
Output Process Image Offset 0 1 3 Byte Destination High Byte D0 D2 D4 Low Byte C D1 D3 Remark DALI command, DSI dimming value Parameter 2 CommandExtension Control byte DALI Address Parameter 1
EnOcean Radio Receiver 750-642 The EnOcean radio receiver has a total of 4 bytes of user data in both the Input and Output Process Image (3 bytes of module data and 1 byte of control/status). The following tables illustrate the Input and Output Process Image, which have 2 words mapped into each image. Word alignment is applied.
Input Process Image Offset 0 1 Byte Destination High Byte D0 D2 Low Byte S D1 Remark Data byte Status byte Data bytes
Output Process Image Offset 0 1 Byte Destination High Byte Low Byte C not used not used Remark Control byte
162
I/O Modules
MP Bus Master Module 750-643 The MP Bus Master Module has a total of 8 bytes of user data in both the Input and Output Process Image (6 bytes of module data and 2 bytes of control/status). The following table illustrates the Input and Output Process Image, which have 4 words mapped into each image. Word alignment is applied.
Input and Output Process Image Offset 0 1 2 3 Byte Destination High Byte C1/S1 D1 D3 D5 Low Byte C0/S0 D0 D2 D4 Data bytes Remark extended Control/Status byte Control/Status byte
163
Vibration Velocity/Bearing Condition Monitoring VIB I/O 750-645 The Vibration Velocity/Bearing Condition Monitoring VIB I/O has a total of 12 bytes of user data in both the Input and Output Process Image (8 bytes of module data and 4 bytes of control/status). The following table illustrates the Input and Output Process Image, which have 8 words mapped into each image. Word alignment is applied.
Input and Output Process Image byte Destination Remark High Byte Low Byte Control/Status byte C0/S0 Not used (log. Channel 1, Sensor input 1) Data bytes D1 D0 (log. Channel 1, Sensor input 1) Control/Status byte C1/S1 Not used (log. Channel 2 Sensor input 2) Data bytes D3 D2 (log. Channel 2 Sensor input 2) Control/Status byte C2/S2 Not used (log. Channel 3 Sensor input 1) Data bytes D5 D4 (log. Channel 3 Sensor input 1) Control/Status byte C3/S3 Not used (log. Channel 4 Sensor input 2) Data bytes D7 D6 (log. Channel 4 Sensor input 2)
Offset 0 1 2 3 4 5 6 7
164
I/O Modules
AS-interface Master Module 750-655 The length of the process image of the AS-interface master module can be set to fixed sizes of 12, 20, 24, 32, 40 or 48 bytes. It consists of a control or status byte, a mailbox with a size of 0, 6, 10, 12 or 18 bytes and the AS-interface process data, which can range from 0 to 32 bytes. The AS-interface master module has a total of 6 to maximally 24 words data in both the Input and Output Process Image. Word alignment is applied. The first Input and output word, which is assigned to an AS-interface master module, contains the status / control byte and one empty byte. Subsequently the mailbox data are mapped, when the mailbox is permanently superimposed (Mode 1). In the operating mode with suppressable mailbox (Mode 2), the mailbox and the cyclical process data are mapped next. The following words contain the remaining process data.
Input and Output Process Image Offset 0 1 2 3 ... max. 23 Byte Destination High Byte D1 D3 D5 ... D45 Low Byte C0/S0 D0 D2 D4 ... D44 Mailbox (0, 3, 5, 6 or 9 words) / Process data (0-16 words) not used Remark Control/Status byte
165
Binary Space Module 750-622 The Binary Space Modules 750-622 behave alternatively like 2 channel digital input modules or output modules and seize depending upon the selected settings 1, 2, 3 or 4 bits per channel. According to this, 2, 4, 6 or 8 bits are occupied then either in the process input or the process output image.
Input or Output Process Image Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 (Data bit (Data bit (Data bit (Data bit (Data bit (Data bit DI 8) DI 7) DI 6) DI 5) DI 4) DI 3) Bit 1 Data bit DI 2 Bit 0 Data bit DI 1
166
8 Application Examples
The example programs in this manual serve to demonstrate how the Linux fieldbus coupler hardware can be accessed, all the programs have been installed on the coupler and are ready to run. They can be called directly from the console using the appropriate call parameters. "$ leds Describes how to access the LEDs of the Linux coupler "$ kbusdemo Describes how to access the process image "$ mb_tcp Describes a more complex program which allows to access the internal bus via a Modbus TCP protocol. "$ CGI application Describes the use of the CGI interface of the BOA web server for the transmission of dynamic web content Note The example programs are a basis for developing your own applications. In order to keep it clear and simple, we left out error handling for the most part, however, it should be implemented to use the code.
167
Function description Using this example program, you can access the freely programmable LEDs: STATUS, SERVICE and USR.
01 02
C D
A B
+ +
g086002x
Signification Function can be defined by the user. Function can be defined by the user. Function can be defined by the user.
168
The kernel module ledman serves to easily access the free LEDs from a user program. In order to illustrate the driver interface, the Linux coupler incorporates the leds example program that allows to changes to the state of the LEDs via the Linux console. The program is called directly via the console and has the following HELP page:
Usage: ./leds OPTION [LEDNAME] [OPTION] [LEDNAME] ... WAGO LED SERVER. OPTION: -n, --on -o, --off -f, --flash -h, --help LEDNAME: sr sg er eg ur ug a Status LED 1 (red) Status LED 1 (green) Service LED 2 (red) Service LED 2 (green) User LED (red) User LED (green) All LEDs Switch LED on Switch LED off Switch LED to flashing Mode Print this message.
Different OPTIONS/commands can be sent to the LEDs via the example program. The LEDs can be turned on or off or they can blink. Each OPTION requires an LEDNAME in order to define to which LED the OPTION/function is applied.
169
Example:
./leds ./leds ./leds ./leds -n -o -f -n ur ur sg er -f ug
Switches on the red user LED Switches off the red user LED Status LED starts blinking green Switches on the red service LED and the user LED starts blinking green Switches off all three LEDs
./leds
-o
Source code description: leds.h This header file contains definitions that control the access to the ledman driver. The following definitions describe the functions:
#define WAGO_FBK_LED_CMD_SET 0x01/*turn on briefly to show activity*/ #define WAGO_FBK_LED_CMD_ON 0x02 /* turn LED on permanently */ #define WAGO_FBK_LED_CMD_OFF 0x03 /* turn LED off permanently */ #define WAGO_FBK_LED_CMD_FLASH 0x04 /* flash this LED */
Using these definitions, you can assign a function to every LED. Additionally, the following LED names are defined which can be used to access the appropriate LED:
#define WAGO_FBK_LED_DEBUG1_RED #define WAGO_FBK_LED_DEBUG1_GREEN #define WAGO_FBK_LED_DEBUG2_RED #define WAGO_FBK_LED_DEBUG2_GREEN #define WAGO_FBK_LED_USER_RED #define WAGO_FBK_LED_USER_GREEN #define WAGO_FBK_LED_ALL 2 3 4 5 6 7 8
170
For every LED there is one definition for red and one for green. Each of the three LEDs can be regarded as two separate LEDs. If, for example, the user LED is switched to RED (on) and at the same time switched to GREEN (on), it lights orange-green. The combination RED (on) and GREEN-BLINKING is also possible and results in a user LED that blinks rot, orange-green. The header file also contains the ledman_cmd macro which imlements the access to the kernel driver. Every time the driver is called, /dev/ledman is opened, written to and closed again.
Source code description: leds.c The leds.c file contains the main() function. The console entries are analyzed and the ledman_cmd() macro (which is defined in leds.h) with its parameter values is called. The help text for the option "-help" is also defined here.
171
Function description This example program can read the state of the input modules. It is furthermore possible to set or to clear bits of the output modules. The data is addressed via byte addresses. Writing data multiple bytes of data is not possible in this example. However, this feature could be added in the source code with little effort. The dynamic loadable module "kbus.o" is used for the internal bus support. In addtition, kbusapi is used which makes it easier to access the internal bus module. This API (Application Interface) is added to the program during compilation and linking. The API interfaces are also described in this chapter. The dynamic loadable module kbus.o serves to access the connected modules from a user program environment. In order to illustrate the driver interface, the Linux coupler incorporates the kbusdemo example program. This program can read or write the state/data of the internal bus via the Linux console.
172
The program is called directly via the console and has the following HELP page:
Usage: ./kbusdemo OPTION [ADDRESS] [OPTION] [ADDRESS] ... WAGO KBUS DEMO. OPTION: -r, --read -n, --on -o, --off -h, --help ADDRESS: xxx.x Startaddress (Byte.Bit) from Output/Input Read Inputbyte [ADDRESS=xxx] Switch on Outputbit [ADDRESS=xxx.x] Switch off Outputbit [ADDRESS=xxx.x] Print this message.
Via the OPTIONS of this example program it is possible to select whether to read or to write data. The ADDRESS field determines the corresponding address. The addresses follow the process image. The /proc/driver/kbus/pab file of the internal bus driver shows the configuration of the process image: Example: cat /proc/driver/kbus/pab
Slot 8 9 Terminal 750-553/000-000 750-559/000-000 Output: Byte.Bit Offset 0.0 6.0 Input: Byte.Bit Offset x.x x.x
-------------------------------------------------------------1 2 3 4 5 6 7 750-4xx 750-4xx 750-4xx 750-4xx 750-4xx 750-4xx 750-4xx x.x x.x x.x x.x x.x x.x x.x 0.0 0.4 0.6 1.0 1.2 1.4 1.6
-------------------------------------------------------------PAB In: PAB Out: 00ffe060 00ffe858 PAB Size: 2040 bytes PAB Size: 2040 bytes
173
Every OPTION of the kbusdemo requires an address since every kbusdemo action, which is specified by the OPTION, is linked to a certain address in the process image. Example:
./kbusdemo -n 0.0
The bit for the output address 0.0 in the process image is set to TRUE
./kbusdemo -o 1.7
The bit for the output address 1.7 in the process image is set to FALSE
./kbusdemo -r 0
Reads the data at input byte 0 Output: IN[0]: 0b10100000 || IN[0]: 0xa0 The first byte has the following format: IN[Byte] binary - || IN[Byte] hexadecimal output
174
Source code description: kbusdemo.h This header file contains process image access definitions. For performance reasons, the process image has a RAM address that cannot be accessed by the kernel. Definitions of these addresses are contained in the header file in order to access the process image.
Source code description: kbusdemo.c The kbusdemo.c file contains the main() function. The console entries are analyzed and the internal bus read and write commands are executed. Process image pointers, which are initialized by the use of definitions from the kbusdemo.h file, are used to read and write internal bus data. The KBusUpdate() function from the kbusapi.h file is used to update the process image. The console output is generated like the help text in that file.
Source code description: kbusapi.h This header file contains definitions that make it easier to access the kbus.o driver.
Source code description: kbusapi.c The accesses from the kbusapi.h file are coded in the kbusapi.c file.
175
Function description This example program allows to read the state of the input modules and to set outputs via Ethernet. The data can be accessed byte by byte or bit by bit. The following Modbus TCP function codes are available:
Function code hex
FC1: FC2: FC3 FC4: FC5: FC6: 0x01 0x02 0x03 0x04 0x05 0x06 Read Coils Read Input Read Multiple Registers Read InputRegisters Write Coil Write SingleRegister Reading one single bit Discrete reading of several input bits Reading several input registers Reading several input registers Writing a single output bit Writing a single output register
Function name
Function description
176
End address
0x01FF 0x03FF
Description
Inputs of the process image Outputs of the process image
End address
0x01FF 0x03FF
Description
Outputs of the process image Outputs of the process image
The dynamic loadable module "kbus.o" is used for the internal bus support. In addtition, kbusapi is used which makes it easier to access the internal bus module. This API (Application Interface) is added to the program during compilation and linking. The API interfaces are also described in this chapter. The dynamic loadable module kbus.o serves to access the connected modules from a user program environment. In order to illustrate the driver interface, the Linux coupler incorporates the kbusdemo example program. This program can read or write the state/data of the internal bus via the Linux console.
Source code description A more detailed description of the source code is not given now. The Modbus TCP server is only supposed to illustrate a more complex application on the Linux fieldbus coupler. Furthermore, the program is used to conduct a functional test of the Linux coupler and is hence installed on every coupler. The customer can change or extend the source code arbitrarily.
177
Function description This example program implements the web-based management (WBM) of the Linux fieldbus coupler. The web server BOA uses the CGI files/programs. The HTML pages come directly from the web server.
The CGI file web can be called via different symbolic links. The name of the link is analyzed in the file and has a direct effect on the HTML output. The links described above are essential in order to execute the functions. This type of CGI call administration is ideal if you only want to need little memory in the file system for the files to be called. It is furthermore possible to exchange the entire functionality of the CGI calls by only replacing one file (see also chapter 4.5.5).
178
In the source code files, the web.c file only serves to connect code files. The actual functionality is in the file that has the same name as its symbolic call. The func.c file contains general functions.
Source code description: *.html The above-mentioned HTML pages contain the general web page layout of the WAGO internet pages. The Index.html file divides the web page into three sections: one part for the headline, one part for the left selection menu and one for the dynamic part in the middle. The headline of the page is stored in the upperframe.html file, the menu is stored in the menuframe.html file. In order to load the status page, the Index.html file executes the CGI call as dynamic part.
Source code description: web.c The name of the symbolic call is analyzed in the web.c file and the appropriate function is called.
Source code description: info.c The status page of the Linux fieldbus coupler is generated in the info.c file. The file includes four functions: "$ read_envvar() "$ read_BKTable() "$ read_IP() "$ main_info() The static HTML code is stored in the string pucHtmlEthernet[], the dynamic values "%s" being replaced by variable values directly in the printf command. The function read_envvar() reads values from the highest flash memory sector, which, in this file, is the MAC address. The function read_BKTable() reads firmware loader (FWL) or u-boot values from the table of the Linux fieldbus coupler. In this example, these are device description, item number, firmware version and serial number.
179
The function read_IP() reads the IP address that is currently used from the Ethernet device eth0. It is irrelevant whether the address was assigned dynamically, for example via DHPC, or if it is a fixed IP address.
main_info() calls the above-mentioned functions and writes the HTML code
Source code description: ether.c The TCP/IP configuration page of the Linux fieldbus coupler is generated in the ether.c file. The file includes five functions: "$ read_envvar() "$ write_envvar() "$ read_file() "$ write_file() "$ main_ether() The static HTML code is stored in the string pucHtmlEthernet[], the dynamic values "%s" being replaced by a variable value directly in the printf command. The function read_envvar() reads values from the highest flash memory sector. If a fixed IP address is used, these are the IP address, the subnet mask, the gateway and the host name. If the IP address is assigned dynamically via DHCP or BootP it is only the host name. The other values are set to default values. The function write_envvar() writes values into the highest flash memory sector. If a fixed IP address is used, these are the IP address, the subnet mask, the gateway and the host name. In case of a dynamic IP address assignment via DHCP or BootP only the host name is saved. The other parameters keep their old values. All parameters are entered as a string into the environment variable ipmode which belongs to the start parameters of the Linux kernel. These environment variables are in the highest flash memory sector and are read by the boot loader (U-Boot).
read_file() reads the IP addresses of the name servers from the
/etc/resolv.conf file. The function write_file() writes the IP addresses of the name servers into the /etc/resolv.conf file.
180
The function main_ether() calls the above-mentioned functions and writes the HTML code to the standard console stdout. HTML shows the network configuration in a form. The form has the SUBMIT button SAVE CONFIGURATION which transfers a changed network configuration to the Linux fieldbus coupler in a QUERY_STRING. You have to enter a user with root privileges and the corresponding password. These entries are authenticated in the crypt.c file. After successful authentication, the SAVE CONFIGURATION query string is analyzed and, if a value is changed, the appropriate write_...- function is called.
Source code description: restart.c The restart page of the Linux fieldbus coupler is generated in the restart.c file. The file includes the function
main_restart() main_restart() writes the HTML code to the standard console stdout.
Furthermore, the query string including the password is analyzed. After entering a user with root privileges and the corresponding password (default:user name: root, password: wago) and clicking the REBOOT button, reboot will be called which will reboot the operating system.
181
Source code description: kernelmsg.c The kernelmsg.c file displays the kernel messages on the screen. The file inludes the function
main_kernelmsg() main_kernelmsg() reads the kernel message ring buffer and displays the data
on the screen.
Source code description: eeprom.c The eeprom.c file displays the EEPROM messages on the screen. The file inludes the function main_eeprom().
main_eeprom() reads the /dev/eeprom device file and displays the data on the
screen in a table.
Source code description: config.c The config.c file displays the IO modules (sorted by type) that are connected to the Linux fieldbus coupler on the screen. The file inludes the functions: "$ "$ "$ "$ "$ "$ "$
printStandard() printAnalogOutput() printAnalogInput() printDigitalOutput() printDigitalInput() printSpecial() main_config()
The printStandard() function outputs the standard parameters of an IO module (type, slot number etc.). The printAnalogOutput() or Input() function displays the special parameters of the individual analog modules separately in pop-up tables.
182
The printDigitalOutput() or ...Input() function displays the special parameters of the individual digital modules separately in pop-up tables. The printSpecial() function displays the special parameters of the individual complex modules (specialty modules) separately in pop-up tables. The main_config() function initializes that part of the pop-up table which needs to be opened. For that purpose, the submit buttons are analyzed.
183
184
"$ int close(int fd); This function closes the open file which is a reference to the file descriptor. fd: File descriptor returned by the open function. "$ off_t lseek(int fd, off_t offset, int mode); This function sets the position pointer to any byte within the file and returns the current position in the file. fd: File descriptor returned by the open function. offset: Position within the file from which the bytes are read and written. mode: SEEK_SET: Within the file, both read/write operations start from the offset value (in bytes). SEEK_CUR: Within the file, both read/write operations start from the current position + offset value. SEEK_END: Within the file, both read/write operations start from the last byte + offset value (here the offset is usually "0" or negative value).
185
Example Program
#include <fcntl.h> #include <stdio.h> int main() { int i; int file; ssize_t sstmp; char buf[2048]; /*Open Device*/ if((file = open(/dev/nvram)) < 0) { printf(ERROR: Cant open device (\/dev/nvram\)\n); close(file); exit(1); } /*Read Device*/ sstmp = read(file, buf, 8); printf(read %d bytes\n, sstmp); if(sstmp != 8) { printf(ERROR: Reading NVRAM failed\n); } else { printf(read(%x %x %x %x %x %x %x %x)\n, buf[0] , buf[1] , buf[2] , buf[3] , buf[4] , buf[5] , buf[6] , buf[7]); } /*Trivial change of values*/ for(i=0;i<8;i++) buf[i] += 1; /*Write into Device*/ if(-1 == lseek(file, 0, SEEK_SET)) printf(ERROR: lseek failed\n); sstmp = write(file, buf, 8); printf(Write (%d) bytes\n, sstmp); if(sstmp != 8) printf(ERROR: Writing into Device failed\n); /*close device*/ close(file); }
186
9 Bootloader (U-Boot)
U-Boot and the Linux kernel boot up process are controlled via environment variables within the boot loader that are stored in the last sector of the flash memory. These variables are verified by a CRC32 checksum. The environment variables can be changed via the boot loader, the web server or through an example application in Linux. To use the boot loader, you have to enter a password during start-up of the Linux fieldbus coupler which will then give access to the configuration interface (see chapter 5.10.2). The environment variable can now be displayed using
LFBK # printenv
or be changed:
LFBK # setenv <variablenname> <variablenwert>
There is no equal sign between variable name and variable value. All changes that are made are not permanent and are lost when the Linux fieldbus coupler is rebooted. Use the saveenv call, in order to get permanent changes in the flash memory.
LFBK # saveenv Saving Environment to Flash... LFBK #
187
Password
> mkdir /tftpboot > chmod 777 /tftpboot
You have to install inetd and atftp via yast2 (S.U.S.E) before you can install a TFTP server on the development PC. After the installation, make the following entry in the /etc/inetd.conf: <host-ip>:tftp dgram udp wait root /usr/sbin/in.tftpd -s /tftpboot inetd starts automatically after a reboot or it can be started manually:
> /etc/init.d/inetd start
or restarted with
> /etc/init.d/inetd stop > /etc/init.d/inetd start
188
A directory called ~/uboot is created in the user's home directory, in which all files that are required for the boot loader compilation are stored.
Create Flash Images Images of the kernel and of the file system can be created during the compilation of the Linux distribution (see chapter 5.3). A boot loader image is created during the compilation of the boot loader U-Boot. The files are automatically copied into the /tftpboot directory which has to be created beforehand. See chapter 9.2.
189
An environment variable can contain values, further environment variables or U-Boot commands. In the latter case, the environment variable works similar to a macro which processes the commands one after the other. The relevant environment variables for the Linux fieldbus coupler boot process are: "$ ipmode Defines the type of IP configuration. Possible values are bootp, dhcp, a static IP in the format xxx.xxx.xxx.xxx or a completely static configuration in the format <FBK-IP>:<ServerIP>:<GW-IP>:<Netmask>:<Hostname>:<Device>
10.1.1.8:10.1.2:1:10.1.1.254:255.255.255.0:lfbk:eth0
"$ bootargs Contains further parameters for the kernel, for example the root file system (root=/dev/mtdblock3) "$ bootcmd Contains a macro that creates a kernel command line from ipmode and bootargs and starts the kernel. This macro is called automatically 3 seconds after starting the Linux fieldbus coupler (stored in the bootdelay variable). "$ bootA/bootB Macros that, depending on the selector switch position of the Linux fieldbus coupler, are copied to bootcmd when U-Boot is started. "$ bootdelay The time the system waits for the abort password to arrrive "$ ethaddr MAC address of the Linux fieldbus coupler
190
The following environment variables are available for a software update: "$ ipaddr IP address of the Linux fieldbus coupler "$ ethaddr MAC address of the Linux fieldbus coupler "$ serverip IP address of the TFTP server "$ netmask Netmask of the network "$ update-rootfs Macro for a root file system update "$ update-kernel Macro for a Linux kernel update Note Please refer to chapter 9.2 for details on a TFTP server setup (required for a software update)..
The following environment variables can be used to determine the standard interfaces: "$ stdin Standard input interface "$ stdout Standard output interface "$ sterr Standard error output interface "$ baudrate Baud rate of the serial interface An update of the environment variables via the Linux operating system is executed via the device interface /dev/mtdblock5. The wagoset example program was developed for this purpose.
191
10 Fieldbus Communication
10.1 ETHERNET
10.1.1 General
ETHERNET is a technology, which has been proven and established as an effective means of data transmission in the field of information technology and office communication. Within a short time ETHERNET has also made a successful breakthrough in the area of private PC networks throughout the world. This technology was developed in 1972 by Dr. Robert M. Metcalfe, David R. Boggs, Charles Thacker, Butler W. Lampson, and Xerox (Stanford, Ct.). Standardization (IEEE 802.3) took place in 1983. ETHERNET predominantly uses coaxial cables or twisted pair cables as a transmission medium. Connection to ETHERNET, often already existing in networks, (LAN, Internet) is easy and the data exchange at a transmission rate of 10 Mbps or for some couplers/controllers also 100 Mbps is very fast. ETHERNET has been equipped with higher level communication software in addition to standard IEEE 802.3, such as TCP/IP (Transmission Control Protocol / Internet Protocol) to allow communication between different systems. The TCP/IP protocol stack offers a high degree of reliability for the transmission of information. In the ETHERNET based (programmable) fieldbus couplers and controllers developed by WAGO, usually various application protocols have been implemented on the basis of the TCP/IP stack. These protocols allow the user to create applications (master applications) with standardized interfaces and transmit process data via an ETHERNET interface. In addition to a series of management and diagnostic protocols, fieldbus specific application protocols are implemented for control of the module data, depending upon the coupler or controller, e. g. MODBUS TCP (UDP), EtherNet/IP, BACnet, KNXNET/IP, PROFINET, Powerlink, Sercos III or others. Information such as the fieldbus node architecture, network statistics and diagnostic information is stored in the ETHERNET (programmable) fieldbus couplers and controllers and can be viewed as HTML pages via a web browser (e.g., Microsoft Internet-Explorer, Netscape Navigator) being served from the HTTP server in the couplers and controllers. Furthermore, depending on the requirements of the respective industrial application, various settings such as selection of protocols, TCP/IP, internal clock and security configurations can be performed via the web-based management system. However, you can also load web pages you have created yourself into the couplers/controllers, which have an internal file system, using FTP.
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
192
The WAGO ETHERNET TCP/IP fieldbus node does not require any additional master components other than a PC with a network card. So, the fieldbus node can be easily connected to local or global networks using the fieldbus connection. Other networking components such as hubs, switches or repeaters can also be used. However, to establish the greatest amount of determinism a switch is recommended. The use of ETHERNET as a fieldbus allows continuous data transmission between the plant floor and the office. Connection of the ETHERNET TCP/IP fieldbus node to the Internet even enables industrial processing data for all types of applications to be called up world-wide. This makes site independent monitoring, visualization, remote maintenance and control of processes possible.
Fig. 10-1. Connection Example and Principle of a Fieldbus Node for a Network Architecture
1Netwerkknotene
Fieldbus communication between master application and (programmable) fieldbus coupler or controller takes place using the implemented fieldbus specific application protocol, e. g. MODBUS TCP (UDP), EtherNet/IP, BACnet, KNXNET/IP, PROFINET, Powerlink, Sercos III or others.
193
10.1.2.1
Transmission Media General ETHERNET transmission standards For transmitting data the ETHERNET standard supports numerous technologies with various parameters (e.g., transmission speed, medium, segment length and type of transmission).
1Base5 10Base2 Uses a 24 AWG UTP (twisted pair cable) for a 1Mbps baseband signal for distances up to 500 m (250 m per segment) in a physical star topology. Uses a 5 mm 50 Ohm coaxial cable for a 10Mbps baseband signal for distances of up to 185 m in a physical bus topology (often referred to as Thin ETHERNET or ThinNet). Uses a 10 mm 50 Ohm coaxial cable for a 10Mbps baseband signal for distances of up to 500 m in a physical bus topology (often referred to as Thick ETHERNET). Uses a fiber-optic cable for a 10Mbps baseband signal for distances of up to 4 km in a physical star topology. (There are three sub-specifications: 10Base-FL for fiber-optic link, 10Base-FB for fiber-optic backbone and 10Base-FP for fiber-optic passive). Uses a 24 AWG UTP or STP/UTP (twisted pair cable) for a 10Mbps baseband signal for distances up to 100 m in a physical star topology. Uses a 75 Ohm coaxial cable for a 10Mbps baseband signal for distances of up to 1800 m (or 3600 m with double cables) in a physical bus topology.
10Base5
10Base-F
10Base-T 10Broad36
100BaseTX Specifies a 100 Mbps transmission with a twisted pair cable of Category 5 and RJ45-connectors. A maximum segment of 100 meters may be used. Tab. 10-1: ETHERNET Transmission Standards
Beyond that there are still further transmission standards, for example: 100Base-T4 (Fast ETHERNET over twisted conductors), 100Base-FX (Fast ETHERNET over fiber-optic cables) or P802.11 (Wireless LAN) for a wireless transmission. The media types are shown with their IEEE shorthand identifiers. The IEEE identifiers include three pieces of information. The first item, for example, 10, stands for the media. The third part of the identifier provides a rough indication of segment type or length. For thick coaxial cable, the 5 indicates a 500 meter maximum length allowed for individual thick coaxial segments. For thin coaxial cable, the 2 is rounded up from the 185 meter maximum length for individual thin coaxial segments. The T and F stand for twisted pair and fiber optic, and simply indicate the cable type.
194
10Base-T, 100BaseTX Either the 10BaseT standard or 100BaseTX can be used for the WAGO ETHERNET fieldbus node. The network architecture is very easy and inexpensive to assemble with SUTP cable as transmission medium or with cables of STP type. Both types of cable can be obtained from any computer dealer. S-UTP cable (screened unshielded twisted pair) is single-shielded cable of Category 5 with overall shield surrounding all twisted unshielded conductor pairs and an impedance of 100 ohm. STP cable (shielded twisted pair) is cable of Category 5 with stranded and individually shielded conductor pairs; no overall shield is provided. Wiring of the fieldbus nodes Maybe, a crossover cable is required for direct connection of a fieldbus node to the network card of the PC.
g012906d
If several fieldbus nodes are to be connected to a network card, the fieldbus nodes can be connected via an ETHERNET switch or hub with straight through/parallel cables.
g012908d
An ETHERNET switch is a device that allows all connected devices to transmit and receive data with each other. The switch can also be viewed as a data traffic cop where the hub polices the data coming in and going out of the individual ports, so the data will only be transmitted to the required node. WAGO recommends using a switch rather then a hub, this will allow for a more deterministic architecture.
195
Attention The cable length between the node and the hub cannot be longer than 100 m (328 ft.) without adding signal conditioning systems (i.e., repeaters). Various possibilities are described in the ETHERNET standard for networks covering larger distances.
10.1.2.2
Network Topologies In the case of 10Base-T, or 100BaseTX several stations (nodes) are connected using a star topology according to the 10Base-T ETHERNET Standard. Therefore, this manual only deals with the star topology, and the tree topology for larger networks in more detail. Star Topology A star topology consists of a network in which all nodes are connected to a central point via individual cables.
G012903e
A star topology offers the advantage of allowing the extension of an existing network. Stations can be added or removed without network interruption. Moreover, in the event of a defective cable, only the network segment and the node connected to this segment is impaired. This considerably increases the fail-safe of the entire network.
196
Tree Topology The tree topology combines characteristics of linear bus and star topologies. It consists of groups of star-configured workstations connected to a linear bus backbone cable. Tree topologies allow for the expansion of an existing network, and enables schools, etc. to configure a network to meet their needs.
G012904e
197
5-4-3 Rule A consideration in setting up a tree topology using ETHERNET protocol is the 5-4-3 rule. One aspect of the ETHERNET protocol requires that a signal sent out on the network cable must reach every part of the network within a specified length of time. Each concentrator or repeater that a signal goes through adds a small amount of time. This leads to the rule that between any two nodes on the network there can only be a maximum of 5 segments connected through 4 repeators/concentrators. In addition, only 3 of the segments may be populated (trunk) segments if they are made of coaxial cable. A populated segment is one that has one or more nodes attached to it. In Figure 5-5, the 5-4-3 rule is adhered to. The furthest two nodes on the network have 4 segments and 3 repeators/concentrators between them. This rule does not apply to other network protocols or ETHERNET networks where all fiber optic cabling or a combination of a backbone with UTP cabling is used. If there is a combination of fiber optic backbone and UTP cabling, the rule is simply translated to 7-6-5 rule. Cabling guidelines "Structured Cabling" specifies general guidelines for network architecture of a LAN, establishing maximum cable lengths for the grounds area, building and floor cabling. The "Structured Cabling" is standardized in EN 50173, ISO 11801 and TIA 568-A. It forms the basis for a future-orientated, application-independent and cost-effective network infrastructure. The cabling standards define a domain covering a geographical area of 3 km and for an office area of up to 1 million square meters with 50 to 50,000 terminals. In addition, they describe recommendations for setting up of a cabling system. Specifications may vary depending on the selected topology, the transmission media and coupler modules used in industrial environments, as well as the use of components from different manufacturers in a network. Therefore, the specifications given here are only intended as recommendations.
198
10.1.2.3
Coupler Modules There are a number of hardware modules that allow for flexible arrangement for setting up an ETHERNET network. They also offer important functions, some of which are very similar. The following table defines and compares these modules and is intended to simplify the correct selection and appropriate application of them.
Module Characteristics/application ISO/OSI layer
Amplifier for signal regeneration, connection on a physical level. 1 Segmentation of networks to increase the length. 2 Multiport bridge, meaning each port has a separate bridge 2 (3) function. Logically separates network segments, thereby reducing network traffic. Consistent use makes ETHERNET collision-free. Used to create star topologies, supports various transmission media, does not prevent any network collisions. Links two or more data networks. Matches topology changes and incompatible packet sizes (e.g. used in industrial and office areas). 2 3
Hub Router
Gateway
Links two manufacturer-specific networks which use different software and hardware (i.e., ETHERNET and Interbus-Loop). Tab. 10-2: Comparison of Coupler Modules for Networks
4-7
10.1.2.4
Transmission Mode Some ETHERNET based WAGO couplers/controllers support both 10Mbit/s and 100Mbit/s for either full or half duplex operation. To guarantee a safe and fast transmission, both these couplers/controllers and their link partners must be configured for the same transmission mode. Note A faulty configuration of the transmission mode may result in a link loss condition, a poor network performance or a faulty behavior of the coupler/controller. The IEEE 802.3u ETHERNET standard defines two possibilities for configuring the transmission modes: "$ Static configuration "$ Dynamic configuration
199
10.1.2.4.1
Static Configuration of the Transmission Mode Using static configuration, both link partners are set to static transmission rate and duplex mode. The following configurations are possible: 10 Mbit/s, half duplex 10 Mbit/s, full duplex 100 Mbit/s, half duplex 100 Mbit/s, full duplex
10.1.2.4.2
Dynamic Configuration of the Transmission Mode The second configuration option is the autonegotiation mode which is defined in the IEEE 802.3u standard. Using this mode, the transmission rate and the duplex mode are negotiated dynamically between both communication partners. Autonegotiation allows the device to automatically select the optimum transmission mode. Note To ensure a correct dynamic configuration process, the operation mode for the autonegotiation of both communication partners must be supported and activated.
10.1.2.4.3
Errors Occurring when Configuring the Transmission Mode Invalid configurations are listed below: Problem
Mismatch of the transmission rate Duplex mode mismatch Mismatch using autonegotiation
Cause
Occurs when configuring one link partner with 10 Mbit/s and the other one with 100 Mbit/s. Occurs when one link partner is running in full-duplex and the other in half-duplex mode. Occurs when one link partner is running in auto-negotiation mode and the other one is using a static configuration of the transmission mode in fullduplex operation.
Symptoms
Link failure
Faulty or discarded data packets as well as collisions on the medium. The link partner, which is in autonegotiation mode, determines the network speed via the parallel detection procedure and sets the duplex mode to half-duplex. If the device is operating in full-duplex mode with static configuration, a duplex mode mismatch will occur (see above).
200
10.1.2.5
Important Terms Data security If an internal network (Intranet) is to be connected to the public network (e.g., the Internet) then data security is an extremely important aspect. Undesired access can be prevented by a Firewall. Firewalls can be implemented in software or network components. They are interconnected in a similar way to routers as a switching element between Intranets and the public network. Firewalls are able to limit or completely block all access to the other networks, depending on the access direction, the service used and the authenticity of the network user. Real-time ability Transmission above the fieldbus system level generally involves relatively large data quantities. The permissible delay times may also be relatively long (0.1...10 seconds). However, real-time behavior within the fieldbus system level is required for ETHERNET in industry. In ETHERNET it is possible to meet the real-time requirements by restricting the bus traffic (< 10 %), by using a master-slave principle, or also by implementing a switch instead of a hub. MODBUS/TCP is a master/slave protocol in which the slaves only respond to commands from the master. When only one master is used, data traffic over the network can be controlled and collisions avoided. Shared ETHERNET Several nodes linked via a hub share a common medium. When a message is sent from a station, it is broadcast throughout the entire network and is sent to each connected node. Only the node with the correct target address processes the message. Collisions may occur and messages have to be repeatedly transmitted as a result of the large amount of data traffic. The delay time in a Shared ETHERNET cannot be easily calculated or predicted.
G012910e
Deterministic ETHERNET
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
201
The TCP/IP software or the user program in each subscriber can limit transmittable messages to make it possible to determine real-time requirements. At the same time the maximum medium message rate (datagrams per second), the maximum medium duration of a message, and the minimum time interval between the messages (waiting time of the subscriber) is limited. Therefore, the delay time of a message is predictable. Switched ETHERNET In the case of Switched Ethernet, several fieldbus nodes are connected by a switch. When data from a network segment reaches the switch, it saves the data and checks for the segment and the node to which this data is to be sent. The message is then only sent to the node with the correct target address. This reduces the data traffic over the network, extends the bandwidth and prevents collisions. The runtimes can be defined and calculated, making the Switched Ethernet deterministic.
G012909e
202
(2) IP: For the communication the Internet Protocol (IP) is positioned above the Ethernet hardware. This bundles the data to be transmitted in packets along with sender and receiver address and passes these packets down to the Ethernet layer for physical transmission. At the receiver end, IP accepts the packets from the Ethernet layer and unpacks them.
(2) (1)
(3) TCP, UDP: a) TCP: (Transmission Control Protocol) The TCP protocol, which is positioned above the IP layer, monitors the transport of the data packets, sorts their sequence and sends repeat requests for missing packets. TCP is a connection-oriented transport protocol. The TCP and IP protocol layers are also jointly described as the TCP/IP protocol stack or TCP/IP stack. b) UDP: (User Datagram Protocol) The UDP layer is also a transport protocol like TCP, and is arranged above the IP layer. In contrast to the TCP protocol, UDP is not connection oriented. That means there are no monitoring mechanisms for data exchange between sender and receiver. The advantage of this protocol is in the efficiency of the transmitted
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
203
data and the resultant increase in processing speed. Many programs use both protocols. Important status information is sent via the reliable TCP connection, while the main stream of data is sent via UDP.
TCP, UDP IP Ethernet (physical interface, CSMA/CD)
(4) Management, Diagnostic and Application Protocols: Positioned above the TCP/IP stack or UDP/IP layer are correspondingly implemented management, diagnostic and application protocols that provide services that are appropriate for the application. For the management and diagnostic, these are, for example, SMTP (Simple Mail Transport Protocol) for e-mails, HTTP (Hypertext Transport Protocol) for www browsers and some others. In this example, the protocols MODBUS/TCP (UDP) and EtherNet/IP are implemented for use in industrial data communication. Here the MODBUS protocol is also positioned directly above TCP (UDP)/IP; EtherNet/IP, on the other hand, basically consists of the protocol layers Ethernet, TCP and IP with an encapsulation protocol positioned above it. This serves as interface to CIP (Control and Information Protocol). DeviceNet uses CIP in the same way as EtherNet/IP. Applications with DeviceNet device profiles can therefore be very simply transferred to EtherNet/IP.
WWW browser
Mail client
Application device profiles (e.g. positioning controllers, semiconductors, pneumatic valves) ...
MODBUS
CIP application objects library CIP data management services (explicit messages, I/O messages) CIP message routing, connection management Encapsulation protocol TCP, UDP IP
SMTP
HTTP
...
ETHERNET/IP
CIP
204
10.1.3.2
Communication Protocols In addition to the ETHERNET standard, the following important communication protocols are implemented in the WAGO ETHERNET based (programmable) fieldbus couplers and controllers: "$ IP Version 4 (Raw-IP and IP-Multicast ) "$ TCP "$ UDP "$ ARP The following diagram is intended to explain the data structure of these protocols and how the data packets of the communication protocols Ethernet, TCP and IP with the adapted application protocol MODBUS nested in each other for transmission. A detailed description of the tasks and addressing schemes of these protocols is contained in the following.
G012907
205
10.1.3.2.1
ETHERNET ETHERNET address (MAC-ID) Each WAGO ETHERNET (programmable) fieldbus coupler or controller is provided from the factory with a unique and internationally unambiguous physical ETHERNET address, also referred to as MAC-ID (Media Access Control Identity). This can be used by the network operating system for addressing on a hardware level. The address has a fixed length of 6 Bytes (48 Bit) and contains the address type, the manufacturers ID, and the serial number. Examples for the MAC-ID of a WAGO ETHERNET fieldbus coupler (hexadecimal): 00H-30H-DEH-00H-00H-01H. ETHERNET does not allow addressing of different networks. If an ETHERNET network is to be connected to other networks, higherranking protocols have to be used. Note If you wish to connect one or more data networks, routers have to be used. ETHERNET Packet The datagrams exchanged on the transmission medium are called ETHERNET packets or just packets. Transmission is connectionless; i.e. the sender does not receive any feedback from the receiver. The data used is packed in an address information frame. The following figure shows the structure of such a packet.
Preamble 8 Byte ETHERNET-Header 14 Byte ETHERNET_Data 46-1500 Byte Check sum 4 Byte
The preamble serves as a synchronization between the transmitting station and the receiving station. The ETHERNET header contains the MAC addresses of the transmitter and the receiver, and a type field. The type field is used to identify the following protocol by way of unambiguous coding (e.g., 0800hex = Internet Protocol). 10.1.3.3 Channel access method In the ETHERNET Standard, the fieldbus node accesses the bus using CSMA/CD (Carrier Sense Multiple Access/ Collision Detection). "$ Carrier Sense: The transmitter senses the bus. "$ Multiple Access: Several transmitters can access the bus. "$ Collision Detection: A collision is detected. Each station can send a message once it has established that the transmission medium is free. If collisions of data packets occur due to several stations transmitting simultaneously, CSMA/CD ensures that these are detected and the data transmission is repeated. However, this does not make data transmission reliable enough for industrial
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
206
requirements. To ensure that communication and data transmission via ETHERNET is reliable, various communication protocols are required. 10.1.3.3.1 IP-Protocol The Internet protocol divides datagrams into segments and is responsible for their transmission from one network subscriber to another. The stations involved may be connected to the same network or to different physical networks which are linked together by routers. Routers are able to select various paths (network transmission paths) through connected networks, and bypass congestion and individual network failures. However, as individual paths may be selected which are shorter than other paths, datagrams may overtake each other, causing the sequence of the data packets to be incorrect. Therefore, it is necessary to use a higher-level protocol, for example, TCP to guarantee correct transmission. IP addresses To allow communication over the network each fieldbus node requires a 32 bit Internet address (IP address). Attention Internet addresses have to be unique throughout the entire interconnected networks. As shown below there are various address classes with net identification (net ID) and subscriber identification (subscriber ID) of varying lengths. The net ID defines the network in which the subscriber is located. The subscriber ID identifies a particular subscriber within this network. Networks are divided into various network classes for addressing purposes: "$ "$ Class A: (Net-ID: Byte1, Host-ID: Byte2 - Byte4) 101 . 16 . 232 . 22 e.g.:
01100101 0 Net-ID 00010000 11101000 Host-ID 00010110
The highest bit in Class A networks is always 0. Meaning the highest byte can be in a range of 0 0000000 to 0 1111111. Therefore, the address range of a Class A network in the first byte is always between 0 and 127.
207
"$
Class B: (Net-ID: Byte1 - Byte2, Host-ID: Byte3 - Byte4) 181 . 16 . 232 . 22 e.g.:
10110101 10 Net-ID 00010000 11101000 Host-ID 00010110
The highest bits in Class B networks are always 10. Meaning the highest byte can be in a range of 10 000000 to 10 111111. Therefore, the address range of Class B networks in the first byte is always between 128 and 191.
"$
Additional network classes (D, E) are only used for special tasks.
Key data
Address range of the subnetwork Possible number of networks 127 (27) Ca. 16 thousand (214) Ca. 2 million (221) Subscribers per network Ca. 16 Million (224) Ca 65 thousand (216) 254 (28)
Each WAGO ETHERNET (programmable) fieldbus coupler or controller can be easily assigned an IP address via the implemented BootP protocol. For small internal networks we recommend selecting a network address from Class C. Attention Never set all bits to equal 0 or 1 in one byte (byte = 0 or 255). These are reserved for special functions and may not be allocated. Therefore, the address 10.0.10.10 may not be used due to the 0 in the second byte.
208
If a network is to be directly connected to the Internet, only registered, internationally unique IP addresses allocated by a central registration service may be used. These are available from InterNIC (International Network Information Center). Attention Direct connection to the Internet should only be performed by an authorized network administrator and is therefore not described in this manual. Subnets To allow routing within large networks a convention was introduced in the specification RFC 950. Part of the Internet address, the subscriber ID is divided up again into a subnetwork number and the station number of the node. With the aid of the network number it is possible to branch into internal subnetworks within the partial network, but the entire network is physically connected together. The size and position of the subnetwork ID are not defined; however, the size is dependent upon the number of subnets to be addressed and the number of subscribers per subnet.
1 8 16 24 32
1 0
Net-ID
Subnet-ID
Host-ID
Subnet mask A subnet mask was introduced to encode the subnets in the Internet. This involves a bit mask, which is used to mask out or select specific bits of the IP address. The mask defines the subscriber ID bits used for subnet coding, which denote the ID of the subscriber. The entire IP address range theoretically lies between 0.0.0.0 and 255.255.255.255. Each 0 and 255 from the IP address range are reserved for the subnet mask. The standard masks depending upon the respective network class are as follows: "$ Class A Subnet mask: 255 .0 .0 "$ Class B Subnet mask: 255 .255 .0 "$ Class C Subnet mask: .0 .0
255 .255 .255 .0 Depending on the subnet division the subnet masks may, however, contain other values beyond 0 and 255, such as 255.255.255.128 or 255.255.255.248. Your network administrator allocates the subnet mask number to you.
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
209
Together with the IP address, this number determines which network your PC and your node belongs to. The recipient node, which is located on a subnet initially, calculates the correct network number from its own IP address and the subnet mask. Only then does it check the node number and delivers the entire packet frame, if it corresponds. Example of an IP address from a class B network:
IP address: Subnet mask: Net-ID: Subnet-ID: Host-ID: 172.16.233.200 255.255.255.128 172.16.00 0.0.233.128 0.0.0.72 10101100 00010000 11101001 11001000 11111111 11111111 11111111 10000000 10101100 00010000 00000000 00000000 00000000 00000000 11101001 10000000 00000000 00000000 00000000 01001000
Attention Specify the network mask defined by the administrator in the same way as the IP address when installing the network protocol.
Gateway The subnets of the Internet are normally connected via gateways. The function of these gateways is to forward packets to other networks or subnets. This means that in addition to the IP address and network mask for each network card, it is necessary to specify the correct IP address of the standard gateway for a PC or fieldbus node connected to the Internet. You should also be able to obtain this IP address from your network administrator. The IP function is limited to the local subnet if this address is not specified. IP Packet In addition to the data units to be transported, the IP data packets contain a range of address information and additional information in the packet header. IP-Header IP-Data
Fig. 10-11: IP Packet
The most important information in the IP header is the IP address of the transmitter and the receiver and the transport protocol used.
210
10.1.3.3.1.1
RAW IP Raw IP manages without protocols such as PPP (point-to-point protocol). With RAW IP, the TCP/IP packets are directly exchanged without handshaking, thus enabling the connection to be established more quickly. However, the connection must beforehand have been configured with a fixed IP address. The advantages of RAW IP are high data transfer rate and good stability.
10.1.3.3.1.2
IP Multicast Multicast refers to a method of transmission from a point to a group, which is a point-to-multipoint transfer or multipoint connection. The advantage of multicast is that messages are simultaneously transferred to several users or closed user groups via one address. IP multicasting at Internet level is realised with the help of the Internet Group Message Protocol IGMP; neighbouring routers use this protocol to inform each other on membership to the group. For distribution of multicast packets in the sub-network, IP assumes that the datalink layer supports multicasting. In the case of Ethernet, you can provide a packet with a multicast address in order to send the packet to several recipients with a single send operation. Here, the common medium enables packets to be sent simultaneously to several recipients. The stations do not have to inform each other on who belongs to a specific multicast address every station physically receives every packet. The resolution of IP address to Ethernet address is solved by the use of algorithms, IP multicast addresses are embedded in Ethernet multicast addresses.
10.1.3.3.2
TCP Protocol As the layer above the Internet protocol, TCP (Transmission Control Protocol) guarantees the secure transport of data through the network. TCP enables two subscribers to establish a connection for the duration of the data transmission. Communication takes place in full-duplex mode (i.e., transmission between two subscribers in both directions simultaneously). TCP provides the transmitted message with a 16-bit checksum and each data packet with a sequence number. The receiver checks that the packet has been correctly received on the basis of the checksum and then sets off the sequence number. The result is known as the acknowledgement number and is returned with the next self-sent packet as an acknowledgement. This ensures that the lost TCP packets are detected and resent, if necessary, in the correct sequence.
211
TCP port numbers TCP can, in addition to the IP address (network and subscriber address), respond to a specific application (service) on the addressed subscriber. For this the applications located on a subscriber, such as a web server, FTP server and others are addressed via different port numbers. Well-known applications are assigned fixed ports to which each application can refer when a connection is built up. Examples: Telnet Port number: 23 HTTP Port number: 80 A complete list of "standardized services" is contained in the RFC 1700 (1994) specifications. TCP segment The packet header of a TCP data packet is comprised of at least 20 bytes and contains, among others, the application port number of the transmitter and the receiver, the sequence number and the acknowledgement number. The resulting TCP packet is used in the data unit area of an IP packet to create a TCP/IP packet. UDP The UDP protocol, like the TCP protocol, is responsible for the transport of data. Unlike the TCP protocol, UDP is not connection-orientated; meaning that there are no control mechanisms for the data exchange between transmitter and receiver. The advantage of this protocol is the efficiency of the transmitted data and the resulting higher processing speed. 10.1.3.3.4 ARP ARP (Address Resolution Protocol). This protocol combines the IP address with the physical MAC address of the respective Ethernet card. It is always used when data transfer to an IP address takes place in the same logical network in which the sender is located.
10.1.3.3.3
212
10.1.3.4
Administration and Diagnosis Protocols In addition to the communication protocols described above, various fieldbus specific application protocols and a view protocols for system admimnistration and diagnosis can be implemented. "$ BootP "$ HTTP "$ DHCP "$ DNS "$ SNTP "$ FTP "$ SMTP. More information You can find a list of the exact available implemented protocols in the chapter "Technical Data" to the fieldbus coupler and/or controller.
10.1.3.4.1
BootP (Bootstrap Protocol) The BootP protocol defines a request/response mechanism with which the MAC-ID of a fieldbus node can be assigned a fix IP address. For this a network node is enabled to send requests into the network and call up the required network information, such as the IP address of a BootP server. The BootP server waits for BootP requests and generates the response from a configuration database. The dynamic configuration of the IP address via a BootP server offers the user a flexible and simple design of his network. The WAGO BootP server allows any IP address to be easily assigned for the WAGO (programmable) fieldbus coupler or controller. You can download a free copy of the WAGO BootP server over the Internet at: http://www.wago.com. More information The procedure for address allocation with the WAGO BootP Server is described in detail in the Chapter Starting up a Fieldbus Node. The BOOTP Client allows for dynamic configuring of the network parameters:
Parameter IP address of the client IP address of the router Meaning Network address of the (programmable) fieldbus coupler or controller If communication is to take place outside of the local network, the IP address of the routers (gateway) is indicated in this parameter. The Subnet mask makes the (programmable) fieldbus coupler or controller able to differentiate, which parts of the IP address determine the network and which the WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
Subnet mask
Fieldbus Communication ETHERNET network station. IP addresses of the DNS servers Host name Here the IP addresses can be entered by maximally 2 DNS servers. Name of the host
213
When using the bootstrap protocol for configuring the node, the network parameters (IP address, etc... ) are stored in the EEPROM. Note The network configuration is only stored in the EEPROM when the BootP protocol is used, although not if configuration is done via DHCP. The BootP protocol is activated in the (programmable) fieldbus coupler or controller by default. When the BootP protocol is activated, the (programmable) fieldbus coupler or controller expects a BootP server to be permanently present. If, however, there is no BootP server available after a power-on reset, the network remains inactive. To operate the (programmable) fieldbus coupler or controller with the IP configuration stored in the EEPROM, you must first deactivate the BootP protocol. This is done via the web-based management system on the appropriate HTML page saved in the (programmable) fieldbus coupler or controller, which is accessed via the Port link. If the BootP protocol is deactivated, the (programmable) fieldbus coupler or controller uses the parameters stored in the EEPROM at the next boot cycle. If there is an error in the stored parameters, a blink code is output via the IO LED and configuration via BootP is automatically switched on. 10.1.3.4.2 HTTP (HyperText Transfer Protocol) HTTP is a protocol used by WWW (World Wide Web) servers for the forwarding of hypermedia, texts, images, audiodata, etc. Today, HTTP forms the basis of the Internet and is also based on requests and responses in the same way as the BootP protocol. The HTTP server implemented in the (programmable) fieldbus coupler or controller is used for viewing the HTML pages saved in the coupler/controller. The HTML pages provide information about the coupler/controller (state, configuration), the network and the process image. On some HTML pages, (programmable) fieldbus coupler or controller settings can also be defined and altered via the web-based management system (e.g. whether IP configuration of the coupler/controller is to be performed via the DHCP protocol, the BootP protocol or from the data stored in the EEPROM). The HTTP server uses port number 80.
214
10.1.3.4.3
DHCP (Dynamic Host Configuration Protocol) The couplers/controllers built-in HTML pages provide an option for IP configuration from a DHCP server, a BootP server, or the data stored in its EEPROM by default. Note The network configuration via DHCP is not stored in the EEPROM, this only occurs when using the BootP protocol.
The DHCP client allows dynamic network configuration of the coupler/controller by setting the following parameters:
Parameter IP address of the router Subnet mask Meaning If communication is to take place outside of the local network, the IP address of the routers (gateway) is indicated in this parameter. The Subnet mask makes the coupler/controller able to differentiate, which parts of the IP address determine the network and which the network station. Here the IP addresses can be entered by maximally 2 DNS servers. Here the maximum duration can be defined, how long the coupler/controller keeps the assigned IP address. The maximum lease time is 24.8 days. This results from the internal resolution of timer. The Renewing time indicates, starting from when the coupler/controller must worry about the renewal of the leasing time. The Rebinding time indicates, after which time the coupler/controller must have gotten its new address.
Renewing time
Rebinding time
In the case of configuration of network parameters via the DHCP protocol, the coupler/controller automatically sends a request to a DHCP server after initialisation. If there is no response, the request is sent again after 4 seconds, a further one after 8 seconds and again after 16 seconds. If all requests remain unanswered, a blink code is output via the IO LED. Transfer of the parameters from the EEPROM is not possible. Where a lease time is used, the values for the renewing and rebinding time must also be specified. After the renewing time expires, the coupler/controller attempts to automatically renew the lease time for its IP address . If this continually fails up to the rebinding time, the coupler/controller attempts to obtain a new IP address. The time for the renewing should be about one half of the lease time. The rebinding time should be about 7/8 of the lease time.
215
10.1.3.4.4
DNS (Domain Name Systems) The DNS client enables conversion of logical Internet names such as www.wago.com into the appropriate decimal IP address represented with separator stops, via a DNS server. Reverse conversion is also possible. The addresses of the DNS server are configured via DHCP or web-based management. Up to 2 DNS servers can be specified. The host identification can be achieved with two functions, an internal host table is not supported.
10.1.3.4.5
SNTP-Client (Simple Network Time Protocol) The SNTP client is used for synchronization of the time of day between a time server (NTP and SNTP server Version 3 and 4 are supported) and the clock module integrated in the (programmable) fieldbus coupler or controller. The protocol is executed via a UDP port. Only unicast addressing is supported. Configuration of the SNTP client The configuration of the SNTP client is performed via the web-based management system under the Clock link. The following parameters must be set:
Parameter Address of the Time server Time zone Update Time Enable Time Client Meaning The address assignment can be made either over a IP address or a host name. The time zone relative to GMT (Greenwich Mean time). A range of 12 to +12 hours is acceptable. The update time indicates the interval in seconds, in which the synchronization with the time server is to take place. It indicates whether the SNTP Client is to be activated or deactivated.
10.1.3.4.6
FTP-Server (File Transfer Protocol) The file transfer protocol (FTP) enables files to be exchanged between different network stations regardless of operating system. In the case of the ETHERNET coupler/controller, FTP is used to store and read the HTML pages created by the user, the IEC61131 program and the IEC61131 source code in the (programmable) fieldbus coupler or controller. A total memory of 1.5 MB is available for the file system. The file system is mapped to RAM disk. To permanently store the data of the RAM disk, the information is additionally copied into the flash memory. The data is stored in the flash after the file has been closed. Due to the storage process, access times during write cycles are long.
216
Note Up to 1 million write cycles are possible for writing to the flash memory for the file system. The following table shows the supported FTP commands for accesses to the file system:
Command USER PASS ACCT REIN QUIT PORT PASV TYPE STRU MODE RETR STOR APPE ALLO RNFR RNTO ABOR DELE CWD LIST NLST RMD PWD MKD Function Identification of the user User password Account for access to certain files Server reset Terminates the connection Addressing of the data link Changes server in the listen mode Determines the kind of the representation for the transferred file Determines the structure for the transferred file Determines the kind of file transmission Reads file from server Saves file on server Saves file on server (Append mode) Reservation of the necessary storage location for the file Renames file from (with RNTO) Renames file in (with RNFR) Stops current function Deletes file Changes directory Gives the directory list Gives the directory list Deletes directory Gives the actually path Puts on a dirctory
The TFTP (Trival File Transfer Protocol) is not supported by some of the couplers/controllers. More information You can find a list of the exact available implemented protocols in the chapter "Technical Data" to the fieldbus coupler and/or controller.
217
10.1.3.4.7
SMTP (Simple Mail Transfer Protocol) The Simple Mail Transfer Protocol (SMTP) enables sending of ASCII text messages to mail boxes on TCP/IP hosts in a network. It is therefore used for sending and receiving e-mails. The e-mail to be sent is created with a suitable editor and placed in a mail outbasket. A send SMTP process polls the out-basket at regular intervals and therefore finds mail waiting to be sent. It then establishes a TCP/IP connection with the target host, to which the message is transmitted. The receive SMTP process on the target host accepts the TCP connection. The message is then transmitted and finally placed in an in-basket on the target system. SMTP expects the target system to be online, otherwise no TCP connection can be established. Since many desktop computers are switched off at the end of the day, it is impractical to send SMTP mail there. For that reason, in many networks special SMTP hosts are installed in many networks, which are permanently switched on to enable distribution of received mail to the desktop computers.
10.1.3.5
Application Protocols If fieldbus specific application protocols are implemented, then the appropriate fieldbus specific communication is possible with the respective coupler/controller. Thus the user is able to have a simple access from the respective fieldbus on the fieldbus node. There are based on ETHERNET couplers/controllers available developed by WAGO, with the following possible application protocols: "$ "$ "$ "$ "$ "$ "$ MODBUS TCP (UDP) EtherNet/IP BACnet KNXnet/IP PROFINET Powerlink Sercos III
More information You can find a list of the exact available implemented protocols in the chapter "Technical Data" to the fieldbus coupler and/or controller. If fieldbus specific application protocols are implemented, then these protocols are individual described in the following chapters.
218
11.3.1 Divisions
Explosive environments are areas in which the atmosphere can potentially become explosive. The term explosive means a special mixture of ignitable substances existing in the form of air-borne gases, fumes, mist or dust under atmospheric conditions which, when heated beyond a tolerable temperature or subjected to an electric arc or sparks, can produce explosions. Explosive zones have been created to describe the concentrations level of an explosive atmosphere. This division, based on the probability of an explosion occurring, is of great importance both for technical safety and feasibility reasons. Knowing that the demands placed on electrical components permanently employed in an explosive environment have to be much more stringent than those placed on electrical components that are only rarely and, if at all, for short periods, subject to a dangerous explosive environment.
219
Explosive areas resulting from gases, fumes or mist: "$ Zone 0 areas are subject to an explosive atmosphere (> 1000 h /year) continuously or for extended periods. "$ Zone 1 areas can expect the occasional occurrence of an explosive atmosphere (> 10 h # 1000 h /year). "$ Zone 2 areas can expect the rare or short-term occurrence of an explosive atmosphere (> 0 h # 10 h /year). Explosive areas subject to air-borne dust: "$ Zone 20 areas are subject to an explosive atmosphere (> 1000 h /year) continuously or for extended periods. "$ Zone 21 areas can expect the occasional occurrence of an explosive atmosphere (> 10 h # 1000 h /year). "$ Zone 22 areas can expect the rare or short-term occurrence of an explosive atmosphere (> 0 h # 10 h /year).
220
Hydrogen being commonly encountered in chemical plants, frequently the explosion group IIC is requested for maximum safety.
221
222
The following table represents the division and attributes of the materials to the temperature classes and material groups in percent:
Tab. 11-4: Material groups in percent Temperature classes T1 T2 26.6 % 42.8 % 94.9 % Explosion group IIA IIB 85.2 % 13.8 % IIC 1.0 %
*
T3 25.5 %
T4 4.9 %
T5 0%
T6 0.2 %
223
Ignition protection n" describes exclusively the use of explosion protected electrical components in zone 2. This zone encompasses areas where explosive atmospheres can only be expected to occur rarely or short-term. It represents the transition between the area of zone 1, which requires an explosion protection and safe area in which for instance welding is allowed at any time. Regulations covering these electrical components are being prepared on a world-wide scale. The standard EN 50 021 allows electrical component manufacturers to obtain certificates from the corresponding authorities for instance KEMA in the Netherlands or the PTB in Germany, certifying that the tested components meet the above mentioned standards draft. Type n ignition protection additionally requires electrical components to be marked with the following extended identification: "$ A non spark generating (function modules without relay /without switches) "$ AC spark generating, contacts protected by seals (function modules with relays / without switches) "$ L limited energy (function modules with switch)
224
Further Information For more detailed information please refer to the national and/or international standards, directives and regulations!
11.4.1 Divisions
The "Divisions" describe the degree of probability of whatever type of dangerous situation occurring. Here the following assignments apply:
Explosion endangered areas due to combustible gases, fumes, mist and dust: Division 1 Encompasses areas in which explosive atmospheres are to be expected occasionally (> 10 h # 1000 h /year) as well as continuously and long-term (> 1000 h /year). Encompasses areas in which explosive atmospheres can be expected rarely and short-term (>0 h # 10 h /year).
Division 2
Class II (dust):
225
226
11.5 Identification
11.5.1 For Europe
According to CENELEC and IEC
Unit category
Community symbol for explosion protected electrical components II 3 G KEMA 01ATEX1024 X EEx nA II T4
Temperature class
n = Type of ignition
Extended identification
ITEM-NO.:750-400
CL I DIV 2 24V DC Grp. A B C D AWG 28-14 op temp code T4A 55C max ambient LISTED 22ZA AND 22XM
2101--02----03
0V
24V
DI1 Di2
24246
PATENTS PENDING
227
Temperature class
ITEM-NO.:750-400
CL I DIV 2 24V DC Grp. A B C D AWG 28-14 op temp code T4A 55C max ambient LISTED 22ZA AND 22XM
4100--02----03
0V
24V
DI1 Di2
24246
PATENTS PENDING
228
The USA and Canada have their own regulations. The following are excerpts from these regulations: NFPA 70 ANSI/ISA-RP 12.6-1987 C22.1 National Electrical Code Art. 500 Hazardous Locations Recommended Practice Canadian Electrical Code
229
Danger When using the WAGO-I/O SYSTEM 750 (electrical operation) with Ex approval, the following points are mandatory: The field bus independent I/O System Modules Type 750-xxx are to be installed in enclosures that provide for the degree of ingress protection of at least IP54. For use in the presence of combustible dust, the above mentioned modules are to be installed in enclosures that provide for the degree of ingress protection of at least IP64. The field bus independent I/O system may only be installed in hazardous areas (Europe: Group II, Zone 2 or America: Class I, Division 2, Group A, B, C, D) or in non-hazardous areas! Installation, connection, addition, removal or replacement of modules, field bus connectors or fuses may only take place when the system supply and the field supply are switched off, or when the area is known to be non-hazardous. Ensure that only approved modules of the electrical operating type will be used. The Substitution or Replacement of modules can jeopardize the suitability of the system in hazardous environments! Operation of intrinsically safe EEx i modules with direct connection to sensors/actuators in hazardous areas of Zone 0 + 1 and Division 1 type requires the use of a 24 V DC Power Supply EEx i module! DIP switches and potentiometers are only to be adjusted when the area is known to be non-hazardous.
Further Information Proof of certification is available on request. Also take note of the information given on the module technical information sheet.
230
Glossary
12 Glossary
B
Bit Smallest information unit. Its value can either be 1 or 0. Bit rate Number of bits transmitted within a time unit. BootP the bootstrap protocol is a protocol which specifies how system and network information is to be transmitted from a server to work stations. Bridge A network bridge serves to transmit messages independent of the destination of the message. It operates at the data link layer (layer 2) of the ISO/OSI model. Bridges divide networks into segments which allows to increase the number of nodes. Incomplete telegrams are removed. Telegrams are only sent if the node's target address is in the connected segment. A bridge creates a data base which contains all station addresses (MAC addresses). On the basis of this data, the bridge decides whether or not the received data packets are forwarded to another network segment. By and by, the bridge will be better able to decide in which segment the data belongs. Today, switches are often used instead of bridges. Broadcast A message that is sent to all station connected to the network. Bus Line for bit serial or bit parallel clocked data transfer. A bus for bit parallel data transfer consists of address, data, control and supply bus. The width of the data bus (8, 16, 32, 64 bits) and its frequency are the determining factors for the data transmission speed. The width of the address bus limits the network expansion. Byte Binary Yoked Transfer Element. A byte generally contains 8 bits.
Glossary
231
C
Client A system that requests the services of another. With the aid of the service request, the client can access objects (data) on the server. The service is provided by the server. CSMA/CD Carrier Sense Multiple Access with Collision Detection. When a collision is detected, all subscribers back off. After waiting a random delay time, the subscribers attempt to re-transmit the data.
D
Data bus see Bus. Deterministic ETHERNET The ETHERNET data is transferred at a defined time constant. The ETHERNET network can be defined and calculated. A Switched ETHERNET architecture makes this possible. Driver Software code which communicates with a hardware device. This communication is normally performed by internal device registers. DHCP Dynamic Host Configuration Protocol. This protocol allows to configure the network of a computer automatically as well as to assign addresses or to set parameters. The DHCP uses a fixed IP address pool when assigning a temporary IP address to a networked computer (client). This is done automatically and saves a lot of network configuration work. The client also obtains other information, such as the gateway address (router) and the IP address of the name server (DNS).
E
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
232
Glossary
ETHERNET Specifies a Local Area Network (LAN), which was developed by Xerox, Intel and DEC in the 70s. The bus access process takes place according to the CSMA/CD method. ETHERNET Standard In 1983 ETHERNET was standardized by IEEE 802.3 10Base-5. ISO took over the standardization in the ISO Standard 8802/3. The essential differences between ETHERNET and the IEEE standard are to be found in the frame architecture and treatment of pad characters.
F
Fieldbus System for serial information transmission between devices of automation technology in the process-related field area. Firewall Collective term for solutions which protect LANs connection to the Internet from unauthorized access. They are also able to control and regulate the traffic from the LAN into the Internet. The crucial part of firewalls are static routers which have an access control list used to decide which data packets can pass from which subscriber. Frame Unit of data transferred at the Data-Link layer. It contains the header and addressing information. FTP (File Transfer Protocol) A standard application for TCP/IP which allows users on one machine to transfer files to/from another. Function Module that always returns the same result (as a function value), prerequisite being identical input values; it has no local variables that store values beyond an invoke.
Glossary
233
G
Gateway Device for connecting two different networks. It converts the different protocols.
H
Header A portion of the data packet, containing, among others, the address information of the receiver. Host computer / Subscriber Originally used to describe a central mainframe computer accessed from other systems. The services provided by the subscriber can be called up by means of local and remote request. Today, this term is also used to refer to simple computers which provide particular central Services (i.e. UNIXSubscribers on the Internet). HTML Abbreviation of hypertext markup language HTML is the description language for documents on the World Wide Web. It contains language elements for the design of hypertext documents. HTTP (Hyper Text Transfer Protocol) client server TCP/IP protocol which is used on the Internet or Intranets for exchanging HTML documents. It normally uses port 80. Hub A device which allows communication between several network users via twisted pair cable. Similar to a repeater, but with many outputs, a hub is used to form a star topology. Hypertext Document format used by HTTP. Hypertext documents are text files which allow links to other text documents via particularly highlighted keywords.
I
WAGO-I/O-SYSTEM 750 Linux Fieldbus Coupler
234
Glossary
ICMP-Protocol TA protocol for the transmission of status information and error messages of the IP, TCP and UDP protocols between IP network nodes. ICMP offers, among others, the possibility of an echo (ping) request to determine whether a destination is available and is responding. IEEE Institute of Electrical and Electronic Engineers. IEEE 802.3 IEEE 802.3 is a IEEE standard. ETHERNET only supports the yellow cable as a medium. IEEE 802.3 also supports S-UTP and wideband coaxial cable. The segment lengths range from 500 m for yellow cable, 100 m for TP and 1800 m for wideband coaxial cable. A star or a bus topology is possible. ETHERNET (IEEE 802.3) uses CSMA/CD as a channel access method. Intel format Set configuration of the fieldbus coupler / controller to establish the process image. In the coupler/controller memory, the module data is aligned in different ways, depending on the set configuration (Intel/Motorola-Format, word-alignment,...). The format determines whether or not high and low bytes are changed over. They are not changed over with the Intel format. Internet A collection of networks interconnected to each other throughout the world. Its most well known area is the World Wide Web. Intranet A network concept with private network connections over which data can be exchanged within a company. IP Internet Protocol. The connectionless network layer, which relies on upper protocols to provide reliability. ISO/OSI- Reference Model Reference model of the ISO/OSI for networks with the objective of creating open communication. It defines the interface standards of the respective software and hardware requirements between computer manufacturers. The model treats communication removed from specific implementations, using seven layers.
Glossary
235
L
LAN Local Area Network
M
Manchester encoding In this encoding system, a 1 is encoded as a transition from low to high and a 0 as a transition from high to low. MIB Short form for "Management Information Base". MIB is a sellection of infomation on all parameters, which can be handed over to the management software with a request via SNMP. Thus can be made remote maintenance, a monitoring and a control of nets by SNMP protocol.
O
Open MODBUS/TCP Specification Specification which establishes the specific structure of a MODBUS/TCP data packet. This is dependant upon the selected function code. Operating system Software which links the application programs to the hardware.
P
Ping command When a ping command (ping <IP address>) is entered, the ping program ICMP generates echo request packets. It is used to test whether a node is available. Port number The port number, together with the IP address, forms an unambiguous connection point between two processes (applications). Predictable ETHERNET The delay time of a message on an ETHERNET network can be predicted. The measures which have been taken in predictable ETHERNET make it virtually possible to realize realtime requirements.
236
Glossary
Proxy gateway A proxy gateway (or proxy server, too) allows systems which do not have direct access to the Internet, indirect access to the network. These can be systems which are excluded from direct access by a firewall for security reasons. A proxy can filter out individual data packets between the Internet and a local network to increase security. Proxies are also used to limit access to particular servers. In addition, proxy gateways can also have a cache function, in which case they check whether the respective URL address is already available locally and return it immediately, if necessary. This saves time and costs when there are multiple accesses. If the URL is not in the cache, the proxy forwards the request as normal. The user should not notice the proxy gateway apart from the single configuration in the web browser. Most web browsers can be configured so that they use different or no proxy gateways per access method (FTP, HTTP).
R
Repeater Repeaters are physical amplifiers without their own processing function. They refresh data without detecting damaged data and forward all signals. Repeaters are used for longer transmission distances or when the maximum number of nodes of 64 devices per twisted pair segment is exceeded. A request from a client to server is a provision to act on a service or function call. Request A service request from a client which requests the provision of a service from a server. Response The servers reply to a clients request. RFC specifications Specifications, suggestions, ideas and guidelines regarding the Internet are published in the form of RFCs (Request For Comments). RJ45 connector Also referred to as a Western connector. This connector allows the connection of two network controllers via twisted pair cables.
Glossary
237
Router Connects neighboring subnets, the router operating with addresses and protocols of the third ISO/OSI layer. As this layer is hardware independent, the routers allow transition to another transmission medium. To transmit a message the router evaluates the logical address (source and destination address) and finds the best path if there are several possibilities. Routers can be operated as repeaters or bridges. Routing Method of selecting the best path over which to send data to a distant network.
S
SCADA Abbreviation for Supervisory Control and Data Acquisition. SCADA software is a program for the control and visualization of processes. Segment Typically, a network is divided up into different physical network segments by way of routers or repeaters. Server Device providing services within a client/server system. The service is requested by the Client. Service Object operation (read, write). SMTP Short form for Simple Mail Transfer Protocol. Standard protocol, with which E-mails are sent away in the internet. SNMP Short form for Simple Network Management Protocol. SNMP serves remote maintenance of servers. Thus leave themselves e.g. rout directly from the office of the network carrier out to configure, without someone must drive for this to the customer.
238
Glossary
SOAP Short form for Simple Object Access Protocol. XML is a standard for Meta data, the access on the XML objects takes place via SOAP.The standard defines, how transactions via internet and XML can be done and how dynamic Web services over distributed networks can be used. Socket Is a software interface introduced with BSD-UNIX for inter-process communication. Sockets are also possible in the network via TCP/IP. As from Windows 3.11, they are also available in Microsoft operating systems. STP With the STP cable (Shielded twisted pair) it acts around a symmetrical cable with in pairs stranded and protected veins. The classical STP cable is a multi-core cable, whose stranded conductors are isolated. The conductors of the STP cable are individually protected. It has no total screen. S-STP Beside the STP cables there is cable, which has total shielding from foil or network shielding additionally to the single shielding of the conductors still another. These cables are called S/STP cables: Screened/Shielded twisted pair. Subnet A portion of a network that shares the same network address as the other portions. These subnets are distinguished through the subnet mask. Subnet mask The subnet mask can be used to manipulate the address areas in the IP address room with reference to the number of subnets and subscribers. A standard subnet mask is, for example, 255.255.255.0. S-UTP Screened unshielded twisted pair cable which only has one external shield. However, the twisted pair cables are not shielded from each other.
Glossary
239
Switch Switches are comparable to bridges, but with several outputs. Each output uses the full ETHERNET bandwidth. A switch switches a virtual connection between an input port and an output port for data transmission. Switches learn which nodes are connected and filter the information transmitted over the network accordingly. Switches are inteligent devices that learn the node connections and can transfer data at the switch and not have to send it back to the main server. Switched ETHERNET The segments of this type of ETHERNET are connected by switches. There are many applications for switching technologies. ETHERNET switching is becoming increasingly popular in local networks as it allows the realization of a deterministic ETHERNET.
T
TCP Transport Control Protocol. TCP/IP Protocol Stack Network protocols which allow communication between different networks and technologies. Telnet The Telnet protocol fulfils the function of a virtual terminal. It allows remote access from the users computer to other computer systems on the network. Traps Traps are unsolicited messages, which are sent by an agent to a management system, as soon as somewhat unexpected and for the management system interesting happens. Traps is with from the hardware admitted interrupts comparably. A well-known example of a Trap message is the Blue screen with Win95/98. Twisted Pair Twisted pair cables (abbreviated to TP).
240
Glossary
U
uClinux The uClinux (microcontroller Linux) is a Linux kernel for microprocessors and microcontrollers without MMU (Memory Management Unit). In 1996 the project started with kernel version 2.0. Since kernel version 2.6, the major parts have been integrated into the Linux kernel. The development of the C standard library uClibc was also part of the uClinux project. Furthermore, several UserLand programs belong to the uClinux distribution. uClinux runs on many embedded systems. Embedded systems are devices in which a small computer is encapsulated by the device it controls, for example a DSL router, DVD player, etc. UDP protocol The user datagram protocol is a transport protocol (layer 4) of the ISO/OSIreference model which supports data exchange between computers without a connection. UDP runs directly on top of the underlying IP protocol. URL Abbreviation for uniform resource locator. Address form for Internet files which are mostly applied within the World Wide Web (WWW). The URL format makes the unambiguous designation of all documents on the Internet possible by describing the address of a document or object which can be read by a web browser. URL includes the transmission type (http, ftp, news etc.), the computer which contains the information and the path on the computer. URL has the following format: Document type//Computer name/List of contents/File name. UTP The UTP cable is a symmetrical, not-protected cable with twisted colored wires in pairs. This type of cable, which there is in execution two-in pairs and four-in pairs, is the dominating type of cable in the floor wiring and the terminal wiring.
W
Web browser Program for reading hypertext. The browser allows the various documents to be viewed in hypertext and navigation between documents. Word-alignment Set configuration of the fieldbus coupler/controller for the creation of a process image. Word-alignment is used to establish the process image wordby-word (2 bytes). World Wide Web HTTP server on the Internet.
Literature List
241
13 Literature List
Manual TCP/IP-ETHERNET for Beginners Wiesemann & Theis GmbH 1st edition, 11/1999 http://www.WuT.de/us_printmed.html Local Area Networks - An introduction to the technology John E. McNamara, Digital Press, 1985 ISBN 0-932376-79-7 Digital Press Teil Nummer EY-00051-DP Network Troubleshooting Guide von Digital Equipment Corporation, August 1990, Digital Press Teil Nummer EK-339AB-GD-002
242
Index
14 Index
1
10Base-T 164
H
HTML pages 182 HTTP 182 hub 162, 164, 168, 169 Hub 90, 165, 201
A
Address Ethernet 174 Hardware 174 IP 175 TCP- 180
I
I/O Modules 130 Internal bus -error 89 Internet 162, 169, 177, 182 Intranet 169 IP address 82, 175, 176, 178, 181 Key data 176
B
BootP 181 Bridge 168, 198, 207 Bus access procedure 174
C
Cable Category 5 164 Crossover 164 Impedance 164 -length 90 Parallel 164 carrier rail 16, 19 contacts data- 20 power- 27 Coupler modules 168 Crossover cable 164 CSMA/CD 174
L
LED blink code 78 red 78 LEDs 43 locking disc 18
M
MAC-ID 46, 174 Modbus/TCP Specification 203
N
Network card 162, 164, 178 Network class 175 node max. number 176
D
data contacts 20 Data packet 174 Ethernet 174 IP 178 TCP 180 TCP/IP 180 Data security 169 Delay time 169 Diagnosis information 161
O
Operating mode STOP 45
P
Ping command 82, 203 Port number 180, 204 Port number 80 182 Power contacts 21, 27 not carried out 28 Predictable Ethernet 170 Process Visualisation 162 Process data 161 Protocols 161 BootP 176 Proxy 204
E
Electrical Isolation 42 error during start-up 78 Error -message 82 Ethernet 161 Address 174 Industry 169 Network 168 Network architecture 162 Predictable 170 Shared 169 Standard 163, 174 Switched 170 Ethernet standard 163, 165
R
Realtime behaviour 169 Realtime requirements 170 Repeater 162, 168, 204 Request 204 Response 204 Router 168, 169, 174, 175, 200, 205
F
Fieldbus node Architecture 162 Firewall 169
G
Gateway 168, 178, 201, 204
Index
243
S
SCADA 205 Segment length 163 Sequence number 179 Shared Ethernet 169 Socket 206 Standard Cabling 167 EN 50173, ISO 11801, TIA 568-A 167 Standardization IEEE 802.3 161 Structured cabling 167 Subnet 178, 206 mask 177, 206 Subscriber ID 177 Switch 162, 168, 207 Switched Ethernet 170, 199, 207
T
TCP/IP 161 Topology 163, 165, 167, 168, 201, 202 Star 165 Transmission media 163 rate 161 speed 163
U
unlocking lug 18
W
word-alignment 137 WWW 182
WAGO Kontakttechnik GmbH Postfach 2880 D-32385 Minden Hansastrae 27 D-32423 Minden Phone: 05 71/8 87 0 Fax: 05 71/8 87 1 69 [email protected] E-Mail: Web:http://www.wago.com