Chapter 4 CP 240 - serial
Manual VIPA System 200V
4-42
HB97E - CP - Rev. 11/30
The wanted Modbus commands are set via your PLC program. In the
present sample the deployment of SEND and RECEIVE in the OB1 is
shown.
OB 1:
CALL FC 0
//"SEND"
ADR :=256
//Start address of the module
_DB :=DB10
//In this block you create
//the telegram you want to send
ABD :=W#16#0
//Starting with this Byte-Offset
//the telegram starts in the _DB
ANZ :=MW12
//Telegram length (length to send) in Byte
PAFE :=MB14
//Error byte
FRG :=M1.0
//Send init (1=init, back to 0
//when send ready)
GESE :=MW16
//required internal
ANZ_INT :=MW18
//required internal
ENDE_KOM :=M2.0
//required internal
LETZTER_BLOCK:=M2.1
//required internal
SENDEN_LAEUFT:=M2.2
//required internal
FEHLER_KOM :=M2.3
//required internal
CALL FC 1
//"RECEIVE"
ADR :=256
//Input address of the module
_DB :=DB11
//In this data block the
//received telegram is stored
ABD :=W#16#0
//Starting with this Byte-Offset the tel. starts in _DB
ANZ :=MW22
//Telegram length (received length) in Byte
EMFR :=M1.1
//Reception status (1=Telegram fully received)
PAFE :=MB34
//Error byte
GEEM :=MW36
//required internal
ANZ_INT :=MW38
//required internal
EMPF_LAEUFT :=M3.0
//required internal
LETZTER_BLOCK:=M3.1
//required internal
FEHL_EMPF :=M3.2
//required internal
U M 1.1
//as long as reception status=1 no new
//telegram is entered
R M 1.1
//for this the reception status must be acknowledged
//with
0
If necessary also adjust the addresses that the CP occupies in the CPU to
the addresses of your parameterization and transfer the hardware
configuration to your CPU 21x of the master system.
Note!
Due to the transfer of the data in blocks of 8Byte you have to make sure
that the length of the reception data area is a multiple of 8. As well the
writing accesses of the master should not be outside of the reception area
otherwise the RECEIVE block announces a range error.
PLC program
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...