
Chapter 3 Programming 3-1 to 3-94
3.1 Installation..................................................................................................................................... 3-1
3.1.1 System Requirements...................................................................................................... 3-1
3.1.2 Installation of HX-CODESYS........................................................................................... 3-1
3.1.3 Installation of USB driver.................................................................................................. 3-3
3.2 Startup........................................................................................................................................... 3-5
3.3 I/O Configuration........................................................................................................................... 3-7
3.3.1 Scan For Devices for expansion units ............................................................................. 3-7
3.3.2 Option board .................................................................................................................... 3-9
3.3.3 Update Device.................................................................................................................. 3-10
3.3.4 I/O address....................................................................................................................... 3-11
3.4 I/O-update..................................................................................................................................... 3-15
3.5 POU and task................................................................................................................................ 3-16
3.6 Variables....................................................................................................................................... 3-18
3.6.1 Data memory.................................................................................................................... 3-18
3.6.2 Marker memory................................................................................................................ 3-19
3.6.3 Available characters for variable names.......................................................................... 3-20
3.6.4 Numeric literals ................................................................................................................ 3-20
3.6.5 Data types........................................................................................................................ 3-21
3.6.6 Local variable................................................................................................................... 3-22
3.6.7 Global variable ................................................................................................................. 3-23
3.7 Configuration................................................................................................................................. 3-24
3.8 Communication settings................................................................................................................ 3-25
3.9 Programming ................................................................................................................................ 3-27
3.10 Login ............................................................................................................................................. 3-29
3.11 Boot application............................................................................................................................. 3-32
3.12 Source Download / Upload ........................................................................................................... 3-33
3.13 Run / Stop / Reset......................................................................................................................... 3-34
3.14 Global network variables............................................................................................................... 3-35
3.15 Modbus-TCP/RTU ........................................................................................................................ 3-38
3.15.1 Introduction ...................................................................................................................... 3-38
3.15.2 Modbus-TCP master (client)............................................................................................ 3-39
3.15.3 Modbus-TCP slave (server)............................................................................................. 3-42
3.15.4 Modbus-RTU master........................................................................................................ 3-43
3.15.5 Modbus-RTU slave .......................................................................................................... 3-46
3.16 EtherCAT master.......................................................................................................................... 3-47
3.16.1 Configuration.................................................................................................................... 3-47
3.16.2 Online settings ................................................................................................................. 3-48
3.16.3 Ethernet speed................................................................................................................. 3-49
3.16.4 Cycle time of EtherCAT task............................................................................................ 3-49
3.16.5 Programming ................................................................................................................... 3-51
3.16.6 Wiring............................................................................................................................... 3-52
3.16.7 Important restrictions ....................................................................................................... 3-52
3.17 High speed counter....................................................................................................................... 3-54
3.18 Interrupt input................................................................................................................................ 3-63
3.19 Pulse Train Outputs ...................................................................................................................... 3-66
3.20 PWM Outputs ............................................................................................................................... 3-72