DP communication for PLC and frequency conversion
Thread Content
Hardware Configuration1. Add MASTERDRIVES CBP/CBP2 to the configuration.
2. Profibus Address
1. Add MICROMASTER 4 to the configuration.
2. Profibus Address
Select Data Format
1. PP0 types available in MASTERDRIVE.
2. I/Q Address
1. Data formats available in MICROMASTER 4.
2. I/Q Address
Programming in Step 7: Create data block DB1
Explanation:
1. When reading and writing parameters in the PKW (parameter area) in Step7, use SFC14 and SFC15.
2. SFC14 (“DPRD_DAT”) is used to read data from the Profibus slave.
3. SFC15 (“DPWR_DAT”) is used to write data to the Profibus slave.
4. W#16#100 (i.e., 256) is the starting address of PKW in hardware configuration.
Program Example 1
1. Read parameter r015
Note: For detailed explanations of PKW and IND, see Appendix.
1. W#16#100 (i.e., 256) is the starting address of PKW in hardware configuration.
2. Read 8 bytes starting from DB1.DBX0.0 from the slave (P#DB1.DBX0.0 BYTE 8)
PKE -> DB1.DBW0
IND -> DB1.DBW2
PWE1 -> DB1.DBW4 (high byte of parameter value)
PWE2 -> DB1.DBW6 (low byte of parameter value)
3. Write 8 bytes starting from DB1.DBX28.0 to the slave (P#DB1.DBX28.0 BYTE 8)
DB1.DBW28 -> PKE
DB1.DBW30 -> IND (high byte of parameter value)
DB1.DBW32 -> PWE1 (low byte of parameter value)
DB1.DBW34 -> PWE2
Note: For detailed explanations of PKW and IND, see Appendix.
Program Example 2 (Reading values from an array of parameters)
2. Read parameter P401.2
Note: For detailed explanations of PKW and IND, see Appendix.
1. W#16#100 (i.e., 256) is the starting address of PKW in hardware configuration.
2. Read 8 bytes starting from DB1.DBX0.0 from the slave (P#DB1.DBX0.0 BYTE 8)
PKE -> DB1.DBW0
IND -> DB1.DBW2
PWE1 -> DB1.DBW4 (high byte of parameter value)
PWE2 -> DB1.DBW6 (low byte of parameter value)
3. Write 8 bytes starting from DB1.DBX28.0 to the slave (P#DB1.DBX28.0 BYTE 8)
DB1.DBW28 -> PKE
DB1.DBW30 -> IND (high byte of parameter value)
DB1.DBW32 -> PWE1 (low byte of parameter value)
DB1.DBW34 -> PWE2
Note: For detailed explanations of PKW and IND, see Appendix.
Program Example 3 (Reading parameters that require a set bit on their parameter page)
3. Read parameter U001.2
Note: For detailed explanations of PKW and IND, see Appendix.
1. W#16#100 (i.e., 256) is the starting address of PKW in hardware configuration.
2. Read 8 bytes starting from DB1.DBX0.0 from the slave (P#DB1.DBX0.0 BYTE 8)
PKE -> DB1.DBW0
IND -> DB1.DBW2
PWE1 -> DB1.DBW4 (high byte of parameter value)
PWE2 -> DB1.DBW6 (low byte of parameter value)
3. Write 8 bytes starting from DB1.DBX28.0 to the slave (P#DB1.DBX28.0 BYTE 8)
DB1.DBW28 -> PKE
DB1.DBW30 -> IND (high byte of parameter value)
DB1.DBW32 -> PWE1 (low byte of parameter value)
DB1.DBW34 -> PWE2
Note: For detailed explanations of PKW and IND, see Appendix.
Program Example 4 (Writing parameters)
4. Write parameter P401.1 (Write W#16#1000 to P401.1)
1. Write W#16#8191 to DB1.DBW28 (PWE)
Note: For detailed explanations of PKW and IND, see Appendix.
1. W#16#100 (i.e., 256) is the starting address of PKW in hardware configuration.
2. Read 8 bytes starting from DB1.DBX0.0 from the slave (P#DB1.DBX0.0 BYTE 8)
PKE -> DB1.DBW0
IND -> DB1.DBW2
PWE1 -> DB1.DBW4 (high byte of parameter value)
PWE2 -> DB1.DBW6 (low byte of parameter value)
3. Write 8 bytes starting from DB1.DBX28.0 to the slave (P#DB1.DBX28.0 BYTE 8)
DB1.DBW28 -> PKE
DB1.DBW30 -> IND (high byte of parameter value)
DB1.DBW32 -> PWE1 (low byte of parameter value)
DB1.DBW34 -> PWE2
Note: For detailed explanations of PKW and IND, see Appendix.
Reading and Writing PZD (Process Data)
Explanation:
1. When reading and writing parameters for PZD (process data) in Step7, use SFC14 and SFC15.
2. SFC14 (“DPRD_DAT”) is used to read data from the Profibus slave.
3. SFC15 (“DPWR_DAT”) is used to write data to the Profibus slave.
4. W#16#108 (i.e., 264) is the starting address of PZD in hardware configuration.
5. For PZD with a special structure, PQW and PIW can be used for reading and writing.
Program Example 5: Reading and Writing 10 PZDs in PPO5
Data words in DB1 corresponding to PZDs
1. Set the Profibus address in P918; it must be the same as that set in Step7. Addresses cannot repeat.
2. Set the tenth bit of the control word to “1”. PZD1 = W#16#X4XX
Appendix