Kuhnke Electronics Instruction Manual

Kuhnke Electronics Instruction Manual Kuhnke Electronics Instruction Manual

17.02.2013 Views

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

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".

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!