Docsity

Bloco de Função Danfoss - Siemens, Manuais, Projetos, Pesquisas de Automação

Pré-visualização parcial do texto

Baixe Bloco de Função Danfoss - Siemens e outras Manuais, Projetos, Pesquisas em PDF para Automação, somente na Docsity!

Programming Guide

Function Blocks with SIEMENS TIA Portal

1 Introduction

1.1 Disclaimer

The software is provided "as is", without warranty of any kind, expressed or implied, including, but not limited to, the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or any legal entity part of Danfoss group be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software, or the use, or other dealings in the software.

1.2 Purpose of the User Guide

The function blocks show examples on how it is possible to integrate Danfoss VLT® drives in a SIEMENS TIA Portal V15 system. The function blocks are not protected and can be altered to serve the specific needs for the application. Danfoss takes no responsibility to losses due to code faults in these function blocks or wrong use.

This manual provides:

  • Step-by-step approach on how to integrate Danfoss VLT® drives into a SIEMENS TIA Portal V15 system.
  • Procedure on using the library to communicate with Danfoss VLT® drives in SIEMENS TIA Portal V15, including examples.

Function blocks for SIEMENS TIA Portal supporting Danfoss VLT® drives.

Danfoss VLT® drives with the following options:

  • VLT® PROFIBUS DP MCA 101
  • VLT® PROFINET MCA 120

The manual is intended for use by qualified personnel.

1.3 Abbreviations

Abbreviation Description FB Function block RPM Revolution per minute STW Status word CTW Control word Amp Ampere FC Frequency converter DDT Derived data types PDO Process data object SDO Service data object DUT Device under test LIB Library PROFI PROFIBUS or PROFINET

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

4 | Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R

1.4 What are Function Blocks?

Function blocks are predefined programs or functions contained within a single program element that can be used in the PLC program.

1.4.1 Advantages of Using Function Blocks

  • Basic skeleton:
    • FB provides the basic infrastructure towards the user.
    • Frees up time to focus on complex and application-specific implementation of the external device.
    • Reuse of an FB several times in a program without rewriting the FB.
    • Easy to use - knowledge of the internal operation of the drive or complex algorithms is not required.
  • Pretested function:
    • The FB is pretested for working and functionality.
  • Extensibility:
    • FBs can be extended in future by Danfoss. It is possible to incorporate the FBs with minimal modification in the existing program.

1.5 Overview of the Danfoss Library (VLT_PROFI_LIB_V1_12)

The VLT_PROFI_LIB_V1_12 library is a collection of predefined function blocks provided by Danfoss. Use these blocks as an aid to simplify programs, containing standard functionality for programming PROFIBUS & PROFINET, SIEMENS TIA Portal systems, and Danfoss drives.

The library contains the following FBs:

  • Basic operation function block (VLT_PROFI_FC_BASIC [FC300]) : Dedicated to handling the basic operation of the drive and connected motor operations.
  • Parameter access function block (VLT_ PROFI _FC_PARAM_ACCESS [FB300]) : Dedicated to parameter read/write through an acyclic channel.
  • Diagnostics function block (VLT_ PROFI _FC_DIAGNOSTICS [FB302]) : Dedicated to read the diagnostic information.
  • Flexible function block (VLT_ PROFI _FC_FLEXIBLE [FC301]) : Dedicated to handle flexible operation of drive and connected motor operations.
  • Flexible control function block (VLT_ PROFI _FC_FLEXIBLE_CTRL [FB301]) : Dedicated to handle flexible control operation of drive and connected motor operations.

The function blocks do not support the following features:

  • PROFIdrive profile.
  • S7 300 & S7 400 PLC.

1.6 Basic Operation Function Block (VLT_PROFI_FC_BASIC [FC300])

The function block provides the following functionalities:

  • Control and monitoring : monitor the drive and control the command or setpoint from the controller to/from the drive.
  • Reverse : forward or reverse the direction of the motor.
  • Speed regulation : allows the speed reference of the drive.
  • Failure management : the FAULT output pin is set to TRUE if there is a drive fault. This drive fault must be reset by the input pin RESET to close the fault. The fault only disappears if the actual root cause of the fault has disappeared.

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R0922| 5

e30bu431.

START

”DRV_EN”=TRUE^ User input CTW.02 (DC brake) = TRUE CTW.03 (No coasting) = TRUE CTW.04 (Ramp) = TRUE CTW.05 (User ramp) = TRUE

FOR OPERATION^ DRIVE READY STW.00 (Control ready), STW.01 (Drive ready), STW.09 (Bus control)^ STW.02 (Enable), = TRUE

No ”RESET” = TRUE^ User input CTW.07 (Reset) = TRUE

Yes

User input ”REF_VALUE”

”RESET” = TRUE^ User input

