Chapter 6 CP 240 - M-Bus
Manual VIPA System 200V
6-16
HB97E - CP - Rev. 11/30
This function sends a request to a M-Bus participant and receives the
answer. The transmit data has to be entered into DB 10 starting with data
byte 4 before calling the function.
UN #Senden_Start
BEB
U
DB11.DBX
108.7
//Waiting for acknowledgment
SPB REC
NOP
0
//Enter transmit data into send buffer
L #Baud
//1
st
send byte is baud rate
T DB10.DBB
0
L #C_Field
//2
nd
send byte is C_Field
T DB10.DBB
1
L #A_Field
//3
rd
send byte is A_Field
T DB10.DBB
2
L #CI_Field
//4
th
send byte is CI_Field
T
DB10.DBB
3
//At Long Frame data must be entered
NOP 0
//from user data on before FC call
SET
//
S
DB10.DBX
260.4
//Set send release
L 0
L
#Data
//Telegram length at Long Frame
<>I
+4
T
DB10.DBW
254
//Telegram length for Long Frame
SPB send
L 0
L
#CI_Field
//ID for Control Frame
<>I
L
4
//Telegram length for Control Frame
SPB sen1
L
3
//Telegram length for Short Frame
sen1: T
DB10.DBW
254
//Telegram
length
send: CALL
FC
0
//Block
send
ADR
:=#Adr_CP
//Module address
_DB
:=DB10
//DB send buffer
ABD
:=W#16#0
//1
st
data byte to send
ANZ
:=DB10.DBW254
//Amount of send data
PAFE
:=DB10.DBB261
//Error byte
FRG
:=DB10.DBX260.4
//Send release
GESE
:=DB10.DBW256
//Internal variable
ANZ_INT
:=DB10.DBW258
//Internal variable
ENDE_KOM :=DB10.DBX260.0
//Internal variable
LETZTER_BLOCK:=DB10.DBX260.1
//Internal variable
SENDEN_LAEUFT:=DB10.DBX260.2
//Internal variable
FEHLER_KOM :=DB10.DBX260.3
//Internal variable
U
DB10.DBX
260.4
//Transmission still running
BEB
//then
end
S
DB11.DBX
108.7
//Waiting for acknowledgment
REC: NOP
0
CALL FC
1
ADR
:=#Adr_CP
//Module address
_DB
:=DB11
//DB receive buffer
ABD
:=W#16#0
//1
st
data byte receive buffer
ANZ
:=DB11.DBW102
//Amount of received bytes
EMFR
:=DB11.DBX108.4
//Telegram received completely
PAFE
:=DB11.DBB109
//Error byte
GEEM
:=DB11.DBW104
//Internal variable
ANZ_INT
:=DB11.DBW106
//Internal variable
EMPF_LAEUFT
:=DB11.DBX108.0
//Internal variable
LETZTER_BLOCK :=DB11.DBX108.1
//Internal variable
FEHL_EMPF :=DB11.DBX108.2 //Internal
variable
UN
DB11.DBX
108.4
//No new value received yet
BEB
R
DB11.DBX 108.4
R
DB11.DBX 108.7
R #Senden_Start
L
DB11.DBW 102
L
1
//If received only 1Byte -> error
==I
SPB Fehl
L W#16#2000
//After respond reception, delete
Ende:
T
#RET_VAL
//start bit and return ID to RET_VAL
BEA
Fehl: L
DB11.DBB
0
//Received
byte
L
1
//No response from M-Bus slave
==I
L
W#16#8001
//Error ID for no response
SPB Ende
L
W#16#80FF
//Undefined response from CP
SPA Ende
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...