Kuhnke Electronics Instruction Manual
Kuhnke Electronics Instruction Manual Kuhnke Electronics Instruction Manual
4.7 Programming Using CoDeSys 114 Programming The sections below explain some basic details you need to know to use CoDeSys for writing your user programs. 4.7.1 Variables/Addresses All memory cells that can be addressed by the user program for signal processing or data storage are referred to as variables. There are two basic types of variables: � Variables with a set address: These variables are inputs, outputs or internal memory cells of the control unit which can be directly accessed by the user program. � External PROFIBUS operands: These variables are either declared locally in a module's declaration section, or globally in the list of global variables. CoDeSys defines the address in the controller when the variables are "interpreted".
4.7.2 Variables with Set Addresses 4.7.2.1 Local Inputs and Outputs Group Input Function Type Qty I Q %IX0.0 inputs 16/32 %IX0.0 Input Range from to %IX0.15 (%IX1.15) PROFIBUS-DP Comment standard IN %IX12.0 inputs 4 %IX12.0 %IX12.3 interrupt IN %QX0.0 outputs 16/32 %QX0.0 %QX0.15 BOOL (%QX1.15) standard OUT %QX10.0 outputs 4 %QX0.0 %QX10.3 special/clock OUT I %IW2 inputs 4 %IW2 %IW5 analogue IN Q %QW2 outputs WORD 2 %QW2 %QW3 analogue OUT Q %QW8 parameter 2 %QW8 %QW9 clock output frequency I %ID3 parameter 3 %ID3 %ID5 counter Q %QD2 parameter DWORD 2 %QD2 %QD3 counter 4.7.2.2 Internal Markers Group Input Function Type Qty Input Range from to MX %MX0.0 BOOL 2048 %MX0.0 %MX2047.15 MB %MB0 BYTE 4096 %MB0 %MB4095 Marker MW %MW0 WORD 2048 %MW0 %MW2047 MD %MD0 DWORD 1024 %MD0 %MD1023 Comment There is a marker range exactly 4096 byte in size. MX, MB, MW and MD are just different ways of accessing the same marker range. The first byte in a word is byte #0. Bits are stored by word. The first bit in a word is bit #0. 115
- Page 63 and 64: 4.3.3.2 The Task Configurator 4.3.3
- Page 65 and 66: 4.3.4 PLC Configuration Function Li
- Page 67 and 68: Function Libraries DI16/DO16". Repe
- Page 69 and 70: 4.3.6 The Flash File System Functio
- Page 71 and 72: 4.4.1 Installing a Thread Function
- Page 73 and 74: Thread usage Function Libraries A t
- Page 75 and 76: 4.4.2 Installing / Uninstalling a T
- Page 77 and 78: To uninstall a timer task: Function
- Page 79 and 80: 4.4.3 Enabling / Disabling the Outp
- Page 81 and 82: 4.4.5 Direct Write of Local Outputs
- Page 83 and 84: FUNCTION INSTALL_ERROR_IRQ : BOOL V
- Page 85 and 86: Function Libraries INSTALL_INPUT_IR
- Page 87 and 88: 4.4.8 Installing a REF IRQ Module F
- Page 89 and 90: 4.4.10 Setting up the Watchdog Func
- Page 91 and 92: 4.5 Library MMC.LIB Function Librar
- Page 93 and 94: 4.5.2 Registering with the File Sys
- Page 95 and 96: 4.5.4 Copying Files Function Librar
- Page 97 and 98: 4.5.6 Determining the Free MMC Spac
- Page 99 and 100: 4.5.8 Moving a File Function Librar
- Page 101 and 102: 4.5.9 Opening a File Function Libra
- Page 103 and 104: 4.5.10 Reading from a File Function
- Page 105 and 106: 4.5.12 Setting the Edit Bookmark of
- Page 107 and 108: 4.5.14 Initialising the File System
- Page 109 and 110: Function Libraries FUNCTION_BLOCK M
- Page 111 and 112: � Use 'start' to repeatedly run t
- Page 113: 4.6.4 Online Reset (cold) 4.6.5 Res
- Page 117 and 118: 4.8 Extraremanent Data 4.8.1 Remane
- Page 119 and 120: Remanent Data If an extraremanent m
- Page 121 and 122: TYPE Extrarema_02: STRUCT END_STRUC
- Page 123 and 124: Start_OK := CheckXREMDATA(Clear); I
- Page 125 and 126: 5 Software Software Read this secti
- Page 127 and 128: Internal combi I/Os %IX0.0-%IX0.3 a
- Page 129 and 130: Internal I/Os AI_x and AO_x I/O Var
- Page 131 and 132: Software If an "Input IRQ module" h
- Page 133 and 134: 5.3.3 Functions of Internal Outputs
- Page 135 and 136: Software Value Frequency Value Freq
- Page 137 and 138: 5.3.4 Short-circuited Output Softwa
- Page 139 and 140: 5.3.5 Internal Analogue Input Funct
- Page 141 and 142: 5.3.6 Internal Analogue Output Func
- Page 143 and 144: 5.3.7 Functions of Internal Counter
- Page 145 and 146: 5.3.7.1.2 Event Counter Variables V
- Page 147 and 148: Resolution of the rotary encoder: s
- Page 149 and 150: Software 5.4 Functions of the Basic
- Page 151 and 152: 5.7 Status Messages of Expansion Mo
- Page 153 and 154: 6 PROFIBUS-DP 6.1 Basic Information
- Page 155 and 156: 6.2 Master-Slave Communication PROF
- Page 157 and 158: 6.2.2 Receive Parameter Data (Prm_D
- Page 159 and 160: 6.2.2.2 Device-specific Bus Paramet
- Page 161 and 162: PROFIBUS replaces the term "byte" w
- Page 163 and 164: Octet 4: Diag.Master_Add PROFIBUS A
4.7 Programming Using CoDeSys<br />
114<br />
Programming<br />
The sections below explain some basic details you need<br />
to know to use CoDeSys for writing your user programs.<br />
4.7.1 Variables/Addresses<br />
All memory cells that can be addressed by the user<br />
program for signal processing or data storage are referred<br />
to as variables. There are two basic types of variables:<br />
� Variables with a set address:<br />
These variables are inputs, outputs or internal<br />
memory cells of the control unit which can be directly<br />
accessed by the user program.<br />
� External PROFIBUS operands:<br />
These variables are either declared locally in a<br />
module's declaration section, or globally in the list of<br />
global variables. CoDeSys defines the address in the<br />
controller when the variables are "interpreted".