Specifications

C-27
IP 240
EWA 4NEB 811 6120-02b
C.8 Programming Example for “Positioning” Mode
Prerequisites, Settings, Blocks and Addresses
The programming example describes the standard functions for operating the
IP 240 counter, position decoder and positioning module in “Positioning”
mode.
Objectives of the programming example:
The example should show the most important functions in exemplary
form.
It should enable testing of the hardware (such as sensors) for
functionability.
The example is therefore simple and easy to follow.
And it can be expanded if desired without a great deal of overhead.
The example shows how to parameterize the module at start-up, how to read
the actual value, dynamic specification of a function (software synchroniza-
tion, approaching a new position, new clearance values etc.) and how an in-
terrupt is generated when a clearance value is reached.
The example can be realized with only a minimum hardware complement (1
byte for inputs, 1 byte for outputs). Essentially, it uses “Monitor/Modify vari-
able”.
The devices listed below are only some of those which can be used to try out
the sample program:
An S7-400 programmable controller system (rack, power supply unit,
CPU)
An adapter casing
An IP 240 module with suitable sensor
One digital input and one digital output module
A programming device (such as a PG 740)
It is possible to do without both the digital input module and the digital out-
put module when all functions are executed with “Monitor/Modify variable”.
This would require changes in organization block OB 1.
As sensor for the IP 240 module, an angular encoder is connected to channel
1 of the module.
The module must have a voltage supply of 24 V (X6 connector)
You must set the addresses for the adapter casing via STEP 7 (hardware con-
figuration). The following I/O settings have been assumed:
S7 address: 512,
S5 address: 0 (I/O area: P)
Length: 16 bytes
Process image
subtable: 0.
Overview
Device
Configuration
Settings in the
CPU
IP 240 Counter, Position Decoder and Positioning Module