Upload
psy-dakstalder
View
214
Download
0
Embed Size (px)
Citation preview
7/26/2019 TIP55
http://slidepdf.com/reader/full/tip55 1/6
Tip055B TOPIC: How to Integrate AS-Interface I/O Data into the S7-200 VERSION: 4.0 DATE: 5/99
***SPECIAL HARDWARE REQUIREMENTS***
See the online help file for a complete list of all hardware components used in this example.
***OVERVIEW***
Functions of the Sample System * Red key turns the red light of the signal column on/off * Green key turns the green light of the signal column on/off * Active AS-interface Sensor 1 turns the flashing light of the signal
column on/off * Active AS-interface Sensor 2 turns the sensing element of the
signal column on/off * Conventional sensor on the IP 65 user module turns the light in
the control device on/off * Photoelectric barrier on IP 20 4I4Q slave switches all 4 outputs
of the IP 65 4A slave
***PROGRAM DESCRIPTION***
For the sample program to function, the following is assumed:
* The AS-interface master CP 242-2 is the only module connectedto the CPU 212.
* The input data of the AS-interface slaves is copied from the analoginput words AIW0 to AIW14 into the variable memory locationsVW800 to VW815. Starting with VW800, an input data image of theAS-interface slaves is then located in the variable memory.
* The output data for the AS-interface master is filed in thevariable memory locations VW900 to VW915. Starting with VW900,an output data image of the AS-interface slaves is then locatedin the variable memory.
* After all slave output bits have been set in the variable memory,starting with VW900, 16 bytes beginning at VW900 are copied tothe analog output words AQW0 to AQW14 of the CP 242-2.
Address List and Bit Assignment
The addresses for the AS-interface slaves are set with the addressing device.
The position of the slaves or slave bits in the area of the analog values as well as in the variable memory area (input or output image of the slaves) is determined in a simple manner by means of the assignment table provided in the CP 242-2 manual.
For the slaves used in this example, the following assignment results:
------------------------------------------------------------------- Inputs Outputs
------------------------------------------------------------------- Slave Slave Analog Variable Analog Variable Address input memory output memory
area area area area with 900
------------------------------------------------------------------- 1 4I/4Q AIW0 800 bits 0-3 AQW0 900 bits 0-3------------------------------------------------------------------- 2 4I AIW0 801 bits 4-7 - -------------------------------------------------------------------- 3 4Q - - AQW0 901 bits 0-3------------------------------------------------------------------- 4 2I AIW2 802 bits 4-5 - -------------------------------------------------------------------- 5 2I AIW2 802 bits 0-1 - -------------------------------------------------------------------- 6 4I/4Q AIW2 803 bits 4-7 AQW2 903 bits 4-7------------------------------------------------------------------- 7 4Q - - AQW2 903 bits 0-3------------------------------------------------------------------- The data regarding the position of the AS-interface slave bits in
the variable memory is needed for generating the program.---------------------------------------------------------------------------------------------------
***MAIN PROGRAM***
INDUSTRIAL AUTOMATION
PROLIFIC SYSTEM AND TECHNOLOGY PVT.LTD.
7/26/2019 TIP55
http://slidepdf.com/reader/full/tip55 2/6
Network 1 Call Subroutine SBR0
Load special memory bit SM0.1 to process this network during the first scan cycle only. Call SBR0.
SM0.1 0
Network 2 Call Subroutine SBR1
Load input bit I1.1 to check the status of the CP. If input I1.1 is set, that is, the CP is ready, call SBR1.
I1.1 1
Network 3 End of Main Program
End the main program.
Network 4 Subroutine SBR0
Start SBR0.
0
INDUSTRIAL AUTOMATION
PROLIFIC SYSTEM AND TECHNOLOGY PVT.LTD.
7/26/2019 TIP55
http://slidepdf.com/reader/full/tip55 3/6
Network 5 Turn On Q1.7 and Reset Output Bits
Load special memory bit SM0.0 to process this network every scan cycle. Immediately turn on output bit Q1.7 to indicate that the PLC is in RUN mode. Note: Only if PLC_RUN = 1, will data exchange with AS-i slaves be possible. Immediately reset 4 output bits starting at output bit Q1.0.
SM0.0 Q1.7
Q1.0
4
Network 6 End of Subroutine SBR0
End SBR0.
Network 7 Subroutine SBR1
Start SBR1. At the beginning, the subroutine cyclically copies the AS-i input data from the CPU into the variable memory (starting with VB800), and at the end transfers the AS-i output data from the variable memory to the CP (starting with VB900).
1
INDUSTRIAL AUTOMATION
PROLIFIC SYSTEM AND TECHNOLOGY PVT.LTD.
7/26/2019 TIP55
http://slidepdf.com/reader/full/tip55 4/6
Network 8 Set Up Input Image
Load special memory bit SM0.0 to process this network every scan cycle. Block move 8 words starting with analog input word AIW0 into the variable memory area starting at VW800.
SM0.0
AIW0
8 VW800
Network 9 Turn On Red Light
Load variable memory bit V803.4 which corresponds to the red key on slave 6. If the red key on slave 6 is set, set variable memory bit V903.1 to turn on the red light on slave 7.
V803.4 V903.1
Network 10 Turn On Green Light
Load variable memory bit V803.5 which corresponds to the green key on slave 6. If the green key on slave 6 is set, set variable memory bit V903.0 to turn on the green light on slave 7.
V803.5 V903.0
INDUSTRIAL AUTOMATION
PROLIFIC SYSTEM AND TECHNOLOGY PVT.LTD.
7/26/2019 TIP55
http://slidepdf.com/reader/full/tip55 5/6
Network 11 Turn On Slave 3 Outputs
Load variable memory bit V800.0 which corresponds to input 1 of the photoelectric barrier slave. If input 1 is set, set variable memory bit V901.0 to set output 1 of slave 3. Set variable memory bit V901.1 to set output 2 of slave 3. Set variable memory bit V901.2 to set output 3 of slave 3. Set variable memory bit V901.3 to set output 4 of slave 3.
V800.0 V901.0
V901.1
V901.2
V901.3
Network 12 Turn On Slave 6 Light
Load variable memory bit V801.4 which corresponds to the conventional sensor attached to input bit 0 of slave 2. If input bit 0 of slave 2 is set, set variable memory bit V903.6 to turn on the light in slave 6, bit 2.
V801.4 V903.6
Network 13 Turn On the Buzzer
Load variable memory bit V802.4 which corresponds to sensor 4. If sensor 4 is on, set variable memory bit V903.3 to turn on the buzzer.
V802.4 V903.3
INDUSTRIAL AUTOMATION
PROLIFIC SYSTEM AND TECHNOLOGY PVT.LTD.
7/26/2019 TIP55
http://slidepdf.com/reader/full/tip55 6/6
Network 14 Turn On the Flashing Light
Load variable memory bit V802.0 which corresponds to sensor 5. If sensor 5 is on, set variable memory bit V903.2 to turn on the flashing light.
V802.0 V903.2
Network 15 Read Out the Output Image
Load special memory bit SM0.0 to process this network every scan cycle. Block move 8 words starting with variable memory word VW900 into the AS-i outputs starting at analog output word AQW0.
SM0.0
VW900
8 AQW0
Network 16 End of Subroutine SBR1
End SBR1.
INDUSTRIAL AUTOMATION
PROLIFIC SYSTEM AND TECHNOLOGY PVT.LTD.