1. Overview of DP bus communication function Periodic and non-periodic data communication between the S7-300/400 and SINAMICS S120 via the DP bus. Using the standard S7 function block SFC14/SFC15, the S7-300/400PLC can send the control word 1 (CTW1) and the master setting value (NSETP_B) to the drive through the PROFIBUS periodic communication mode. With the standard S7 function blocks SFC58/SFC59, it is possible to achieve non-periodic data exchange, read or write the parameters of the drive.
2. The connection between S7-300/400 and S120 device
3. Drive station address setting 1. There are two ways to set the PROFIBUS communication address of the drive: (1) The address setting is realized by the DIP switch on the CU control unit, and the effective address value is: 1... 126, in this example, the address setting is shown in the figure below. Note: When changing the address through the DIP switch, the power supply of the inverter should be disconnected (2) When the DIP switch is all dialed to the OFF or ON state, the address can be set by using the parameter P918, otherwise The address set in the P918 parameter is invalid. By default, the Baud rate for PROFIBUS communication of the drive unit is 1.5 Mbps 2. The station address of the drive device set in the hardware configuration of the S7-300/400 should be consistent with the station address of the drive device. 4. Communication message settings Only specific message structures can be selected for different drives, as described in SINAMICS_S120_Commissioning_Manual. Table 1 lists commonly used packets. Table 1. Packet format 999 is a user-defined message, and when the user selects this packet format, the start and stop control positions of the motor need to be associated by the user. In this case, the PLC control request must be set to 1 (P854=1). Note: You can configure the packet structure as needed during the S7-300/400 hardware configuration
compilation and saving; After that, open Starter and check whether the packet structure is consistent
Open "configuration" and click the "Transfer to HW config" button.
DC/AC drive packet setting
fig.3
5. Use DP bus to start, stop and speed control the motor The S7-300/400PLC sends the control word 1 (CTW1) and the master setting value (NSETP_B) to the drive via PROFIBUS periodic communication. (1) Bit0 in the control word is used to control the start and stop of the motor. (2) The main setpoint is the speed setpoint, and the frequency setpoint and the actual value are standardized so that 4000H (hexadecimal) corresponds to 100%, and the highest frequency (max) of transmission is 7FFFH (200%). The reference frequency can be modified in the P2000 (the default value is 50Hz). (3) When the configured packet structure PZD=2 or free packet 999, the "MOVE" command can be used to transmit data in S7-300/400; When the configured packet structure PZD〉2, the SFC14 and SFC15 system function blocks need to be called in S7-300/400. • SFC14 ("DPRD_DAT") is used to read process data from Profibus slaves • SFC15 ("DPWR_DAT") is used to write process data to Profibus slaves Examples: SERVO_02 control word, transmission of master setting value, status word, and actual frequency reading program (1) Control the drive to run: The drive is started by sending the control word (STW1) 047E and then 047F, which is specified in DB10.DBW8 (see Figure 4), the master setting value is set in DB10.DBD10, and the operating signal is M1.0. These values are set and monitored VAT_2 variable tables. The control procedure is shown in Figure 3. (2) Stop the drive: The control word 047E should be sent to the drive. (3) Read the actual value of the drive status word and frequency: The PLC receives the status word 1 (ZSW1) and stores it in DB10.DBW0, and the actual value of the frequency transmitted by the receiving driver is stored in DB10.DBD2.
6. Reading and writing drive parameters 1. Extended PROFIBUS DP Functionality (DPV1) The non-periodic data transfer mode allows: • Exchange large amounts of user data (up to 240 bytes) • Non-periodic data exchange can be achieved with the functions of DPV1 READ and WRITE. Number of transfers
The contents of the block should be in accordance with the PROFIdrive Parameter Channel (DPV1) dataset DS47 (non-periodic parameters
multi-channel structure). 2. Structure of parameter request and parameter response A parameter request consists of three parts: the request title, the parameter address, and the parameter value. Table 2.Parameter request format
Table 3.Parameter Response Format
Table 4: Parameter request and response description
Table 5.Description of Error Values in DPV1 Parameter Answers
3. The S7-300/400PLC reads the driver parameters through PROFIBUS non-periodic communication. Please note: The PLC must use two function blocks SFC58/SFC59 to read the drive parameters (see Figure 5 for the program) Here are some examples: (1) USE THE FLAG M10.0 AND THE FUNCTION SFC58 BLOCK TO SEND A WRITE REQUEST (DATASET RECORD DB1) (FIGURE 6) TO THE DRIVE. Set M10.0 to the value of 1 to start a write request, and when the write request is completed, the request must be set to 0 to end the request. MW108 (RET_VAL) displays an error code that indicates an error that occurred while the function was being processed. For a description of the error, see "System Functions/Function Block Help". (2) After that, a read request is sent to the drive using the flag bit M10.1 and the function SFC59 block, and the drive returns a parameter value response (response block DB2) (see Figure 7). Set M10.1 to the value of 1 to start a read request, and when the read request is completed, the request must be set to 0 to end the request. MW110 (RET_VAL) display includes error codes. Used to represent errors that occur while the function is being processed. For a description of the error, see "System Functions/Function Block Help".
Figure 5. Read the drive parameter program
Figure 6. Write request block DB1
fig7. The drive returns the parameter value data block DB2
4. The S7-300/400PLC writes the driver parameter P1217 through PROFIBUS non-periodic communication. Here are some examples: The PLC only needs to use SFC58 to write parameters and send a write request DB1 (see Figure 9) to the driver in Network 3 of this project. SFC59 is used when the PLC reads the "Write Parameter" response, and in this case the parameter value data block returned by the read drive is DB2 (see Figure 10). See Figure 8 for the procedure. (1) Set M10.0 to the value of 1 to start a write request, and when the write request is completed, the request must be set to 0 to end the request. MW108 (RET_VAL) displays an error code that indicates an error that occurred while the function was being processed. For a description of all errors, see "System Functions/Function Blocks Help". (2) Set M10.1 to the value of 1 to start a read request, and when the read request is completed, the request must be set to 0 to end the request. MW110 (RET_VAL) display includes error codes. Used to represent errors that occur while the function is being processed. For a description of the error, see "System Functions/Function Block Help".
Figure 8. Write to the drive parameter program
Figure 9. Write request DB1
Figure 10. The data block returned by the drive DB2
This article is from Siemens' official website, if there is any infringement, contact to delete
|