Sie sind auf Seite 1von 65

MASISA S.A.

PROYECTO MDF-2005
CABRERO - CHILE

PROGRAMMING SPECIFICATIONS
FOR ControlLogix PLC AND SCADA SYSTEM

GERENCIA DE INGENIERÍA CORPORATIVA


FEBRUARY 2006
MASISA STANDARD

Revision History

Date Comments Rev. By


Feb/2006 -Changes the TAG example of all elements according to B sh
“Electrical Specification and Tag numbering” document.

-Changes the way that Factory Link read the General


Alarms.

- Changes the type of Communication drive to read/write


data from/to PLC.

-Switching Valves: Include a status bit to indicate the type of


valve. See page 49.

-Redefines the TAGs to check communication between


factoryLink and PLC system
MASISA STANDARD

For the execution of new projects, MASISA has developed a programming standard for
ControlLogix PLC and SCADA System.
The standard was developed considering an easy communication between the PLC and the
SCADA system and a well structured programming, based on data arrays.

The standard consist of:


- Standard SCADA application: Consist of “Ready to use” graphs and modules including
menus, faceplates, alarms, trending charts, component listings, etc. This standard is easily
scalable, because it allows to add a new component just dragging an object in any drawing
and entering an index.
- Standard PLC program: Consist of several modules and subroutines specially developed
to communicate with the SCADA and to decrease the development time. The program
includes “ready to use” modules for motors, controllers, checking alarm limits of analog
variables, alarm generation, report generation, etc.

The use of the MASISA standard has the following advantages:


- Same structure in all applications
- Easy to be used and updated by the Maintenance Department
- Less time to develop a specific application

RELATED DOCUMENTATION:

Programming Standard SCADA User Guide


Specifications for the Application
PLC and SCADA System

READ THIS
MANUAL FIRST - Conventions and - Intended for the use
definitions used in the of operators. Contains
- Data structure between standard SCADA detailed information
HMI and PLC application about the HMI modules,
- PLC structure: Data and - Procedures to configure like controller faceplates,
Program Files the SCADA modules. trendings,...
- Using program modules - Database maintenance
in the PLC
INDEX

INDEX................................................................................................................................................... 1

1. INTRODUCTION ........................................................................................................................ 1
1.1 BASIC SCADA ARCHITECTURE .......................................................................................................... 1
1.2 STANDARD HMI APPLICATION AND PLC MODULES .................................................................... 2
1.3 GENERAL OVERVIEW OF THE STANDARD HMI APPLICATION.................................................. 3

2. ABOUT THIS DOCUMENT ...................................................................................................... 4

3. DATA STRUCTURE ON FACTORY LINK ............................................................................ 5


3.1 GENERAL................................................................................................................................................. 5
3.2 MOTORS .................................................................................................................................................. 6
3.3 SWITCHING VALVES ............................................................................................................................ 7
3.4 SWITCHES (DISCRETE SENSORS) ...................................................................................................... 8
3.5 ANALOG VARIABLES (NOT RELATED TO A CONTROL LOOP) ................................................... 9
3.6 CONTROLLERS (PID LOOPS) ............................................................................................................. 10
3.7 OPEN LOOP CONTROLLERS .............................................................................................................. 12
3.8 PARAMETERS....................................................................................................................................... 13
3.9 GENERAL ALARMS ............................................................................................................................. 14
3.10 GENERAL COMMANDS ...................................................................................................................... 15
3.11 CHECKING COMMUNICATION BETWEEN HMI-PLC.................................................................... 16
3.12 PRODUCTION JOBS ............................................................................................................................. 17

4. DATA STRUCTURE ON THE PLC........................................................................................ 18


4.1 PROGRAM FILES .................................................................................................................................. 18

5. PROGRAM MODULES ON THE PLC .................................................................................. 19


5.1 MOTOR MODULES............................................................................................................................... 20
5.1.1 DESCRIPTION................................................................................................................................. 20
5.1.2 CALLING THE SUBROUTINE....................................................................................................... 21
5.1.3 MOTOR MODULES ........................................................................................................................ 23
5.1.4 ADDRESS DEFINITION ................................................................................................................. 24
5.1.5 COMMAND AND STATUS WORDS............................................................................................. 24
5.1.6 MODULE CODE .............................................................................................................................. 27
5.1.7 LOGIC DIAGRAM OF MOTOR MODULE 1 (FWD) .................................................................... 28
5.1.8 USING THE MOTOR MODULES .................................................................................................. 29
5.1.8.1 USING MODULE 1: FWD ..................................................................................................... 30
5.1.8.2 USING SPEEDGUARD SENSOR.......................................................................................... 31
5.2 PID CONTROLLER MODULE.............................................................................................................. 32
5.2.1 DESCRIPTION................................................................................................................................. 32
5.2.2 MODULE DIAGRAM ...................................................................................................................... 33
5.2.3 CALLING THE SUBROUTINE....................................................................................................... 35
5.2.4 COMMAND AND STATUS WORDS............................................................................................. 36
5.2.5 STATUS BITS GENERATION ....................................................................................................... 38
5.2.6 SCALING OF THE CONTROL VALUE......................................................................................... 39
5.2.7 ALARM INHIBITION...................................................................................................................... 40
5.3 OPEN LOOP CONTROLLERS .............................................................................................................. 41
5.3.1 DESCRIPTION................................................................................................................................. 41
5.3.2 MODULE DIAGRAM ...................................................................................................................... 42
5.3.3 CALLING THE OPEN LOOP MODULE ........................................................................................ 42
5.3.4 VARIABLES, COMMANDS AND STATUS WORDS................................................................... 43
5.4 POSITIONER MODULE ........................................................................................................................ 45
5.4.1 DEFINITION .................................................................................................................................... 45
5.4.2 CALLING THE POSITIONER MODULE....................................................................................... 45
5.5 RAMP MODULE .................................................................................................................................... 46
5.5.1 DESCRIPTION................................................................................................................................. 46
5.5.2 CALLING THE RAMP MODULE................................................................................................... 46
5.5.3 USING THE RAMP MODULE........................................................................................................ 46
5.6 SWITCHING VALVES .......................................................................................................................... 47
5.6.1 DESCRIPTION................................................................................................................................. 47
5.6.2 CALLING THE SUBROUTINE....................................................................................................... 47
5.6.3 COMMAND AND STATUS WORDS............................................................................................. 48
5.6.4 LOGIC DIAGRAM OF VALVE MODULE..................................................................................... 50
5.7 STARTUP FILE ...................................................................................................................................... 51
5.7.1 DESCRIPTION................................................................................................................................. 51
5.8 ALARM HANDLING AND SENDING ................................................................................................. 51
5.8.1 DESCRIPTION................................................................................................................................. 51
5.8.2 ALARM GENERATION .................................................................................................................. 52
5.8.3 A SPECIAL CASE: GENERAL ALARMS ...................................................................................... 53
5.9 GENERAL COMMANDS ...................................................................................................................... 54
5.9.1 DESCRIPTION................................................................................................................................. 54
5.10 CHECKING THE COMMUNICATION ................................................................................................ 56
5.10.1 TESTS ON HMI ............................................................................................................................... 56
5.10.2 TESTS ON PLC ................................................................................................................................ 57
5.10.3 CONSIDERATIONS ........................................................................................................................ 58
5.11 PRODUCTION JOBS ............................................................................................................................. 59
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 1 OF 60

1. INTRODUCTION

The purpose of this document is to specify the general principles of the Supervision, Control and Data
Acquisition System (SCADA) of MASISA.

This text is a complement to the “Electrical Specifications” of MASISA.

Deviation from this specification can be made only upon special agreement.

Together with this document, MASISA delivers a complete visualization system program and
PLC Subroutines for the development of new projects. This software and documentation belongs to
MASISA and shall not be used or reproduced in any manner without a commercial agreement
with MASISA.

1.1 BASIC SCADA ARCHITECTURE

The next chart shows the different levels within the SCADA system:

10.22.59.09 10.22.59.10

Internet Server Server Impresoras


Hot Backup
10.22.59.10 – Area 1
10.22.59.11 – Area 2
10.22.59.12 – Area 3

10.22.59.01 10.22.59.06
10.22.59.04
10.22.59.02 10.22.59.07
10.22.59.05
Router 10.22.59.03 10.22.59.08

Security-Server HMI Area 1 HMI Area 2 HMI Area 3

Ethernet (10.10.10.x)

PLC Area 1 PLC Area 2 PLC Area 3


MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 2 OF 60

• HMI STATIONS: (Human Machine Interface) Personal Computer running a special visualization
software. HMI stations are the interface to perform all supervisory functions, as well as motor and
group start and alarm information. The HMI software used by MASISA is Factory Link. See
“Software requirements” later on this document for further information.

• PLCs: The control is done by the Allen Bradley family ControlLogix processors.