User input ”REVERSE” ”FALSE = FORWARD” ”TRUE = REVERSE” CTW.15 (Reverse) = TRUE

”RUN” = TRUE^ User input CTW.06 (Start) = TRUE RUNNING = TRUE STW.11 (In operation) = TRUE

Yes (^) Motor running at preset speed reference? No

RUN_ON_REF = TRUE STW. (Speed = reference)

RUN_ON_REF = FALSE STW. (Speed ≠ reference)

User input ”RUN” = FALSE CTW.06 (Ramp stop) = FALSE Motor stopped

END

Illustration 2: Flow Chart for Basic Operation Of Drive Control

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R0922| 7

1.7 Parameter Access Function Block (VLT_PROFI_FC_PARAM_ACCESS [FB300])

The function block provides functionality to read and write VLT FC series parameters access through acyclic service.

  • Read non-array type parameters.
  • Write non-array type parameters.
  • Read array type parameters.
  • Write array type parameters.

VLT_PROFI_FC_PARAM_ACCESS EN

BOOL

BOOL

BOOL

BOOL BOOL

DWORD BYTE DWORD

BOOL

BOOL WORD

ADR

PAR_NO WR_VALUE

INDEX

BUSY DONE FAULT RD_VALUE FAULT_CODE

e30bu516.

ENO HW_IO EXECUTE RD_WR

DWORD

Illustration 3: Parameter Access Function Block Layout

The following elementary function blocks are embedded inside VLT_PROFI_FC_PARAM_ACCESS [FB300], see SIEMENS TIA Portal Instruction⇒Extended Instruction⇒Distributed IO⇒DP & PROFINET⇒“RDREC & WRREC”.

  • RDREC: a function block which allows to read the data on PROFIBUS slave & PROFINET I/O through acyclic communication.
  • WRREC: a function block which allows to write the data on PROFIBUS slave & PROFINET I/O slave through acyclic communication.

Table 3: Input Parameter

Parameter Type Description EN BOOL Default function block enable input pin. ADR HW_IO S7-1200/1500 requires HW identifier. This parameter can be found in HW configuration for the specific PPO type. EXECUTE BOOL 1=the rising edge of this signal starts the requested operation, 0=triggers an ACK of the end-of-operation notification and the client. RD_WR BOOL Type of operation. 0=read operation, 1=write operation. PAR_NO WORD Enter the drive parameter number in the Hex format. (Example: parameter 3-41 Ramp 1 Ramp Up Time= Hex). INDEX BYTE Enter the index number (Example: parameter 310 [2] Preset Reference) 3–10 is the parameter number and 2 is the index number. WR_VALUE DWORD Write value to the drive.

Table 4: Output Parameter

Parameter Type Description ENO BOOL Default function block enable input pin. BUSY BOOL 0=execution is not started, or execution is completed, 1=execution is processing. DONE BOOL 0=value exchange is not completed, 1=value exchange is completed. FAULT BOOL 0=value exchange is completed, 1=value exchange is unsuccessful.

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

8 | Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R

1.9 Flexible Function Block (VLT_PROFI_FC_FLEXIBLE [FC301])

This function block provides the functionality to read and write cyclic process data (parameter 9-15 PCD Write Configuration and parameter 9-16 PCD Read Configuration).

The function block supports the following functionalities:

  • Read process data from the drive in user accessible format. That is, PCD Read [0] (STW expressed in data bits), PCD Read [1] (main actual value), and PCD Read [2] to PCD Read [9] depends on the drive configuration.
  • Write process data to the drive in user accessible format. That is, PCD Write [0] (control word expressed in data bits), PCD Write [1] (reference value), and PCD Write [2] to PCD Write [9] depends on the drive configuration.
  • Drive communication health status is continuously monitored using COMM_ERR output.

VLT_PROFI_FC_FLEXIBLE EN PPO_READ_FCPROFILE

INT

BOOL BOOL

PPO_WRITE_FCPROFILE

ADR COMM_ERR PCDREAD PCDWRITE

e30bu518.

ENO HW_IO

Illustration 5: Flexible Function Block Layout

Table 7: Input Parameter

Parameter Type Description EN BOOL Default function block enable input pin. ADR HW_IO S7-1200/1500 requires HW identifier. This parameter can be found in HW configuration for the specific PPO type.

Table 8: Output Parameter

Parameter Type Description ENO BOOL Default function block enable output pin. COMM_ERR INT If communication between PLC and the device is healthy, result of DPRD_DAT and 0=no error.

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

10 | Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R

Table 9: Input/output Parameter

