Professional Documents
Culture Documents
Page 1 of 19
1. Contents
1. Purpose ........................................................................................................................................................................... 5
2. Intended Use ................................................................................................................................................................. 5
3. Revision History............................................................................................................................................................ 5
4. Open Library License.................................................................................................................................................. 5
5. Hardware and Software Compatibility ................................................................................................................. 5
6. Background ................................................................................................................................................................... 6
7. Target Platforms .......................................................................................................................................................... 6
7.1. PLC Target .............................................................................................................................................................. 6
7.2. HMI Target ............................................................................................................................................................. 6
8. Testing............................................................................................................................................................................. 6
8.1. PLC Testing............................................................................................................................................................. 6
8.2. HMI Testing ........................................................................................................................................................... 6
9. Support Resources ...................................................................................................................................................... 7
9.1. Technical Support ................................................................................................................................................ 7
9.2. Documentation .................................................................................................................................................... 7
10. Library Overview ........................................................................................................................................................ 8
10.1. Motor Control ...................................................................................................................................................... 8
10.1.1. G Series VFD Control fbVFD_GSeries ................................................................................................ 8
10.1.2. Analog VFD Control fbVFD_Analog.................................................................................................. 8
10.1.3. Digital Single Speed Motor fbMotor_Reversing ........................................................................... 8
10.2. Valve Control....................................................................................................................................................... 8
10.2.1. Two State Solenoid Valve fbValve_Solenoid.................................................................................. 8
10.2.2. Analog Valve fbValve_Analog ............................................................................................................ 8
10.3. Inputs/Outputs ................................................................................................................................................... 8
10.3.1. Analog Input with Scaling and Alarms fbIO_AnalogInput......................................................... 8
10.3.2. Analog Output with Scaling fbIO_AnalogOutput ........................................................................ 8
10.4. General .................................................................................................................................................................. 8
10.4.1. System Control ............................................................................................................................................ 8
10.4.2. Interlock Function Block - fbInterlock ................................................................................................. 9
10.4.3. PID Interface fbPID_CompactInterface ........................................................................................... 9
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 2 of 19
Page 3 of 19
Page 4 of 19
1. Purpose
The purpose of this document is to provide a general overview of the library and to discuss
decisions in program architecture that make best use of the library. Additionally, this document will
discuss system compatibility, testing, and how to contribute to growing the Open Library.
2. Intended Use
This document is intended to be the starting point by anyone utilizing the Open Library for PLC
and HMI Development.
3. Revision History
Version
1.0
1.1
1.2
1.3
Date
2016-05-23
2016-06-20
2016-08-23
2016-10-11
Author
DMC
DMC
DMC
DMC
Comments
Initial Release
No Changes
Added information on Supplementary Blocks
No Changes
Page 5 of 19
6. Background
The Siemens Open Library was developed by DMC Inc. over many years. Through a joint
collaboration with Siemens Industry, DMC documented the library and released it as an Open
Source Library open for anyone to use and distribute. The Library is Open Source and will allow for
users to contribute content to help enhance the overall availability of functionality to the greater
Siemens User Community.
7. Target Platforms
This section covers the target platforms that apply to the library.
8. Testing
This section covers the testing that was completed for use of the project.
Page 6 of 19
9. Support Resources
This section covers available support resources for use of the Siemens Open Library.
9.2. Documentation
The following documents have been created to help users implement, customize, and maintain the
Siemens Open Library
1.
2. Initial Setup
Provides information on how to do the initial configuration required for all library objects.
3. Example Object Configuration
Walks through how to use and configure a single object and uses fbValve_Solenoid as an
example.
4. Detailed Library Block Description
Provides detailed information for the functionality, inputs, outputs, UDTs, and Faceplates
for each object.
5. Siemens HMI Alarm Generation
Provides information for how to generate alarms for use in WinCC Comfort or WinCC RT
Advanced using the automated tools.
6. PID Block Configuration
Walks through how to use and configure the PID Object, as it has special instructions.
7. Customizing Library Objects
Discusses how to modify the library to change functionality or appearance.
Page 7 of 19
10.3. Inputs/Outputs
10.3.1. Analog Input with Scaling and Alarms fbIO_AnalogInput
This library object scales analog inputs and provides setups for alarms.
10.4. General
10.4.1. System Control
This library object is a User Defined Type only that is used to provide mode information to other
Library Objects, and is controlled by HMI Faceplates.
Page 8 of 19
Page 9 of 19
Page 10 of 19
PREFIX EXAMPLE
BOOL
bInAuto
BYTE
by
byOutStatus
INT
iInMode
REAL
rActualWeight
WORD
wInModbusAddress
DWORD
dw
dwInFlow
TIME
tInUpdateTimeout
STRING
sTitle
HMI_VFD_Control
MULTI INSTANCE
FUNCTION BLOCK
ParameterReadWrite
None
PREFIX
EXAMPLE
FB/FC Input
In
bInAuto
FB/FC Output
Out
byOutStatus
Internal Static
Variable
<blank>
rActualWeight
Internal
Temporary
Variable
Temp
tTempElapsedTime
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 11 of 19
DESCRIPTION
Modes
Modes.PID
HMI
HMI.Status
IoScaling
IoScaling.S7Analog
Contains constants for all S7 series AI cards and all sensor types.
Estop
DataTypes
Page 12 of 19
Page 13 of 19
12.1.1. Overview
The Library Utilizes a Mode architecture that is used to control a given block in Off, Auto, or
Manual modes. A single global mode is typically used for small systems, and multiple system
modes are typically used for larger systems. For example, if the system is a standalone skid, then a
single mode can apply to all objects. If the system is an entire manufacturing line with multiple
sections, then it is often best to create a mode for each subsystem, however, this is not required.
Value
Description
Stop
Auto
All blocks are in Auto. Each block will use the PLC configured
values and logic for control.
Manual
All blocks are in Manual. Each block will use the HMI for
control.
Independent
10
Each block mode will be set via the HMI. This allows for some
devices to be in automatic and other to be in manual based on
HMI mode selection.
Most current industry systems maintain a global mode of
Independent, which allows for switching of devices to an
individual mode independent of the mode of other devices.
Page 14 of 19
Stop
Page 15 of 19
12.3.1. Status
Status is indicated on the HMI by changing the color of the actuator or device. HMI indication is
done through an integer in the HMI control structure named iStatus. Status is not used for device
control popups. The iStatus integer is meant for HMI indication only and is therefore not
recommended to be used in PLC logic.
Page 16 of 19
The Data Block must be non-optimized (applies to 1200/1500 only and is accessible via the
properties of the Data Block).
2. The User Defined Type, Struct, and/or individual Boolean comments will be utilized for the
alarm text, so it is important to put in meaningful comments on each alarm.
3. The Excel macro will work with nested User Defined Types and Structs.
4. The Excel macro works only with data blocks containing only Booleans, so all automatically
generated alarms will need to be Boolean alarms, and should be concentrated in Data
Blocks.
Page 17 of 19
Page 18 of 19
Page 19 of 19
Page 1 of 6
Contents
1. Purpose ........................................................................................................................................................................... 3
2. Intended Use ................................................................................................................................................................. 3
3. Revision History............................................................................................................................................................ 3
4. Open Library License.................................................................................................................................................. 3
5. Hardware and Software Compatibility ................................................................................................................. 3
6. System and Clock Memory Bytes ........................................................................................................................... 4
7. Retrieve Open Library ................................................................................................................................................ 5
8. Add Tag Table .............................................................................................................................................................. 6
Page 2 of 6
1. Purpose
The purpose of this document is to provide a guide for the initial use of the Siemens Open Library.
The steps contained in this document should be done before attempting to use any library object,
or the compilation of the project will result in errors.
2. Intended Use
This document is intended to be the starting point by anyone utilizing the Open Library for PLC
and HMI Development.
3. Revision History
Version
1.0
1.1
1.2
1.3
Date
2016-05-23
2016-06-20
2016-08-23
2016-10-11
Author
DMC
DMC
DMC
DMC
Comments
Initial Release
No Changes
No Changes
No Changes
Page 3 of 6
Open the Hardware configuration and select the processor that will be using the library
objects.
2. Right click and select Properties
3. In the Properties, find the System and clock memory settings and click the Enable check
box for both the System memory bits and the Clock memory bits
4. The addresses can be changed, as all items are accessed symbolically.
Page 4 of 6
In the file menu of TIA Portal, select Options -> Global libraries ->Retrieve library
2. Select a place on the development machine to store the library. This will be the place any
changes made will also be saved.
3. By default, the Open Library will open as read only. If edits need to be made, close the
library, open it again, and deselect the Read-only checkbox.
Page 5 of 6
Inside the Master copies of the Open Library, navigate to the Open Library tag table.
2. Drag the Open Library tag table from the Master copies into the PLC tags of the
controller using the Open Library.
Page 6 of 6
Page 1 of 24
Contents
CONTENTS ......................................................................................................................................................................... 2
1. PURPOSE......................................................................................................................................................................... 3
2. INTENDED USE ............................................................................................................................................................. 3
3. REVISION HISTORY ..................................................................................................................................................... 3
4. OPEN LIBRARY LICENSE ............................................................................................................................................ 3
5. HARDWARE AND SOFTWARE COMPATIBILITY ................................................................................................ 4
6. EXAMPLE SETUP .......................................................................................................................................................... 5
6.1. Initial Setup............................................................................................................................................................. 5
6.2. PLC ........................................................................................................................................................................... 5
6.2.1. Adding PLC Library Objects to Project ................................................................................................. 5
6.2.2. Create Required Data Blocks and User Defined Types ................................................................. 10
6.2.3. Create PLC Code........................................................................................................................................ 13
6.3. HMI Development ............................................................................................................................................. 16
6.3.1. Special considerations for S7-300/S7-400 PLCs .............................................................................. 16
6.3.2. HMI Pop-up Creation and Configuration .......................................................................................... 16
6.3.3. HMI Icon Creation and Configuration ............................................................................................... 22
Page 2 of 24
1. Purpose
The purpose of this document is to walk through the steps required to setup an object in the
Siemens Open Library. Each object has a different interface, as defined in the detailed block
description for that object, however, all of the objects are setup and configured using the methods
outlined in this document.
2. Intended Use
This document is intended to be used by anyone utilizing the Open Library for PLC and HMI
Development. This document should be used after reviewing the following documents:
1. 1- Siemens Open Library Library Overview and Architecture
2. 2- Siemens Open Library Initial Setup
3. Revision History
Version
1.0
1.1
1.2
1.3
Date
2016-05-23
2016-06-20
2016-08-23
2016-10-11
Author
DMC
DMC
DMC
DMC
Comments
Initial Release
No Changes
No Changes
No Changes
Page 3 of 24
Page 4 of 24
6. Example Setup
This tutorial walks through the process of using one of the blocks from the Open Library. The
example object is the Solenoid Valve, but the same method is utilized for any other object block,
with special consideration and separate document for use of the PID Interface block. For detailed
information for each individual object, see the documentation pertaining to that object in 4Siemens Open Library Detailed Block Overview.
6.2. PLC
This section covers the steps required to configure the PLC project. It utilizes the best practices
standard with this library, but different methods can be used to store the Function Block Instance
memory and the User Defined Types.
Page 5 of 24
1.
In the controllers Program blocks, we have created example groups and blocks used in this
tutorial, as seen below. A similar structure is suggested for your project. Notice the Library
Blocks group is empty now because this is where the library blocks will be placed.
2. Copy the desired Function Block from the Open Library Types group of the library into the
Library Blocks group created in our project. This is done by dragging and dropping from
Page 6 of 24
the library into the Program Blocks of your PLC. In this case we will demonstrate
fbValve_Solenoid. This will need to be done for each PLC in the project that uses this block.
Page 7 of 24
Page 8 of 24
Page 9 of 24
Create global Data Blocks for housing of the User Defined Types for the HMI and the
Errors. In this example, the HMI data will be contained in dbWaterSystem and the error
data will be contained in dbErrors_WaterSystem.
2. The Error Data block needs to be non-optimized to utilize the Excel Macro to automatically
generate alarms. To setup non-optimized access, right click on the data block and select
Properties. Under the Attribute tab, verify the Optimized block access is not checked.
For additional details see 5- Siemens Open Library - Siemens HMI Alarm Generation.
3. Repeat step 2 for the HMI data block if using an S7-300 or S7-400.
4. In the Data Block that will contain the HMI interface, dbWaterSystem in this example, add
the HMI control structure for the device by naming the structure and assigning it the
Page 10 of 24
proper Data type. In this example, the UDT is named SOL_MainWater (SOL derives from
Solenoid and is a DMC naming standard for Solenoid devices) but any name can be used.
5. The User Defined Type has a large number of variables, with full details provided in the
documentation for the specific Library Object that is being used. It can be expanded to see
the variables available inside the UDT.
Page 11 of 24
6. Add the error structure to error data block. In this example it is added to
dbErrors_WaterSystem.
The Error Data Block needs to be non-optimized, for which the setting is available via the
Data Block Properties by right clicking on the data block. For additional details see 5-
Page 12 of 24
Create the function block that will contain the logic for the Solenoid valve. In this case we
created a Function Block called fbWaterSystem. Add the inputs and outputs that
correspond to the required logic for the water system.
2. Inside the function block that will contain the logic, add a Static Variable to contain the
instance memory for the Library Object. In this example, SOL_MainWater is added with
data type fbValve_Solenoid.
Page 13 of 24
3. Drag and drop the Object from the project tree Program blocks into the ladder logic where
it will be used.
4. Choose to use this block as a multiple instance call and select the instance created in the
static memory of fbWaterSystem. Alternatively, you can provide a name for the instance
memory and TIA Portal will automatically add it to the static variables section of the block.
Page 14 of 24
5. Assign tags to the inputs and outputs of the object. Detailed information for the meanings
of each input and output can be found in the 4- Siemens Open Library - Detailed Block
Overview document.
Page 15 of 24
Create a new Pop-up screen for the Solenoid Valve. This is done by clicking the Add new
pop-up screen button in the Pop-up screens section. Give a name that identifies the
specific object being used.
Page 16 of 24
2. Drag the Pop-up Faceplate, fpValve_Solenoid_Popup in this example, from the library onto
the new Pop-up screen. The faceplate can be resized to best fit the size of the HMI that is
being used, however, increasing text size requires making a new version of the object with
larger text. Be sure that the Pop-up screen size is equivalent to the size of the faceplate. If
the screen size is smaller than the faceplate, it will be cut off. If the screen size is larger than
the faceplate, there will be a white boarder around the Pop-up.
Page 17 of 24
3. Create an HMI tag for the object in the HMI Tag Table and map it to the HMI UDT that was
created on the PLC, in this case: dbWaterSystem.SOL_MainWater. As an additional option,
the tag can be automatically created by dragging and dropping the UDT directly from the
PLC into the HMI Interface.
Below shows the method for creating the object tag from the HMI Tag Table:
And below shows how to have Portal automatically have the tags created for you, by
dragging and dropping the UDT directly into the interface:
Page 18 of 24
4. Configure the required variables in the Interface of the faceplate. If the Interface tab is not
visible, right click on the faceplate, select properties, and the window should appear on the
bottom of the screen. Each library object has a slightly different interface. The details of
each can be seen in the documentation for the specific object. In this case, the interface
contains the following variables: HMI_ValveControl, sBottomButtonText, sTopButtonText,
and sTitle. Configure the HMI_ValveControl using the HMI tag created in step 3, or by
Page 19 of 24
dragging and dropping the tag from the PLC. Configure any strings required by typing the
fixed text into the interface.
5. You will notice on the faceplate that there is a greyed-out area at the bottom of the
faceplate, typically in the bottom right area. This is for the addition of an exit button to the
popup screen, allowing you to successfully close the popup when you wish to revert back
to the original screen.
Page 20 of 24
6. To add this button, you need to retrieve it from the Open Library under Master Copies. It
will be named Exit Button. Drag and drop it onto the faceplate. Note: the button size will
vary depending on the faceplate, and may need to be resized to fit correctly.
7. Adding the popup functionality: We want the exit button to exit out of the popup screen.
This can be achieved by using the ShowPopupScreen function. To do this, click on the Exit
button, navigate to the button properties tab (either by right-clicking and selecting
properties, or alternatively just pressing Alt + Enter). In the Properties sub-tab click over to
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 21 of 24
the Events tab. There should already be a ShowPopupScreen Function added to the
function list. You will need to simply add the name of the screen that you wish to exit, in
this case it is Solenoid Valve. Now the button is set up to turn the popup screen off when
pressed.
Page 22 of 24
1.
Navigate to the correct HMI Icon Faceplate in the Open Library. In this case we will use
fpValve_Solenoid_Horizontal
2. Pull the Icon Faceplate into the desired screen. If the device is rotated, the I will be at the
angle of the device. There is a Horizontal and Vertical version of all devices to allow for
vertical alignment with a correctly oriented interlock symbol.
3. Configure the Interface to the Icon Faceplate using the tag configured in the HMI Pop-up,
or by dragging and dropping the UDT from the PLC.
4. Create an event that will open the Pop-up window in runtime when the valve on the HMI
screen is clicked.
Page 23 of 24
Page 24 of 24
Page 1 of 58
Contents
1. Purpose ......................................................................................................................................................................................................... 3
2. Intended Use ............................................................................................................................................................................................... 3
3. Revision History.......................................................................................................................................................................................... 3
4. Open Library License................................................................................................................................................................................ 3
5. Hardware and Software Compatibility ............................................................................................................................................... 3
6. Section Overview ....................................................................................................................................................................................... 4
6.1. Function Block ..................................................................................................................................................................................... 4
6.2. HMI_Devicetype User Defined Type ............................................................................................................................................ 4
6.3. ERROR_Devicetype User Defined Type ....................................................................................................................................... 4
6.4. HMI Icon Faceplate ........................................................................................................................................................................... 4
6.5. HMI Pop-up Faceplate..................................................................................................................................................................... 4
7. Devices .......................................................................................................................................................................................................... 5
7.1. G Series Motor Control fbVFD_GSeries ................................................................................................................................... 5
7.2. Analog VFD Control fbVFD_Analog ....................................................................................................................................... 13
7.3. Digital Single Speed Motor fbMotor_Reversing ................................................................................................................ 18
8. Valve Control ........................................................................................................................................................................................... 24
8.1. Two State Solenoid Valve fbValve_Solenoid ...................................................................................................................... 24
8.2. Analog Valve fbValve_Analog................................................................................................................................................. 29
9. Input/Output Control ............................................................................................................................................................................ 34
9.1. Analog Input with Scaling and Alarms fbIO_AnalogInput ............................................................................................. 34
9.2. Analog Output with Scaling fbIO_AnalogOutput ............................................................................................................ 39
10. General Control ..................................................................................................................................................................................... 44
10.1. System Control ............................................................................................................................................................................... 44
10.2. Interlock Function Block fbInterlock.................................................................................................................................... 47
10.3. PID Interface - fbPID_CompactInterface ................................................................................................................................ 51
10.4. Standard Alarm Interface fbAlarmWarning ...................................................................................................................... 58
Page 2 of 58
1. Purpose
This document details the inputs, outputs, user defined types, and functionality of the Siemens Open Library
Function Blocks and HMI Faceplates. It should be used as a reference when using or configuring any of the blocks.
2. Intended Use
This document is intended to be used by anyone utilizing the Open Library for PLC and HMI Development. This
document should be used after reviewing the following documents:
1. 1- Siemens Open Library Library Overview and Architecture
2. 2- Siemens Open Library Initial Setup
3. 3- Siemens Open Library Example Object Configuration
3. Revision History
Version
1.0
1.1
1.2
Date
2016-05-23
2016-06-20
2016-08-23
Author
DMC
DMC
DMC
1.3
2016-10-11
DMC
Comments
Initial Release
Updates to Faceplates, function blocks, and datatypes
Updating information regarding S7-1200 use of the GSeries
VFD.
No Changes
Page 3 of 58
6. Section Overview
This section provides a general overview of the library objects and what it contains.
Page 4 of 58
7. Devices
This section covers all objects that are in the Devices Folder of the open library.
Page 5 of 58
Type
Description
tInTimeout
Time
iInMode
Int
Device mode input. See Section 12.1.2 of the Library Overview and
Architecture document of the Library Overview and Architecture document
for further details
bInEstop
Bool
iInAddress
Int
The VFD IO start address. Input and Output IO addresses need to start at
the same value
bInSignalContactor
Bool
bInEnableForward
Bool
bInEnableReverse
Bool
rInCommandSpeed*
Real
rInRampUpTime
Real
rInRampDownTime
Real
The ramp down time for the VFD in seconds (S7-1500 ONLY)
bInCommandForward*
Bool
This is the forward command for auto mode. If this input is set high in auto
mode the motor will run in this direction until the forward interlock
becomes false, or this input is set low
bInCommandReverse*
Bool
This is the reverse command for auto mode. If this input is set high in auto
mode the motor will run in this direction until the reverse interlock
becomes false, or this input is set low
bInResetError
Bool
If an error condition exists, the error must first be fixed, then set this bit
high to reset the internal error
bInMotorProtector
Bool
This input should be mapped directly to the motor's circuit breaker input, if
available. If not available, this input should be set to true. When false, the
motor is disabled and an error is triggered
bInLocalDisconnect
Bool
This input should be wired directly to the motor's safety disconnect switch
input, if available. If not available, this input should be set to true. When
false, the motor is disabled and an error is triggered
Page 6 of 58
bInClutch
Bool
This input should be wired directly into the motors clutch overload input, if
available. If not available, this input should be set to true. When false, the
motor is disabled and an error is triggered
bInCoolingFan
Bool
This input is used to tell the VFD that the cooling fan is running, if available.
If not available, this input should be set to true. When false for 30 seconds
after VFD starts, the motor is disabled and an error is triggered
bInUseCurrentAlarm
Bool
bInUseMaxFrequency
Bool
Type
Description
udtHMI_VF
D_Control
This in/out UDT is used to communicate to the HMI. Inside the UDT are all the
variables needed to control the motor in manual mode, including forward,
reverse, and stop commands. Also inside this UDT are all feedback signals
including actual speed, actual current, and the forward/reverse signals
Type
Description
bOutContactor
Bool
bOutForward
Bool
bOutReverse
Bool
rOutSpeed
Real
rOutCurrent
Real
rOutPower
Real
bOutError
Bool
bOutAuto
Bool
ERROR_VFD
udtError_VFD
This output UDT has one bit for every type of error. It should be
mapped to the HMIs error list. It can also be used for advanced
debugging of the error state
Page 7 of 58
Name
Description
iMode
Int
Current mode
iErrorCode
Int
iStatus
Int
rManualSpeedSP
Real
rAutoSpeedSP
Real
rActualSpeed
Real
rActualCurrent
Real
rActualPower
Real
bPB_ResetError
Bool
bPB_Forward
Bool
bPB_Reverse
Bool
bPB_Stop
Bool
bPBEN_ResetError
Bool
bPBEN_Forward
Bool
bPBEN_Reverse
Bool
bPBEN_Stop
Bool
bForwardOn
Bool
bReverseOn
Bool
bSignalForward
Bool
Forward signal
bSignalReverse
Bool
Reverse signal
bError
Bool
Overall error
bInterlock
Bool
VFD Interlocked
7.1.3.2. udtError_VFD
Errors
Description
Current
Local_Disconnect
Page 8 of 58
Clutch
Clutch error
Signal_Contactor_On
Signal_Contactor_Off
Contactor still ON
Signal_Forward
Signal_Reverse
Not_Stopped
VFD_Max_Freq
VFD_Current
VFD overcurrent
VFD_Motor_Overload
Motor overload
VFD_Overload
VFD overload
VFD_Fault
VFD fault
Cooling_Fan_On
Page 9 of 58
Pump Horizontal
Yellow Border
Yellow Hexagon with I in center
Motor Vertical
Pump Vertical
Meaning
Blue: Stopped
Green: Running
Yellow: Start
Red: Error state
Red Flashing: E-stop pressed
Manual mode
Interlocked
Page 10 of 58
Object
Type
Description
Auto Mode
Button
Manual Mode
Button
Auto Mode SP
Output
Manual Mode SP
Input
Actual Speed
Output
Actual Current
Output
Output
Page 11 of 58
Output
Button
Displays current error status. Field box turns red if any errors are
present, and displays active error text. It will scroll through multiple
alarms.
Commands motor forward when in Manual Mode
Stop Button
Button
Button
RESET Button
Button
Resets errors
EXIT Button
Button
Page 12 of 58
Type
Description
tInTimeout
Time
iInMode
Int
Device mode input. See Section 12.1.2 of the Library Overview and
Architecture document of the Library Overview and Architecture document
for further details
bInEstop
Bool
bInSignalContactor
Bool
Contactor feedback
Page 13 of 58
bInSignalForward
Bool
Forward feedback bit. This tells the motor function block whether the
motor is going in the forward direction. If no feedback input is available,
wire the forward output to the forward feedback input
bInSignalReverse
Bool
Reverse feedback bit. This tells the motor function block whether the
motor is going in the reverse direction. If no feedback input is available,
wire the forward output to the forward feedback input
wInSpeedAct
Word
bInEnableForward
Bool
bInEnableReverse
Bool
rInCommandSpeed*
Real
rInRampUpTime
Real
rInRampDownTime
Real
bInCommandForward*
Bool
This is the forward command for auto mode. If this input is set high in auto
mode the motor will continue to run in this direction until the forward
interlock becomes false, or this input is set low
bInCommandReverse*
Bool
This is the reverse command for auto mode. If this input is set high in auto
mode the motor will continue to run in this direction until the reverse
interlock becomes false, or this input is set low
bInResetError
Bool
If an error condition exists, the error must be fixed first, then set this bit
high to reset the internal error
bInMotorProtector
Bool
This input should be wired directly to the motor's circuit breaker input, if
available. If not available, this input should be set to true. When false, the
motor is disabled and an error is triggered
bInLocalDisconnect
Bool
This input should be wired directly to the motor's safety disconnect switch
input, if available. If not available, this input should be set to true. When
false, the motor is disabled and an error is triggered
bInClutch
Bool
This input should be wired directly into the motors clutch overload input, if
available. If not available, this input should be set to true. When false, the
motor is disabled and an error is triggered
Page 14 of 58
Type
Description
udtHMI_VF
D_Control
This In/Out UDT is used to communicate to the HMI. Inside the UDT are all the
variables needed to control the motor in manual mode, including forward,
reverse, and stop commands. Also inside this UDT are all feedback signals
including actual speed, actual current, and the forward/reverse signals
Type
Description
bOutContactor
Bool
bOutForward
Bool
bOutReverse
Bool
wOutSpeedSP
Word
rOutSpeedActual
Real
bOutError
Bool
bOutAuto
Bool
ERROR_VFD
udtError_VFD
This output UDT has one bit for every type of error. It should be
mapped to the HMIs error list. It can also be used for advanced
debugging of the error state
Name
Description
iMode
Int
Current mode
iErrorCode
Int
iStatus
Int
rManualSpeedSP
Real
rAutoSpeedSP
Real
rActualSpeed
Real
Page 15 of 58
rActualCurrent
Real
rActualPower
Real
bPB_ResetError
Bool
bPB_Forward
Bool
bPB_Reverse
Bool
bPB_Stop
Bool
bPBEN_ResetError
Bool
bPBEN_Forward
Bool
bPBEN_Reverse
Bool
bPBEN_Stop
Bool
bForwardOn
Bool
Forward command is on
bReverseOn
Bool
Reverse command is on
bSignalForward
Bool
Forward signal
bSignalReverse
Bool
Reverse signal
bError
Bool
Overall error
bInterlock
Bool
VFD Interlocked
7.2.3.2. udtError_VFD
Errors
Description
Current
Local_Disconnect
Clutch
Signal_Contactor_On
Signal_Contactor_Off
Contactor still ON
Signal_Forward
Signal_Reverse
Not_Stopped
VFD_Max_Freq
VFD_Current
VFD_Motor_Overload
VFD_Overload
VFD_Fault
Page 16 of 58
Cooling_Fan_On
Pump Horizontal
Motor Vertical
Pump Vertical
Yellow Border
Yellow Hexagon with I in center
Meaning
Blue: Stopped
Green: Running
Yellow: Start
Red: Error state
Red Flashing: E-stop pressed
Manual mode
Interlocked
Page 17 of 58
Type
tInTimeout
iInMode
Time
Int
bInEstop
bInSignalForward
Bool
Bool
bInSignalReverse
Bool
bInEnableForward
Bool
bInEnableReverse
Bool
Description
The amount of time before an error condition triggers an error
Device mode input. See Section 12.1.2 of the Library Overview and Architecture
document for further details
Emergency stop input
Forward feedback bit. This tells the motor function block whether the motor is going
in the forward direction. If no feedback input is available, wire the forward output to
the forward feedback input
Reverse feedback bit. This tells the motor function block whether the motor is going
in the reverse direction. If no feedback input is available, wire the forward output to
the forward feedback input
Forward interlock. The motor is allowed to run in the forward direction if this
condition has been met. If the motor should always be able to move in this direction,
this input should be set to true. To disable the motor from ever traveling in this
direction, this input should be set to false
Reverse interlock. The motor is allowed to run in the reverse direction if this condition
has been met. If the motor should always be able to move in this direction, this input
should be set to true. To disable the motor from ever traveling in this direction, this
input should be set to false
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 18 of 58
bInCommandForward*
Bool
bInCommandReverse*
Bool
bInResetError
Bool
bInMotorProtector
Bool
bInLocalDisconnect
Bool
bInClutch
Bool
This is the forward command for auto mode. If this input is set high in auto mode the
motor will continue to run in this direction until the forward interlock becomes false,
or this input is set low
This is the reverse command for auto mode. If this input is set high in auto mode the
motor will continue to run in this direction until the reverse interlock becomes false, or
this input is set low
If an error condition exists, the error must be fixed first, then set this bit high to reset
the internal error
This input should be wired directly to the motors circuit breaker input, if available. If
not available, this input should be set to true. When false, the motor is disabled and
an error is triggered
This input should be wired directly to the motors safety disconnect switch input, if
available. If not available, this input should be set to true. When false, the motor is
disabled and an error is triggered
This input should be wired directly to the motors clutch input. When false, the motor
is disabled and an error is triggered
Type
Description
udtHMI_M
otorContro
l
This in/out UDT is used to communicate to the HMI. Inside the UDT are all the
variables needed to control the motor in manual mode, including forward,
reverse, and stop commands
Type
Description
Bool
bOutReverse
Bool
bOutError
Bool
ERROR_Motor
udtError_M
otor
This output UDT has one bit for every type of error. It should be mapped to
the HMIs error list. It can also be used for advanced debugging of the error
state
bOutAuto
Bool
Name
Description
iMode
Int
Current mode
iErrorCode
Int
Error code. See Section 12.3.1 of the Library Overview and Architecture document for
further details
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 19 of 58
iStatus
Int
Status for HMI display. See Section 12.3.1 of the Library Overview and Architecture
document for further details
bPB_ResetError
Bool
bPB_Forward
Bool
bPB_Reverse
Bool
bPB_Stop
Bool
bPBEN_ResetError
Bool
bPBEN_Forward
Bool
bPBEN_Reverse
Bool
bPBEN_Stop
Bool
bForwardOn
Bool
Forward command is on
bReverseOn
Bool
Reverse command is on
bSignalForward
Bool
Forward signal
bSignalReverse
Bool
Reverse signal
bError
Bool
Overall error
bInterlock
Bool
Motor interlocked
7.3.3.2. udtError_Motor
Name
Description
MotorProtectorTripped
LocalDisconnectOff
ClutchTripped
Clutch tripped
NoSignalForward
NoSignalReverse
MotorNotStopped
Page 20 of 58
Motor Horizontal
Pump Horizontal
Motor Vertical
Pump Vertical
Yellow Border
Yellow Hexagon with I in center
Meaning
Blue: Stopped
Green: Running
Yellow: Start
Red: Error State
Red Flashing: E-stop
pressed
Manual Mode
Interlocked
Page 21 of 58
Type
Description
Button
Sets device to Auto Mode. Only available when global mode is Independent. Button
is green when devices is in Auto Mode.
Sets device to Manual Mode. Only available when global mode is Independent.
Button is green when device is in Manual Mode.
Displays current status of device interlock (yellow for interlock, grey when not)
Manual Mode
Button
I/O Field
I/O Field
Button
Displays current error status. Field box turns red if any errors are present, and
displays active error text. It will scroll through multiple alarms.
Drives motor forward when in Manual Mode
Stop Button
Button
Button
RESET Button
Button
Resets errors
EXIT Button
Button
Page 22 of 58
Page 23 of 58
8. Valve Control
8.1. Two State Solenoid Valve fbValve_Solenoid
8.1.1. Description
This library item is to be utilized with two state solenoid valve applications. It can be used for spring close, spring
open, or double acting solenoids.
Type
Description
tInTimeout
Time
iInMode
Int
Device mode input. See Section 12.1.2 of the Library Overview and Architecture
document for further details
bInEstop
Bool
bInSignalHome
Bool
bInSignalWork
Bool
bInEnable
Bool
Valve interlock. The valve is allowed to operate if this condition has been met
bInCommandWork*
Bool
bInResetError
Bool
If an error condition exists, the error must be fixed first, then set this bit high to
reset the internal error
Page 24 of 58
Type
Description
udtHMI_Cy
linderContr
ol
This in/out UDT is used to communicate to the HMI. Inside the UDT are all the
variables needed to control the cylinder in manual mode
Type
Description
bOutHome
Bool
bOutWork
Bool
bOutAuto
Bool
bOutError
Bool
ERROR_Cylinder
udtError_Cyl
inder
This output UDT has one bit for every type of error. It should be mapped to
the HMIs error list. It can also be used for advanced debugging of the error
state
Description
NoHomeFeedback
NoWorkFeedback
HomeFeedbackStillActive
WorkFeedbackStillActive
8.1.3.2. udtHMI_ValveControl
Data
Type
Name
Description
iMode
Int
Current mode
iErrorCode
Int
iStatus
Int
bPB_ResetError
Bool
bPB_Home
Bool
bPB_Work
Bool
Error code. See Section 12.3.1 of the Library Overview and Architecture document for
further details
Status for HMI display. See Section 12.3.1 of the Library Overview and Architecture
document for further details
Page 25 of 58
bPBEN_ResetError
Bool
bPBEN_Home
Bool
bPBEN_Work
Bool
bHomeOn
Bool
Home command is on
bWorkOn
Bool
Work command is on
bSignalHome
Bool
Home feedback
bSignalWork
Bool
Work feedback
bError
Bool
Error status
bInterlock
Bool
Valve interlocked
Valve Vertical
Yellow Border
Yellow Hexagon with I in center
Meaning
Green: Open
Yellow: Valve
Opening/Closing
Red: Error state
Red Flashing: E-stop
pressed
Manual mode
Interlocked
Page 26 of 58
Type
Button
Manual Mode
Button
I/O Field
I/O Field
HOME Button
Button
Description
Sets device to Auto Mode. Only available when global mode is Independent. Button
is green when device is in Auto Mode.
Sets device to Manual Mode. Only available when global mode is Independent.
Button is green when device is in Manual Mode.
Displays current status of device interlock (yellow for interlock, grey when not)
Displays current error status. Field box turns red if any errors are present, and
displays active error text. It will scroll through multiple alarms
Sets valve to HOME position
Page 27 of 58
WORK Button
Button
RESET Button
Button
Resets errors
EXIT Button
Button
Page 28 of 58
Type
Description
tInTimeout
Time
iInMode
Int
Device mode input. See Section 12.1.2 of the Library Overview and Architecture
document for further details
iInEstopFunction
Int
bInEstop
Bool
bInEnable
Bool
Valve interlock. The valve is allowed to operate if this condition has been met
rInSignalCommand
Real
rInAutoCommand
Real
bInResetError
Bool
If an error condition exists, the error must be fixed first, then set this bit high to
reset the internal error
Type
Description
Page 29 of 58
HMI_CylinderControl
udtHMI_Analo
gValveControl
This in/out UDT is used to communicate to the HMI. Inside the UDT are all
the variables needed to control the cylinder in manual mode and provide
status for the HMI
Type
Description
wOutCommand
Word
rOutCommand
Real
bOutAuto
Bool
bOutError
Bool
ERROR_AnaValve
udtError_An
aValve
This output UDT has one bit for every type of error. It should be mapped to
the HMIs error list. It can also be used for advanced debugging of the error
state
Name
Description
iMode
Int
Current mode
iErrorCode
Int
iStatus
Int
rManualSP
Real
rAutoSP
Real
rEstopSP
Real
rActual
Real
Actual value
bPB_ResetError
Bool
bPBEN_ResetError
Bool
bError
Bool
Overall error
bInterlock
Bool
Valve Interlocked
iEstopFunction
Int
Error code. See Section 12.3.1 of the Library Overview and Architecture document for
further details
Color status for HMI. See Section 12.3.1 of the Library Overview and Architecture
document for further details
Page 30 of 58
8.2.3.2. udtError_AnalogValve
Name
Invalid
Data
Type
Bool
Description
Invalid input given
Meaning
Green: Opening
Red: Error state
Manual mode
Interlocked
Page 31 of 58
Type
Description
Button
Manual Mode
Button
Auto Mode SP
Output
Sets device to Auto Mode. Only available when global mode is Independent. Button
is green when devices is in Auto Mode.
Sets device to Manual Mode. Only available when global mode is Independent.
Button is green when device is in Manual Mode.
Displays PLC setpoint to be used in Auto Mode.
Manual Mode SP
Input
Estop SP
Output
Actual
Output
I/O Field
Displays current status of device interlock (yellow for interlock, grey when not)
I/O Field
RESET Button
Button
Displays current error status. Field box turns red if any errors are present, and
displays active error text. It will scroll through multiple alarms
Resets errors
EXIT Button
Button
Page 32 of 58
Page 33 of 58
9. Input/Output Control
9.1. Analog Input with Scaling and Alarms fbIO_AnalogInput
9.1.1. Description
This library object scales analog inputs and provides setups for alarms.
Type
Description
iInMode
Int
Mode input. See Section 12.1.2 of the Library Overview and Architecture
document for further details
wInValue
Word
rInEngUnitsMin
Real
rInEngUnitsMax
Real
rInLowLow
Real
Page 34 of 58
rInLow
Real
rInHigh
Real
rInHighHigh
Real
rInLowLowDeadband
Real
rInLowDeadband
Real
rInHighDeadband
Real
rInHighHighDeadband
Real
bInResetError
Bool
If an error condition exists, the error must be fixed first, then set this bit high to
reset the internal error
Type
Description
udtHMI_An
alogInput
This In/Out UDT is used to communicate to the HMI. Inside the UDT are all the
variables needed to configure additional settings and provide status to the HMI
Type
Description
rOutEngUnitsValue
Real
bOutLowLow
Bool
bOutLow
Bool
bOutHigh
Bool
bOutHighHigh
Bool
bOutAuto
Bool
HMI_IO_AnalogInput
bOutError
Bool
Error Exists
ERROR_IO_AnalogIn
udtError_An
alogInput
This output UDT has one bit for every type of error. It should be mapped to
the HMIs error list. It can also be used for advanced debugging of the error
state
Name
iMode
Int
Description
Current mode
Page 35 of 58
Error code. See Section 12.3.1 of the Library Overview and Architecture document for
further details
Overall HMI Status. See Section 12.3.1 of the Library Overview and Architecture
document for further details
iErrorCode
Int
iStatus
Int
rActiveValue
Real
rInputValue
Real
Input Value
rManualValue
Real
bPB_ResetError
Bool
bPBEN_ResetError
Bool
bError
Bool
Overall error
9.1.3.2. udtError_AnalogInput
Errors
Description
LowLowAlarm
HighHighAlarm
Invalid
Invalid input
HMI_AnalogInput: Control needs to be mapped to the same udtHMI_AnalogInput used by the Function
Blocks
sFormatPattern: Sets the amount of leading/trailing zeros of the display value
sUnit: Sets the unit the value is displayed in (i.e. amps, centimeters etc.)
Page 36 of 58
Object
Type
Description
Button
Manual Mode
Button
Override Value
Input
Sets device to Auto Mode. Only available when global mode is Independent. Button
is green when devices is in Auto Mode.
Sets device to Manual Mode. Only available when global mode is Independent.
Button is green when device is in Manual Mode.
Adjusts the current value of the device
Input Value
Output
Active Value
Output
I/O Field
RESET Button
Button
Displays the value being currently used the Override Value in Manual Mode, or
Input Value in Auto Mode
Displays current error status. Field box turns red if any errors are present, and
displays active error text. It will scroll through multiple alarms
Resets errors
EXIT Button
Button
9.1.5.3. Interface
The device interface is shown below. Four properties are linked in this interface:
HMI_AnalogInput: Needs to be mapped to the same udt_HMI_AnalogInput used by the Function Block
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 37 of 58
sFormatPattern: Changes data format of values, setting amount of leading and trailing zeros of outputs.
Adjusted directly in table
sTitle: Sets title of the pop up display. Adjusted directly in table
sUnits: Sets the units used in the display. Adjusted directly in table
Page 38 of 58
Type
Description
iInMode
Int
Mode input. See Section 12.1.2 of the Library Overview and Architecture document
for further details
iInSensorType
Int
iInEstopFunction
Int
bInEstop
Bool
bInEnable
Bool
Interlock for the Analog Output. If this bit is false, then output will be 0.
rInValue*
Real
rInEngUnitsMin
Real
rInEngUnitsMax
Real
Page 39 of 58
bInResetError
If an error condition exists, the error must be fixed first, then set this bit high to reset
the internal error
Bool
Type
Description
udtHMI_An
alogOutpu
t
This In/Out UDT is used to communicate to the HMI. Inside the UDT are all the
variables needed to configure additional settings and provide status to the HMI
Type
Description
Bool
bOutError
Bool
Error exists
wOutValue
Word
ERROR_IO_AnalogOut
udtError_An
alogOut
This output UDT has one bit for every type of error. It should be mapped to
the HMIs error list. It can also be used for advanced debugging of the error
state
Name
Type
Description
iMode
Int
Current mode
iErrorCode
Int
rValue
Real
rAutoValue
Real
rManualValue
Real
rEstopValue
Real
bPB_ResetError
Bool
bPBEN_ResetError
Bool
bError
Bool
Overall error
bInterlock
Bool
iEstopFunction
Int
Page 40 of 58
9.2.3.2. udtError_AnalogOutput
Errors
Description
Out_Of_Range
Configuration_Error
Meaning
Current value sent to device
Device interlocked
Page 41 of 58
Type
Description
Button
Manual Mode
Button
Auto Mode SP
Output
Manual Mode SP
Input
EStop Value
I/O Field
I/O Field
I/O Field
RESET Button
Button
EXIT Button
Button
Page 42 of 58
sFormatPattern: Changes data format of values, setting amount of leading and trailing zeros of outputs.
Adjusted directly in table
sTitle: Sets title of the pop up display. Adjusted directly in table
sUnit: Sets the units used in the display
Page 43 of 58
Name
Description
iMode
Int
System mode
bEStop
Bool
bError
Bool
bAuto
Bool
bIndependentEnable
Bool
bPB_ResetError
Bool
System Color
Grey
Green
Blue
Yellow
Page 44 of 58
Type
Description
Auto Mode
Button
Manual Mode
Button
Independent Mode
Button
Stop Mode
Button
I/O Field
Displays current system alarm status (red for alarm, grey for System Ok)
I/O Field
RESET Button
Button
Displays current E-stop status. Field box turns red if an E-stop error is present, and
displays active error text.
Resets errors
EXIT Button
Button
Page 45 of 58
Page 46 of 58
Type
Description
bInInterlock_01
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_02
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_03
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_04
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_05
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_06
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
Page 47 of 58
bInInterlock_07
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_08
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_09
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_10
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_11
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_12
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_13
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_14
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_15
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
bInInterlock_16
Bool
Interlock for the system. When value is 1, system is okay to operate. Disable
input by not mapping or putting in a value of True
Type
Description
udtHMI_Int
erlock
This In/Out UDT is used to communicate to the HMI. Inside the UDT are all the
variables needed to configure additional settings and provide status to the HMI
Type
Description
Bool
Data Type
Array[1..16] of Bool
Description
Interlock statuses
Page 48 of 58
asInterlockNames
Array[1..16] of
String[20]
Interlock names
bInterlockOk
Bool
System Interlock is ok
Meaning
Yellow: Device interlocked
Grey: Device not interlocked
Page 49 of 58
Interlock8
Interlock16
Both faceplates use the same UDT- udtHMI_Interlock. fpInterlock8 is to be used when you have 8 or fewer
devices requiring interlocks.
10.2.5.2. HMI Pop-up Appearance and Functionality
The table below gives a feature description for the pop-up faceplate:
Object
Type
Output
EXIT Button
Button
Description
Device OK: Displays OK in a green box
Device Interlocked, unable to run: Displays Interlock displayed in Red Box
Exits the pop-up screen
Page 50 of 58
This block is used to handle HMI mode selection and control as well as scale inputs, handle e-stop conditions, and
allow manual and automatic tuning from the HMI.
The PID_Compact block must still be called from a cyclic interrupt OB. The interface tags used here should be
passed from the output of the fbPID_CompactInterface block with the exception of the ErrorAck bit, which must
be reset in the cyclic interrupt.
Page 51 of 58
Int
bInEstop
iInEstopFunction
Bool
Int
rInSetpoint*
rInInput
wInInputPER
rInManualValue*
Real
Real
Word
Real
bInManualEnable*
iInPIDModeActual
Bool
Int
iInPIDModeRequest
Int
bInPIDModeActivate
Bool
bInResetError
Bool
Description
Sets the mode of the block. When the block is in auto mode, it utilizes rInSetpoint.
When the block is in manual mode, it reads commands from the HMI through
HMI_PIDInterface. . See Section 12.1.2 of the Library Overview and Architecture
document for further details
Emergency stop input
Enumerated value of E-Stop response constant. Estop.MinSetPoint sets Output to
the minimum set point (PID output maximum), Estop.MaxSetPoint sets to the
maximum set point (PID output minimum), and Estop.HMISetPoint sets to an HMIspecified value that can be in between the min and max.
PID set point
Scaled Process value (0-100%) Use this value or wInInputPer
Raw Process value. Use this value or rInInput
Used by automation logic to override PID and provide a manual value through PLC
logic
rInManualValue is used to override the PID output value when this is true
Actual mode of the PID_Compact technology object. This should be mapped from
the technology object data block
PID_Compact Mode as described by the PID compact. Used by automation logic to
enable the override of the PID_Compact mode
PID_Compact Mode will change on a rising edge of this bit based on
iInPIDModeRequest
If an error condition exists, the error must be fixed first, then set this bit high to reset
the internal error
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 52 of 58
dwInPIDCompactError
DWord
PID_Config
PID_Comp
actConfig
This is the output from the PID Compact Block and is used to create meaningful
alarms. This should be mapped from the technology object data block
PID_Compact structure used to provide configuration data. This should be mapped
from the technology object data block.
Type
Description
HMI_PID
udtHMI_PIDInt
erface
This in/out UDT is used to communicate to the HMI. Inside the UDT are all
the variables needed to control the PID in manual mode
PID_CompactControlPara
ms
PID_CompactC
ontrolParams
Type
Description
ERROR_PID
udtError_PI
D
This output UDT has one bit for every type of error. It should be mapped to
the HMIs error list. It can also be used for advanced debugging of the error
state
OUT_PIDInterface
udtOUT_PID
Interface
The output UDT is used to map standard variables to the inputs of the
PID_Compact block
Type
Description
rProportionalGain
Real
rIntegralTime
Real
rDerivativeTime
Real
rProportionalWeight
Real
rDerivativeWeight
Real
10.3.3.2. udtOUT_PIDInterface
Name
Type
Description
rProcessValue
Real
Process value
wProcessValue
Word
rSetPoint
Real
rManualValue
Real
iModeRequest
Int
Page 53 of 58
bManualEnable
Bool
bModeChangeRequest
Bool
10.3.3.3. udtHMI_PIDInterface
Name
Type
Description
iMode
Int
Current mode
iPIDMode
Int
iErrorCode
Int
Error code. See Section 12.3.1 of the Library Overview and Architecture
document for further details
iEstopFunction
Int
rEstopValue
Real
rManualSP
Real
rAutoSP
Real
rActualInput
Real
wActualInputPeripheral
Word
rOutput
Real
wOutputPeripheral
Word
bPB_ResetError
Bool
bPB_Pretune
Bool
bPB_FineTune
Bool
bPB_AutomaticMode
Bool
bPB_ManualMode
Bool
bPB_ManualTuning
Bool
bTOG_ManualTuning
Bool
bPBEN_ResetError
Bool
bPBEN_Pretune
Bool
bPBEN_FineTune
Bool
bPBEN_AutomaticMode
Bool
bPBEN_ManualMode
Bool
bError
Bool
Overall error
bErrorAck
Bool
10.3.3.4. udtError_PID
Name
Description
InputOutOfRange
InputPERInvalid
Page 54 of 58
ValueOscillationFailed
ProcessValueCloseToSetPoint
SetPointChangedDuringTuning
PretuningDuringFineTuning
InvalidOutputValueLimits
InvalidFineTuningParameter
InputInvalidFormat
OutputCalculationError
SamplingTimeError
SetPointInvalidFormat
ManualInvalidFormat
SubstituteOutputInvalidFormat
DisturbanceInvalidFormat
Page 55 of 58
Type
Description
Button
Manual Mode
Button
Auto Mode SP
Output
Manual Mode SP
Input
Actual Input
I/O Field
Peripheral
I/O Field
Estop Value
I/O Field
Button
Button
P Field
I/O Field
I Field
I/O Field
D Field
I/O Field
PW Field
I/O Field
Proportional Weight
DW Field
I/O Field
Derivative Weight
PreTune Button
Button
Page 56 of 58
Button
Button
RESET Button
Button
EXIT Button
Button
HMI_PIDInterface: Needs to be mapped to the same udtHMI_PIDInterface used by the Function Block
rLeftY-AxisEndValue: Maximum value for the left Y-Axis of the Trend Graph. This will typically be the
maximum value of the variable that is being controlled, water temperature for this example. Adjusted
directly in table. Note: This is only used for the PID Control pop-up with Trend Graph
rLeftY-AxisStartValue: Minimum value for the left Y-Axis of the Trend Graph. This will typically be the
minimum value of the variable that is being controlled, water temperature for this example. Adjusted
directly in table. Note: This is only used for the PID Control pop-up with Trend Graph
rTimeAxisRangeInSeconds: Defines the number of seconds being shown on the Trend graph. Adjusted
directly in table. Note: This is only used for the PID Control pop-up with Trend Graph
sFormatPattern: Changes data format of values, setting amount of leading and trailing zeros of outputs.
Adjusted directly in table
sTitle: Sets title of the pop-up display. Adjusted directly in table
sUnit: Sets the units used in the display. Adjusted directly in table
Trend: This is configured by right clicking on the trend on the pop up and adding the relevant tags to the
trend. Note: This is only used for the PID Control pop-up with Trend Graph
*Note: If custom values are required for both the right and left Y-Axis, use the PID control without the Trend
Graph and add a new one in manually. The right Y-Axis for the pop-up with the Trend Graph is set to default
to values between 0 and 100, representing the percentage of the PID control.
Page 57 of 58
Description
bInWarning
bInAlarm
Bool
Bool
bInResetError
Bool
If an error condition exists, the error must be resolved first, then set this bit high to
reset the internal error
Type
Description
bOutWarning
Bool
bOutAlarm
Bool
Signal used to show alarm is active and has not been reset
Page 58 of 58
Page 1 of 14
Contents
Contents .............................................................................................................................................................................. 2
1. Purpose ........................................................................................................................................................................... 3
2. Intended Use ................................................................................................................................................................. 3
3. Revision History............................................................................................................................................................ 3
4. Open Library License.................................................................................................................................................. 3
5. Hardware and Software Compatibility ................................................................................................................. 3
6. General Overview ........................................................................................................................................................ 5
6.1. Excel Macro ............................................................................................................................................................ 5
6.2. Alarm Special Considerations.......................................................................................................................... 5
7. Verify Non-Optimized Data Blocks........................................................................................................................ 6
8. Alarm Naming Conventions..................................................................................................................................... 7
8.1. Macro Alarm String Creation ........................................................................................................................... 7
9. Excel Macro ................................................................................................................................................................... 8
10. Importing Alarms to a Comfort Panel .............................................................................................................. 12
Page 2 of 14
1. Purpose
This document walks through automatically generating HMI alarms for Siemens HMIs. This
overview covers tools included in the Open Library. Note that these tools are designed for use
with Open Library structures and architecture only. Specifically, these may only be used to
generate alarms for bit-packed Data Blocks. Use with any other alarm setup may not work.
2. Intended Use
This document is intended to be used by anyone utilizing the Open Library for PLC and HMI
Development after the PLC code has been complete and alarms are ready to be generated.
3. Revision History
Version
1.0
1.1
1.2
1.3
Date
2016-05-23
2016-06-20
2016-08-23
2016-10-11
Author
DMC
DMC
DMC
DMC
Comments
Initial Release
No Changes
No Changes
No Changes
Page 3 of 14
Page 4 of 14
6. General Overview
Siemens Comfort Panels and WinCC Advanced Runtime use bits out of words to trigger alarms,
and there are no methods to configure Boolean alarms. This library, however, utilizes bits for all
alarms. To automate this process the Siemens Open Library includes a Microsoft Excel macro that
utilizes a data block of Booleans to generate alarms.
2.
3.
4.
5.
The Data Block must be non-optimized (applies to 1200/1500 only and is accessible via the
properties of the Data Block). See Section 7 of this document or 2- Siemens Open Library
- Initial Setup for details about how to set up a non-optimized data block.
The User Defined Type, Struct, and/or individual Boolean comments will be utilized for the
alarm text, so it is important to put in meaningful comments on each alarm.
The Excel macro will work with nested User Defined Types and Structs.
The Excel macro works only with data blocks containing only Booleans, so all automatically
generated alarms will need to be Boolean alarms, and should be concentrated in Data
Blocks.
The Excel macro utilizes the bit comments for alarm text, so arrays are not a recommended
structure as they wont generate unique alarm text, but could be used by modifying the
Excel Macro to grab relevant information from the array.
Page 5 of 14
Page 6 of 14
For alarms not in a User Defined Type or Struct, the alarm string will be the Boolean
comment string.
2. For alarms in a single or nested User Defined Types and/or Structs, the comment for each
User Defined Type and/or Struct will be a prefix for the alarm.
Page 7 of 14
9. Excel Macro
The instructions below use an installation of Microsoft Office, specifically Microsoft Excel. However,
the Open Library Alarm Generator is in a macro-enabled Open XML format (.xlsx) and is
compatible with several open source office platforms.
1.
Open the Open Library Alarm Generator.xlsm document and click the Enable Content
button, if prompted.
2. Open up the PLC project that contains the desired alarm data blocks.
3. Right click the Errors data block that contains the alarms and select Copy as text
Page 8 of 14
5. Paste the copied contents into the next available row in column A
7. Add the Data Block name, number, and HMI connection name to the list
8. Repeat steps 3-7 for each Errors data block containing HMI alarms.
9. If you are not using custom Error UDTs, you can skip to step 14.
10. Right click the custom Error UDT and select Copy as text
Page 9 of 14
12. Paste the copied contents into the next available of column A
13. Repeat steps 10-12 for each custom Error UDT used in your Errors data blocks
14. Navigate back to the Instructions tab
16. If you are prompted with any errors that occurred, make sure to resolve them before trying
again.
17. If alarm generation was successful, Excel will prompt you to save a file without macros
enabled. Select Yes. This will save a copy of the current workbook with an identical name
but with an .xlsx file extension instead of .xlsm. This is done so that the workbook can
be imported into TIA Portal properly.
Page 10 of 14
Page 11 of 14
3. Browse for the generated .xlsx file and press the Import button
Page 12 of 14
5. Press Ok and check to make sure that all tags were imported correctly
Page 13 of 14
8. Again, browse for the generated .xlsx file and press the Import button
9. Once completed, you will get prompted with another success dialog
10. Press Ok and check to make sure that all alarms were imported correctly
Page 14 of 14
Page 1 of 18
Contents
1. Purpose ........................................................................................................................................................................... 3
2. Intended Use ................................................................................................................................................................. 3
3. Revision History............................................................................................................................................................ 3
4. Open Library License.................................................................................................................................................. 3
5. Hardware and Software Compatibility ................................................................................................................. 4
6. Open Library PID Compact Setup.......................................................................................................................... 5
6.1. Initial Setup ............................................................................................................................................................ 5
6.2. PLC ........................................................................................................................................................................... 5
6.2.1. Creating PID Technology Object ............................................................................................................ 5
6.3. HMI......................................................................................................................................................................... 17
Page 2 of 18
1. Purpose
The purpose of this document is to assist with configuration of the PID Open Library Object. In
order to use the features of the built in Technology Object for the PID Compact Block, the library
object requires special setup. The PID Comact Block only exists on the S7-1200 and S7-1500. The
Open Library Object was written to be compatible with PID_Compact V2.2, and capabilities cannot
be guaranteed for other versions of the PID Compact block.
2. Intended Use
This document is to be used by anyone utilizing the Siemens Open Library
fbPID_CompactInterface. This document is used to configure the PLC and HMI objects for the
library, as the configuration of these objects is not standard with the rest of the library.
3. Revision History
Version
1.0
1.1
Date
2016-05-23
2016-06-20
Author
DMC
DMC
1.2
1.3
2016-08-23
2016-10-11
DMC
DMC
Comments
Initial Release
Updated screenshots for PID_Compact and the interface
function block
No Changes
No Changes
Page 3 of 18
Page 4 of 18
It provides a block to call and execute logic for the PID control in the Main Scan, which
limits the logic located in the Cyclic OB.
2. It provides an easy interface for operation and changes to the PID from an HMI faceplate.
3. It utilizes the technology object, so all of the PID functions built in to portal can still be
used.
6.2. PLC
This section covers the setup required for the PLC programming. The following steps are required:
1.
2.
3.
4.
Start by creating a PID_Compact technology object. Expand the Technology Objects folder
and click Add new object.
Page 5 of 18
2. In the new object dialog box, give your object a name and select the PID_Compact v2.2
block.
Page 6 of 18
4. Pull fbPID_CompactInterface from the Open Library Types group into the Library Blocks
group to use it in our project.
Page 7 of 18
5. In a global data block (dbWaterSystem in this example), add a structure for all of your PID
related variables. The required variables are seen in the screenshot below. This structure
should include you HMI control for the PID system (udtHMI_PIDInterface). It should also
include a structure for interfacing with the PID_Compact block (udtOUT_PIDInterface).
6. Similarly, add the error structure to the errors Data Block, dbErrors_WaterSystem in this
example.
7. Add a multiple instance static memory variable for the fbPID_CompactInterface block in the
fbWaterSystem main block.
Page 8 of 18
9. When the Call options dialog appears, choose the static memory multiple instance that you
just created in the block interface.
Page 9 of 18
10. Fill in the interface for your fbPID_CompactInterface instance. Notice the tag references to
the PID_Compact technology data block as well as the HMI and Errors data block
structures.
11. Add a new Cyclic Interrupt OB that will call our time sensitive cyclic operations.
Page 10 of 18
12. Give the cyclic interrupt OB a name and set the cycle time to something appropriate for the
application. In this case, temperature does not need a fast cycle so it was set to 100ms
(100,000s).
Page 11 of 18
13. Add a new function block that will call our PID_Compact and will be called from the cyclic
interrupt OB. It is recommended best practice to limit logic inside an OB, and the library
object requires instance memory, so we will use the FB to encapsulate our cyclic operation
logic.
15. Create an instance data block to accompany the cyclic function block.
Page 12 of 18
16. Name the instance data block and give it the type of your cyclic function block.
17. Inside of the cyclic interrupt OB, drag in an instance of the cyclic FB you created.
Page 13 of 18
Page 14 of 18
19. Inside of your cyclic FB, drag in an instance of PID_Compact from the Siemens library.
Assign the single instance to the data block of your technology object.
Page 15 of 18
20. Fill in the interface of the PID_Compact block with the dbWaterSystem variables created
earlier.
Page 16 of 18
6.3. HMI
This section walks through the required steps to add the HMI pop-ups for the PID Interface Block.
1. Create a new Pop-up screen for the PID Faceplate.
2. Pull the fpPID_CompactInterface_Popup_Graph into the new Pop-up screen.
Page 17 of 18
4. Create the Water Temperature PID tag in the new table and map it to
dbWaterSystem.WaterTemperature.PID_WaterTemperature.
5. Fill in the interface of the popup with the newly created tag as well as static values.
6. Lastly, configure the Trend view with the tags you would like to trend.
Page 18 of 18
Page 1 of 14
CONTENTSCONTENTS ................................................................................................................................................... 2
1. PURPOSE......................................................................................................................................................................... 3
2. INTENDED USE ............................................................................................................................................................. 3
3. REVISION HISTORY ..................................................................................................................................................... 3
4. OPEN LIBRARY LICENSE ............................................................................................................................................ 3
5. REASONS FOR CUSTOMIZATION.......................................................................................................................... 4
6. MAINTAINING A NEW LIBRARY ............................................................................................................................. 4
7. MAKING LIBRARY EDITS............................................................................................................................................ 5
7.1. Order of Edits ........................................................................................................................................................ 5
7.2. Creating New Objects ........................................................................................................................................ 5
7.3. Duplicating a Type .............................................................................................................................................. 5
7.4. Editing User Defined Types .............................................................................................................................. 5
7.5. Editing PLC Function Blocks ............................................................................................................................. 7
7.6. Editing Faceplates................................................................................................................................................ 9
8. SPECIAL CONSIDERATIONS WITH S7-300/400 .............................................................................................. 13
8.1. User Defined Types............................................................................................................................................ 13
8.2. HMI User Data Type ......................................................................................................................................... 13
8.3. Function Block Edits .......................................................................................................................................... 13
9. CONTRIBUTING TO THE LIBRARY ....................................................................................................................... 14
Page 2 of 14
1. Purpose
The purpose of this document is to provide information regarding the customization of the
Siemens Open Library in order to meet applications outside of the current functionality of the
Siemens Open Library. This document covers how to edit Function Blocks, User Defined Types, and
Faceplates.
2. Intended Use
This document is intended to be used by anyone modifying the Open Library to customize it for
applications outside of the current library functionality. This document should be used after
reviewing the following and resources:
1.
2.
3.
4.
5.
6.
7.
3. Revision History
Version
1.0
1.1
1.2
1.3
Date
2016-05-23
2016-06-20
2016-08-23
2016-10-11
Author
DMC
DMC
DMC
DMC
Comments
Initial Release
No Changes
No Changes
No Changes
Page 3 of 14
COPYRIGHT HOLDERS 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.
Page 4 of 14
3.
4.
5.
Add all Global Library Objects to a project so they become part of the Project Library, as
types can only be edited from the Project Library.
Edit the User Defined Type first, if edits are required. Since the library has versions, function
blocks and faceplates will reference a specific version of the User Defined Type, so edits to
Faceplates and Function Blocks will need an updated User Defined Type created first.
Edit the PLC Function Block, and update the type to the latest User Defined Type.
Edit the HMI Faceplate, and update the type to the latest User Defined Type.
Update the Global Library based on edits made in the Project Library.
Add the User Defined Type into a project containing an S7-1200 or S7-1500, even if edits
are being done for other processors (see special considerations for using the S7-300/400
for more information).
2. Once the User Defined Type is included in the PLC project, it will be added to the Project
Library.
3. To Edit the User Defined Type, right click on the type in the Project Library and select Edit
Type. A pop-up will appear for the test environment. This is the environment that will be
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 5 of 14
used to verify that edits compile. For User Defined Types, verify the environment selected is
an S7-1200 or S7-1500.
4. The editor will open, and allow you to add or remove variables as would be possible in any
User Defined Type. Note that the project library shows a new version that is [in test]. Make
any required edits to the User Defined Type and then select release the version. (If the
yellow banner is not visible, click the exclamation point in the yellow circle).
5. A pop-up will appear where version number can be selected. Additionally, it will have a
check box for Delete unused type versions from the library. If the Function Block and
Faceplate are not part of the Project Library then it will delete the previous version of the
UDT, as it wont be used in the current Project Library, however, if the Function Block and
Faceplate have already been added to the project, then the previous version will remain as
part of the Project Library as it is still used by the other objects in the Library. If any PLC or
Chicago Boston Denver Houston New York
www.dmcinfo.com sales@dmcinfo.com 888.DMC.4400
Page 6 of 14
HMI in the project is using the type being edited, the option Update instances in the
project will be available. Check this box to automatically upgrade all type instances in the
project as soon as the new version is released.
6. Add the modified User Defined Type to the Global Library by dragging and dropping it into
the Global Library.
Add the Function Block into a project containing a PLC that the object is to be used with
(S7-300, S7-400, S7-1200, and S7-1500 have different compiler requirements).
2. If a modified User Defined Type is being used, delete the User Defined Type in the PLC
Project, and add the updated User Defined Type from the Project Library.
3. To Edit the Function Block, right click on the type in the Project Library and select Edit
Type, or right click on the Function Block in the PLC Project and select Edit Type. A popup will appear for the test environment. This is the environment that will be used to verify
that edits compile.
Page 7 of 14
4. The editor will open, and allow you to modify code as required. Note that the project
library shows a new version that is [in test]. Make any required edits to the Function Block
and then select release the version. (If the yellow banner is not visible, click the
exclamation point in the yellow circle).
Page 8 of 14
5. A pop-up will appear where version number can be selected. Additionally, it will have a
check box for Delete unused type versions from the library, and a checkbox to Update
instances in the project. If the changes made should override any previous instances of this
function block, ensure that both check boxes are checked. If it is intended to keep multiple
versions of the object, then ensure that neither check box is checked.
6. Add the modified Function Block to the Global Library by dragging and dropping it into the
Global Library.
Page 9 of 14
5. For objects utilizing the Siemens Object Library (VFDs, Motors, Solenoid Valve, Analog
Valve, etc.) the appearance of the object can be quickly edited by selecting a different
image under the General portion of the properties for the object. Any changes will need
to utilize Solid or Shaded as the Fill Style in the Appearance portion of the properties for
the color changing to function as intended.
Page 10 of 14
6. Make any required edits to the Faceplate and then select release the version. (If the yellow
banner is not visible, click the exclamation point in the yellow circle).
7. A pop-up will appear where version number can be selected. Additionally, it will have a
check box for Delete unused type versions from the library, and a checkbox to Update
instances in the project. If the changes made should override any previous instances of this
function block, ensure that both check boxes are check. If it is intended to keep multiple
versions of the object, then ensure that neither check box is checked.
Page 11 of 14
8. Add the modified Faceplate to the Global Library by dragging and dropping it into the
Global Library.
Page 12 of 14
Page 13 of 14
Page 14 of 14