• NETWORK CONNECTION: Hardware (Wires, optic fiber, hubs, switches, cards,...) and
software (TCP/IP protocol, Allen-Bradley communications driver) to allow the communication
between the HMI stations and the PLCs.

1.2 STANDARD HMI APPLICATION AND PLC MODULES

MASISA has develop a standard HMI application, which consist of a lot of drawings, program
procedures, power packs (templates), database handlers, etc. The Standard HMI application should be
used as a starting base for the development of visualizations systems.

The use of a standard HMI application has the following advantages:

• All applications will look similar


• Easy to be used and updated by the Maintenance Department, which should learn only one type of
programming scheme
• The development of a new application is fast and easy
• The standard HMI application is based on the know-how of programmers with years of experience
in Factory Link

Additionally, MASISA has also developed a lot of PLC program modules and a programming
structure, which is a complement to the standard HMI application.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 3 OF 60

1.3 GENERAL OVERVIEW OF THE STANDARD HMI APPLICATION

As shown in the “Basic SCADA Architecture” section, each HMI communicates with one or more
PLCs. The standard HMI application structure is “PLC based”. “PLC based” means that the whole
data arrays, communications tables, databases, etc... are defined to one PLC. If more than one PLC
communicates with the HMI station, the whole structure should be repeated for the new one.

The standard HMI application is ready to be used with up to three PLCs (a fourth PLC could be
programmed following the rules on the document “Standart SCADA Application”). Along this
document, “PLCX” or “PX” is used to refer to the respective PLC, where “X” is a running number.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 4 OF 60

2. ABOUT THIS DOCUMENT

This document has the following structure:

DATA STRUCTURE FOR THE INTERFACE BETWEEN HMI AND PLC: This chapter is
useful for filling the communications tables between HMI and the PLCs, because it shows the data
structure and nomenclature used at the HMI level for the communication with the PLCs. The HMI
programmer should refer to this chapter to know what means each variable before introducing the
right PLC address in the communication tables.

PLC STRUCTURE: This chapter contains the complete description of data and program files for a
PLC program of a MASISA plant.

USING PROGRAM MODULES IN PLC: This chapter shows how to use the MASISA
standard PLC modules.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 5 OF 60

3. DATA STRUCTURE ON FACTORY LINK

3.1 GENERAL

• Data should be structured in arrays.


• Variables in Factory Link should be named as:

PX_A_BBB[[i]]

X: Number of the PLC where the data is written/read (a running number to differentiate one
PLC from another).
A: Code of the electrical component [M=motor, S=switch,..] (See next pages)
B: One or more characters to identify the tag type.
i: index number of the array.

P1_M_descr[45] is the name of the variable that contains the description of motor (M) with
index 45, controlled by the PLC 1.

• Variables, which are read or written to the PLC are in uppercase


• Variables, which are used only in Factory Link end in lowercase

In the next tables, following abridgements are used:

PX_ : PLC number X (a running number)


R : Read only variables (from F. Link) 1
W : Write only variables (from F. Link)
[e.u.] : Engineering units

The following arrays should be used, for each PLC, in the Factory Link programming:

1
Some data are read periodically from the PLC, and can be changed from Factory Link at any time sending the new data to the PLC. To
avoid that the new data may be overwritten by the read procedure before it has been sent, different variables for the read and write operation
should be used. To differentiate the “write variables” from the read ones, the name of the write variables in Factory Link ends with “_W”
(This rule is only valid for PLC addresses that are both read and written from Factory Link)
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 6 OF 60

3.2 MOTORS

FACTORY LINK PLC DESCRIPTION TYPE


PX_M_STAT_W[i]* {TAG}.M_STAT_W HMI Commands Analog, W
PX_M_STAT_R1[i]* {TAG}.M_STAT_R1 PLC Commands Analog, R
PX_M_STAT_R[i]* {TAG}.M_STAT_R Output Word (status) Analog, R
PX_M_descr[i] - Description Message (40)
PX_M_id[i] - Tag Message (20)
PX_M_dir[i] - Status address Message (20)
PX_M_sec[i] - Security level Analog

* See Bit arrangement on section 5.1

• {TAG} is the ID for each element, for example T10_M01. For each motor there is a data structure
defined in PLC related to TAG name.

User Data Structure Motor Object:

Name Data Type Style Description


StartDelay TIMER START DELAY TIMER
SpeedGuard TIMER SPEEDGUARD TIMER
Fault_Motor BOOL Decimal ALARM MOTOR FAULT
STAT_W INT Decimal Command Word from HMI
STAT_R1 INT Decimal Status Word 1 for HMI information
STAT_R INT Decimal Status Word for HMI Information
INV_TIME INT Decimal Inversion Time delay [ms]
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 7 OF 60

3.3 SWITCHING VALVES

FACTORY LINK PLC DESCRIPTION TYPE


PX_VS_STAT_W[i]* {TAG}.VS_STAT_W Command word Analog, W
PX_VS_STAT_R1[i]* {TAG}.VS_STAT_R1 Status word Analog, R
PX_VS_STAT_R[i]* {TAG}.VS_STAT_R Status word Analog, R
PX_VS_descr[i] - Description Message (40)
PX_VS_id[i] - Tag Message (20)
PX_VS_dir[i] - Status address in PLC Message (20)
PX_VS_sec[i] - Security level Analog

* See bit arrangement on section 5.6

• {TAG} is the ID for each element, for example C05_VS10. For each valve there is a data structure
defined in PLC related to TAG name.

User Data Structure valves Object:

Name Data Type Style Description


STAT_W INT Binary Command word from HMI
STAT_R INT Binary Status word for HMI
Fault TIMER Timeout Timeout to set fault
STAT_R1 INT Binary Status word
Alarm BOOL Binary Failure in command valve
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 8 OF 60

3.4 SWITCHES (DISCRETE SENSORS)

(limit sw., press. sw., flow sw., ...)

FACTORY LINK PLC DESCRIPTION TYPE


PX _S_STAT_R[i] S_STAT_R[i] Switch actived * BOOL, R
PX _S_descr[i] - Switch description Message (40)
PX _S_id[i] - Switch identification Message (20)
PX _S_dir[i] - Switch status address Message (20)

* switch addresses must be moved to S_STAT_R[i], BOOL array in PLC to get the same order that
database has in HMI.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 9 OF 60

3.5 ANALOG VARIABLES (NOT RELATED TO A CONTROL LOOP)

For analog variables, following arrays are defined:

FACTORY LINK PLC DESCRIPTION TYPE


PX_ANL_PV[i] {TAG}.PV Process value [e.u.] Float, R
PX_ANL_MAX[i] {TAG}.MAX Scaling Max. value [e.u.] Float, R
PX_ANL_MIN[i] {TAG}.MIN Scaling Min. value [e.u.] Float, R
PX_ANL_HHV_W[i] {TAG}.HHV High High limit value [e.u.] Float, W
PX_ANL_HHV[i] {TAG}.HHV High High limit value [e.u.] Float, R
PX_ANL_HV_W[i] {TAG}.HV High limit value [e.u.] Float, W
PX_ANL_HV[i] {TAG}.HV High limit value [e.u.] Float, R
PX_ANL_LV_W[i] {TAG}.LV Low limit value [e.u.] Float, W
PX_ANL_LV[i] {TAG}.LV Low limit value [e.u.] Float, R
PX_ANL_LLV_W[i] {TAG}.LLV Low Low limit value [e.u.] Float, W
PX_ANL_LLV[i] {TAG}.LLV Low Low limit value [e.u.] Float, R
PX_ANL_descr[i] - Description Message (40)
PX_ANL_id[i] - Tag Message (20)
PX_ANL_dir[i] - Address Message (20)
PX_ANL_unit[i] Unit (e.g., m/min) Message (10)
PX_ANL_sec[i] - Security level Analog

• {TAG} is the ID for each element, for example D25_LT10_1. For each analog variable there is a data
structure defined in PLC related to TAG name.

User Data Structure analog variable Object:


Name Data Type Style Description
PV REAL Float Process Value
MAX REAL Float E.U. Maximum
MIN REAL Float E.U. Minimum
HHV REAL Float High High Alarm limit
HV REAL Float High Alarm limit
LV REAL Float Low Alarm limit
LLV REAL Float Low Low Alarm Limit
IHH BOOL Decimal Inhibit High Alarms
ILL BOOL Decimal Inhibit Low Alarms
HH BOOL Decimal HH Alarm active
H BOOL Decimal H Alarm Active
L BOOL Decimal L Alarm Active
LL BOOL Decimal LL Alarm Active
DB REAL Float Deadband for alarm reset
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 10 OF 60

3.6 CONTROLLERS (PID LOOPS)

For analog variables, related to a control loop following arrays are defined:

FACTORY LINK PLC DESCRIPTION TYPE