Parameter Type Description PCDREAD PPO_READ_FCPROFILE Pointer to data structure for drive data. Parameter Type Description STW Structure Status word BIT_00_CTRL_RDY BOOL 0=control not ready, 1=control ready. BIT_01_DRV_RDY BOOL 0=drive, 1=drive ready. BIT_02_COST_RDY BOOL 0=coasting, 1=enable. BIT_03_TRIP BOOL 0=no error, 1=trip. BIT_04_ERROR BOOL 0=no error, 1=error (no trip). BIT_05_RESERVED BOOL 0=reserved, 1=no action. BIT_06_TRIPLOCK BOOL 0=no error, 1=trip lock. BIT_07_WARINING BOOL 0=no warning, 1=warning. BIT_08_RUNNING_REF BOOL 0=speed<>reference, 1=speed=reference. BIT_09_CTRL_SOURCE BOOL 0=local operation, 1=bus control. BIT_10_F_LIMIT_OK BOOL 0=out of frequency limit, 1=frequency limit ok. BIT_11_IN_OPR BOOL 0=no operation, 1=in operation. BIT_12_IN_AUTOSTART BOOL 0=drive OK, 1=stopped, auto start. BIT_13_VOLT_MAX BOOL 0=voltage OK, 1=voltage exceeded. BIT_14_TORQ_MAX BOOL 0=torque OK, 1=torque exceeded. BIT_15_THERMAL_MAX BOOL 0=timer OK, 1=timer exceeded. MAV INT Measured actual value (speed) in raw value (-16384) to (+16384). PCD_02 INT Depends on the drive configuration. PCD_03 INT Depends on the drive configuration. PCD_04 INT Depends on the drive configuration. PCD_05 INT Depends on the drive configuration. PCD_06 INT Depends on the drive configuration. PCD_07 INT Depends on the drive configuration. PCD_08 INT Depends on the drive configuration. PCD_09 INT Depends on the drive configuration.

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R0922| 11

  • CTW as expressed in the input of the function block and drive operation status as expressed in the output of the function block.
  • Read process data from the drive in user accessible format. That is, PCD Read [0] (STW expressed in data bits), PCD Read [1] (main actual value), and PCD Read [2] to PCD Read [9] depend on the drive configuration.
  • Write process data to the drive in user accessible format. That is, PCD Write [0] (CTW expressed in data bits), PCD Write [1] (reference value), and PCD Write [2] to PCD Write [9] depend on the drive configuration.
  • VLT_PROFI_FC_FLEXIBLE_CTRL [FB301] function block should be used along with VLT_PROFI_FC_FLEXIBLE [FC301] function block.

VLT_PROFI_FC_FLEXIBLE_CTRL EN BOOL

BOOL BOOL READY

PCDREAD PCDWRITE

e30bu519.

ENO

PPO_READ_FCPROFILE PPO_WRITE_FCPROFILE

INT

BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL

INT

BOOL BOOL BOOL BOOL INT

FAULT WARNING

PRESET_REF_ PRESET_REF_ DC_BRAKE_RAMP COAST_INV RUNNING QSTP_RMP (^) RUN_ON_REF HLD_RMP MAV START RESET JOG RAMP_1_ DATA_VALID RLY_1_ON RLY_2_ON SETUP_SEL_ SETUP_SEL_ REVERSE REF_VALUE

DPRDWR_ERR

Illustration 6: Flexible Control Function Block Layout

Table 10: Input Parameter

Parameter Type Description EN BOOL Default function block enable input pin. PRESET_REF_1 BOOL Bit 0.0=reference value, 1=selection lsb. PRESET_REF_2 BOOL Bit 1.0=reference value, 1=selection msb. DC_BRAKE_RAMP BOOL Bit 2.0=DC brake, 1=ramp. COAST_INV BOOL Bit 3.0=coasting, 1=no coasting. QSTP_RMP BOOL Bit 4.0=quick stop, 1=ramp. HLD_RMP BOOL Bit 5.0=hold output frequency, 1=use ramp. START BOOL Bit 6.0=ramp stop, 1=start. RESET BOOL Bit 7.0=no function, 1=reset. JOG BOOL Bit 8.0=no function, 1=Jog. RAMP_1_2 BOOL Bit 9.0=ramp 1, 1=ramp 2.

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R0922| 13

Parameter Type Description DATA_VALID BOOL Bit 10.0=do not use CTW, 1=use CTW. RLY_1_ON BOOL Bit 11.0=relay 01 deactivated, 1=relay 01 active. RLY_2_ON BOOL Bit 12.0=relay 02 deactivated, 1=relay 02 active. SETUP_SEL_1 BOOL Bit 13.0=parameter set-up, 1=selection lsb. Multi setup in parameter 0-10 Active Set-up must be selec- ted. SETUP_SEL_2 BOOL Bit 14.0=parameter set-up, 1=selection msb. Multi setup in parameter 0-10 Active Set-up must be se- lected. REVERSE BOOL Bit 15.0=no reverse, 1=reverse. REF_VALUE INT Reference speed is a raw value (-16384) to (+16384).

