13.5.6.3.4 Create data block for Modbus slave
For each inverter drive, which is serially connected via Modbus RTU, a data block must
be created.
1.
Click at ‘Project tree è ...CPU...PLC program è Program blocks
è Add new block’.
ð
The dialog ‘Add block’ is opened.
2. Select the block type ‘DB block’ and assign it the name "A1_V1000". The DB
number can freely be selected such as DB100. Specify DB 100 and create this as a
global DB with [OK].
ð
The block is created and opened.
3. In "A1_V1000" create the following variables:
n ‘AxisData’ of type UDT 879 - VMC_AxisRTU_REF
n ‘V1000Data’ of type UDT 881 - VMC_ConfigV1000RTU_REF
13.5.6.3.5 Create data block for all Modbus slaves
For the communication data of the inverter drives, which are serially connected via
Modbus RTU, a common data block is to be created.
1.
Click at ‘Project tree è ...CPU...PLC program è Program blocks
è Add new block’.
ð
The dialog ‘Add block’ is opened.
2. Select the block type ‘DB block’ and assign it the name "ComDataSlaves". The DB
number can freely be selected such as DB99. Specify DB 99 and create this as a
global DB with [OK].
ð
The block is created and opened.
3. In "ComDataSlaves" create the following variable:
n ‘Slaves’ of Type UDT 877 - VMC_ComSlavesRTU_REF
13.5.6.3.6 OB 1 - Create instance of communication manager
The FB 877 - VMC_ComManager_RTU ensures that only 1 inverter drive (Modbus slave)
can use the serial interface. As a communication manager, the block sends the jobs to
the respective Modbus slaves and evaluates their responses.
1. Open the OB 1.
2. Add a Call FB877, DB877 to OB 1.
ð
The block call is created and a dialog opens to specify the instance data block
‘VMC_ComManager_RTU_877’ .
3. Confirm the query of the instance data block with [OK].
4. Specify the following parameters:
Call FB877, DB877
Ä
Chap. 13.5.7.6 ‘FB 877 - VMC_ComManager_RTU - Modbus RTU communication manager’ page 505
NumberOfSlaves := 1 // Number of connected inverter drives: 1 IN: INT
WaitCycles := "ComWaitCycles" // Minimum number of waiting cycles IN: DINT
SlavesComData := "ComDataSlaves.Slave" // Reference to all communication objects IN-OUT: UDT 877
VIPA SPEED7
Motion control - Simple Motion Control Library
Usage inverter drive via Modbus RTU > Usage in Siemens TIA Portal
HB00 | OPL_SP7 | Operation list | en | 18-30 498