PX_CTR_STAT_R[i]* {TAG}.STAT_R Status words Analog, R
PX_CTR_STAT_W[i]* {TAG}.STAT_W Command words Analog, W
PX_CTR_PV[i] {TAG}.ANL.PV Process Value [e.u.] Float, R
PX_CTR_HHV_W[i] {TAG}.ANL.HHV High High limit value [e.u.] Float, W
PX_CTR_HHV[i] {TAG}.ANL.HHV High High limit value [e.u.] Float, R
PX_CTR_HV_W[i] {TAG}.ANL.HV High limit value [e.u.] Float, W
PX_CTR_HV[i] {TAG}.ANL.HV High limit value [e.u.] Float, R
PX_CTR_LV_W[i] {TAG}.ANL.LV Low limit value [e.u.] Float, W
PX_CTR_LV[i] {TAG}.ANL.LV Low limit value [e.u.] Float, R
PX_CTR_LLV_W[i] {TAG}.ANL.LLV Low Low limit value [e.u.] Float, W
PX_CTR_LLV[i] {TAG}.ANL.LLV Low Low limit value [e.u.] Float, R
PX_CTR_SPL[i] {TAG}.SPL Local Setpoint [e.u.] Float, W
PX_CTR_SPR[i] {TAG}.SPR Remote Setpoint [e.u] Float, R
PX_CTR_CVMAX[i] {TAG}.CVMAX Max value of scaled CV [e.u.] Float, R
PX_CTR_CVMIN[i] {TAG}.CVMIN Min value of scaled CV [e.u.] Float, R
PX_CTR_CV[i] {TAG}.CV Control Value [%] or [e.u.] 1 Float, R
PX_CTR_SPI[i] {TAG}.SPI Setpoint before ramp module [e.u.] Float, R
PX_CTR_SP[i] {TAG}.PID.SP Setpoint after ramp module [e.u.] Float, R
PX_CTR_RAMPV_W[i] {TAG}.RAMPV Ramp value [e.u./sec] Float, W
PX_CTR_RAMPV[i] {TAG}.RAMPV Ramp value [e.u./sec] Float, R
PX_CTR_CV_W[i] {TAG}.CV Control value [%] Float, W
PX_CTR_TOL_W[i] {TAG}.TOL Tracking fault range [e.u.] Float, W
PX_CTR_TOL[i] {TAG}.TOL Tracking fault range [e.u.] Float, R
PX_CTR_TAU_W[i] {TAG}.TAU Timeout for tracking fault [sec] Float, W
PX_CTR_TAU[i] {TAG}.TAU Timeout for tracking fault [sec] Float, R
PX_CTR_KD_W[i] {TAG}.PID.KD Derivative Gain [sec] Float, W
PX_CTR_KD[i] {TAG}.PID.KD Derivative Gain [sec] Float, R
PX_CTR_KI_W[i] {TAG}.PID.KI Integral Gain [1/sec] Float, W
PX_CTR_KI[i] {TAG}.PID.KI Integral Gain [1/sec] Float, R
PX_CTR_KP_W[i] {TAG}.PID KP Proportional Gain [unitless] Float, W
PX_CTR_KP[i] {TAG}.PID.KP Proportional Gain [unitless] Float, R

1
If PX_CTR_CVMAX ≠ PX_CTR_CVMIN, the CV is scaled to engineering units. If not, CV remains in [%].
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 11 OF 60

PX_CTR_DB_W[i] {TAG}.PID.DB Deadband [e.u.] Float, W


PX_CTR_DB[i] {TAG}.PID.DB Deadband [e.u.] Float, R
PX_CTR_MAX[i] {TAG}.PID.MAXS Scaling Max.Value [e.u.] Float, R
PX_CTR_MIN[i] {TAG}.PID.MINS Scaling Min.Value[e.u.] Float, R
PX_CTR_descr[i] - Description Message (40)
PX_CTR_id[i] - Tag Message (20)
PX_CTR_unit[i] - Unit of Process Variable Message (20)
PX_CTR_cvunit[i] - Unit of scaled CV Message (20)
PX_CTR_dir[i] - Address in PLC Message (20)
PX_CTR_sec[i] - Security level Analog

* See bit arrangement on section 5.2

• {TAG} is the ID for each element, for example Z40_PIC. For each controller there is a data structure
defined in PLC related to TAG name.

User Data Structure controller Object:

Name Data Type Style Description


ANL ANL_STR Analog structure for controller
SPL REAL Float Local Setpoint
SPR REAL Float Remote Setpoint
RAMPV REAL Float Ramp Value [e.u./sec]
CV REAL Float Control Value in %
CVMAX REAL Float Control Value MAX in e.u.
CVMIN REAL Float Control Value MIN in e.u.
CVEU REAL Float Control Value in e.u.
TOL REAL Float Tracking fault range e.u.
TAU REAL Float Timeout for tracking faul [sec]
SPI REAL Float Setpoint value before ramp
SP REAL Float Setpoint value after ramp
UPD TIMER Update pulse timer
TRK TIMER Tracking fault detection timer
ITF BOOL Decimal Inhibit Tracking Fault Alarm
AUX INT Decimal Aux for alarm handling
TF BOOL Decimal Tracking fault Alarm
PID PID PID Structure for controller
IHB BOOL Decimal Inhold Bit
IHV REAL Float Inhold Value
UPTIME REAL Float Controller update time [sec]
STAT_W INT Decimal Commands from HMI
STAT_R INT Decimal Controller status indication to HMI
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 12 OF 60

3.7 OPEN LOOP CONTROLLERS

Direct action on an actuator, like VFD’s, control valves without control loops, etc. If feedback exist, it
should be displayed in screen as Analog Variable (PX_ANL_PV[i]).

FACTORY LINK PLC DESCRIPTION TYPE


PX_OL_STAT_R[i]* {TAG}.STAT_R Status words Analog, R
PX_OL_STAT_W[i]* {TAG}.STAT_W Command words Analog, W
PX_OL_RAMPV_W[i] {TAG}.RAMPV Ramp value [e.u./sec] Float, W
PX_OL_RAMPV[i] {TAG}.RAMPV Ramp value [e.u./sec] Float, R
PX_OL_SPL[i] {TAG}.SPL Local Setpoint [e.u.] Float, W
PX_OL_SPR[i] {TAG}.SPR Remote Setpoint [e.u.] Float, R
PX_OL_SPI[i] {TAG}.SPI Setpoint before ramp module [e.u.] Float, R
PX_OL_SP[i] {TAG}.SPI Setpoint after ramp module [e.u.] Float, R
PX_OL_MAX[i] {TAG}.MAX Scaling Max value [e.u.] Float, R
PX_OL_MIN[i] {TAG}.MIN Scaling Min value [e.u.] Float, R
PX_OL_descr[i] - Description Message array (40)
PX_OL_id[i] - Tag Message array (20)
PX_OL_unit[i] - Unit Message array (20)
PX_OL_dir[i] - Address in PLC Message array (20)
PX_OL_sec[i] - Security level Analog array

* See Bit arrangement on section 5.3

• {TAG} is the ID for each element, for example N35_ZT_02. For each open loop controller there is a
data structure defined in PLC related to TAG name.

User Data Structure open loop controller Object:

Name Data Type Style Description


STAT_W INT Binary Commands from HMI (reset by PLC)
STAT_R INT Binary Open Loops Status Indication to HMI
RAMPV REAL Float Ramp value [e.u./sec]
SPL REAL Float Local Setpoint [e.u.]
SPR REAL Float Remote Setpoint [e.u.]
SPI REAL Float Setpoint before ramp module
SP REAL Float Setpoint after ramp module
MAX REAL Float Scaling max value
MIN REAL Float Scaling min value
MAXOUT REAL Float Max output value (4095 o 32767)
UNSCALED DINT Decimal Unscaled to send output value to card
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 13 OF 60

3.8 PARAMETERS

(Volume of a screw, length of a weight conveyor, etc...)

FACTORY LINK PLC DESCRIPTION TYPE


PX_PARAM_VAL_W[i] PARAM_VAL[i] Parameter Value [e.u.] Float, W
PX_PARAM_VAL[i] PARAM_VAL[i] Parameter Value [e.u.] Float, R
PX_PARAM_descr[i] - Description Message (30)
PX_PARAM_id[i] - Identification Message (20)
PX_PARAM_dir[i] - Address in PLC Message (20)
PX_PARAM_sec[i] - Security level Analog
PX_PARAM_max[i] - Max Value [e.u.] Float
PX_PARAM_min[i] - Min Value [e.u.] Float

Note: For special cases, like production orders management, new parameters files could be defined.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 14 OF 60

3.9 GENERAL ALARMS

Alarm bits are read by HMI station every one (1) second.

FACTORY LINK PLC DESCRIPTION TYPE