Table 11: Output Parameter

Parameter Type Description READY BOOL Drive is ready to start. FAULT BOOL Fault is present. Trip or trip lock. WARNING BOOL Warning is present. RUNNING BOOL Drive is started, but not necessarily running on reference speed. RUN_ON_REF BOOL Running on reference. MAV INT Measured actual value (speed) in raw value (-16384) to (+16384).

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

14 | Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R

Parameter Type Description PCDWRITE PPO_WRITE_FCPROFILE Pointer to data structure for drive data. Parameter Type Description CTW Structure Control word BIT_00_PRESET_REF_1 BOOL 0=reference value, 1=selection lsb. BIT_01_PRESET_REF_2 BOOL 0=reference value, 1=selection msb. BIT_02_DC_BRAKE_RAMP BOOL 0=DC brake, 1=ramp. BIT_03_COASTING BOOL 0=coasting, 1=no coasting. BIT_04_RAMP BOOL 0=quick stop, 1=ramp. BIT_05_USE_RAMP BOOL 0=hold output frequency, 1=use ramp. BIT_06_START BOOL 0=ramp stop, 1=start. BIT_07_RESET BOOL 0=no function, 1=reset. BIT_08_JOG BOOL 0=no function, 1=jog. BIT_09_RAMP_1_2 BOOL 0=ramp 1, 1=ramp 2. BIT_10_DATA_VALID BOOL 0=do not use CTW, 1=use CTW. BIT_11_RLY_1_ON BOOL 0=relay 01 deactivated, 1=relay 01 active. BIT_12_RLY_2_ON BOOL 0=relay 02 deactivated, 1=relay 02 active. BIT_13_SETUP_SEL_1 BOOL 0=parameter set-up 1, 1=selection msb. BIT_14_SETUP_SEL_2 BOOL 0=parameter set-up 2, 1=selection msb. BIT_15_REVERSE BOOL 0=no reverse, 1=reverse. REF_VALUE INT Main reference speed is a raw value (-16384) to (+16384). PCD_02 INT Depends on the drive configuration. PCD_03 INT Depends on the drive configuration. PCD_04 INT Depends on the drive configuration. PCD_05 INT Depends on the drive configuration. PCD_06 INT Depends on the drive configuration. PCD_07 INT Depends on the drive configuration. PCD_08 INT Depends on the drive configuration. PCD_09 INT Depends on the drive configuration. DPRDWR_ERR INT Map the COMM_ERR tag from VLT_PROFI_FC_FLEXIBLE function block.

Programming Guide | Function Blocks with SIEMENS TIA Portal Introduction

16 | Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R

2 Using FBs in TIA Portal

2.1 Importing Danfoss Library into a Project

Procedure

1. Download the VLT_PROFI_LIB_V1_12.ZIP file from the Danfoss website. 2. Unzip the VLT_PROFI_LIB_V1_12.ZIP file.

e30bu520.

Illustration 7: Extract VLT_PROFI_LIB_V1_12 Library

3. Open the Project view in the SIEMENS TIA Portal and click Options in the menu bar. 4. Select Global libraries and click Retrieve library….

e30bu521.

Illustration 8: TIA Portal Retrieve Library

5. In Retrieve archived global library pop-up window, navigate to unzipped VLT_PROFI_LIB_V1_12 library folder location. 6. Select the VLT_PROFI_LIB_V1_12.zal15 library file, and uncheck the Open as read only checkbox.

Programming Guide | Function Blocks with SIEMENS TIA Portal Using FBs in TIA Portal

Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R0922| 17

e30bu524.

Illustration 11: Global Libraries

10. Expand the VLT_PROFI_LIB_V1_12 library folder and check whether the DB’s and DUT’s function blocks are retrieved as shown in the following illustration.

Programming Guide | Function Blocks with SIEMENS TIA Portal Using FBs in TIA Portal

Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R0922| 19

e30bu525.

Illustration 12: VLT_PROFI_LIB_V1_12 Libraries

11. From Global libraries, select VLT_PROFI_LIB_V1_12 library folder. 12. Drag and drop the VLT_PROFI_LIB_V1_12 library folder to Program blocks folder as shown in the following illustration.

e30bu526.

Illustration 13: VLT_PROFI_LIB_V1_12 Libraries in Program Blocks

13. From Global libraries, select VLT_PROFI_LIB_V1_12 library folder. 14. Drag and drop the PPO_FC, PPO_READ_FCPROFILE, and PPO_WRITE_FCPROFILE DUTs to PLC data types folder as shown in the following illustration.

Programming Guide | Function Blocks with SIEMENS TIA Portal Using FBs in TIA Portal

20 | Danfoss A/S © 2019.12 AU326537640107en-000101 / 130R