Chapter 5 CP 240 - EnOcean
Manual VIPA System 200V
5-12
HB97E - CP - Rev. 11/30
The example already contains the PLC application and the hardware
configuration. The following blocks are used:
CALL FC 9
//Re-boot or Reset
ADR
:=256
//Address of the module
TIMER_NR :=T2
ANL
:=M3.0
NULL
:=M3.1
RESET
:=M3.2
STEUERB_S :=MB4
STEUERB_R :=MB6
U M 3.0
//Reception can only be started
BEB
//after execution of FC 9 (SYNCHRON_RESET)
CALL FC 100
//Call of reception-FC
L 0
T MB 1
//delete order bit
UN M 3.0
//Initialize re-boot
S M 3.0
CALL FC
1
ADR :=256
//Address of the module
_DB :="EMPFANG_en_ocean"
//DB with received data
ABD :=W#16#0
//1. DBB received data
ANZ :=W#16#B
//reception length always 11
EMFR :=M7.0
//all data received
PAFE :="EMPFANG_en_ocean".Pafe
//error byte
GEEM :="EMPFANG_en_ocean".GEEM
//received amount (internal)
ANZ_INT:="EMPFANG_en_ocean".ANZ_INT
//reception length (internal)
EMPF_LAEUFT:="EMPFANG_en_ocean".EMP_LAEUFT
//receiving data (internal)
LETZTER_BLOCK:="EMPFANG_en_ocean".LETZTER_BLOCK
//all data received
FEHL_EMPF:="EMPFANG_en_ocean".FEHL_EMPF
//Error in the
//reception routine
UN
M
7.0
//no telegram received
BEB
//then
end
R
M
7.0
//delete reception bit
L "EMPFANG_en_ocean".Empfangsfach.IDbyte0_1
//switch ID
L W#16#1C7A
//Please enter here the ID
==I
//of your switch.
SPB e_a2
//This can be taken from
BEA
//DB 11.DBW 8
e_a2:
NOP 0
L 5
//ID switch on
L
"EMPFANG_en_ocean".Empfangsfach.Datenbyte3
//Byte with ID
SRW
4
//ID in Low nipple
==I
//Proof if switch is pushed
SPB ein
L 7
//ID switch of
==I
//Proof if switch is pushed
SPB aus
BEA
ein:
NOP 0
S A
0.0
//Function
on
BEA
aus:
NOP 0
R A
0.0
//Function
off
BEA
PLC program
OB 1
OB 100
FC 100
Summary of Contents for CP 240 RS232
Page 1: ...Manual VIPA System 200V CP Order No VIPA HB97E_CP Rev 11 30...
Page 2: ...L...
Page 14: ...Chapter 1 Basics Manual VIPA System 200V 1 6 HB97E CP Rev 11 30...
Page 126: ...Chapter 5 CP 240 EnOcean Manual VIPA System 200V 5 32 HB97E CP Rev 11 30...
Page 144: ...Chapter 6 CP 240 M Bus Manual VIPA System 200V 6 18 HB97E CP Rev 11 30...
Page 148: ...Index Manual VIPA System 200V A 4 HB97E CP Rev 11 30 M Stich...