(ARRAY
DEFINED)
PX_GNRL_ALM[i] GNRL_ALM[i] Special alarm trigger Digital
PX_GNRL_descr[i] - Special alarm message Message (40)

See section 5.8 for further information.


MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 15 OF 60

3.10 GENERAL COMMANDS

To be used for commands like “start cleaning cycle”, groupstart / stop, etc...

FACTORY LINK PLC DESCRIPTION TYPE


PX_CMD_W[i] CMD_W[i] Command from F.Link Array type Bool, W
PX_CMD_A[i] CMD_A[i] Command will start or is in progress Array type Bool, R
PX_CMD_R[i] CMD_R[i] Requested action done Array type Bool, R
PX_CMD_F[i] CMD_F[i] Failure during execution Array type Bool, R
PX_CMD_descr[i] - Command description Message (40)

See section 5.9 for further information about the use of General Commands.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 16 OF 60

3.11 CHECKING COMMUNICATION BETWEEN HMI-PLC

FACTORY LINK PLC DESCRIPTION TYPE


PLC_ALIVE PLC_ALIVE[i] “PLC is alive”: HMI station can Digital, R
communicate with PLC [i].
FL_ALIVE[i] FL_ALIVE[i] “Factory Link is alive”: PLC can Digital, W
(i>0) communicate with HMI station [i]

Look on section 5.10 for further information about this theme.


MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 17 OF 60

3.12 PRODUCTION JOBS

Job Parameters (Thickness, width,..)

FACTORY LINK PLC DESCRIPTION TYPE


MDF_JOB_C[i] MDF_JOB_CUR[i] Current Production Job Float, R
MDF_JOB_N_W[i] MDF_JOB_NXT[i] Next Production Job Float, W
MDF_JOB_N[i] MDF_JOB_NXT[i] Next Production Job Float, R
MDF_JOB_min - Min valid value [e.u.] Float
MDF_JOB_max - Max valid value [e.u.] Float
MDF_JOB_unit - Unit [e.g.: m/min] Message (10)
MDF_JOB_descr[i] - Description Message (40)
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 18 OF 60

4. DATA STRUCTURE ON THE PLC

4.1 PROGRAM FILES

FILE Name DESCRIPTION


Mainroutine Main routine (jump sequence to subroutines)
Analog_Input Scaling and settings for analogs inputs

M_{id}_{TAG} Programming for motor {TAG}, (ex: M_04_M410)

PID_{id}_{TAG} Programming for controller {TAG}, (ex: PID_04_FIC440)

MOD_ANALOG Standard analog module (alarm checking) (normal operation)


MOD_PID Standard controller module (normal operation)

MOD_M_FWD Motor module 1: Forward (normal operation)


MOD_M_FWD_HS Motor module 2: Forward + High speed (two speed motor)
MOD_M_FWD_BWD Motor module 3: Forward/Backward (normal operation)
MOD_M_FWD_BWD_HS Motor module 4: Forward/Backward + High speed (two speed motor)

MOD_OL Open loop module


MOD_VS Switching valves module (normal operation)

MOD_POSITIONER Positioner module


MOD_RAMP Ramp module

GENERAL_SETTINGS General settings and commands acknowledge from HMI

TOTALIZERS Totalizers to generate consumption’s reports


COMMUNICATION Detects if communication node isn’t active. Comm. between PLC’s
REPORTS Shift and Production Job Report generation
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 19 OF 60

5. PROGRAM MODULES ON THE PLC

The structure of a PLC program is the same for all motors of the same type, differing only the addresses.
The same principle is applicable to controllers and other actions, like scaling, ramp generation, etc.
Thus, MASISA has defined that the PLC program should be structured in subroutines, where each of
them contains a part of program that is common for more than one component. Each of these subroutines
is called a “module”, and has input and output parameters. The module is programmed using arrays,
where the desired address is pointed by an Index (Indirect Addressing Mode).

Program modules are used for the following reasons:

• Standard and structured programs for PLC and HMI Stations in all areas of the plant.
• Direct and pre-defined relationship between PLC and HMI programs.
• Ease maintenance, because of the standard structure for each vendor in the whole plant.

The next is the list of the existing modules, described on this document:

• Motors
• Controllers (PID)
• Positioner Module
• Open Loop Controllers
• Switching Valves
• Ramp generation

Additionally, the standard PLC and Factory Link programs of MASISA, which are delivered with
this document, includes the following items:

• Analog variables: range definition, scaling and alarm generation


• Startup routine
• Sending of alarms to HMI Stations
• Startup files
• General Commands
• Checking communication between PLCs and HMI stations
• Totalizers for consumption’s reports
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 20 OF 60

5.1 MOTOR MODULES

5.1.1 DESCRIPTION

Motor modules include the most used commands and options for PLC motor programing, as well as the
whole communication with the routines in Factory Link.

These modules include the following features:

• HMI Commands: The modules receive pulse commands from a HMI station to start, stop and
change speed. Pulse commands are reset in each module.
• Safety Logic (SIF/SIB): The modules include safety interlock logic (FWD and BWD), separated of
operation conditions. Safety conditions can’t be bypassed in the module logic.
• Motor Release (REF/REB): Include the FWD and BWD interlocks between motors and different
parts of the process. Release conditions are not considered in maintenance mode.
• Command mode (COM): Command Mode is an input parameter in the motor block subroutine. This
parameter allows the motor to be operated from any HMI station. When the Command Mode is
active, the HMI motor window shows the commands START, STOP, BWD, etc... (displayed options
depends on the motor type). When the command mode is not active, the HMI motor window only
displays motor information. The Input Parameter can be overwritten for an specific Motor with the
Forced Manual Mode bit (FMM) , which can be Set by the HMI if the Enable Forced Manual Mode
(EMM) = 1.
• Invertion Time: Parameter of the Motor Object Data Strcture, used to delay the change of rotation
wise.
• Alarm Generation: The motor blocks include the alarm bit generation, which should be reset by the
operator, sending a reset command (ACK) for the given motor.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 21 OF 60

5.1.2 CALLING THE SUBROUTINE

The motor block subroutine is called by using the PLC instruction JSR (JUMP TO SUBROUTINE). The
motor modules have only input parameters, which are detailed in the next table:

PARAM TYPE * DESCRIPTION


JSR X Jump to subroutine: File X. See next section to determine which
subroutine should be used according with the motor type. X=10-13
(or 20-23 for test purpose)
Input TAG STR • Motor STRUCTURE. This input parameter identifies a motor
Parameter 1 (Ex: in both HMI and PLC programs.
T10_M01) • for the tag P1_M_STAT_R[3] see P1_M_id[3]
Input MODE INT Motor Operation Mode: Maintenance
Parameter 2 (See next table with the different operation modes)
• MODE=1 => motor modules use only the maintenance bits to
command the motor. Only safety interlocks are considered.
The parameter MODE sets the bit IMM (indication Maintenance
Mode) in the motor module output word
Input COM INT Command Mode
Parameter 3 (See next table with the different operation modes)
• COM=1 => motor commanded from HMI station. The HMI
displays a command window when the motor is selected. The
window depends on the motor type. Also, the HMI commands
can be “generated” by the PLC during a groupstart/stop.
The parameter COM sets the bit “0” in the motor module output
word (PX_M_STAT_R[i])
Return TAG STR • Motor STRUCTURE. This input parameter identifies a motor
Parameter 1 in both HMI and PLC programs.

* It is very important to use the right type of variable (INT) or unpredictable operation could
occur (The “jump to subroutine” instruction don’t makes any type conversion).

The parameters may be a variable or just a number directly written in the JSR instruction. Always the 4
parameters should be filled out (The fourth parameter can be “0” for motors without backward option)

MODE COM FMM Description Motor Commanded from: Obs.


0 0 0 Automatic Mode PLC, STAT_R1:(AFW, ABW) If AMM =0 then FMM = 0
0 1 x Manual Mode HMI commands STAT_W:(FW,BW)
0 x 1 Manual Mode HMI commands STAT_W:(FW,BW) FMM=1 only if AMM = 1
x Maint. Mode from
1 0 Pushbuttons on Local Panels Only considers safety interlocks
pushbuttons
x Maintenance Mode
1 1 HMI commands Only considers safety interlocks
from HMI
(See section 5.1.5 for explanations regarding bits AMM and FMM)
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 22 OF 60

Example : JSR MOD_M_FWD 3 T10_M01 T10_to_T30_MODE T10_M01_COM T10_M01

where:
Motor Routine file name :MOD_M_FWD (only FWD running)
Tag :T10_M01 (motor tag this PLC)
Mode :T10_to_T30_MODE (e.g.: Maintenance bit for the area related to that motor)
Command Mode :T10_M01_COM (e.g.: manual operation from HMI, may be any integer)
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 23 OF 60

5.1.3 MOTOR MODULES

Each type of motor has his own motor subroutine or module. In this document there are the following
four motor modules.

PLC FILE Name NAME DESCRIPTION MB0 MB1 MB2


MOD_M_FWD FWD Forward 0 0 0
MOD_M_FWD_HS FWD_HS Forward and High Speed 0 1 0
MOD_M_FWD_BWD FWD_BWD Forward and Backward 1 0 0
MOD_M_FWD_BWD_HS FWD_BWD_HS Forward, Backward and High Speed 1 1 0

Every motor block module has a subroutine code. The Visualization System reads this code to open the
motor window correspondent to the motor type.

Motor Module
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 24 OF 60

5.1.4 ADDRESS DEFINITION

Look on sections 3.2 and 5.1 for the list of the whole variables to configure the motor module.
Command and Status Words are cleared at the PLC Startup, in the program File Nº 3.

5.1.5 COMMAND AND STATUS WORDS

COMMAND WORD [COM=1]

HMI Tag :PX_M_STAT_W[i]


Description :Commands
PLC Address :{TAG}.STAT_W
OPC Client Table :Exception Write
Signal Type :Pulse

BIT COND. 1 DESCRIPTION


0 OFF COM = 1 Stop the motor from HMI
1 FW COM = 1 Start forward from HMI
2 BW COM = 1 Start backward from HMI
3 HS COM = 1 High Speed
4 LS COM = 1 Low Speed
5 ACK - Motor alarm reset from HMI
6 EMM AMM = 1 Enable Forced Manual Mode (FMM = 1)
7 DMM AMM = 1 Disable Forced Manual Mode (FMM = 0)
8 .. - Spare
… .. - Spare
15 _ Spare

The use of these command bits is intended to:

- Sending commands from HMI


- Group Start /Stop sequence (start/stop signals generated by PLC)

All pulse signals are cleared in motor block subroutine.

1
COM is the bit {TAG}.STAT_R.0 set bit the subroutine input parameter seen on section 5.1.2. or the FMM bit ({TAG}.STAT_R.15)
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 25 OF 60

PLC COMMAND WORD

PLC Address :{TAG}.STAT_R1


Signal Type :Level

The PLC command word is used as input to the motor modules for level commands.
Level commands are not available from HMI stations, and are intended to be used in maintenance and
automatic mode.

BIT DESCRIPTION COND. 1 SET BY


0 SIF Safety Interlock Forward Safety Logic. Set before calling the motor module
1 SIB Safety Interlock Backward Safety Logic. Set before calling the motor module
2 REF Release FWD (Ready to Start) Operation Logic. Set before calling the motor module
3 REB Release BWD Operation Logic. Set before calling the motor module
4 RCI Rotation Change Interlock Internl, used in the motor module to Stop before change
the rotation wise
5 AFW Automatic FWD (start command) C=0 &M=0 Operation Logic. Set before calling the motor module
6 ABW Automatic BWD (start command) C=0 &M=0 Operation Logic. Set before calling the motor module
7 AHS Automatic High Speed C=0 &M=0 Operation Logic. Set before calling the motor module
2
8 SG Speed Guard Failure This signal must be generated outside the motor
module and will stop the motor when active.
9 OVL Overload Failure This signal is generated with the PLC input of the
Thermal protection (1= failure)
10 DRV Drive Failure 3 This signal is generated with PLC Input of the Drive
status. (1=failure)
11 MFW Maintenance Forward Command MODE=1 Ext. Input (P.View) or Local Panel (TBxx)
12 MBW Maintenance Backward Command MODE=1 Ext. Input (P.View) or Local Panel (TBxx)
13 MHS Maintenance High Speed MODE=1 Ext. Input (P.View) or Local Panel (TBxx)
14 K1M Contactor Failure This signal is generated with the PLC input for all
motor contactors in parallel. (1=contactor not active)
15 -- Timer Reset Internal

1
C=COM (bit {TAG}.STAT_R.0); M=MODE (subroutine parameter seen on section 5.1.2.)
2
The motor block stops the motor if the signal SG is active when the motor runs.
3
The motor block stops the motor if the signal DRV is active when the motor runs.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 26 OF 60

OUTPUT WORD OF MOTOR BLOCK (PLC→


→HMI AND PLC→
→OUTPUTS)

HMI Tag :PX_M_STAT_R[i]


Description :Motor status indication to HMI
PLC Address :{TAG}.STAT_R
OPC Client Table :Triggered Read
Signal Type :Level

BIT DESCRIPTION SET BY HMI ACTION


0 COM Command mode JSR Input Parameter Select window in HMI
(Commands from HMI allowed)
1 MB0 Module Code 0 Motor Module Select window in HMI1
2 MB1 Module Code 1 Motor Module Select window in HMI
2
3 AMM Allowed Forced Manual Mode Set by Latch or Fill Instruction Shows the forced Manual Button
4 IHS Indication High Speed Motor Module Text Display in HMI
5 RSF Indication Ready to Start REF & SIF Set Motor in blue
6 RSB Ready to Start Backward REB & SIB Set Motor and arrow 3 in blue
7 ONF Running Forward Motor Block Logic -
8 ONB Running Backward Motor Block Logic Set arrow in green
9 FBK Contactor Feedback (Fwd or Bwd) Motor Block Logic Set Motor in green
10 IMM Indication Maintenance Mode Mode Group in Maint. Set Motor status flashing
(JSR Input Parameter)
11 FEC Failure in Electrical Cubicle Motor Module Text Display in HMI
12 FSG Failure Speedguard Motor Module Text Display in HMI
13 FOL Failure Overload Motor Module Text Display in HMI
14 FDR Failure in Drive Motor Module Text Display in HMI
15 FMM Forced Manual Mode Motor Block Logic through Sets Motors in flashing status
EMM and DMM bits from with changed color
HMI, if AMM=1

1
The “module code” is assigned in the motor block subroutine. See next section for further information.
2
When AMM=1 enable forced manual mode from HMI.
3
Only for motors with reverse rotation: attached to the motor symbol, MMI displays an arrow to indicate backward operation.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 27 OF 60

5.1.6 MODULE CODE

As seen, every motor module writes a Code on the Output Word, used by the Visualization System to
open the proper window when a motor is selected. When the Command Mode is active (COM = 1), the
following Codes are read:

MB1 MB0 COMMAND MODE (IN HMI)


0 0 Module FWD
0 1 Module FWD/BWD
1 0 Module FWD+HS
1 1 Module FWD/BWD+HS
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 28 OF 60

5.1.7 LOGIC DIAGRAM OF MOTOR MODULE 1 (FWD)


This section shows as exmaple the logic diagram of motor module #1
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 29 OF 60

5.1.8 USING THE MOTOR MODULES

The use of the motor modules is described in the next examples:

- Example 1: “Using Module 1: FWD (subroutine 10)”


- Example 2: “Using Module 2: FWD + HS (subroutine 11)”
- Example 3: “Using Module 3: FWD/BWD (subroutine 12)”
- Example 4: “Using Module 4: FWD/BWD+HS (subroutine 13)”
- Example 5: “Group Start Sequence”
- Example 6: “Group Stop Sequence”

Additionally, MASISA delivers a standard PLC program, where these examples are included.
Variables indicated with [*] are only as example.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 30 OF 60

5.1.8.1 USING MODULE 1: FWD


Motor Module FWD
Subroutine Code 00 (Visualization mode)
JSR File Name MOD_M_FWD

Motor N°1 Safety Conditions FWD


e.g. Emergency Stop

Motor N°1 Interlock Conditions FWD


(Not used in maintenance)

Motor N°1 Automatic FWD Conditions


(Used if COM=0 and MODE=0)

T10_M01.STAT_R.7 is interlocked internally with


the alarm bit (T10_M01.Fault_motor). However, it
is recommendable to include it again in this rung in
order to see the alarm condition
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 31 OF 60

5.1.8.2 USING SPEEDGUARD SENSOR


CASE A) Pulse signal switch

CASE B) Level signal switch


MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 32 OF 60

5.2 PID CONTROLLER MODULE

5.2.1 DESCRIPTION

This module includes the following features:

• The module performs the action requested by a command sent by the operator from the HMI
Station and resets the command bit. Commands change the operation modes: Auto/Manual,
Local/Remote and Ramp/Step.
• The module activates the PID instruction, and determines the Update Time (PID uses the Update
Time for the calculation of the Integral and Derivative Terms).
• Control Value (CV) could be in [%] or in engineering units.
• Setpoint changes with steps or ramps. Ramps generation is done according to a selected ramp value
[Engineering units / second]
• PID goes to manual when the actuator isn’t ready or when a process condition determines that the
system should be in manual.
• In manual mode, only local mode is allowed.
• When the “change to remote mode” command is send and the controller is in manual, the PID goes
first to automatic mode (if possible) and then changes to remote mode.
• In remote mode, Local Setpoint follows the Remote Setpoint for a bumpless transition to local
mode.
• When the controller goes to manual, the Control Value (CV) remains with the same value.
• Alarm Handling: Based on the alarm limits sent from the Operation Station, the module generates
the alarm signals (HighHigh, High, Low, LowLow and Tracking Fault). (see section 5.8 “ALARM
HANDLING AND SENDING” for further information).
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 33 OF 60

5.2.2 MODULE DIAGRAM

The following chart shows the interface between the controller module and the PID instruction. A
specific diagram of the controller module could be found at the next chart.

_CTR_STAT_R[i]/9

OUTPUT PARAM.

OUTPUT PARAM.
OUTPUT PARAM.
UPDATE PULSE
STATUS WORD

CONTROLLER
UPDATE TIME

SET OUTPUT
AFTER RAMP

{TAG}.CVEU
_CTR_CV[i]
{TAG}.UPD

SETPOINT

{TAG}.SP

INPUT PARAMETER
INPUT PARAMETER

INPUT PARAMETER
PROCESS VALUE

[s]
UPDATE TIME
{TAG}.ANL.PV

SET OUTPUT

{TAG}.CVEU
*_CTR_PV[i]

_CTR_CV[i]
[msec]

Interface between Controller Module and PID instruction


MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 34 OF 60

Controller Module
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 35 OF 60

5.2.3 CALLING THE SUBROUTINE

The structure of the PID invocation is the next :

PARAMETER TYPE DESCRIPTION


MOD_PID Jump to subroutine
Input Parameter 1 TAG STR Control loop TAG
Output Parameter 1 TAG STR Control loop TAG
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 36 OF 60

5.2.4 COMMAND AND STATUS WORDS

HMI Tag: PX_CTR_STAT_W[i]


Description: Commands from HMI (reset by the PLC)
PLC Address: {TAG}.STAT_W
OPC Client Table.: Exception Write
Signal Type: Pulse

BIT DESCRIPTION SET BY RESET BY


0 Change to Automatic Mode Procedure in HMI PLC PID Subroutine
1 Change to Manual Mode Procedure in HMI PLC PID Subroutine
2 Change to Local Mode Procedure in HMI PLC PID Subroutine
3 Change to Remote Mode Procedure in HMI PLC PID Subroutine
4 Do changes with Steps Procedure in HMI PLC PID Subroutine
5 Do changes with Ramps Procedure in HMI PLC PID Subroutine
6 Spare
7 Spare
8 Spare
9 Spare
10 Spare
11 Spare
12 Spare
13 Spare
14 Spare
15 Spare
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 37 OF 60

HMI Tag: PX_CTR_STAT_R[i]


Description: Controller Status Indication to HMI
PLC Address: {TAG}.STAT_R
OPC Client Table: Triggered Read
Signal Type: Level

BIT DESCRIPTION OBSERVATION


0 Spare
1 Change PID parameters When this bit rises to one, the PLC should change the PID
parameters. The Controller Module doesn’t include the
program to change the parameters. Refer to the SCADA.RSP
program for examples about the use of this bit.
2 Return to automatic after parameters For a bumpless response, the PID parameters should be
change changed only in manual mode.
Therefore, the controller is put in manual during the change
and returned to automatic (if this bit is set) after finishing it.
The Controller Module doesn’t include the program to change
the parameters. Refer to the SCADA.RSP program for
examples about the use of this bit.
3 Actuator running If the actuator is a motor, this bit shows if the motor is running
or not. In case of control valves or dampers, this bit should be
always 1.
4 Process interlock go to manual Process condition forces the controller to be in manual
5 Spare
6 Spare
7 Spare
8 Spare
9 Execute the PID instruction Trigger to the execution of the PID instruction (intern)
10 Spare
11 0 = Changes with Steps Setpoint changes will be done with ramps or steps
1 = Changes with Ramps
12 0 = Automatic Mode
1 = Manual Mode
13 0 = Local Mode
1 = Remote Mode
14 Tracking Fault Indication PV can’t follows the SP
15 -
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 38 OF 60

5.2.5 STATUS BITS GENERATION

Following chart explains the generation of the Status Bits (PX_CTR_STAT_R[ ]) within the PID
Module. Command Bits (PX_CTR_STAT_W[ ]) are pulses, set by the HMI, reset by the controller
module.

_CTR_W: Change to
manual mode: _CTR_R: STAT_R.12
STAT_W.1 ≥1 L 0: auto mode
1: manual mode
U
_CTR_R: STAT_R.3
Actuator running

_CTR_R: STAT_R.4
Process interlock:
go to manual &

_CTR_W: Change to
automatic mode: ≥1
STAT_W.0

_CTR_W: Change to
remore mode:
STAT_W.3

_CTR_W: Change to _CTR_R: STAT_R.13


remore mode:
L 0: local mode
STAT_W.3 U 1: remote mode

_CTR_W: Change to ≥1
local mode:
STAT_W.2

_CTR_W: Change to _CTR_R: STAT_R.11


ramp mode
L 0: step mode
STAT_W.5 U 1: ramp mode

_CTR_W: Change to
step mode
STAT_W.4

Actuator running:
(Set by ladder logic out _CTR_R: STAT_R.3
of subroutine) Actuator running

Process interlock _CTR_R: STAT_R.4


(Set by ladder logic out Process interlock:
of subroutine) go to manual

_CTR_R: STAT_R.9
TIMER Timing
Execute PID instruction
.UPD done
(pulse)

PV can't follows SP: _CTR_R: STAT_R.14


TIMER Timing
|SP - PV|> Tolerance Tracking fault:
{}.TRK done
Tolerance: {}.TOL PV can't follows SP
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 39 OF 60

5.2.6 SCALING OF THE CONTROL VALUE


The Controller module can scale the Control Value to engineering units. Usually, the Control Value is
expressed in [%], but it could the scaled according to the PLC variables CTR.CVMIN and
CTR.CVMAX (Max and Min scaling values respectively).
The system only scales to engineering units if CTR.CVMAX ≠ CTR.CVMIN. In this case, the HMI
shows the CV with the proper units and, in manual mode, the operator can enter a desired Control
Value in engineering units, too.
To inhibit the scaling of the Control Value, make CTR_CVMAX = CTR.CVMIN. This Mode is also
useful if the Controller output should be in a positive and negative Range. In this case the zero axis is
right adjusted in the Faceplate.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 40 OF 60

5.2.7 ALARM INHIBITION


The Controller module doesn’t use special bits to inhibit alarms (like LowLow Flow when the pump is
stopped). To inhibit this kind of undesired alarms, alarms should be reset (with unlatch instructions)
after the module call.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 41 OF 60

5.3 OPEN LOOP CONTROLLERS

5.3.1 DESCRIPTION

The purpose of the Open Loop Module is to be used in all those cases where an actuator exist, which
isn’t related to a closed control loop. A typical application of an Open Loop Controller is the speed
reference for a VFD, where the feedback of the Process Value is not available or used only as
indication, but not as part of a control loop.

The Open Loop Module includes the following features:

• Commands to change the operation mode: Local/Remote and Ramp/Step selection.


• Setpoint generation, both scaled and unscaled (raw value). Unscaled value can be moved directly to
an analog output address1.
• In remote mode, the Local Setpoint follows the Remote Setpoint for a bumpless transition to local
mode.
• Ramp value set from HMI station on engineering units per second.

1
If the analog output card uses a range different to 0-4095 (eg.0-32767), the unscaled Setpoint should be adapted assigning the
maximum value for Unscaled Setpoint ( {TAG}.UNSCALED).
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 42 OF 60

5.3.2 MODULE DIAGRAM

The next chart shows the diagram of the Open Loop Module:

LOCAL / REMOTE RAMP / STEP


_OL_STAT_R[]/13 _OL_STAT_R[]/11
{TAG}.STAT_R.13 {TAG}.STAT_R.11

R
RAMP
UNSCALING OF
L SETPOINT
SETPOINT
LOCAL SETPOINT BEFORE
_OL_SPL[] LIMITING MODULE RAMP {TAG}.MAXOUT
{TAG}.SPL {TAG}.SPI (REF. ANALOG OUTPUT
CARD)

REMOTE SETPOINT R
_OL_SPR[]
{TAG}.SPR
S

5.3.3 CALLING THE OPEN LOOP MODULE

Use the next structure to call the Open Loop module:

PARAMETER TYPE * DESCRIPTION


MOD_OL Jump to subroutine
Input Parameter TAG STR Openloop structure
Output Parameter TAG STR Openloop structure
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 43 OF 60

5.3.4 VARIABLES, COMMANDS AND STATUS WORDS

Look on section 3.7 for the whole variables related to the Open Loop Module.

The next tables show the bit arrangement of the Command and Status Words of the Open Loop
Module:

HMI Tag: PX_OL_STAT_W[i]


Description: Commands from HMI (reset by the PLC)
PLC Address: {TAG}.STAT_W
OPC Client Table.: Exception Write
Signal Type: Pulse

BIT DESCRIPTION SET BY RESET BY


0 Spare
1 Spare
2 Change to Local Mode HMI .PRG PLC PID Subroutine
3 Change to Remote Mode HMI .PRG PLC PID Subroutine
4 Do changes with Steps HMI .PRG PLC PID Subroutine
5 Do changes with Ramps HMI .PRG PLC PID Subroutine
6 Spare
7 Spare
... ...
15 Spare
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 44 OF 60

HMI Tag: PX_OL_STAT_R[i]


Description: Open Loop Status Indication to HMI
PLC Address: {TAG}.STAT_R
NETDTL Config.: Triggered Read
Signal Type: Level

BIT DESCRIPTION OBSERVATION


0 Spare
1 Spare
... ...
10 Spare
11 Step = 0 / Ramp = 1 HMI shows option on window
12 Spare
13 Local = 0 / Remote = 1 HMI shows option on window
14 Spare
15 Spare
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 45 OF 60

5.4 POSITIONER MODULE

5.4.1 DEFINITION

Actuators such as Control Valves, dampers, etc, with no external positioner, require to be positioned
by the PLC Programm through two digital Open/Close Signals. The Position Setpoint may be
generated in the PLC or be the output of an Open Loop Controller or an PID Controller.
This Module has the following features:

• Two control signals: Open/Close.


• Deadband Variable in order to stop the actuator a little bit before reaching the Setpoint, and to
avoid oscilations.
• The Output Control Signals are pulsed for small position errors. The length of the pulse is
proportional to the position error.
• The Pulse period is defined once, for the whole positioners. (typically one second)

5.4.2 CALLING THE POSITIONER MODULE

The next table shows the way to call the Positioner module:

PARAMETER TYPE * DESCRIPTION


MOD_POSITIONER Jump to subroutine
Input Parameter 1 Position Setpoint Real Desired position of the Actuator
POS_SP
Input Parameter 2 Actual Position Real Actual position of the actuator
POS_PV
Input Parameter 3 Deadband Real Permitted Position error without
POS_DB action

Output Parameter Bit 0 =Opening Signal Integer This Signals increase/decrease the
POS_ACTUATOR Bit 1 = Closing signal actuator position

* It is very important to use the right type of variable or unpredictable operation could occur
(The “jump to subroutine” instruction don’t makes any type conversion).
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 46 OF 60

5.5 RAMP MODULE

5.5.1 DESCRIPTION

The ramp module continuously changes the value of a variable, according to a changing rate, until
reaching a desired value. The changing rate is expressed as engineering units per second.

5.5.2 CALLING THE RAMP MODULE

The next table shows the way to call the Ramp module:

PARAMETER UNIT TYPE * DESCRIPTION


MOD_RAMP Jump to subroutine
Input Parameter 1 Ramp value e.u./sec Real Ramp value
RAMP_GAIN
Input Parameter 2 Value before ramp e.u. Real Desired final value
RAMP_DESIRED module

Input Parameter 3 Value after ramp e.u. Real Current value (previous PLC scan)
RAMP_CURRENT module

Output Parameter Value after ramp e.u. Real Current value (calculated for the
RAMP_CURRENT module current PLC scan)

* It is very important to use the right type of variable or unpredictable operation could occur
(The “jump to subroutine” instruction don’t makes any type conversion).

5.5.3 USING THE RAMP MODULE

The next ladder program explains the use of the ramp module:

| |
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 47 OF 60

5.6 SWITCHING VALVES

5.6.1 DESCRIPTION

The operation of switching valves includes the next features:

• Activate/disable of valves
• Interlock of valve operation
• Command mode: this mode allows the valve operation from any Operation Station (if needed)
• Alarm generation (failure to open/close)

5.6.2 CALLING THE SUBROUTINE

PARAMETER UNIT TYPE * DESCRIPTION


MOD_VS Jump to subroutine:
Input {TAG} - STR • Valve Tag. This input parameter identifies a valve in both
Parameter 1 HMI and PLC programs.

Input MODE - INT Maintenance Mode


Parameter 2 (See next table with the different operation modes)
• MODE=1 => Valve module use only the maintenance bits
to command the motor. Only safety interlocks are
considered.
Input COM - INT Command Mode
Parameter 3 (See next table with the different operation modes)
• COM=1 => valve commanded from HMI station. The
HMI displays a window with command buttons when the
valve is selected.
The parameter COM sets the bit “0” of the valve module
output word (PX_VS_STAT_R[i])
Output {TAG} - STR • Valve Tag. This input parameter identifies a valve in both
Parameter 1 HMI and PLC programs.

Operation Modes work in the same way as defined for motors:

MODE COM Description Valve Commanded from: Obs.


0 0 Automatic Mode PLC logic
0 1 Manual Mode HMI commands
Maintenance Mode from
1 0 Pushbuttons on Local Panels Only considers safety interlocks
pushbuttons
1 1 Maintenance Mode from HMI HMI commands Only considers safety interlocks
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 48 OF 60

5.6.3 COMMAND AND STATUS WORDS

Look on sections 3.3 for the whole variables to configure the switching valves:

Description: Commands from PLC


PLC Address: {TAG}.STAT_R1
Signal Type: Level

BIT DESCRIPTION
0 SIF Safety Interlock to activate valve
1 REF Operation Interlock (Release)
2 AFW Automatic Condition to activate valve
3 MFW Maintenance Condition to activate valve (only used in
“Maintenance from pushbottons” Mode)
4 FON Failure when valve ON
5 FOF Failure when valve OFF
6 Spare
7 Spare
... ...
15 Spare

HMI Tag: PX_VS_STAT_W[i]


Description: Commands from HMI (reset by the PLC)
PLC Address: {TAG}.STAT_W
OPC Client Table.: Exception Write
Signal Type: Pulse

BIT DESCRIPTION SET BY RESET BY


0 Activate Valve HMI .PRG PLC ladder logic
1 Disable Valve HMI .PRG PLC ladder logic
2 Spare
3 Spare
... ...
15 Spare
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 49 OF 60

HMI Tag: PX_VS_STAT_R[i]


Description: Valve Status Indication to HMI
PLC Address: {TAG}.STAT_R
OPC Client Table.: Triggered Read
Signal Type: Level

BIT DESCRIPTION OBSERVATION


0 Command Mode (COM) • COM = 0 : Valve can’t be commanded from the
HMI
• COM = 1 : Valve can be commanded from the
HMI, which shows the buttons to command the
valve on the valve window.
1 Valve (disable =0 / active = 1) • active: valve is energized
2 Interlock • Interlock = 0 : Valve is not blocked.
• Interlock = 1 : Valve is blocked by a process
condition.
3 Indication Maintenance Mode
4 Indication Failure Open/Failure Close 0= Normal Close
The bit Must be set in plc program, just 1= Normal Open
in case.
... ...
13 Spare
14 Failure to Open / Close
15 Spare

The next table shows the color animation of a switching valve in the HMI:

COLOR DESCRIPTION PRIVILEGE


Blue Valve not energized LOW
Green Valve energized ↓
Yellow Valve Blocked ↓
Red Failure HIGH

If more than one condition is active at the same time, the animation is done according to the privilege.

Note: In some areas (e.g.Panelhandling) where there are a lot of switching valves, which are not
actuated from the HMI, the use of the routine is optional. However the status words should be
maintained.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 50 OF 60

5.6.4 LOGIC DIAGRAM OF VALVE MODULE


MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 51 OF 60

5.7 STARTUP FILE

5.7.1 DESCRIPTION

PLC Program MOD_STARTUP is used for the initialization of data files. The system jumps into the
startup file the first time the PLC program starts.

The next are examples of variables to be included in this startup file:

• Enabling / Disabling the posibility of forcing motor manual mode from the HMI
• Enabling the activation of alarms (controllers and analog variables)
• Reset of alarm bits
• Reset of Status and Command Words (e.g. for the motor module, file {TAG}.STAT_R1 are reset)
• etc...

5.8 ALARM HANDLING AND SENDING

5.8.1 DESCRIPTION

Alarm handling and sending includes the following items:

• Alarm generation for motors, PID controllers, analog variables, switching valves and special
alarms
• Detection of changes on the alarm status, and sending to Factory Link.
• Deadband to reset an alarm condition in the case of field variables.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 52 OF 60

5.8.2 ALARM GENERATION

Next table shows the alarm types used by MASISA:

TYPE DESCRIPTION
HH HighHigh: Process Value greater than High Alarm limit
H High: Process Value greater than High Warning limit
L Low: Process Value less than Low Warning limit
LL Low Low: Process Value less than Low Alarm limit
TF Tracking Fault: (Only for controllers) In automatic mode, Process Value can’t follows the
Setpoint Reference. (detection using tolerance range and timeout).
Motor Fault Motor failure, possible causes: fault in electric cubicle (FEC), Speedguard (FSG),
Overload (FOL) or Drive (FDR). The specific failure is read from the motor status word,
because they are not sent as alarm.
FOC Switching Valve alarm: failure to Open/Close
Special alarm Any special alarm

Depending of the type of component, alarms are generated on different places:

TYPE GENERATED BY ALARMS GENERATED ON FILES


Motors Motor Module Motor fault MOD_M_FWD
MOD_M_FWD_BWD
MOD_M_FWD_HS
MOD_FWD_BWD_HS
Controllers Controller Modules HH, H, L, LL and TF MOD_PID
MOD_ANALOG
Analog variables Analog Variables Module HH, H, L, and LL MOD_ANALOG
Switching valves (along the program) FOC (along the program)
General alarms (along the program) General alarms (along the program)

Look on each module on chapter 3 for the proper addresses and arrays names.
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 53 OF 60

5.8.3 A SPECIAL CASE: GENERAL ALARMS

As seen on section 3.9, there is a special group of alarms, known as “General Alarms”. This type
contains every alarm that can’t be classified in the other alarm groups.

General alarm conditions should be programmed on data file GNRL_ALM[i].


MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 54 OF 60

5.9 GENERAL COMMANDS

5.9.1 DESCRIPTION

General commands are sent from HMI to PLC requesting a desired action.
As seen on sections 3.10 the next bit arrays should be used to configure the General Commands:

FACTORY PLC DESCRIPTION


LINK
PX_CMD_W[i] CMD_W[i] _W: Command from HMI: commands like “start cleaning cycle”, “start
change of production”, etc...
Like any other command from HMI, when _W arrives, it is reset
immediately by the PLC, and bit _A is set.
PX_CMD_A[i] CMD_A[i] _A: Command will start or is in progress: In some cases, the requested
action can’t start immediately or demands a long time in its execution.
During this waiting time, the operator knows that his requested action is
still in progress.
This bit is used by the HMI to display information on the process screens.
PX_CMD_R[i] CMD_R[i] _R: Requested action done:
e.g. command “empty line” has the bit _R active when the line is empty.
This bit is used by the HMI to display information on the process screens.
PX_CMD_F[i] CMD_F[i] _F: Failure during execution: ( if required) a failure occurs during the
execution of the required command.
e.g.: a failure occurs during a groupstart sequence.
The ways to reset this alarm are:
• Sending the same command once again: the alarm bit is reset.
• Sending an opposite command (e.g. groupstop): alarm is reset and the
stopping sequence is started.
- CMD_RESET[i] _X (reset bit) (for intern use on PLC, not read or written by HMI):
one scan duration pulse generated when _W arrives. This bit is used to:
• Reset Failure bits (_F) from own command and opposite commands
(e.g. “Failure during groupstart” and “Failure during groupstop”)
• Reset _A bits from opposite commands (e.g. “groupstart in progress” is
reset with “start groupstop”)
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 55 OF 60

The next chart summarises the way to program the commands on the PLC:
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 56 OF 60

5.10 CHECKING THE COMMUNICATION

As seen on section 3.11, the communication between HMI stations and PLCs is tested using “alive
bits”.

5.10.1 TESTS ON HMI

HMI checks the communication with the different PLCs. To do the test, each HMI station executes
following steps:

• HMI read, at some timed interval, a bit that is always “1” on the PLC. This bit is known as “PLC is
alive”.
• After a time-out without reading this alive bit, the HMI sets the flag “No communication with PLC
“X” ”. This flag remains active until reading again the “PLC is alive”.

The HMI routine, for these “PLC is alive” bits (1 per PLC), is included in the Factory Link Standard
of MASISA.

The next chart is an example of 2 HMI Stations testing the communication with 4 PLCs:

PLC 1 HMI 1
PLC_ALIVE[1]
FL_ALIVE[0].0 = 1
PLC_ALIVE[2]

PLC 2 PLC_ALIVE[3]

FL_ALIVE[0].0 = 1 PLC_ALIVE[4]= Not used

HMI 2
PLC 3
PLC_ALIVE[1]=Not used
FL_ALIVE[0].0 = 1
PLC_ALIVE[2]=Not used

PLC_ALIVE[3]
PLC 4
PLC_ALIVE[4]
FL_ALIVE[0].0 = 1

- Each HMI only checks the “alive bits” with the PLCs which it communicates.
- FL_ALIVE[0].0 : the same address should be used in all PLCs
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 57 OF 60

5.10.2 TESTS ON PLC

The PLC should check the communication with the HMI stations (e.g., for sending “Message”
instructions when a HMI station is disconnected).
The PLC has a lot of node status bits for channel 1A, but they are not available for Ethernet
communication (channel 2). So, each PLC should have a program for the generation of these node
status bits.

To do the test, each PLC executes following steps:

• Each HMI sends, at some timed interval, a bit that is always “1”. This bit is known as “Factory
Link is alive”.
• Each time the “FL is alive” bit arrives on the PLC, it’s reset on the PLC, together with a timer.
• If the “alive bit” don’t arrives, the timer will complete the timing operation, resetting the flag “HMI
with node “i” active” (File HMI_STA[i]). This flag remains inactive until receiving the “FL is
alive” bit again.

The routines for these “FL is alive” bits, is included in the Factory Link and PLC Standard programs
of MASISA.

The next chart is an example of 2 PLCs testing the communication with 3 HMI stations, where the
second HMI station can’t communicates with the PLC’s. On both PLCs, signal B140/2 shows that
HMI node 2 isn’t active:

HMI 1

PLC 1 FL_ALIVE[[ 1]] = 1

HMI_STA[1]=1 FL_ALIVE[0].1 FL_ALIVE[[ 2]] = Not used

HMI_STA[2]=0 FL_ALIVE[0].2 FL_ALIVE[[ 3]] = Not used

HMI_STA[3]=1 FL_ALIVE[0].3
HMI 2

FL_ALIVE[1] = Not used

FL_ALIVE[2] = 1
PLC 1
FL_ALIVE[3] = Not used
HMI_STA[1]=1 FL_ALIVE[0].1

HMI_STA[2]=0 FL_ALIVE[0].2 HMI 3


HMI_STA[3]=1 FL_ALIVE[0].3 FL_ALIVE[[ 1]] = Not used

FL_ALIVE[[ 2]] = Not used

FL_ALIVE[[ 3]] = 1
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 58 OF 60

5.10.3 CONSIDERATIONS

Each PLC has an unique index, which represent its position within the “PLC is alive” bits array. The
same is applicable to HMI stations.
To avoid duplications of indexes, a table with the different PLC’s and HMI stations should be make,
before filling the communications tables on the HMI stations. The table should look as the next
example (IP addresses only as example):

HMI STATIONS PLCs


IP ADDRESS HMI INDEX: IP ADDRESS PLC INDEX:
( FOR FL_ALIVE[[i]] ) ( FOR PLC_ALIVE[[i]] )
10.10.50.19 1 10.10.50.51 1
10.10.50.11 2 10.10.50.52 2
10.10.50.12 3 10.10.50.53 3
10.10.50.13 4 10.10.50.54 4
10.10.50.14 5 10.10.50.55 5
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 59 OF 60

5.11 PRODUCTION JOBS

There are two Production Job data files: for the current one and for the next one.
The SCADA system always sends the complete “Next Job” to all PLCs and each of them only uses
the data it really requires. When a next Job starts, each PLC overrides the current Job with the next
one.
The logic to change from one Job to another should be programmed in the PLC, and should be able to
change from one product to the other without stopping the line and minimizing the material reject.

The data files defined for the Jobs are the following:

FILE DESCRIPTION
MDF_JOB_CUR Current Production Job
MDF_JOB_NXT Next Production Job
MASISA PROGRAMMING SPECIFICATIONS February 2006
GERENCIA DE INGENIERÍA MASISA PLANTA CABRERO MDF-1 PAG. 60 OF 60

The data structure of each file is the next:

WORD DESCRIPTION
0 Not used
1 Job ID (MSW)
2 Job ID (LSW)
3 Type
4 Thickness
5 Overthickness
6 Board Length
7 Board Width
8 Board Rated Density
9 Board Rated Weight
10 .. 15 Spare
16 Production Parameter #1
17 Production Parameter #2
18 Production Parameter #3
19 Production Parameter #4
... ...

The first 15 words, called header, are the variables which defines a specific Production Job. Anyone of
them that changes, implies a new product or job. The production parameters start from word 16 and
will be defined during the project.

Das könnte Ihnen auch gefallen