Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can...

225
Technical Information STARDOM Engineering Guide (FCN-500/FCN-RTU) TI 34P02K35-02E TI 34P02K35-02E © Copyright Apr. 2016 (YK) 1st Edition Apr.28.2016 (YK)

Transcript of Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can...

Page 1: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

Technical Information

STARDOM Engineering Guide (FCN-500/FCN-RTU)

TI 34P02K35-02E

TI 34P02K35-02E © Copyright Apr. 2016 (YK)

1st Edition Apr.28.2016 (YK)

Page 2: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

Blank Page

Page 3: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

i

All Rights Reserved. Copyright © 2001, Yokogawa Electric Corporation TI 34P02K35-01E Mar. 31, 2014-00

Introduction About this manual

This engineering guide is intended as a guide for system engineering of a STARDOM system (FCN-500, FCN-RTU) based on given specifications. It supplements the information contained in the following documents, which are required for STARDOM engineering, and explains precautions and pointers, following the engineering workflow sequence.

Related Documents - GS 34P02Q02-01E FCN-RTU Autonomous Controller Functions - GS 34P02Q03-01E FCN Autonomous Controller Functions (FCN-500) - IM 34P02P25-01E NPAS POU – Overview - IM 34P02Q01-01E STARDOM FCN/FCJ Guide - TI 34P02A03-01E STARDOM Technical Guide - TI 34P02K13-02E STARDOM FCN-500/FCN-RTU

Primer – Fundamental - TI 34P02K25-01E STARDOM Network Configuration Guide - TI 34P02Q91-01E STARDOM FCN/FCJ Installation Guide

IMPORTANT

Notation in this document: - The term “FCN-500” refers to the autonomous controllers with NFCP501/NFCP502 CPU module. - The term “FCN-RTU” refers to the low power autonomous controllers with NFCP050 CPU module.

Page 4: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

ii

TI 34P02K35-02E Apr. 28, 2016-00

Copyrights and Trademarks Copyrights

The copyrights of this document belong to Yokogawa Electric Corporation. No part of this document may be transferred, sold, distributed (including delivery via a commercial PC network or the like), or registered or recorded on videotapes.

Trademarks and Licensed Software - STARDOM is a trademark. - Company names and product names included in this document are trademarks

or registered trademarks of their respective owners. - Registered trademarks or trademarks are not denoted with the ‘TM’ or ‘®’ mark

in this document.

Page 5: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

iii

TI 34P02K35-02E Apr. 28, 2016-00

CONTENTS Introduction ................................................................................................ i Copyrights and Trademarks .................................................................... ii CONTENTS ............................................................................................... iii 1. Overview ........................................................................................... 1 2. Basic Design and Function Design ................................................ 3

2.1 Checking Hardware Specification ............................................................ 3 2.1.1 Current Consumption of FCN-500 and FCN-RTU Unit ................... 3 2.1.2 Checking Operation Specifications of I/O Modules ........................ 6 2.1.3 Checking Automatic Loading of I/O Modules .................................. 6 2.1.4 Measures for Duplexing .................................................................. 7

2.2 Pre-Application Creation Checklist .......................................................... 9 2.2.1 Checking Revisions of FCN-500, FCN-RTU and Tools .................. 9 2.2.2 Checking FCN-500, FCN-RTU Control Application Size .............. 12 2.2.3 Checking FCN-500, FCN-RTU Performance ................................ 13 2.2.4 Determining FCN-500, FCN-RTU Scan Cycle .............................. 15 2.2.5 Retentive Variable (Retain Data) Considerations ......................... 18 2.2.6 Time Synchronization .................................................................... 23

3. Hardware Setup .............................................................................. 25 3.1 Resource Configurator Setting ............................................................... 25 3.2 Setup in Web Browser ............................................................................. 27

4. Control Application Creation ......................................................... 29 4.1 Using Logic Designer Setup ................................................................... 29

4.1.1 Selecting a Template for a New Project ........................................ 29 4.1.2 Control Task Setup ........................................................................ 31 4.1.3 Multi-tasking .................................................................................. 34 4.1.4 Specifying Target FCN/FCJ........................................................... 35 4.1.5 Multi-resource Project ................................................................... 37 4.1.6 Application Size ............................................................................. 38

4.2 Application Programming Languages ................................................... 40 4.2.1 Programming Languages Supported by Logic Designer .............. 40 4.2.2 Selecting a Programming Language ............................................. 41

STARDOM Engineering Guide (FCN-500/FCN-RTU)

TI 34P02K35-02E 1st Edition

Page 6: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

iv

TI 34P02K35-02E Apr. 28, 2016-00

4.3 Principles of Application Creation .......................................................... 42 4.3.1 Principles of Application Creation ................................................. 42 4.3.2 Example of a Simple Application ................................................... 42 4.3.3 Bottom-up Application Creation .................................................... 45

4.4 Application Creation Know-how ............................................................. 46 4.5 Network Templates ................................................................................... 47 4.6 Application Encapsulation ...................................................................... 48

4.6.1 Features of Application Encapsulation .......................................... 48 4.6.2 Procedure for Creating a POU ...................................................... 50 4.6.3 Modifying Logic of a POU ............................................................. 54

4.7 Handling Compile Errors and Warnings ................................................ 58 4.8 Precautions About Downloading ............................................................ 60

4.8.1 Offline Download and Online Download ....................................... 60 4.8.2 Downloading Boot Project and Source ......................................... 62 4.8.3 Detailed Description of Download Dialog ..................................... 62 4.8.4 Importance of Boot Project ........................................................... 64 4.8.5 Importance of Source .................................................................... 65

4.9 Control Application Backup .................................................................... 66 5. Function Test (Debugging) ............................................................ 69

5.1 Equipment Used for Testing .................................................................... 69 5.1.1 Precautions of Testing When Using In-house Equipment ............. 70 5.1.2 Precautions of Testing When Using FCN/FCJ Simulator .............. 73 5.1.3 Precautions of Testing When Using Target Equipment ................. 75 5.1.4 Precautions of Migrating Testing from In-house Equipment to

Target Equipment .......................................................................... 77 5.2 Unit Test and Combination Test .............................................................. 79 5.3 Unit Test Precautions ............................................................................... 80

5.3.1 Pre-unit Test Checklist .................................................................. 80 5.3.2 Unit Test Methodology ................................................................... 81 5.3.3 Unit Test Know-how ...................................................................... 83

5.4 Combination Test Precautions ................................................................ 86 5.4.1 Combination Test Prerequisites .................................................... 86 5.4.2 Equipment Used for Combination Test ......................................... 86 5.4.3 Checking Log Files of FCN-500, FCN-RTU .................................. 87 5.4.4 System Failure Test ....................................................................... 87

5.5 Checking CPU Load and Application Size ............................................. 91 5.5.1 Checking CPU Load...................................................................... 91 5.5.2 Checking Application Size ............................................................. 92

Page 7: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

v

TI 34P02K35-02E Apr. 28, 2016-00

5.6 Logic Designer’s Debug Mode ................................................................ 94 5.6.1 Switching to Debug Mode ............................................................. 95 5.6.2 Basic Operation in Debug Mode ................................................... 98 5.6.3 Disconnecting I/O .......................................................................... 98 5.6.4 Entering and Checking Values of Device Label Variables .......... 100

5.7 Software Wiring ...................................................................................... 105 5.7.1 Overview of Software Wiring ....................................................... 105 5.7.2 Software Wiring Creation and Precautions ................................. 106 5.7.3 Precautions When Creating Software Wiring ............................. 108

5.8 Using Loop Check Tool .......................................................................... 109 5.8.1 Values Displayed in Loop Check Tool .......................................... 110 5.8.2 Locating Problems Using Loop Check Tool ................................. 111

6. User Acceptance Test (UAT) ........................................................ 113 6.1 Pre-UAT Checklist ................................................................................... 113

6.1.1 UAT Prerequisites ........................................................................ 113 6.1.2 UAT Implementation Guidelines................................................... 114

6.2 Items Requiring Prior Explanation to Users ......................................... 115 6.2.1 Differences in Equipment Used from Actual System ................... 115 6.2.2 Differences between Process I/O and Software Wiring ............... 116 6.2.3 Equipment Communicating with FCN-500, FCN-RTU ................. 116

7. System Delivery Precautions ...................................................... 117 7.1 System Delivery Checklist ...................................................................... 118

7.1.1 System Delivery Prerequisites ..................................................... 118 7.1.2 Forms of Delivery ......................................................................... 118

7.2 Delivery for New System ....................................................................... 120 7.2.1 Pre-Delivery Preparation ............................................................. 120 7.2.2 Control Application Backup ......................................................... 121 7.2.3 System Delivery .......................................................................... 122

7.3 Delivery for System Expansion ............................................................. 123 7.4 Delivery for System Modification .......................................................... 124

7.4.1 Pre-Delivery Preparation and Application Backup ...................... 124 7.4.2 System Delivery .......................................................................... 124 7.4.3 Preparation for On-site Installation ............................................. 124 7.4.4 On-site Installation ...................................................................... 125

7.5 Procedure Instruction Sheet and Rehearsal ....................................... 126 8. Detailed Description ..................................................................... 127

8.1 Checking Operation Specifications of I/O Modules ............................ 127 8.1.1 Checking Operation Specification of Analog/Digital Input .......... 127 8.1.2 Checking Operation Specification of Analog/Digital Output ........ 129 8.1.3 Checking Specification of Pulse Input......................................... 131 8.1.4 Checking Specification of Pulse Width Output ........................... 132

8.2 Checking Specification of Serial Communication .............................. 134

Page 8: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

vi

TI 34P02K35-02E Apr. 28, 2016-00

8.3 Precautions about Multi-tasking .......................................................... 136 8.4 Criteria for Selecting Programming Languages in Logic Designer .. 140

8.4.1 Selection Criteria for FBD, LD and ST ........................................ 140 8.4.2 Selecting between FBD and LD .................................................. 148 8.4.3 Combining FBD, LD and ST ....................................................... 149 8.4.4 Selecting between SFC and Stepped FBD or LD ....................... 151

9. Advanced Engineering ................................................................ 155 9.1 General Application Development Know-how ..................................... 155

9.1.1 Variable Definitions ..................................................................... 155 9.1.2 Local Variables versus Global Variables ..................................... 156 9.1.3 _RB and _BOOL Suffix Variables of Device Label Variables ...... 159 9.1.4 Execution Order of Control Application ....................................... 161 9.1.5 Inter-FCN/FCJ Communication Concept .................................... 168 9.1.6 How to Create User Data Types ................................................. 174 9.1.7 Jump, Connector and Return Functions ..................................... 177 9.1.8 Cross References ....................................................................... 181 9.1.9 Specifying Retain Data and OPC Property ................................. 184 9.1.10 Getting FCN-500, FCN-RTU Time .............................................. 185 9.1.11 Precautions When Using Terminal EN of Functions ................... 186 9.1.12 Logic for Saving Retain Data ...................................................... 189 9.1.13 Comparing Logic Designer Projects ........................................... 191 9.1.14 Avoidance of the Error during Execution .................................... 192

9.2 Know-how in Use of NPAS_POU .......................................................... 193 9.2.1 Scan Cycle and Control Cycle .................................................... 193 9.2.2 How to Detect Mode, Status and Alarm ...................................... 196 9.2.3 NPAS_POU Status Propagation ................................................. 201 9.2.4 Blocked NPAS_POU Status Propagation ................................... 206 9.2.5 Selection of Timers and Counters ............................................... 209 9.2.6 Engineering Parameters ............................................................. 210

Appendix 1 STARDOM Engineering Flow Chart ............................... 213 Revision Information ................................................................................. i

Page 9: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<1. Overview> 1

TI 34P02K35-02E Apr. 28, 2016-00

1. Overview STARDOM engineering can be divided into phases as shown in the diagram below.

Check require-ment spec.

User acceptance test (UAT)

System delivery

Unit test

Integration test

System test

Detailed function design of

application software

Check requirement spec.

Check system configuration

- Verify that the requirement specification can be implemented using the STARDOM system.

- Verify that the system configuration allows implementation of the requirement specification.

- Based on the requirement specification, prepare basic specifications for FCN/FCJ control applications, operation/monitoring applications and communication functions.

- Based on basic functions, perform detailed design of each application and prepare functional specification.

- Based on function specification, create applications.

- In unit test, check individual applications.

- In integration test, combine applications already tested in unit tests and test the integrated STARDOM system as a whole.

- In system test, combine external equipment and control panels with the STARDOM system, and perform function test, including communication tests.

- Verify along with customer that the designed/created application satisfies the function specification.

- After completion of UAT, deliver STARDOM system.

FCN/FCJ control applications

Operation and monitoring

applications

Communication applications

Bas

ic d

esig

n an

d fu

nctio

n de

sign

App

licat

ion

crea

tion

Fun

ctio

n te

st

This engineering guide is intended as a guide for system engineering of a STARDOM system based on given specifications. For this purpose, it describes the precautions and checklist for each of the engineering phases after specifications are confirmed, including basic design and function design, application creation, function test, user acceptance test (UAT) and system delivery. This engineering guide focuses on FCN/FCJ control applications. Details on the functions and use of the FCN-500 and FCN-RTU controller and individual application programming tools can be found in their respective instruction manuals (IM) and Technical Information (TI). Wherever necessary, this manual will refer the reader to these documents for details on functions and usage.

Page 10: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

Blank Page

Page 11: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 3

TI 34P02K35-02E Apr. 28, 2016-00

2. Basic Design and Function Design The first thing to do in STARDOM engineering is to check whether a given customer specification can be implemented using the hardware, application programming tools, APPFs (application portfolios), and licenses provided with the system.

2.1 Checking Hardware Specification Review specifications for the hardware given in GS and IM documents to confirm whether specification requirements are achievable.

2.1.1 Current Consumption of FCN-500 and FCN-RTU Unit Calculate the current consumption of each FCN unit, and check that it does not exceed the rated output current of the power supply module.

● Rated Output of Power Supply Module The rated output current of the FCN-500 power supply module is given by:

System power supply: 0 A to 7.8 A

Analog field power supply: 4 A (max)

SEE ALSO Chapter A1.3, “Power Supply Module” of IM “STARDOM FCN/FCJ Guide”

The rated output current of the FCN-RTU power supply module is given by:

NFPW426: System power supply: 0 A to 2.4 A

Analog field power supply: 0.54 A (max)

NFPW441: System power supply: 0 A to 7.8 A

Analog field power supply: 4 A (max)

SEE ALSO Chapter A2.3, “Power Supply Module (NFPW426, NFPW444)” of IM “STARDOM FCN/FCJ Guide”

The power supply module mounted on a unit supplies power only to that unit so the current consumption of each unit must be kept below the rated output described above.

Page 12: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 4

TI 34P02K35-02E Apr. 28, 2016-00

● Calculating Current Consumption of an FCN Unit The current consumption of the system power supply of an FCN unit can be obtained by summing the current consumption values of the base module, as well as the CPU modules, I/O modules, and SB bus modules installed on the base module. If I/O modules requiring analog field supply are mounted in the unit, the current consumption of the analog field supply of the FCN unit should be calculated additionally. The system power supply current consumption and analog field supply current consumption values of individual modules given in the “STARDOM FCN/FCJ Guide” can be used for these calculations. An example of current consumption calculation This example calculates the current consumption of the control unit, as well as, that of the extended unit, shown in the figure below.

- Calculating current consumption of control unit System power supply Current consumption of NFCP501 modules : 1200 mA×2 =2400 mA Current consumption of NFAI141 modules : 310 mA×2 = 620 mA Current consumption of NFAV141 modules : 350 mA×2 = 700 mA Current consumption of SB bus repeat modules : 500 mA×2 =1000 mA Total: 4720 mA < rated output current of 7.8A Analog field power supply Current consumption of NFAI141 : 450mA×2 = 900mA Total: 900mA < rated output current of 4A NFAV141 and SB bus repeat modules do not require analog field power and

are thus excluded from the calculation. - Calculating current consumption of extension unit System power supply Current consumption of NFDV551 modules : 700mA×2 = 1400mA Current consumption of NFDV557 modules : 550mA×2 = 1100mA Current consumption of SB bus repeat modules : 500mA×2 = 1000mA Total: 3500mA < rated output current of 7.8A

Page 13: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 5

TI 34P02K35-02E Apr. 28, 2016-00

Analog field power supply Current consumption of NFDV551 modules : 60mA×2 = 120mA Current consumption of NFDV557 modules : 60mA×2 = 120mA Total: 240mA

(For digital output cards, 24Vmust be supplied to each module) SB bus repeat module does not require analog field power and are thus

excluded from the calculation. In this example, the current consumption of the system power supply, as well as the current consumption of the analog field power supply, of both the control unit and the extension unit, are below the rated output of the power supply modules so there is no problem.

● I/O Modules Requiring Analog Field Power Supply In the power consumption calculation example given above, some of the I/O modules of the FCN-500 and FCN-RTU units require analog field power supply.

SEE ALSO Section A1.13.3 "Field Power Supply" of IM “STARDOM FCN/FCJ Guide."

Any of such I/O modules, when used, require 24 V DC to be supplied to the power supply module, in addition to the power supply used for control. Check the hardware specification for 24 V DC power supply.

Page 14: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 6

TI 34P02K35-02E Apr. 28, 2016-00

2.1.2 Checking Operation Specifications of I/O Modules Compare the operation specification of each I/O module against the requirement specification to ensure that requirements can be met. For more details, see Section 8.1, "Checking Operation Specifications of I/O Modules;" Section 8.2, "Checking Serial Communication Specification" of Chapter 8, "Detailed Description," as well as the "STARDOM FCN/FCJ Guide."

2.1.3 Checking Automatic Loading of I/O Modules Operation settings, device label names and all other configuration information of I/O modules and communication modules are saved in the on-board flash memory of the FCN-500 and FCN-RTU. Using Resource Configurator, whether to automatically load configuration information into a new I/O module when an I/O module is replaced can be specified. If automatic loading is enabled, configuration information stored on the flash

memory is loaded and a replacement I/O module begins operations automatically provided if the same model name I/O module being replaced. Otherwise, confirmation information is not loaded automatically.

If automatic loading is disabled, configuration information stored on the flash

memory is not loaded automatically regardless of the model of the replacement module. In such case, redefine and download settings using the Resource Configurator and rebooting the FCN-500 or FCN-RTU is required.

Page 15: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 7

TI 34P02K35-02E Apr. 28, 2016-00

2.1.4 Measures for Duplexing Within a STARDOM system, the following components can be duplexed: CPU of FCN-500 Power supply module of FCN-500 or FCN-RTU (used long base module only) SB bus of FCN-500 Control network (control LAN) of FCN-500 Communication application Check precautions described below for duplexed system components.

● FCN-500 Operation When Configured with Duplexed CPU The operation specification and precautions applicable when the CPU of an FCN-500 is duplexed are given in the following IM and TI documents: Section B1.3.3, “Precautions on the Creation of Control Applications” of IM

“STARDOM FCN/FCJ Guide” Chapter C2, “Duplex CPU Module (FCN-500)” of IM “STARDOM FCN/FCJ

Guide” Section B7.2, “Operation using Duplex FCN CPU Modules" of TI “STARDOM

Technical Guide”

● FCN-500 and FCN-RTU Operation When Configured with Duplexed Power Supply Module Duplexing of the power supply module can be achieved by simply installing two power supply modules on a long base module.

SEE ALSO For details on the operation specification of an FCN-500 configured with duplexed power supply module, see Section B3.1.2, “Power Supply Module” of TI “STARDOM Technical Guide.”

● FCN-500 Operation When Configured with Duplexed SB Bus Duplexing of the SB bus can be achieved simply by configuration using Resource Configurator.

SEE ALSO For details on the operation specification of an FCN-500 configured with duplexed SB bus, see Section B3.1.4, “SB Bus Repeat Module for FCN” of TI “STARDOM Technical Guide.”

Page 16: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 8

TI 34P02K35-02E Apr. 28, 2016-00

● FCN-500 Operation and Precautions Regarding Duplexed Control Network For details on the operation specification and precautions applicable to a STARDOM system configured with duplexed control network, see: Section D2.2.2, “Control Network Duplexed Configuration” of IM “STARDOM

FCN/FCJ Guide” Section B7.3, “Duplexing Network” of TI “STARDOM Technical Guide” TI “STARDOM Network Configuration Guide”

• Diagnostic communication interval In a duplexed control network, diagnostic frames are transmitted periodically

through multicast communication. If two successive diagnostic frame transmissions are unsuccessful, system

network failure is assumed, and control network switchover is performed.

One diagnostic frame is transmitted and one receive processing is performed for each duplexed device within each cycle. When there are many duplexed devices, the CPU load increases proportionally due to increased receive processing of diagnostic frames. The diagnostic communication interval is defined as 500 ms by default and can be lengthened as appropriate if many duplexed devices are present on the network.

SEE ALSO For details, see Section B7.3.1, “The Duplexed Network Function Provided on STARDOM” of TI “STARDOM Technical Guide.”

● Operation and Precautions Regarding Duplexed Communication Application To implement duplexed communication with non-STARDOM equipment such

as FA-M3, third-party PLCs, and remote I/O, a communication application must include logic for executing a transmission path switchover when a communication error is detected.

SEE ALSO For more details, see Section B7.3.1, “The Duplexed Network Function Provided on STARDOM” of TI “STARDOM Technical Guide.”

Page 17: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 9

TI 34P02K35-02E Apr. 28, 2016-00

2.2 Pre-Application Creation Checklist This section covers checking items on application programming tools, application size, etc, before creating applications.

2.2.1 Checking Revisions of FCN-500, FCN-RTU and Tools Before programming applications, check the revisions of the FCN/FCJ Basic Software and each tool to be used in subsequent engineering. These include: - FCN/FCJ Basic Software (stored on the system card) - Resource Configurator - Logic Designer - Various application portfolios The revision of the FCN/FCJ Basic Software should match the revision of the CPU module (on-board flash memory).

SEE ALSO For details on how to check the revision of the system card, see "● Revision of System Card Used” of Section 5.1.1, “Precautions of Testing when Using In-house Equipment.”

● For New System Implementation When implementing a new system, using the latest versions of the FCN/FCJ Basic Software and tools listed above is recommended. If application development is to be carried out using in-house development equipment instead of the target equipment, upgrade the FCN-500, FCN-RTU, Logic Designer and all software tools to the latest versions before starting application creation.

● For System Modification When modifying an existing application using in-house development equipment, whether revisions of the FCN/FCJ Basic Software and the various tools listed above of the in-house equipment match those of the existing system is needed to be checked. When carrying out engineering for system modification using in-house equipment having revisions later than the existing system, beware of using new system functions not supported in the existing system. Otherwise, the application may, despite thorough testing on in-house equipment, fail to be downloaded to the existing system or, even if successfully downloaded to the existing system, fail to run or fail to run correctly. Moreover, even if a function used in the modified application is present on the existing system, its operation specification may be different because of functional enhancements included in the revision upgrade so that the modified application may behave differently when tested on in-house equipment and when executed on the existing system after delivery.

Page 18: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 10

TI 34P02K35-02E Apr. 28, 2016-00

● For System Expansion STARDOM allows intermixing of FCN-500 and FCN-RTU of different revisions within a system. When implementing system expansion through addition of a new FCN-500 and FCN-RTU to an existing system, consider whether to use the latest revision for the new FCN-500 and FCN-RTU or to match the existing system revision. Consider the pros and cons described below, and decide whether to use the latest revision for the new FCN-500, FCN-RTU and intermix different FCN-500, FCN-RTU revisions within the system, to standardize revisions throughout the system by downgrading the new FCN-500, FCN-RTU to match the existing system revision, or to standardize to the latest revision throughout the system by upgrading the existing system.

• Using the latest revision In this case, all supported functions can be used. However, beware that the operation specifications of some functions may

have changed due to functional enhancements included in the revision upgrade so that the expanded system may behave differently from the existing system. Furthermore, system revision control may be more tedious with intermixing of FCN-500 and FCN-RTU s of different revisions.

• Matching the existing revision In this case, the new FCN-500 and FCN-RTU will behave the same as the

existing system but new functionality included in the latest revision will not be available. However, system revision control will be easier with a standardized FCN-500 and FCN-RTU revision throughout the system. The FCN-500 is used R4.02 or later.

● Procedure for System Downgrade The procedures are essentially the same for downgrading and upgrading the revision of in-house equipment to match the revision of an existing system for the purpose of system modification or system expansion engineering. When upgrading, use the DVD-ROM for the latest system revision; when downgrading, use the DVD-ROM for the required system revision instead. Observe the following precautions for downgrading the FCN/FCJ Basic Software.

• Precautions when downgrading FCN/FCJ Basic Software FCN-500 can not be downgrading before than R4.02.

FCN-RTU can not be downgrading before than R2.10. To downgrade a system, follow essentially the same procedure for system

upgrade by decompressing the Basic Software stored on the DVD-ROM for the required revision to the PC, and then issuing an “FcxRevup” command at the command prompt but include a “-s” option.

Page 19: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 11

TI 34P02K35-02E Apr. 28, 2016-00

If you execute the plain “FcxRevup” command without the “-s" option, as is usually done when performing a revision upgrade, configuration information stored on the flash memory will be retained after command execution. This may cause an error if the existing configuration information cannot be interpreted by the older revision after system downgrade. Therefore, when downgrading a system, execute the "FcxRevup” command with the “-s" option to perform a clean upgrade along with initialization of configuration information.

● Checking Service Packs and Service Releases Service releases or service packs may have been published for some system revisions. For new system implementation, after installing the latest system revision, check for the presence of published service releases and service packs, and apply them as required. Similarly, after having upgraded or downgraded the revision of in-house equipment to match the existing system, check whether any service releases and service packs have been previously applied to the existing system, and apply them accordingly to the in-house equipment.

Page 20: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 12

TI 34P02K35-02E Apr. 28, 2016-00

2.2.2 Checking FCN-500, FCN-RTU Control Application Size Estimate the size of an FCN500 or FCN-RTU control application from the requirement specification and ensure that there is no problem.

SEE ALSO For details on how to estimate the size of an application, see Section B4.5.2, “Calculation of Control Application Capacity" of TI "STARDOM Technical Guide."

Estimate the control application size by estimating the ADLST size and retain data size as described in TI “STARDOM Technical Guide.” To investigate the utilization of application resources, calculate the respective utilization rates of ADLST capacity of retain data capacity, and take the larger of the two values as the system-wide utilization rate. The checking items described in this section is based on calculated values, which should be verified by checking the actual control application size during function test.

SEE ALSO For details, see Section 5.5.2, “Checking Application Size.”

• For projects using NPAS POUs Projects using NPAS POUs usually exceed the ADLST size limit (if ever it is

exceeded) before exceeding the retain data size limit. Therefore, first estimate the ADLST size, and if it is within the 4MB upper limit, you can assume that there is no application size problem. You can also use the ADLST utilization as an indicator of the utilization of the control application.

• For projects not using NPAS POUs For projects not using NPAS POUs, the ADLST size and retain data size

depend on how many variables are specified with OPC property and RETAIN property during engineering.

In this case, estimate both ADLST size and retain data size and if both values are within their respective upper limits, it can be assumed that there will be no application size problem.

Furthermore, use the larger of the ADLST and retain data utilization rates as an indicator of the utilization rate of the control application.

Page 21: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 13

TI 34P02K35-02E Apr. 28, 2016-00

2.2.3 Checking FCN-500, FCN-RTU Performance Estimate the execution time of an FCN-500 or FCN-RTU control application from the requirement specification and determine the CPU load.

SEE ALSO For details on how to estimate performance, see Section B4.5.3, “Confirmation of Performance" of TI "STARDOM Technical Guide".

The checking items described in this section is based on calculated values, which should be verified by checking the actual CPU load during function test.

SEE ALSO For details, see Section 5.5.1, “Checking CPU Load."

● Calculating Execution Time and CPU load of Control Application The method for estimating the execution time of a control application depends on whether the project uses NPAS POUs. • For projects using NPAS POUs For a project using NPAS POUs, determine the execution time as described in

the above-mentioned TI document, and calculate the CPU load using the following formula:

NPAS_POU's execution timeControl task interval

CPU load (%) = x 100%

• For projects not using NPAS POUs The above-mentioned TI document does not describe how to calculate the

execution time of a project not using NPAS POUs. This is because the execution time of non-NPAS_POU blocks are very short and hence need not be considered during the estimation phase.

TIP In the CPU function specification description of the GS document “FCN Autonomous Controller Functions (FCN-500)” or “FCN-RTU Low Power Autonomous Controller Functions”, the execution speed is given as: FCN-500s Execution speed: Approx. 10 µs per kilosteps in an IL program FCN-RTUs Execution speed: Approx. 50 µs per kilosteps in an IL program This means that about 10 µs (FCN-500) or 50 µs (FCN-RTU) is required to process 1 kilosteps of an IL program block. Each function such as AND or OR coded in IL is equivalent to 3 steps. Therefore, the execution time of 1000 functions is about 30 µs (FCN-500) or about 150 µs (50 µs x 3, FCN-RTU). Based on this calculation, about 195,000 functions (FCN-500) or about 65,000 functions (FCN-RTU) can be processed within 10 milliseconds.

Page 22: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 14

TI 34P02K35-02E Apr. 28, 2016-00

● Recommended CPU Load The following FCN-500 and FCN-RTU functions are executed during CPU idle time:

- Ethernet communications of FCN-500 and FCN-RTU - Communication with VDS/ASTMAC data server - Inter- FCN-500 and FCN-RTU communication - Various inter-device communications such as Modbus communications

using Ethernet or serial communications - Operation or setup from Logic Designer or Resource Configurator - Java function of FCN-RTU - Downloading of boot project and source

To allow such processing, it is recommended that the CPU load be kept at 60% or lower.

IMPORTANT

The CPU load calculation described in this section considers only the execution time of the control application. In an actual system, execution time also includes CPU module and I/O module access time. Therefore, consider a CPU load slightly higher than the value estimated here. The I/O module access time varies with the number of I/O modules and normally ranges between several milliseconds to 20 milliseconds.

Execution time

Scan cycle

Idle time

Execution time Scan cycle CPU load (%) = x 100 %

CPU load ≤ 60%

Executes communication and Java functions

Page 23: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 15

TI 34P02K35-02E Apr. 28, 2016-00

2.2.4 Determining FCN-500, FCN-RTU Scan Cycle As described in the previous section 2.2.3, “Checking FCN-500 and FCN-RTU Performance,” it is recommended that CPU load be kept at 60% or lower. Check that the estimated CPU load is 60% or lower, and there is no problem with the scan cycle stated in the requirement specification if applicable. If the CPU load exceeds 60%, investigate rectification measures.

● Setting Range for Scan Cycle The scan cycle of the FCN-500 can be set to a value between 5 ms and 32760 ms in 5 ms increments. The scan cycle of the FCN-RTU can be set to a value between 10 ms and 32760 ms in 10 ms increments. When setting the scan cycle to 4 seconds or longer, note the precautions described later.

● When a Required Scan Cycle is Stated in Requirement Specification If a scan cycle is stated in the requirement specification, use the stated value to estimate the CPU load and check that it is 60% or lower. If the CPU load exceeds 60%, consider whether it can be reduced using the methods described later.

● When no required scan cycle is stated in requirement specification If no scan cycle is stated in the requirement specification the engineer is given the responsbility, determine the scan cycle from the execution time of the control application estimated as described in Section 2.2.3, “Checking FCN-500 and FCN-RTU Performance.”

● Example for Determining Scan Cycle If engineer is asked to decide on the scan cycle, use Logic Designer’s default scan cycle of 100 ms as a baseline consideration. Example 1: When estimated control execution time is 20 ms Estimated CPU load = 20 ms/100 ms = 20% Based on the estimated CPU load of 20%, even considering the time for

accessing I/O modules, the CPU load is expected to be below the recommended limit of 60%. Therefore, the scan cycle of 100 ms should be fine.

Example 2: When estimated control execution time is 50 ms Estimated CPU load = 50 ms/100 ms = 50% The estimated CPU load of 50% is below the recommended limit of 60%. However, if the time for accessing I/O modules is taken into consideration, the

CPU load is expected to approach 60%, or even exceed 60% if many I/O modules are installed.

In this example, we should look into reducing the CPU load using the methods described hereafter.

If the scan cycle is set to 100 ms, download the application early on in application creation to check that there is indeed no CPU load problem.

Page 24: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 16

TI 34P02K35-02E Apr. 28, 2016-00

● Ways for Reducing CPU Load Consider the ways described below for reducing CPU load.

• Lengthen the scan cycle By lengthening the scan cycle, CPU load can be reduced even if the execution

time remains unchanged. Execution time Scan cycle CPU load

70 ms 100 ms 70% 70 ms 200 ms 35%

IMPORTANT

After changing the scan cycle, which is the most fundamental setting affecting FCN-500 and FCN-RTU operation, always check that control is not adversely affected.

• Define a task with long control cycle and move the application For an application that can tolerate a long control cycle, define a task with a

longer cycle and move. By doing so, it reduces the overall CPU load.

Page 25: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 17

TI 34P02K35-02E Apr. 28, 2016-00

● Precautions When Using a Long Scan Cycle • When scan cycle is 4 seconds or longer Analog/digital output modules are defined with line access loss time of 4

seconds. If the scan cycle is 4 seconds or longer, the interval between FCN-500 or

FCN-RTU CPU accesses of the output modules will be 4 seconds or longer. Depending on individual setting, an output module may assume that a CPU error has occurred and perform output fallback.

SEE ALSO For details, see Section 8.1.2, "Checking Operation Specification of Analog/Digital Output” of Chapter 8, “Detailed Description.”

• About windup of NPAS POUs For NPAS POU, after an FCN-500 or FCN-RTU reboot, windup processing is

executed for 30 scan cycles before control computation begins. As the windup time is proportional to the scan cycle, lengthening the scan

cycle delays the starting of control computation after an FCN-500 or FCN-RTU boot.

Control Cycle Windup Time 100 ms 3 seconds 500 ms 15 seconds

1000 ms (= 1 minute) 30 seconds 2000 ms (= 2 minutes) 60 seconds (= 1 minute)

Page 26: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 18

TI 34P02K35-02E Apr. 28, 2016-00

2.2.5 Retentive Variable (Retain Data) Considerations Retain data of the FCN-500 and FCN-RTU may reside in the following locations: - Non-volatile memory (factory setting) - Volatile memory - Flash memory Based on the requirement specification, decide whether retain data is to reside in volatile memory or non-volatile memory, as well as the procedure for saving retain data to the flash memory.

SEE ALSO For details on considerations of retain data in FCN-500 and FCN-RTU, see Section B4.3.5, “Retentive Variables” of TI “STARDOM Technical Guide.”

● Retain Data Residing in Memory Retain data can be stored in either volatile memory or non-volatile memory using Resource Configurator and is always resident in one of these locations. By default factory setting, retain data is resident in non-volatile memory. - Non-volatile memory

Retain data, when resident in non-volatile memory, is retained by a backup battery even if the FCN-500 or FCN-RTU is powered off.

- Volatile memory Data, including retain data, resident in the volatile memory is cleared when the FCN-500 or FCN-RTU is powered off.

The management of retain data is rather different depending on whether it resides in volatile or non-volatile memory.

● Saving Retain Data to Flash memory Retain data residing in memory can also be backed up to the flash memory either manually by an operator or by executing a save instruction from an application. An operator can manually execute the backup using “Save Retain Data” from the FCN/FCJ “Maintenance Menu” or, equivalently, set global variable "GS_RETAIN_SV_SW” to TRUE in Logic Designer’s DEBUG mode. Depending on the conditions present after an FCN-500 or FCN-RTU reboot, retain data may be restored from the flash memory so saving retain data to the flash memory is an important aspect of retain data management.

SEE ALSO For details on executing a save instruction from an application, see Section 9.1.12, “Logic for Saving Retain Data” of Chapter 9, "Advanced Engineering ". In the FCN-500, the retain data is stored in the flash memory, and can be saved on the SD card. For details, refer to D3.4 "Backup of all data to SD card (FCN-500)" of IM “STARDOM FCN/FCJ Guide”

Page 27: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 19

TI 34P02K35-02E Apr. 28, 2016-00

TIP In subsequent description, the term "retain data on the flash memory" refers to retain data which was current as at the time when it was saved to the system card but not necessarily the most up-to-date. For instance, if retain data was saved a week ago, “retain data on the flash memory" would be one week old.

● Behavior of Retain Data when FCN-500 or FCN-RTU Power is Off/On 1. If retain data is resident in non-volatile memory As described earlier, retain data residing in non-volatile memory is retained even after the FCN-500 or FCN-RTU is powered off. When the FCN-500 or FCN-RTU is powered on, the system reboots using retain data in the non-volatile memory so retain data persistency is guaranteed.

However, under certain circumstances, retain data in the non-volatile memory may not be restored. Instead, all retentive variables are first initialized to their initial values after power on. If retain data has been previously saved to the flash memory, that data is restored. Otherwise, the FCN-500 or FCN-RTU reboots with all initial variable values. Some circumstances under which retain data in the non-volatile memory will not be restored are listed below.

• If the structure of retain data of the application at startup does not match the structure of retain data in the non-volatile memory

If the control application running before power off is inconsistent with the boot project on the flash memory on the number, data type or some other aspect of retain data, retain data in the non-volatile memory will not be restored after power on.

• If the backup battery was removed If the backup battery is removed when power is off, retain data, like all other

data residing in the non-volatile memory, will be lost and hence cannot be restored at power up.

• If the CPU module or FCJ has been replaced If the CPU module or FCJ is replaced, retain data residing in the non-volatile

memory of the hardware naturally cannot be restored.

2. If retain data is resident in volatile memory Retain data stored in volatile memory is lost when the FCN-500 or FCN-RTU is powered off. After power on, all retentive variables are first initialized to their initial values. If retain data has been previously saved to the flash memory, that data is restored. Otherwise, the FCN-500 or FCN-RTU reboots with all initial variable values.

Page 28: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 20

TI 34P02K35-02E Apr. 28, 2016-00

● Behavior of Retain Data in FCN/FCJ Start Mode Performing offline download to FCN-500 or FCN-RTU from Logic Designer stops control on the FCN-500 or FCN-RTU. However, as power supply is not interrupted, retain data, even if resident in volatile memory, retain their data. As such, the behavior of retain data after data download in the FCN/FCJ start mode is the same regardless of whether retain data is resident in volatile or non-volatile memory. 1. If FCN/FCJ is warm started 1.1 If there is no change in retain data area If there is no change in the retain data area, control is started using retain data

values current before offline download, even if the control application has been changed.

1.2 If retain data structure has been changed If the number or data type of retain data has been changed so that the retain

data structure is modified, retain data in the memory can no longer be used. SEE ALSO Point 1 of TIP below In this case, all retentive variables are first initialized to their initial values. If

retain data has been previously saved to the flash memory, control is restarted using that data.

SEE ALSO Point 2 of TIP below If no retain data is saved on the system card, the FCN-500 or FCN-RTU is

rebooted with initial values for retentive variables.

Page 29: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 21

TI 34P02K35-02E Apr. 28, 2016-00

TIP 1. In the case of 1.2 described above, the following dialog is displayed before offline download:

This message indicates that warm start using retain data residing in the memory will not be

possible after downloading. It does not mean that warm start, in itself, is not allowed. 2. In this case, performing a warm start after completion of offline download generates the following

PLC error:

The first line of the message means that cold start was performed as warm start using retain

data in memory was not possible. The second line of the message means that the FCN-500 or FCN-RTU was restarted using retain data saved on the flash memory. From these two error messages, retain data saved on the flash memory was restored by a warm start after an offline download is understood.

2. If FCN/FCJ is cold started After a cold start, the FCN-500 or FCN-RTU initializes all variables and start controlling. In other words, all retentive variables are initialized by a cold start.

TIP The retain data structure will be changed by the following events: - Adding or deleting an NPAS POU having one or more access parameters or engineering

parameters specified as retain data - Specifying a non-retentive variable as a retentive variable or vice versa - Changing the data type of a variable specified as retain data The behavior of retain data on the FCN-500 or FCN-RTU start mode described above applies similarly when the FCN-500 or FCN-RTU is stopped from Logic Designer’s Application Control dialog,and then restarted without performing downloading.

Page 30: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 22

TI 34P02K35-02E Apr. 28, 2016-00

● Behavior of Retain Data on Online Download Even if a modification involves a change in the retain data area, persistency of retain data is guaranteed so long as the modification is online downloaded. Newly added retentive variables, however, will be set to initial values.

● Relationship between Initial Value and Retained Value After an FCN-500 or FCN-RTU warm start, even if initial values are specified for retain dat, their retained values take precedence.

● Summary By default setting, FCN-500 or FCN-RTU is configured so that retain data is resident in non-volatile memory. As such, you can first review the specification on this basis.

Data resident in non-volatile memory retain their values even after the FCN-500 or FCN-RTU is powered off because of a backup battery. These retained values are restored at the next FCN-500 or FCN-RTU power on. In this way, the most up-to-date data values are always maintained so keeping retain data resident in non-volatile memory is the usual practice.

However, even if retain data is made resident in non-volatile memory, we recommend saving retain data to the flash memory regularly as a safeguard against unexpected situations where data retained in memory cannot be used. In addition to saving retain data manually, saving data regularly using a control application is also recommended.

SEE ALSO For details, see Section 9.1.12, “Logic for Saving Retain Data” of Chapter 9, “Advanced Engineering.”

If a backup of retain data is saved on the flash memory, in case of event that data retained in non-volatile memory cannot be used for whatever reason, retained data values as at the time of saving will be restored from the system card. by doing so, it avoids the worst-case scenario where all retain data variables are initialized. Compared to keeping retain data resident in non-volatile memory, keeping retain data reside in volatile memory enables a shorter execution time, and hence a shorter scan cycle for FCN-500 or FCN-RTU operation. However, if the FCN-500 or FCN-RTU is powered off and on again, retain data values before power off is lost and retain data values are always restored from the flash memory. To prepare for unexpected contigency, save retain data to the flash memory regularly, and also by manually whenever retain data is modified.

SEE ALSO For details on scan cycle, see Section 2.2.4, “Determining FCN-500 and FCN-RTU Scan Cycle.”

Page 31: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<2. Basic Design and Function Design> 23

TI 34P02K35-02E Apr. 28, 2016-00

2.2.6 Time Synchronization The FCN-500 or FCN-RTU allows time synchronization among external devices supporting SNTP (Simple Network Time Protocol).

SEE ALSO For details on time synchronization of FCN-500 or FCN-RTU, see: - Section B1.9.4, “Time Synchronization Function” of IM “STARDOM FCN/FCJ Guide” - Section B2.3.3, “Time Synchronization Function” of TI “STARDOM Technical Guide”

● For FCN-500 Running as SNTP Server After setting through FCN-500 maintenance page, the FCN-500 time

synchronization server automatically runs and starts time reporting. Setting for SNTP server is done through FCN-500 maintenance page. The following file is modified to start SNTP sever.

However, the FCN-500 cannot provide highly accurate time reporting as its reported time includes internal timer error of -17.5 to +12 seconds/day.

1. JEROS Basic Setting File (DOUNUS.PRP)

It specifies whether to start the SNTP server function. This setting is for only FCN-500 only. Specify YES to start SNTP Server.

Setting item: Start the SNTP server function (SntpServer) SntpServer = YES use the SNTP server function SntpServer = NO not use the SNTP server function,

default value

SEE ALSO For details of JEROS basic setting file, see online-help.

● For FCN-500 or FCN-RTU Running as SNTP Client If the FCN-500 or FCN-RTU runs as an SNTP client. To setup from the

FCN/FCJ maintenance homepage to enable the FCN-500 or FCN-RTU to receive reported time values from an SNTP server (as an SNTP client) and perform time synchronization accordingly.

From the FCN/FCJ maintenance homepage, time synchronization settings are

implemented at the following two locations. 1. JEROS Basic Setting File (DOUNUS.PRP) Configure for the use of SNTP client function. 2. SNTP Setting File (SNTP.PRP)

SEE ALSO For details of JEROS basic setting file, see online-help.

Page 32: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

Blank Page

Page 33: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<3. Hardware Setup> 25

TI 34P02K35-02E Apr. 28, 2016-00

3. Hardware Setup After reviewing and deciding on a desired FCN-500 and FCN-RTU hardware configuration as described in Chapter 2, perform the actual FCN-500 and FCN-RTU hardware setup by running Resource Configurator and by accessing the FCN/FCJ maintenance homepage using a generic web browser.

3.1 Resource Configurator Setting Among the hardware configuration items reviewed and described in Chapter 2, the following items are configured using Resource Configurator: - I/O module operation - Enabling/disabling of automatic loading of I/O modules - Duplexed operation - Enabling/disabling of hardware backup of retain data

SEE ALSO - Section 2.1.2,”Checking Operation Specifications of I/O Modules” - Section 2.1.3,”Checking Automatic Loading of I/O Modules” - Section 2.1.4,”Measures for Duplexing” - Section 2.2.5,”Retentive Variable (Retain Data) Considerations”

IMPORTANT

Do not turn off the power to the FCN-500 and FCN-RTU controller while downloading Resource Configuration. It will take up to three minutes to complete the download operation.

For details on the Resource Configurator and how to use the Resource Configurator Editor, read “STARDOM FCN-500/FCN-RTU Primer – Fundamental”(TI 34P02K13-02) and the Resource Configurator online help documentation.

Page 34: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<3. Hardware Setup> 26

TI 34P02K35-02E Apr. 28, 2016-00

● Precautions When Using FCN-500 or FCN-RTU with No Actual I/O Modules If FCN-500 or FCN-RTU is not installed with the required I/O modules and new hardware configuration us downloaded using Resource Configurator, existing I/O module configuration already defined will be overwritten and lost.

As an example, consider the following scenario. An engineer defines the required device labels and I/O settings for target equipment installed with the required I/O modules, and downloads the project to the FCN-500 or FCN-RTU. However, as application creation and debugging is to be carried out using an in-house FCN-500 or FCN-RTU, he relocates the CPU module on the target FCN-500 or FCN-RTU to the in-house FCN-500 or FCN-RTU and reboots the FCN-500 or FCN-RTU. When the engineer connects to the in-house FCN-500 or FCN-RTU using Resource Configurator at this stage, the system reads a state of no I/O module. The engineer then downloads this information using Resource Configurator, resulting in I/O module information being overwritten, and information defined previously is lost permanently.

To prevent this, it is advisable not to modify hardware settings using Resource Configurator when working with no I/O module installed or from using a different set of I/O modules than what is currently defined in the configuration.

● Using Resource Configurator Editor Resource Configurator works by first reading configuration information from a running FCN-500 or FCN-RTU, and then downloading new configuration information after it has been modified on a PC. As such, it cannot be used to perform hardware setup without a running FCN-500 or FCN-RTU. To perform hardware setup when an FCN-500 or FCN-RTU is not available, such as in the early phase of engineering or in a job involving modification of an existing system, use Resource Configurator Editor instead. Settings defined using Resource Configurator Editor can be saved to a file, and downloaded later using Resource Configurator when the FCN-500 or FCN-RTU is available for connection.

Page 35: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<3. Hardware Setup> 27

TI 34P02K35-02E Apr. 28, 2016-00

3.2 Setup in Web Browser Detailed setup and various FCN-500 or FCN-RTU operations can be achieved using FCN/FCJ maintenance homepage through a generic web browser. Among the hardware configuration items reviewed and decided as described in Chapter 2, the following items can be configured by accessing the FCN/FCJ maintenance homepage: - Serial communication port - Time synchronization

SEE ALSO - Section 8.2, “Checking Serial Communication Specification (Serial Communication Port Settings)” - Section 2.2.6, “Time Synchronization”

In addition to the above configuration items, setting system date and time, saving retain data, read log files of the FCN-500 or FCN-RTU, reading various properties of the FCN-500 or FCN-RTU , display CPU status and display resource configuration can be achieved from the FCN/FCJ maintenance homepage.

SEE ALSO For details on the operation and configuration items accessible on the maintenance homepage, see: - Chapter B2, “Advanced Settings Using Web Browser“ of IM “STARDOM FCN/FCJ Guide” - Section B4.1.6, “Settings of FCN/FCJ by Web Browser“ of TI “STARDOM Technical Guide”

Page 36: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

TI 34P02K35-02E Apr. 28, 2016-00

Blank Page

Page 37: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 29

TI 34P02K35-02E Apr. 28, 2016-00

4. Control Application Creation Control applications executed by FCN-500 and FCN-RTU autonomous controllers are created using Logic Designer and then downloaded to the FCN-500 and FCN-RTU. This chapter describes precautions on Logic Designer setup, as well as basic principle, know-how and prohibitions on creating control applications. For details on basic user operations of Logic Designer, see TI “STARDOM FCN-500/FCN-RTU Primer – Fundamental" and the Logic Designer online help documentation.

4.1 Using Logic Designer Setup This section describes the required setup and selection using Logic Designer before creating a control application, along with related precautions and know-how information.

4.1.1 Selecting a Template for a New Project When creating a new project using Logic Designer, select a project type from a list of template projects. For details on how to create a new project and select a template, see Section 4.1.2, “Creating a New Project” of TI “STARDOM FCN-500FCN-RTU Primer – Fundamental.”

● Template Types and Selection Criteria When creating a new project, the project type can be selected from the following three template projects.

• STARDOM FCX This is the minimal template, which provides only system-defined functions and

function blocks. It does not include NPAS_POU, PAS_POU, serial communication function blocks and function blocks for Foundation Fieldbus.

As such, select this template only when creating an application that uses neither NPAS_POU nor PAS_POU.

• STARDOM FCN-500 It is the standard template for creating control application for the FCN-500.

Necessary functions for creating the control application has been prepared in advance. (NPAS_POU, serial communication function block, function block for Foundation Fieldbus, Turbomashinary, etc.) If necessary, it is possible to add other library after creating a project.

Page 38: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 30

TI 34P02K35-02E Apr. 28, 2016-00

• STARDOM FCX_A It is the standard template for creating control application for the FCN-RTU.

Necessary functions for creating the control application has been prepared in advance. (NPAS_POU, serial communication function block, function block for Foundation Fieldbus, Turbomashinary, etc.) If necessary, it is possible to add other library after creating a project.

● Adding Libraries Logic Designer allows libraries to be added to a project to expand the available functions. Similarly, an application using an APPF can be created by installing the required APPF from DVD-ROM to a PC running Logic Designer, and adding the relevant libraries to the project. Examples: - To create an application using NPAS POUs, select the STARDOM FCX template

when creating the project, and then add the related NPAS_POU library. Which library to add depends on the function to be aded. For details on the type of library to be added and the procedure, see the online help documentation of each function.

● Logic Designer Libraries and FCN-500, FCN-RTU Licenses No license is required for adding a library to Logic Designer. In other words, application development using a system function is allowed even if no license for that function is registered in the FCN-500 or FCN-RTU. However, a PLC error will be generated and the FCN-500 or FCN-RTU cannot run if a project is downloaded to an FCN-500 or FCN-RTU without registering with the required licenses for all functions used in the project. When adding a library for functionality expansion, check that the required license is registered in the FCN-500 or FCN-RTU .

SEE ALSO Section 2.1.5, "Required Licenses”

Page 39: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 31

TI 34P02K35-02E Apr. 28, 2016-00

4.1.2 Control Task Setup Control applications created in Logic Designer are created by assigning to tasks and turn into instances. This section describes task types and task settings.

● General Limitations of Control Tasks All control tasks are subject to the following limitations. • Limit on number of tasks Up to 16 control tasks can be created for one FCN-500 or FCN-RTU. Running

only one control task on one FCN-500 or FCN-RTU is known as single-tasking, while creating and running multiple control tasks concurrently on one FCN-500 or FCN-RTU is called multi-tasking.

• Task name A task name consists of up to 7 alphanumeric and underscore (‘_’) characters

with the following restrictions: - A task name cannot begin with a number. - A task name cannot contain two contiguous underscore (‘_’) characters. - A task name cannot end with an underscore (‘_’) character.

● Types of Control Tasks There are three types of control tasks with different behaviors.

• Cyclic A cyclic task is run at a specified interval, known as scan cycle. This task type is

used for most control applications. • Default A default task has the lowest execution priority among all control tasks. It is not

executed at fixed intervals. Instead, it is executed automatically when all other control tasks are idle (not executing).

A default task is executed at variable execution intervals as its execution is

dependant on the operation of other control tasks. Hence, this task type is, in general, not used in control applications.

• System A system task is run when there is a change in the operating status of the FCN-

500 or FCN-RTU, or when an error is detected in the FCN-500 or FCN-RTU.

Page 40: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 32

TI 34P02K35-02E Apr. 28, 2016-00

Execution triggers (status change or error) for a system tasks can be selected from a list of predefined triggers.

System tasks are run only under specific FCN-500 or FCN-RTU conditions.

Hence, this task type is, in general, not used in control applications except for some special-purpose applications.

IMPORTANT

As default and system task types are, in general, not used in control applications, the description hereafter is limited to the cyclic task type. Moreover, the term "control task" hereafter shall refers to a cyclic control task.

Page 41: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 33

TI 34P02K35-02E Apr. 28, 2016-00

● Control Task Settings The Task Settings dialog is used for specifying the execution interval, execution priority, watchdog time and other settings of a control task. For details on the relationship between the execution interval, priority and watchdog time of a control task, and how these settings affect task execution, see Section B4.3.3, “Task Schedule” of TI “STARDOM Technical Guide.”

1. Execution interval of control task Specify the execution interval of a control task in the [Interval] field on the Task Settings dialog. The default execution interval for a new project is 100 ms. Modify it according to the value decided as described in Section 2.2.4, ”Determining FCN/FCJ Scan Cycle.” 2. Priority When running multiple tasks concurrently on an FCN-500 or FCN-RTU, specify a value (ranging from 0 to 31 in decreasing priority) for [Priority] on the task settings dialog as the priority level of a task relative to other tasks during execution. Assigning different priority values to individual tasks running in multi-tasking mode is recommended. 3. Watchdog time When the actual execution time of a control task exceeds the specified [Watchdog Time], a watchdog error is generated and handled according to the setup described in Section 4.1.4, “Specifying Target FCN/FCJ.” Setting the watchdog time to 0 disables the watchdog timer. Set the watchdog time to the same value as the control task execution interval as described in Section 4.1.4, “Specifying Target FCN-500, FCN-RTU” is recommended 4. Other Settings The other settings on the Task Settings dialog including [Stack] and [Options] can be left unchanged at default values.

Page 42: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 34

TI 34P02K35-02E Apr. 28, 2016-00

4.1.3 Multi-tasking This section describes the considerations and precautions for running multiple tasks concurrently on an FCN-500 or FCN-RTU.

SEE ALSO For details on the behavior of the FCN-500 or FCN-RTU when multiple tasks are created, see Section B4.3.3, “Task Schedule” of TI “STARDOM Technical Guide.”

● Considerations Multi-tasking Two possible reasons for considering implementing multi-tasking are given below: 1. To create control tasks having different execution intervals in an attempt to

reduce CPU load of the FCN-500 or FCN-RTU. For details, see Section 2.2.4, “Determining FCN-500, FCN-RTU Scan Cycle.”

2. To create control tasks having the same execution interval and priority

level for sorting control tasks to be instantiated by function.

The FCN/FCJ runs without problems even with multi-tasking. However, in multi-tasking mode, tasks are processed alternately at intervals of 30 ms in a time-sharing manner as described in TI “STARDOM Technical Guide” and this complicates desk investigation of control applications.

Therefore, running one task per FCN-500 or FCN-RTU is generally recommended. When deciding on control application execution, start with single-tasking and consider multi-tasking only if it is necessary.

Even when considering creating multiple tasks so as to reduce the CPU load of the FCN-500 or FCN-RTU, listed as the first reason above, first consider the option of lengthening the execution interval of a single control task, and consider multi-tasking only if the first option is disallowed by the requirement specification.

Creating multiple tasks having the same execution interval and priority for sorting purpose, listed as the second reason above, is unnecessary. Multi-tasking not only complicates system operation, it may also increase CPU load due to processing for sharing such as shared access to I/O modules. For these reasons, it is best to avoid splitting a single task into multiple tasks having the same execution interval and priority.

● Precautions When Multi-tasking Pay attention to some precautions when using multi-tasking.

SEE ALSO For details on precautions when multi-tasking, see Section 8.3, “Precautions about Multi-tasking" of Chapter 8, “Detailed Description."

Page 43: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 35

TI 34P02K35-02E Apr. 28, 2016-00

4.1.4 Specifying Target FCN/FCJ The following Target dialog is used for specifying the IP address of the FCN-500 or FCN-RTU.

Besides the IP address, this dialog also displays a checkbox with the message “The task aborts when the execution time of a task exceeds a watch dog time.” The checkbox setting is explained below.

SEE ALSO For details on how the above setting affects system behavior in the event of a watchdog error, see Section B4.3.3, “Task Schedule” of TI “STARDOM Technical Guide.” For details on how to specify the IP address of an FCN-500 or FCN-RTU, see Section 4.1.3, “Specifying Target FCN-500, FCN-RTU (by Specifying IP Address)" of “FCN-500/FCN-RTU Primer – Fundamental.”

● Defining Task Behavior upon a Watchdog Error Event How a control task behaves when its execution time exceeds the specified watchdog time described in Section 4.1.2, “Control Task Setup” differs whether the “The task aborts when the execution time...” checkbox described above is ticked or not. • Common behavior regardless of whether checkbox is ticked or not If the watchdog time described in Section 4.1.2, "Control Task Setup” is set to a

value other than 0 ms, a watchdog error will be generated when the execution time of a control task exceeds the preset value.

At the same time, a watchdog error will be logged in the log file on the FCN-500 or FCN-RTU.

• Behavior when checkbox is ticked If the checkbox is ticked, execution of the associated task will be aborted at the

same time a watchdog error is generated. The control application associated with the task also stops execution. Moreover, once aborted, execution of the task will not be restarted until the FCN-500 or FCN-RTU is rebooted.

• Behavior when checkbox is not ticked If the checkbox is not ticked, nothing happens when a watchdog error is

generated, and the control task continues execution.

Page 44: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 36

TI 34P02K35-02E Apr. 28, 2016-00

The above description shows that if the “The task aborts when the execution time...” checkbox is ticked, control computation of the FCN-500 or FCN-RTU will stop even if only one watchdog error is generated. To prevent this, untick the “The task aborts when the execution time...” checkbox.

● Watchdog Time Setting On the other hand, monitoring task execution time using watchdog time provides important diagnostic information about the current state of the system. Therefore, set the watchdog time described in Section 4.1.2, “Control Task Setup” to the same value as the scan cycle to enable monitoring of the execution time of a control task. In this way, a watchdog error will be generated and recorded in the system log file whenever a control task fails to complete execution within the specified duration. Moreover, as described in Section 2.2.3, “Checking FCN-500, FCN-RTU Performance,” control execution time increases as CPU load increases. In cases where an increased CPU load for whatever reason is expected to affect the entire system, set the watchdog time to a value between 80% and 90% of the scan cycle. With this setting, a watchdog error will be generated whenever the CPU load (%) exceeds 80% to 90%, thus providing an effective means for monitoring the CPU load.

IMPORTANT

Do not tick the “The task aborts when the execution time...” checkbox when using a redundant CPU. Watchdog time modifications cannot be applied through an online download. To apply a watchdog time modification, stop the FCN-500 or FCN-RTU and perform an offline download.

Page 45: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 37

TI 34P02K35-02E Apr. 28, 2016-00

4.1.5 Multi-resource Project In Logic Designer applications, FCN-500s or FCN-RTUs are called resources and one FCN-500 or FCN-RTU controller maps to one resource. In the example shown in the figure below, a system comprises three FCN-500s so three resources are created. When creating projects for this system, you can choose either to create three resources within one project, as indicated by the solid line, or create three projects, one for each resource, as indicated by the dotted lines. In cases like this where there is more than one resource within a system, consider and decide whether to create one project containing multiple resources, or one project per resource.

FCN01 FCN02 FCN03

Project

Project01 Project02 Project03

When creating a multi-resource project, the number of resources that can be defined within one project of Logic Designer is limited to 100 as described in Section 4.1.6, “Application Size.” This system limit, though present, is actually large enough for most practical systems. On the other hand, creating one project per resource requires creating as many projects as the number of resources, which makes project management on the development PC more tedious. Hence, in principle, create only one project even if there are multiple resources within a system is recommended. However, having many resources within one project makes engineering work more tedious and may cause confusion. Therefore, we recommend limiting the maximum number of resources per project to between 5 and 10.

TIP This recommendation for limiting the maximum number of resources within one project to between 5 and 10 is based on considerations of efficient project management and engineering. The system itself can accommodate up to 100 resources per project so even defining more than 10 resources per project is not a problem.

Page 46: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 38

TI 34P02K35-02E Apr. 28, 2016-00

4.1.6 Application Size The upper limit for the size of an application is described in Section 2.2.2, “Checking FCN-500, FCN-RTU Control Application Size." In addition to application size, the system imposes limits on the number of resources, the number of logical POUs, etc. While these limits are described in Logic Designer’s online help documentation, we elaborate on some of the more important limits here.

1. Maximum number of resources in the project tree: 100

2. Maximum number of program instances in the resources: 1000 This is the maximum number of logical POUs that can be created as an instance in one resource (FCN-500 or FCN-RTU).

3. Maximum number of tasks in the resources: 16 This is the maximum number of tasks that can be defined for one resource (FCN-500 or FCN-RTU).

4. Maximum number of program instances in the tasks: 500

5. Maximum number of global variables: 15000

6. Maximum number of local variables in the logical POUs: 15000

Page 47: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 39

TI 34P02K35-02E Apr. 28, 2016-00

7. Maximum value of code size in the logical POUs: 200KB This is the upper limit on the size of one logical POU. If the size of a logical POU exceeds 200 KB, a compiler error is generated. If the size exceeds 80% of 200 KB, a compiler warning is displayed.

8. Maximum number of input/output parameters of the functions/function blocks: 300

9. Maximum number of logical POUs in the projects: 2000

10 Maximum number of POU instances that can be defined in project: 64000

11. Maximum number of code worksheets in the logical POUs: 255

12.Maximum number of types of available functions/function blocks in the logical POUs: 620

13. Maximum number of available functions/function blocks in the logical POUs: 1024

14. Maximum number of jumps and labels in the logical POUs: 750

15. Maximum number of contacts/coils in the logical POUs: 3600

TIP As the above list of system limits is not exhaustive, browse the above-mentioned online help documentation before creating your application.

SEE ALSO For details on the Jump function, see Section 9.1.7, “Jump, Connector and Return Functions” of Chapter 9, “Advanced Engineering.” For details on user-defined function blocks, see Section 4.7, “Application Encapsulation.”

Page 48: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 40

TI 34P02K35-02E Apr. 28, 2016-00

4.2 Application Programming Languages Logic Designer supports 5 types of programming languages for creating control applications. This section describes the characteristics of each of these languages, and the types of applications for which they are best suited.

4.2.1 Programming Languages Supported by Logic Designer Logic Designer supports 5 types of programming languages conforming to the IEC 61131-3 standard for creating applications. • FBD (Function Block Diagram) In FBD, functions, application blocks and NPAS_POUs are provided as blocks

and connected using signal lines, along which data is propagated. FBD offers a visual representation of data flow, and is thus ideal for programming regulatory control of analog signals.

• LD (Ladder Diagram) LD is the most widely used language for programming PLC applications, where

logical computations are coded using symbols of contacts and coils as basic components.

Besides offering a visual representation of data flow like FBD, LD allows not only analog signals but also digital signals to be represented visually using BOOL-type contacts and coils.

• SFC (Sequential Function Chart) An SFC consists of steps, transitions and actions. While a step is active, actions

coded within the step are executed. When the transition of the step becomes true, the following step then becomes the active step, and its actions are executed until its transition becomes true, and so on.

SFC’s step-by-step processing makes it ideal for building process progress type applications and sequence control applications.

• IL (Instruction List) In IL, each line consists of one operator and its operands, so coded expressions

are unambiguous but it is cumbersome for coding complex logical relations. • ST (Structured Text) In ST, control applications are coded using text. ST allows conditionals, such as

IF, CASE and FOR statements, as well as complex calculations to be coded easily. As such, it is well suited for conditional decision and calculation processing.

Page 49: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 41

TI 34P02K35-02E Apr. 28, 2016-00

These five languages can be broadly classified into continuous execution languages and step execution languages. FBD, LD, IL and ST belong to the former group, whereby application content is executed continuously, while ST belong to the latter group, whereby application content is segmented into and executed as steps. FBD, LD, IL and ST can be further classified into graphical languages and text-based languages, with FBD, LD belonging to the former group, and ST, IL belonging to the latter group.

FBD (Function Block Diagram)LD (Ladder Diagram)ST (Structured Text)IL (Instruction List)SFC(Sequential Function Chart)Step execution languages

Continuous execution languages

Graphical languagesText-based languages

TIP As IL is seldom used in practice, descriptions about continuous execution language type hereinafter will be limited to three programming languages, namely, FBD, LD and ST.

4.2.2 Selecting a Programming Language

Logic Designer allows programming language to be selected on logical POU (program, function, function block) basis. When using SFC, programming language can also be selected on transition or action basis. While a programmer may select any language according to preference, it is important to select a language suited for a specific purpose to fully exploit its unique features. For details on selection of programming language, see Section 8.4, “Criteria for Selecting Programming Languages in Logic Designer.”

Page 50: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 42

TI 34P02K35-02E Apr. 28, 2016-00

4.3 Principles of Application Creation In previous sections, we discussed task settings and selection of programming language in Logic Designer. This section discusses some principles for good application creation.

4.3.1 Principles of Application Creation When creating a function in Logic Designer, consider different techniques but select an appropriate language and creating a simple application are the two principles that should be adhered to.

● Select a Suitable Language Select a programming language suited for creating application according to the selection criteria for programming language described in Section 8.4, “Criteria for Selecting Programming Languages in Logic Designer” of Chapter 8, “Detailed Description.” Using a programming language not suited for an application leads to complicated logic, with greater likelihood of bugs.

● Simple Application Creating an application that is easy-to-understand simplifies logic checking at the time of application creation. It increases the accuracy of desk debugging, and reduces the number of bugs during application creation. Moreover, a simple application is not only easily understood by the developer himself but also by other engineers. For ease of future job handover to other engineers as the development team grows, it is important to create simple applications that are easy-to-understand.

4.3.2 Example of a Simple Application We discuss the concept of simple application with a concrete example below.

● Segmentation of Code Worksheet Logic Designer allows more than one code worksheet to be created within one logical POU. Exploit this feature by segmenting logic to be created by function and creating one code worksheet for each function. Doing so yields simple worksheets and clear worksheet segmentation by function.

Page 51: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 43

TI 34P02K35-02E Apr. 28, 2016-00

Consider the example logic to be created below, which consists of multiple analog inputs, NPAS_PIDs and analog outputs, as well as logic for setting MV to MAN, 0%, PV value calculation processing and logic for writing SV value for the NPAS_PID. This application can be segmented by function into four pieces: analog I/O and NPAS_PID; logic for setting MV to MAN, 0%; PV value calculation processing and logic for writing SV value. The first option is to create one worksheet for each segment, as shown in segmentation pattern A below.

Analog input

NPAS_PID

Analog output

MV=0% sequence logic

PV value calculation processing

Logic for writing SV value

Segmentation pattern A

Analog input

NPAS_PID

Analog output

MV=0% sequence logic

PV value calculation processing

Logic for writing SV value

Segmentation pattern B

Analog input

NPAS_PID

Analog output

MV=0% sequence logic

PV value calculation processing

Logic for writing SV value

Segmentation pattern C

Analog input

NPAS_PID

Analog output

MV=0% sequence logic

PV value calculation processing

Logic for writing SV value

Unsegmented worksheet

As the logic for setting MV=0% and logic for writing SV value are relatively simple, including their codes into the same worksheet for analog I/O and NPAS_PID may increase ease of understanding. This option for worksheet creation is shown in segmentation pattern B above. Over segmentation may sometimes lead to a more complicated application. In segmentation pattern C, the analog I/O and NPAS_PID function is segmented into three pieces, namely, analog input, NPAS_PID, analog output. The figure below shows the actual view displayed in Logic Designer after creation.

Page 52: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 44

TI 34P02K35-02E Apr. 28, 2016-00

In this segmentation, while the worksheet is organized by individual functions of analog input, NPAS_PID and analog output, the connections between the NPAS_POUs are not implemented by direct links, but implemented through data passing by variables. As a result, the data flow and inter-block relationships are not visually captured, which destroys one of the features of FBD. This counter example shows how over segmentation can produce a more complicated application. In short, code worksheet segmentation by function is necessary for creating simple applications but over segmentation may actually increase complexity.

● Segmentation of Program POU Besides code worksheet segmentation, program POU creation by function is also allowed.

Analog input

NPAS_PID

Analog output

Program POU A

MV=0% sequence logic

Program POU B

Analog input

NPAS_PID

Analog output

MV=0% sequence logic

PV value calculation processing

Logic for writing SV value

Unsegmeted program POU

Logic for writing SV value

Program POU C

PV value calculation processing

Program POU D

However, doing this increases complexity as connections between program POUs are implemented through global variables instead of local variables. Therefore, unless there are special reasons such as the size of one program POU exceeding the system limit, segmenting a program POU is not recommended.

IMPORTANT

If the data in the FCN-500 orFCN-RTU is referenced from the outside (e.g. via FCN/FCJ OPC server), you need to pay attention to the length of a variable name and a POU instance name.. - Variable name, instance name: up to 30 characters

The hierarchy of POU can be up to 6. If it is referred to as "POU instance name .POU instance name .------. Variable name", it will be up to 216 characters.

Page 53: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 45

TI 34P02K35-02E Apr. 28, 2016-00

4.3.3 Bottom-up Application Creation In Section 4.3.2, “Example of a Simple Application," we have investigated code worksheet segmentation and logical POU segmentation. After deciding on the organization of the code worksheets and logical POUs, create the control application in a bottom-up manner starting from the smaller parts by investigating which parts, if any, should be combined or componentized.

In the example given in Section 4.3.2, the application is divided by function into 4 parts: analog I/O and NPAS_PID; logic for setting MV to MAN, 0%; PV value calculation processing and logic for writing SV value.

- Analog I/O and NPAS_PID Create this part without encapsulating as there is no special need to do so.

- Logic for setting MV to MAN, 0% Consider encapsulating this part to enable reuse in multiple locations.

- Logic for writing SV value Consider encapsulating this part to enable reuse in multiple locations.

- PV value calculation processing Consider encapsulating of this part to enable reuse in multiple locations.

Comparing the logic for setting MV to MAN, 0% and the logic for writing SV value, both logics write to access parameters, and are executed when a condition is true so they can also be created collectively as one component without any problem. On the other hand, the logic for calculation processing of PV value is always executed regardless of condition, and thus must be created separately from the above two parts. From the above discussion, the example given in Section 4.3.2 can be created into three parts, namely, Analog I/O and NPAS_PID; component for setting MV to MAN, 0% and writing SV value and component for PV value calculation processing, as shown in the figure below.

Analog input

NPAS_PID

Analog output

MV=0% sequence logic

PV value calculation processing

Logic for writing SV value

Example in Section 4.3.2

Analog input

NPAS_PID

Analog output

MV=0% sequence logic

Logic for writing SV value

PV value calculation processing

Result of investigation

Component 1

Component 2

After deciding on the organization of the code worksheets and logical POUs, create the application through bottom-up investigation and combination, starting from the smaller logics.

Page 54: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 46

TI 34P02K35-02E Apr. 28, 2016-00

4.4 Application Creation Know-how Control application is created using Logic Designer. For details on know-how relating to control application creation, see Chapter 9, “Advanced Engineering.” Section 9.1, “General Application Development Know-how ” of Chapter 9, “Advanced Engineering” Section 9.2, “Know-how in Use of NPAS_POU” of Chapter 9, “Advanced Engineering”

Page 55: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 47

TI 34P02K35-02E Apr. 28, 2016-00

4.5 Network Templates In the term “network template”, network refers to control logic connections, and network template refers to a control logic (circuit diagram) model. Model codes are made into templates to enable code reuse. Use of network templates simplifies control logic construction.

Basic control loop templates, published on the Network-based Control System “STARDOM” Members Only Page of the “Yokogawa Plus” website (https://plus.yokogawa.co.jp/Membership/Top.do), can be downloaded and copied into a prescribed folder for reuse. For more details, read the documentation accompanying the templates.

(3) Circuit diagram is generated automatically.

(2) Specify variable names (tag names).

(1) Select a suitable network template (model code) from the list.

Page 56: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 48

TI 34P02K35-02E Apr. 28, 2016-00

4.6 Application Encapsulation User-defined POUs and function blocks can be registered in Logic Designer. This section describes the features of user-defined POUs, how to create these POUs and the relevant precautions.

4.6.1 Features of Application Encapsulation

● What is an Application Encapsulation? Application encapsulation in this document refers to user-created logic defined as a user defined POUs. It may also include system-defined functions, system-defined function blocks or NPAS POUs. User defined POUs can be created using any programming language.

● Deciding on Encapsulating Applications Before encapsulating certain logic, first investigate whether it is indeed necessary to encapsulate logic. As described later, the merits of encapsulating lie in more efficient application creation and debugging arising from using a registered component in multiple places. As such, encapsulating logic that is used in only one place in Logic Designer has little merit. On the contrary, you should consider encapsulating application when the same logic is used in multiple places in Logic Designer.

● Merits of Encapsulating Application Followings are the benefits. 1. Reduced application creation effort To create logic by copying logic from another location in Logic Designer, first

specify the range for copying, execute a copy and paste, and then modify the function block names and variable names in the copied logic.

Moreover, such work has to be repeated for all copies of the logic in different locations.

On the other hand, encapsulating logic, like system-defined function blocks and NPAS POUs, are created not by copying but by definition using the Edit Wizard.

Compared to copying, definition using Edit Wizard is simpler and componentization is expected to save application creation effort.

Page 57: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 49

TI 34P02K35-02E Apr. 28, 2016-00

2. Reduced debugging effort As described earlier, besides copying and pasting, creating logic by copying also

requires modification of variables names. Such hand work must be checked using desk debugging, as well as actual operation.

Encapsulated logic, on the other hand, runs exactly the same way wherever it is used in Logic Designer.

In other words, using a debugged and proven encapsulated logic in another place does not require rechecking of its internal logic.

In practice, variable assignment validation and simple execution validation is still required but compared to the checking required for copied logic, application encapsulation is expected to save debugging effort.

3. Better support of specification changes Sometimes, created logic needs to be modified to support a specification change

or fix a bug. For logic created through copying, any modification has to be repeated in all

copies of the logic. Moreover, there is a risk of missing some modifications. Encapsulated logic, on the other hand, requires only the registered component to

be modified for the modification to be reflected in all places where the encapsulated logic is used.

In other words, even if a encapsulated logic used in many places, only one place needs to be modified, which translates into better support of specification changes.

Page 58: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 50

TI 34P02K35-02E Apr. 28, 2016-00

4.6.2 Procedure for Creating a POU This section describes the procedure for creating a POU using as example the logic for detecting a mode, status or alarm condition of an NPAS POU given in Section 9.2.2, “How to Detect Mode, Status and Alarm” of Chapter 9, “Advanced Engineering.”

● Selecting Usage for Variables of a POU When creating a POU, the property of a variable its usage can be selected. The five available usage options are VAR, VAR_EXTERNAL, VAR_INPUT, VAR_OUTPUT and VAR_IN_OUT. Among these, VAR and VAR_EXTERNAL are similar with general programming languages. VAR_INPUT : External data to be read into a POU

Besides global variables, data of VAR_INPUT type are read and used for calculation within a POU.

VAR_OUTPUT : Output data from a POU

Select VAR_OUTPUT type for outputting internal calculation results of a POU.

VAR_IN_OUT :Select VAR_IN_OUT type for external data to be read into

a POU, overwritten and then re-output from the POU. When creating a POU, in addition to VAR and VAR_EXTERNAL, VAR_INPUT, VAR_OUTPUT and VAR_IN_OUT can be used.

● Procedure for Creating a POU Create the control logic shown in the figure below as a POU.

1. Register a POU 1.1 Right-click on [Logical POUs] in Logic Designer, and then select [Insert]-

[Function Block] from the pop-up menus.

Page 59: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 51

TI 34P02K35-02E Apr. 28, 2016-00

1.2 On the displayed dialog, specify a POU name and language. Click [OK]. For this example, specify “SAMPLE” for the name and select “FBD” for the language.

1.3 A user function block named "SAMPLE" is created under [Logical POUs]. Next,

create logic within this block.

2. Create logics 2.1 Open the SAMPLE code worksheet, place one AND function block and one EQ

function block, and then connect the output terminal of the AND function block to the input terminal of the EQ function block.

2.2 Double-click the input terminal of the AND function, and specify a variable name,

usage and data type on the displayed dialog.

Page 60: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 52

TI 34P02K35-02E Apr. 28, 2016-00

For this example, specify "IN" for [Name]. This becomes the terminal name of the POU. As this terminal is to be used for reading external data into the POU, select "VAR_INPUT” for [Usage]. Select “DWORD” for [Data Type] (the same data type for an NPAS POU mode, status or alarm condition).

2.3 Similarly, create terminals to be connected to the mode, status or alarm condition global variable. For this example, specify "GM” for name, "VAR_INPUT” for [Usage] and “DWORD” for [Data Type] (the same data type as the system global variable). Connect GM to the terminals of AND and EQ.

2.4 Create a terminal for outputting the calculation result of the POU.

For this example, specify “OUT” for [Name], “VAR_OUTPUT” for [Usage] and “BOOL” for [Data Type] (the same data type as the output terminal of EQ), and then connect the variable to the output terminal of EQ. This variable is the terminal for outputting result to the external.

2.5 This completes the creation of the logic. Compile the project. 3. Paste to Logical POU 3.1 In Edit Wizard, the created POU is displayed in green. Created POUs can be

treated like any other functions, functions blocks and NPAS POUs.

Page 61: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 53

TI 34P02K35-02E Apr. 28, 2016-00

3.2 In the figure below, the first row shows the basic logic of the POU while the second row shows two logics, which make use of the created POU for detecting HH and LL alarms of NPAS_PVI_1 respectively.

(*Detects HH alarm of PVI_1*)” (*Detects LL alarm of PVI_1*)

Page 62: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 54

TI 34P02K35-02E Apr. 28, 2016-00

4.6.3 Modifying Logic of a POU This section describes the procedure for modifying a created POU along with precautions.

● Precautions on POU Modification 1. Selective Modification of POU is not Allowed As described in the merits of componentization in Section 4.7.1, “Features of Application Encapsulation,” once a registered POU is modified, the modification will be reflected in all logic using that POU. This also means that it is not possible to apply a logic modification to some applications. A new POU should be created if previous logics have to be kept in some applications. 2. When increasing or decreasing the number of I/O terminals Some logic modifications may involve increasing or decreasing the number of I/O terminals. For FBD or LD code worksheets, increasing or decreasing the number of I/O terminals involves a graphical change. To apply a graphic change requires redefinition of the POU as described later.

Page 63: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 55

TI 34P02K35-02E Apr. 28, 2016-00

● Procedure for Modifying a POU This section describes here the procedure for modifying a POU, using an example involving adding an input terminal to the “SAMPLE” POU created in Section 4.7.2, “Procedure for Creating a POU.” Change in requirement specification The OUT terminal is to be turned on if the mode, status or alarm condition

becomes true and remains true for a certain duration, which can be specified individually for each logic.

1. Add an input terminal Open the variable worksheet of user function block “SAMPLE,” and define a new

terminal. For this example, specify “TM” as the name of the input terminal for setting the

duration, “VAR_INPUT” as its usage and “TIME” as its data type.

Precautions when adding terminals

- Sequence of variables The sequence of terminals follows the sequence of the variables on the

variable worksheet. In the above figure, three VAR_INPUT type variables are defined with the following sequence: IN, GM and TM. The terminals of the user function block follow the same sequence: IN, GM and TM.

- Initial value of variable The initial value of input terminal “TM” is defined as “TIME#1s”. With this setup, if terminal “TM” is connected to nothing, its default value is 1

second. In this example, if terminal “IN” or terminal “GM” is connected to nothing, this

comparison logic would be meaningless so this case is not considered in the logic.

However, terminal “TM” is used for setting the duration so even if it is connected to nothing, the comparison logic is still meaningful.

Therefore, a default value is defined in case that terminal “TM” is connected to nothing.

Page 64: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 56

TI 34P02K35-02E Apr. 28, 2016-00

2. Modify the control logic Modify the logic within the user function. The figure below shows the logic after modification using jump and return

functions described in Section 9.1.7, “Jump, Connector and Return Functions” of Chapter 9, “Advanced Engineering.”

Firstly, if the mode, status or alarm condition becomes true, variable “V001”

becomes true. Next, the preset duration TM is compared against 0 second using EQ. If the preset duration is 0 second, logic execution jumps to label “TM_SET_0s”,

skipping TON_1. As a result, terminal “OUT” becomes true when the condition is true without executing the duration logic.

On the other hand, if TM is set to a non-zero value, the jump is ignored and TON_1 is executed.

Moreover, as a RETURN function is coded below TON_1, subsequent logic is not executed if a duration is specified using TM.

After modifying the control logic, compile the project.

Page 65: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 57

TI 34P02K35-02E Apr. 28, 2016-00

3. Redefine the control logic The modification of the control logic is completed. However, adding terminal “TM” involves a graphical change, which is not

reflected graphically in Logic Designer unless the POU is redefined in Logic Designer.

3.1 Click “PVI_1_HH,” whose logic has been modified. The display is shown in the

figure on the right below. 3.2 In this state, double-click user function block [SAMPLE] in the Edit Wizard.

3.3 A dialog is displayed. Click [OK] without modifying anything.

3.4 This completes redefinition of the POU with the added terminal. Connect a

variable to terminal TM and specify the required duration. If no variable is connected to terminal TM, the duration defaults to the initial

value of 1 second as described in point 1 above.

(*Detects HH alarm of PVI_1*)” (*Detects LL alarm of PVI_1*)

(*Detects HH Alarm of PVI_1*)

Page 66: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 58

TI 34P02K35-02E Apr. 28, 2016-00

4.7 Handling Compile Errors and Warnings When compiling a project in Logic Designer, compile errors and warnings may sometimes be displayed as a compile result.

A compile error indicate the presence of a system error or a syntax error in the application program that prevents successful completion of compile. Performing downloading without first removing all compile errors will cause invalid code to be downloaded, thus affecting normal control. To avoid this, always fix and remove all compile errors before downloading. On the other hand, compile warnings are not errors but may also affect normal control if ignored. Fix all reported compile warnings.

TIP Performing downloading without first removing all compile errors will cause the following dialog to be displayed.

Figure Compilation Error Message Dialog

● Compile Warning Example Shown below is a list of warnings generated during compile of a project. The list of warnings includes a warning which, if left unresolved, affects normal control.

Message displayed at the end of compile 0 Error(s), 34 Warning(s)

Detailed description of warnings Worksheet empty. Worksheet empty. : : Variable 'NewVar4' is never used. Variable 'NewVar3' is never used. Variable 'NewVar2' is never used. Variable 'NewVar1' is never used. Variable 'ALARM_HI' is never used. Instance 'SAMPLE_1' is never used. Instance 'R_TRIG_1' is used more than once. Variable 'V07' is never used. Variable 'GM_ALRM_HI' is never used. Variable 'V006' is never used. Variable 'V007' is never used.

Page 67: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 59

TI 34P02K35-02E Apr. 28, 2016-00

Variable 'V008' is never used. Variable 'V009' is never used. Variable 'V011' is never used. : Among these warnings, the warning “Instance 'R_TRIG_1' is used more than once.” indicates a real problem. From the warning, we know that function block “R_TRIG” for detecting a rising edge is used in multiple places with the same name “R_TRIG_1”.

Problem Consider the following scenario. Variable “a,” which is connected to input parameter CLK of R_TRIG_1 in one location becomes ON and remains ON after R_TRIG_1 detects the rising edge and performs output. Variable “b,” which is connected to input parameter CLK of R_TRIG_1 in another location now becomes ON. As variable “a” connected to input parameter CLK of R_TRIG_1 in the first location remains ON after the first rising edge is detected, R_TRIG_1 fails to detect the rising edge in variable “b” and thus performs no output. In other words, the rising edge in variable “b” goes undetected. This is an example where leaving an unresolved warning affects normal control.

● Recommendation: Fix All Compile Warnings In the above example, one out of 34 warnings indicates a real problem. When there are not so many warnings (say 30 or less), it may be easier to spot a problematic warning among all displayed warnings. However, when there are many warnings, it is possible that a problematic warning in the midst may be ignored. As such, fixing all compile warnings is recommended, even if they are non-problematic, to avoid missing out a problematic warning.

Page 68: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 60

TI 34P02K35-02E Apr. 28, 2016-00

4.8 Precautions About Downloading A control application can be downloaded to the FCN-500 or FCN-RTU after successful compile. This section describes some precautions about downloading.

For details on this topic, read the online help documentation shown below.

TIP In this document, unless otherwise stated, download refers to downloading a project to the main memory.

4.8.1 Offline Download and Online Download A control application can be downloaded in offline mode or online mode.

- Offline download There are no restrictions associated with offline downloading except that control

operation on the FCN-500 or FCN-RTU stops at the time of download.

SEE ALSO For details on the relationship between start mode and retain data after offline downloading, see Section 2.2.5, “Retentive Variables (Retain Data) Considerations.”

- Online download Online download allows changes to be made to a control application without

stopping control operation on the FCN/FCJ. However, online download limits some of application modification.

Page 69: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 61

TI 34P02K35-02E Apr. 28, 2016-00

IMPORTANT

Error items to be checked during the execution of the control application are shown in the table below. If an error occurs, the task may stop and multiple error messages may be displayed. In this case, online downloads are no longer enabled. Once again, please download project offline. Please test the project to avoid the error before performing an online download. For details, see 9.1.14, “Avoidance of the Error during Execution.” Errors are confirmed on FCN/FCJ system alarm message during operation and message window on Logic Designer during programming and debugging.

Table Operation of the Control Application Error

Error Action

Division by zero occurs (integer variables) The task will stop.

Data exceeds the range of the array or structure

The operation of a task differs in the target setting dialog. When the check box “Array boundary check” on the extended setting is checked, the task will stop. (recommended) Please check the array boundary. If you do not check, the task will not stop. The memory contents next to the array may be broken.

An error occurs in a string operation EX1: Input more than 32 bytes a characters as

STRING(32) type data EX2: Input more than 80 bytes a characters as

STRING type data(*1)

The task will continue. If string processing continues, multiple error messages are displayed.

The execution of the task is not completed within the watchdog time

The task will stop when the check box "The task aborts when the execution time of task exceeds a watch dog time." in the target setting dialog is checked.

A stack is overflowed

The task will stop when the check box "Stack check" on the extended setting in the target setting dialog is checked.

*1:STRING type is usually up to 80 bytes.

SEE ALSO For details on online downloading, see Chapter B3, “Online Download" of IM “STARDOM FCN/FCJ Guide.”

Page 70: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 62

TI 34P02K35-02E Apr. 28, 2016-00

4.8.2 Downloading Boot Project and Source This section describes downloading boot project and source .

SEE ALSO For details on boot project and source, see Section 4.8.4, “Importance of Boot Project” and Section 4.8.5, “Importance of Source.”

● Boot Project A boot project is stored on the on-board flash memory and loaded automatically into main memory when the FCN-500 or FCN-RTU is powered on and control begins.

● Source A source is a Logic Designer project stored on the flash memory. A source is downloaded to the flash memory by Logic Designer. The project is compressed into zwt format before download. A project in Logic Designer can be restored by uploading its source from the flash memory.

4.8.3 Detailed Description of Download Dialog The following picture shows Logic Designer’s Download dialog.

1. Include Bootproject; Include Sources Ticking the checkboxes enclosed by blue box (1) causes the boot project and sources to be downloaded at the same time when the project is downloaded.

(1)

(2)

(3)

(4)

Page 71: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 63

TI 34P02K35-02E Apr. 28, 2016-00

2. Download Source Clicking the [Download Source] button enclosed by blue box (2) causes only the source to be downloaded to the flash memory. As source download is performed during the CPU’s idle time, it will not affect control operation if the CPU load is below the recommended limit of 60% as described in Section 2.2.3, “Checking FCN-500, FCN-RTU Performance.” Use of the User-Libraries, Pagelayouts and Backend-Code checkboxes are described in detail in Section 4.10, “Control Application Backup” but these three checkboxes should in general be left unticked. Clicking the [Delete Source on Target] button causes existing source loaded in the flash memory to be deleted. 3. Download Boot Project Clicking the [Download] button enclosed by blue box (3) causes only the boot project to be downloaded to the flash memory. Like source download, boot project download is performed during the CPU’s idle time so it will not affect control operation if the CPU load is below the recommended limit of 60%. 4. Download File Clicking the [Download File] button enclosed by blue box (4) allows any file to be downloaded to the flash memory for storage.

SEE ALSO For details on how to download a project, see Section 4.6, “Hands-on: Downloading a Project” of TI “STARDOM FCN-500/FCN-RTU Primer – Fundamental.”

Page 72: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 64

TI 34P02K35-02E Apr. 28, 2016-00

4.8.4 Importance of Boot Project It is extremely important to download the latest project to the boot project in real systems. As described in Section 4.8.2, “Downloading Boot Project and Source,” when the FCN-500 or FCN-RTU is powered on, it begins control using the boot project. If the boot project is out-dated, powering off and then on the FCN-500 or FCN-RTU will cause control to be started with an out-dated control application. A Case Story In daily operation, an application was modified using online download and its operation tested but the changes were not downloaded to the boot project. At the next routine inspection, the FCN-500 or FCN-RTU was powered off and then powered on. The FCN-500 or FCN-RTU started control using the boot project, which was out-dated, so control was unfortunately started with an old control application instead of the latest control application used before the routine inspection. To avoid this unfortunate scenario, we recommend downloading the boot project at the same time whenever the project is downloaded to the FCN-500 or FCN-RTU. Specifically, this means ticking the [Include Bootproject] checkbox as shown within blue box (1) in the picture given in Section 4.8.3, “Detailed Description of Download Dialog.” If it is not feasible to download the boot project at the same time as the project for some reason, download the latest control application to the boot project subsequently using the button enclosed by box (3) of the picture shown in Section 4.8.3.

Page 73: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 65

TI 34P02K35-02E Apr. 28, 2016-00

4.8.5 Importance of Source As described in Section 4.9.2, “Downloading Boot Project and Source,” a source is actually a Logic Designer project compressed into zwt format and stored on the flash memory. Moreover, by a simple operation, a project can be restored on a PC by uploading the source. Whether a source is present on the flash memory does not directly affect control operation on the FCN-500 or FCN-RTU but a source can be used as a backup copy of the application. A Case Story A Logic Designer project created on a PC is normally backed up to a server or other media for safekeeping. However, when the PC was damaged or replaced, it was discovered that the backup copy was missing or may not be the most up-to-date, making project recovery difficult. In such unfortunate situations, if the source of the latest project had been downloaded to the flash memory previously, restoring the Logic Designer application would be easy. While keeping a backup copy of a Logic Designer application on a server or other media is basic, we also recommend saving the source on the flash memory just in case. Specifically, ticking the [Include Sources] checkbox as shown within blue box (1) in the picture given in Section 4.9.3, “Detailed Description of Download Dialog” causes the source to be downloaded at the same time as the project. If it is not feasible to download the source at the same time as the project for some reason, download the source of the latest control application subsequently using the button enclosed by box (2) of the picture shown in Section 4.9.3. Logic Designer R4.02.01 and later versions allow a project on a PC and a project on a FCN-500 or FCN-RTU to be compared. For details, see 9.1.13, “Comparing Logic Designer Projects.”

Page 74: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 66

TI 34P02K35-02E Apr. 28, 2016-00

4.9 Control Application Backup Daily backup of control applications is important to guard against damage or replacement of he PC used for creating the control applications. This section describes the procedure for application backup.

● Folder for Storing Logic Designer Applications Applications created using Logic Designer are stored in the following folder on the PC: <Logic Designer’s installed path>\FCN-FCJ\LogicDesigner\Projects If Logic Designer is installed in its default location, this folder corresponds to: C:\YOKOGAWA\FCN-FCJ\LogicDesigner\Projects Within this folder, application data is stored in a folder having the same name as the Logic Designer project and a file named “<project name>.mwt”. Depending on the size of an application, the folder named after the project may be several tens of megabytes, making direct backup a little difficult. In this case, compress the application into a zwt format file first and backup the compressed zwt file. Typically, a folder several tens of megabytes can be compressed into a zwt file below 1 megabyte.

● Procedure for Compressing a Project into zwt Format 1. Select [File]-[Zip and Save As] from Logic Designer’s menu bar. 2. On the displayed dialog, select “Zipped Project Files (*.zwt).”

3. When “Zipped Project Files (*.zwt)” is selected, the Zip Options checkboxes are

enabled for selection. Unless required for some reason, these options should generally be left unticked. Click [Save].

4. A compressed “zwt” file will be created in the folder displayed in the dialog. 5. Save a backup copy of the compressed zwt file.

Page 75: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<4. Control Application Creation> 67

TI 34P02K35-02E Apr. 28, 2016-00

TIP The Zip Options checkboxes should generally be left unticked unless page layout has been edited. Even if you are creating a user library, user library, please do not compress. It will also be compressed libraries such as NPAS POU and APPF POU at the same time. When you unzip the compression project in a different environment, it will be different versions of the POU are mixed. It is recommended to separately manage the user library.

Page 76: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

TI 34P02K35-02E Apr. 28, 2016-00

Blank Page

Page 77: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 69

TI 34P02K35-02E Apr. 28, 2016-00

5. Function Test (Debugging) Function test is synonymous to debugging, and involves checking whether a created control application runs in compliance to a requirement specification and checking for application bugs. Function test may also help discover contradictions in the requirement specification. This chapter describes know-how and precautions relating to debugging of FCN-500 and FCN-RTU applications.

5.1 Equipment Used for Testing Function test of a control application may be carried out using the target equipment, in-house test equipment or FCN/FCJ simulator. This section describes precautions to these test environments.

Page 78: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 70

TI 34P02K35-02E Apr. 28, 2016-00

5.1.1 Precautions of Testing When Using In-house Equipment When using in-house test equipment for debugging, the test environment may be different from the target equipment.

● Style of CPU module When debugging a new system, the FCN-500 or FCN-RTU of the in-house test equipment used for debugging may be of an older version and its style number of the CPU may be different from that of the target equipment. On the other hand, when testing a modification of an existing system, the production FCN-500 or FCN-RTU may be old and the style code of its CPU may differ from that of the in-house test equipment.

A control application can be debugging using in-house test equipment whose CPU style code differs from that of the target equipment or production equipment, provided some restrictions and precautions to be described later are observed.

• How to check style code of CPU Connect to the FCN/FCJ Maintenance homepage using a Web browser to

display the Top Page as shown in the figure below. On the Top Page, check the displayed Type, which is enclosed by a blue box

below.

In the above figure, "S1U" is displayed after the model name (“NFCP502-W05”)

of the CPU module, indicating the latest S1 style CPU.

SEE ALSO For details on checking CPU load, see Section 5.5.1, “Checking CPU Load.”

Page 79: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 71

TI 34P02K35-02E Apr. 28, 2016-00

● Revision of CPU module Before starting debugging using in-house test equipment, check the revision of the FCN/FCJ Basic Software (OS) stored on the CPU module. When testing using in-house equipment, the FCN/FCJ OS stored on the CPU module may not be of the latest revision and thus should be checked. • How to check revision of system card Connect to the FCN/FCJ Maintenance homepage using a Web browser to

display the Top Page as shown in the figure below. On the Top Page, check the displayed OS Revision and BootROM Revision,

which are enclosed within a blue box below.

After determining the revision of the CPU module of the in-house test equipment, check whether it matches the revisions of the tools verified in Section 2.2.1, “Checking Revisions of FCN-500, FCN-RTU and Tools.” If the revisions differ, upgrade or downgrade accordingly to match the revisions.

Page 80: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 72

TI 34P02K35-02E Apr. 28, 2016-00

● Suffix code on CPU module Consider whether the suffix code on CPU module of the in-house test equipment differ from the suffix code for target equipment. Compare the suffix code on CPU module of the in-house test equipment against the suffix code for target equipment, and check for any debugging problem. Debugging Problem Example 1 To create a using NPAS POU application, an FCN-500 extended type (with

NPAS license) was purchased for the target equipment, but the NPAS POU license was not included in the FCN-500 standard type for the in-house test equipment.

Debugging Problem Example 2 As there is no need to use NPAS_POU, NFCP501 standard type (without NPAS

license) was purchased for the target equipment. However, the in-house development equipment has FCN-500 extended type (with NPAS_POU license), and an engineer created an application using NPAS_POU without realizing that FCN-500 standard type (without NPAS_POU license) was purchased for the target equipment.

In this example, the FCN-500 of the in-house equipment ran normally during

function test as an NPAS_POU license was present. However, when the application was moved to the target equipment, the FCN-500

no longer runs and it was necessary to either fix the application or purchase an FCN-500 extended type for the target equipment.

● Installed I/O Modules As described in Section 5.5.1, “Checking CPU Load,” CPU load includes I/O module access. If the I/O modules installed on in-house test equipment differ from those to be installed on the target equipment, an accurate CPU load cannot be reflected so CPU load checking cannot be done on the in-house test equipment.

● Duplexed Parts In a STARDOM system, the CPU of the FCN-500, the power supply module, the SB bus, the control network (Ethernet) and the communication application can be duplexed. However, parts required to be duplexed in the system may not be duplexed in the in-house test equipment. In such cases, investigate whether there is any problem with performing function tests without duplexing, and how to perform switchover test for the duplexed parts.

Page 81: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 73

TI 34P02K35-02E Apr. 28, 2016-00

5.1.2 Precautions of Testing When Using FCN/FCJ Simulator The FCN/FCJ Simulator tool is used to simulate the execution of a control application on a PC. Using a FCN/FCJ Simulator allows the function test of a control application to be carried out on a PC without an FCN-500 or FCN-RTU. For details on the FCN/FCJ Simulator, see the online help documentation of the FCN/FCJ Simulator.

Functions Not Supported by FCN/FCJ Simulator The FCN/FCJ Simulator does not support the following functions. • I/O function Input to I/O cannot be done as no I/O module can be installed. • CPU duplex function Switchover test for a duplexed CPU cannot be done as the FCN/FCJ Simulator

can only simulate a single CPU. • Network duplex function Switchover test for a duplexed network cannot be simulated as the FCN/FCJ

Simulator can only run with a single network. • FCN/FCJ Maintenance page (Web) • Upload/download to Resource Configurator • Java runtime environment (FCN-RTU only) The Java Application Development Kit is used for development and execution

(debugging) of Java applications. The FCN/FCJ Simulator only provides an environment for accessing variables defined in a running control application.

Page 82: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 74

TI 34P02K35-02E Apr. 28, 2016-00

• Communication function of POU performing communication processing Inter-FCN/FCJ communication, Modbus communication, serial communication,

Ethernet communication, communication using communication POUs, etc. cannot be done.

● Items that can be debugged using FCN/FCJ Simulator As described earlier, the I/O function is not supported by the FCN/FCJ Simulator. Therefore, debugging using FCN/FCJ Simulator is in fact debugging with I/O in disconnected state. Moreover, as various communication modules using communication POUs are not supported, connection test and combination test using these modules cannot be done, as well. For these reasons, use the FCN/FCJ Simulator for unit test of a control application but use a real FCN-500 or FCN-RTU for connection test and combination test.

Page 83: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 75

TI 34P02K35-02E Apr. 28, 2016-00

5.1.3 Precautions of Testing When Using Target Equipment Target equipment is delivered after completion of user acceptance test for use in the factory. Therefore, it is important to ensure that all settings are properly done and avoid failures due to oversight.

● FCN-500 Equipment Setup Install power supply module, CPU module, various I/O modules, communication module and SB bus repeat module in the base module based on hardware specifications. Perform equipment setup as described in Section 2.1, "Checking Hardware Specification." Some equipment setup is done using Resource Configurator, while others are done on the hardware itself. The first kind of setup is done after installing target equipment and starting the FCN-500; while the second kind of hardware setup described below is done at installation before starting the FCN-500. • Unit number setting of base module FCN-500 uses the same base module hardware for control units and expansion

units. Whether a base module is to be used as a control unit or expansion unit is defined using a hardware switch on the base module. Before shipment, all base modules are set to unit 1 (for control unit) so during installation, you need to set the switch of each base module to be used as an expansion unit. If a system has only one base module with no expansion unit, unit number setup is not required.

SEE ALSO For details on how to set the switch of a base module, see Section A1.2, “Base Module” of IM “STARDOM FCN/FCJ Guide.”

• Single/Duplexed CPU module setting of base module Whether an FCN-500 uses a single CPU module or duplexed CPU modules is

also defined using the resource configurator and a hardware switch of the base module. The factory default setting is for a single CPU and must be changed accordingly when using duplexed CPU modules.

SEE ALSO For details on how to set the switch of a base module, see Section A1.2, “Base Module” of IM “STARDOM FCN/FCJ Guide.”

Page 84: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 76

TI 34P02K35-02E Apr. 28, 2016-00

• 2-wire/4-wire setting of current input module The following current input modules must be configured for 2-wire or 4-wire

system during installation. NFAI141 NFAI143 NFAI841

SEE ALSO For details on the 2-wire/4-wire setting, see Section 8.1.1, “Checking Operation Specification of Analog/Digital Input.”

● FCN-RTU Equipment Setup Install power supply module, CPU module, various I/O modules and communication module in the base module based on hardware specifications. Perform equipment setup as described in Section 2.1, "Checking Hardware Specification." Some equipment setup is done using Resource Configurator, while others are done on the hardware itself. The first kind of setup are done after installing target equipment and starting the FCN-RTU; while the second kind of hardware setup described below are done at installation before starting the FCN-RTU. • Unit number setting of base module FCN-RTU uses the base module hardware for control units only.

Before shipment, all base modules are set to unit 1 (for control unit) so during installation.

● Prevention of Equipment Failure Handle equipment with care to prevent target equipment failure due to physical shock. Beware that improper power supply connection will cause power supply module failure. Examples of improper power supply connection: - Connecting a 24V DC power supply module to 100 V AC - Connecting a 100V AC power supply module to 240 V AC - Connecting the 24V DC analog field supply to 100 V AC - Connecting to the 24V DC power supply of an FCJ with reverse polarity - Connecting the 24 DC power supply of an FCJ to 100 V AC To avoid power supply module failure, perform power supply connections carefully.

Page 85: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 77

TI 34P02K35-02E Apr. 28, 2016-00

5.1.4 Precautions of Migrating Testing from In-house Equipment to Target Equipment

Debugging is sometimes started on in-house test equipment and then migrated to the target equipment halfway through function test. We describe two migration scenarios below.

● If CPU Module of In-house Equipment Are Used before Migration In this migration scenario, debugging started using the CPU module of in-house equipment is to be migrated to the target equipment upon delivery of its CPU module. Firstly, migrate the information stored on the CPU module of the in-house equipment to the target CPU module using the following steps: 1. Save retain data specified on in-house equipment to its CPU module. 2. Execute the FcxBackup command to save data stored on the CPU module of the

in-house equipment to a PC. 4. Define the IP address on the target CPU module. 5. Execute the FcxRestore command to migrate the data of the CPU module of the

in-house equipment saved on the PC earlier to the target system card. • Resource Configurator settings Configuration data defined using Resource Configurator is saved in the CPU

module on-board flash memory. However, if the I/O module configuration is different between the in-house equipment and target equipment, I/O modules need to be reconfigured and device labels redefined for the target equipment.

• Items saved by FcxBackup command The list of items to be saved by FcxBackup command is defined in a file named

“backuplist.txt” stored in the same folder as the “FcxBackup.exe” executable file. The default backuplist.txt file list covers IEC control applications but does not include files added by Java applications (FCN-RTU only). Read “README.TXT” and edit the “backuplist.txt” file accordingly to add to or modify the list of items to be saved by FckBackup command as required.

Page 86: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 78

TI 34P02K35-02E Apr. 28, 2016-00

● If FCN/FCJ Simulator Is Used before Migration In this migration scenario, debugging started using FCN/FCJ Simulator is to be migrated to the target equipment upon its delivery.

As no hardware setup is done using FCN/FCJ Simulator, test migration from FCN/FCJ Simulator to target equipment requires only migration of retain data. The procedure for migration to target equipment depends on the state of retain data. If the number of variables with retain data option is less, re-enter data on the target FCN-500 or FCN-RTU without migrating retained data from FCN/FCJ Simulator. Otherwise, migrate the retain data using the following procedure.

1. Save retain data specified using FCN/FCJ simulator to the CPU module using the same procedure for a real FCN-500 or FCN-RTU. Retain data of FCN/FCJ Simulator is saved as a csv format file named "RETAIN.CSV" on the PC in the following folder:

<FCN/FCJ Simulator's installed path>\WorkSpace\Current \USERS\STARDOM\RETAIN If FCN/FCJ Simulator is installed in its default location, this folder corresponds

to: C:\YOKOGAWA\FCN-FCJ\FCXSim\WorkSpace\Current \USERS\STARDOM\RETAIN

2. Download Logic Designer projects not used by FCN/FCJ Simulator to the target FCN-500 or FCN-RTU.

3. Execute FcxBackup command for the target FCN-500 or FCN-RTU. This backs up data on the CPU module of the target FCN-500 or FCN-RTU to a folder named “Backup” on the PC.

4. Copy the “RETAIN.CSV” file saved in step 1 to overwrite backup data saved in step 3. The folder is: \BACKUP\JEROS\USERS\STARDOM\RETAIN

5. Switch the target FCN-500 or FCN-RTU to Maintenance mode, and restore the data saved in item 3 using an FcxRestore command. At the same time, retain data copied in step 4, in other words, retain data used by FCN/FCX Simulator, is also restored.

6. Reboot the FCN-500 or FCN-RTU. Download the project used by FCN/FCJ Simulator and perform a warm start.

This procedure restores retain data stored on the CPU module under the same conditions described under TIP of ”● Behavior of Retain Data on FCN-500, FCN-RTU Start Mode” of Section 2.2.5, “Retentive Variables (Retain Data) Considerations”

Page 87: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 79

TI 34P02K35-02E Apr. 28, 2016-00

5.2 Unit Test and Combination Test Function test can be divided by scope into unit test and combination test. • Unit test The control applications such as its control logic and control loops are tested. • Combination test Including FCN-500 or FCN-RTU application graphics, displays and third-party

equipment/sub-systems, and communication functions. Applications using programming languages such as Java (on FCN-RTU) and VB

(on VDS) are also tested in combination test. Function test normally begins with unit test and moves on to combination test after control applications are checked.

Page 88: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 80

TI 34P02K35-02E Apr. 28, 2016-00

5.3 Unit Test Precautions Unit test focuses on confirming the operation of control applications running on the FCN-500 or FCN-RTU. This section describes know-how and precautions related to unit test.

5.3.1 Pre-unit Test Checklist Check the following items before starting unit test. • Verify the source code. Print out the source code, and check. Besides checking control logic, check that

application meets requirement specification. • Verify that no Logic Designer compile errors and warnings are reported. Check no errors or warnings are displayed in Logic Designer's compile result.

SEE ALSO For details on compile errors and warnings, see Section 4.8, “Handling Compile Errors and Warnings.”

TIP If multiple compile warnings on unused local variables and unused FB instances are reported, they can be removed from all POU variable worksheets by selecting [Build]-[Remove unused variables and FB instances] from the menu bar. This function, however, is only supported by Logic Designer R2.01.01 and later versions.

• Check for unused global variables. Check for the presence of unused global variables following the procedure

described in Section 9.1.8, “Cross References” of Chapter 9, “Advanced Engineering.” Specifically, if unused device label variables are found, determine whether it is intentional or whether application programming is incomplete.

• Verify that no PLC error is reported at download. Verify that no PLC error is reported when the project is downloaded to the FCN-

500 or FCN-RTU through Logic Designer.

Page 89: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 81

TI 34P02K35-02E Apr. 28, 2016-00

5.3.2 Unit Test Methodology Like creation of control application, unit test should be carried out in a bottom-up manner, starting from the smaller logic parts and combining them into larger parts. This section describes this method using the control application example described below. Application Example: Reaction Tank Heating Application This sample heating application consists of several parts as described below, with multiple reaction tanks using the same heating application. - Control loops NPAS_PID (tag name TIC001) for temperature control NPAS_PG_L30 (tag name TIC001PG) for heating program setup - Conditional logics Conditional logic for starting heating Conditional logic for ending heating and logic for transiting to constant state Logic for stopping and restarting heating - User function blocks As the above conditional logics are used in multiple places, they are registered

as user function blocks. START : Conditional logic for starting heating END : Conditional logic for ending heating and logic for transiting to constant

state STOP : Logic for stopping heating

The figure below shows the schematic of the application example.

Temperature control PID�

TIC001

Heating application

Control loops

Heating program setup TIC001PG

Logic for starting heating

START

Logic for ending heating

END

Logic for stopping heating

STOP

Conditional logics

In this example, the basic control involves two main control loops, named TIC001 and TIC001PG, which are activated and deactivated by conditional logic. The conditional logic cannot be tested unless the control loops operate correctly. So, first debug the control loops. Next, debug the user function blocks. At this stage, debug the logic of each user function block by itself, without considering the operation of the control loops.

Page 90: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 82

TI 34P02K35-02E Apr. 28, 2016-00

After debugging each control loops and conditional logics, combine and debug them together. In combined debug, start by debugging the two normal paths: from starting to ending heating and from stopping to restarting heating. After debugging the normal paths, debug the exception paths. Exception paths involve failure of equipment during heating. Assume failure of the temperature detector or control valve, generate IOP or OOP in the analog I/O, and check whether the control application operates correctly.

Besides checking for correct operation, also check whether the operation is correct within the plant environment. For instance, when a failure occurs, consider whether the valve controlling the temperature should be fully-open, fully-closed or maintained at its current state, and whether the operation of the control application is correct within the plant environment. Moreover, if the requirement specification is inconsistent with correct operation within the plant environment, check with the user.

After the first heating application has been successfully debugged, copy it to the other locations where the same application is used. As each destination uses the same logic, provided the copying is done correctly, it should operate the same way as the first debugged location. Hence, when debugging each destination, it is sufficient to check for correct operation of the normal paths.

Page 91: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 83

TI 34P02K35-02E Apr. 28, 2016-00

5.3.3 Unit Test Know-how This section provides some useful know-how for testing a control application.

● Testing Control Loops When testing a control loop that makes use of NPAS POUs, besides checking loop connections such as processing of regulatory data and cascade connection, also check for correct assignment of engineering parameters.

● Testing Control Logics When testing control logic, besides checking for true condition, false condition, also check for concurrent true/false conditions, prevention of chattering and pulse/status type conditions.

• Concurrent true/false conditions Consider an example where the open/close state of a valve having both open

and close signals is used as a condition within a control application. At the time of valve opening or closing, it is possible that open and close signals are both OFF.

Consider another example where the TRUE/FALSE calculation results of two control logics are used as conditions of other logics so that processing is performed when the condition is true. Depending on how the application is programmed or the requirement specification, it is possible that both calculation results may be true at the same time.

With these considerations, investigate and debug possible scenarios of concurrent true results or conditions in control logic and the expected operation under these scenarios.

• Prevention of chattering When the PV value or alarm status of an NPAS POU or the state of a digital

input is used within control logic, chattering may occur under actual plant conditions due to rapid cyclical state changes. However, such chattering may not be observed in the test environment, which differs from the plant environment.

During debugging, investigate the possibility, suppression and handling of chattering.

• Pulse-type data versus status-type data Data used within control logic may be designed as pulse-type or status-type.

For instance, logic for initiating control may make use of a status-type start condition or a pulse-type start trigger.

If a Start PB is also a status-type, control may be started at the time the start condition is true.

With these considerations, consider whether data used within control logic is status type or pulse type and debug accordingly.

Page 92: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 84

TI 34P02K35-02E Apr. 28, 2016-00

● Testing User Function Blocks A function block created as a POU behaves the same way in every location where it is used. Therefore, when debugging a user function block, thorough testing is only required in any one location. Once debugged, it can be expected to operate correctly in every other location, and thus requires only simple verification of correct operation.

● Testing Exception Paths of Control Logic When debugging control logic, in addition to checking normal execution paths, it is important to also check exception paths. For exception paths, consider the following events: - IOP or OOP event due to equipment failure, etc. - Indefinite state of digital input due to equipment failure, etc. - No response to output signal in input signal - Time lag in response to output signal - Disconnection or no response during communication with other equipment In addition to the above, consider other kinds of exception conditions. Besides exception handling described in the function specification, investigate and debug other possible errors and exceptions due to equipment failure, etc.

Page 93: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 85

TI 34P02K35-02E Apr. 28, 2016-00

● Testing Communication Applications Connections between an FCN-500 or FCN-RTU, which uses communication application, and communication equipment can be tested in four steps as described below.

1. Check physical hardware connection with communication equipment and its setup

Check the cable connecting the FCN-500 or FCN-RTU and communication equipment, as well as its wiring system.

The cable to be used varies with the equipment but the following general checklist can be used.

Straight cable or cross cable 2-wire, 3-wire or 4-wire system Pin assignment This check is important as failure to establish communication with other

equipment is often due to improper cable and other physical connections, or invalid connection-related settings.

2. Test communication application After completing the checks described in step (1), check the operation of the

communication application. Connect variables to the ERROR terminal and STATUS terminal of POUs used in the creation of each communication application, and verify that no communication error has been reported. If any communication error is reported, check the error code stored in the variable connected to the STATUS terminal, and fix the application.

3. Check mapping of received data After ensuring the absence of communication error in step (2), check the

mapping of received data. Verify that data of the remote equipment is correctly read and written.

4. Check application which uses received data Steps (1) to (3) check the communication itself. After ensuring the absence of

communication problems, check the operation of the control application, which makes use of the communication data.

Page 94: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 86

TI 34P02K35-02E Apr. 28, 2016-00

5.4 Combination Test Precautions Combination test goes beyond the control applications of FCN-500 or FCN-RTU. With the FCN-500 or FCN-RTU connected to graphics, higher-level computers and other equipment through various means of communication, combination test verifies whether the system as a whole operates correctly, whether it operates correctly even in the event of failures, and whether there are any inconsistencies in the requirement specification.

5.4.1 Combination Test Prerequisites Before starting combination test, ensure that the following preconditions are met. • Unit test of FCN-500, FCN-RTU is completed. The purpose of combination test is to test the operation of the system as a

whole. When a problem is detected in combination test, it takes time to pinpoint whether

the cause lies in the control application itself or other system components. The test is interrupted if control application has bugs.

To avoid this, always complete unit tests of FCN-500 or FCN-RTU control applications before starting combination test.

• Unit tests of graphics and displays are completed. For the same reason explained earlier for FCN-500 or FCN-RTU control

applications, always complete unit tests for any graphics and displays to be connected before starting combination test.

• Communication is successfully established for communication

applications. For equipment to be connected through various means of communication,

ensure that communication is successfully established and data sending and receiving is allowed before starting combination test.

5.4.2 Equipment Used for Combination Test

Combination test is intended for testing not just the control application, but the system as a whole. As such, we recommend using target equipment for combination test is recommended. Using In-house equipment during combination test may result in following:

1. Any problems faults in hardware will go undetected 2. Any missing licnese on target system will go undetected

To avoid these problems, use target equipment during combination test if possible.

Page 95: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 87

TI 34P02K35-02E Apr. 28, 2016-00

5.4.3 Checking Log Files of FCN-500, FCN-RTU System errors such as watchdog errors caused by a sudden increase in CPU load, inter-FCN/FCJ communication interruptions, as well as array boundary errors and division by zero errors caused by control applications, whenever detected, are recorded by the FCN-500 or FCN-RTU in system log files. During the combination test phase, display the FCN-500 or FCN-RTU log files once a day to investigate and rectify reported system errors, if any.

SEE ALSO For details on how to display log files of FCN/FCJ, see Section B2.4.8, “Displaying Log Files” of IM “STARDOM FCN/FCJ Guide.”

5.4.4 System Failure Test

Perform system failure test during combination test. System failure test includes testing for recovery from FCN-500 or FCN-RTU power off, recovery from system-wide power off, operation and recovery after communication disconnection, as well as operation and recovery after failure of one of two duplexed FCN-500 components. This section describes how to simulate failure and recovery of some typical system failures for testing purposes. However, how the system behaves in the event of a system failure depends on the factory condition and requirement specification. Verify that the control operation both after a system failure and after system recovery comply with the requirement specification. In addition to the system failure tests described below, perform other system failure tests as required.

● Recovery from FCN-500, FCN-RTU System Power Off Turn off the system power of the FCN-500 or FCN-RTU. Verify that operation of all equipment other than the FCN-500 or FCN-RTU complies with the requirement specification. Next, turn on the system power of the FCN-500 or FCN-RTU and verify the operation after recovery. Besides checking the operation of the control application, verify that each communication function is restored and retain data is preserved.

• Procedure for checking preservation of retain data 1. Select any one retain data item. 2. Before powering off the FCN-500 or FCN-RTU, save the current data to the

on-board flash memory. 3. Modify the value of the retain data item. As this point, the data on the FCN-500 or FCN-RTU is different from the data

saved on the flash memory. 4. Power off the FCN-500 or FCN-RTU. 5. Power on the FCN-500 or FCN-RTU. 6. After FCN-500 or FCN-RTU startup, check the value of the selected retain

data item.

Page 96: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 88

TI 34P02K35-02E Apr. 28, 2016-00

If retain data is resident in non-volatile memory, the value specified in step 3 should be restored. If retain data is resident in volatile memory, the value saved to the flash memory in step 2 should be restored.

● Operation and Recovery after Power Off of External Field Power Supply of FCN-500, FCN-RTU When the external field power supply of FCN-500 or FCN-RTU is turned off, IOP (input open alarm) or OOP (output open alarm) is reported in device label variables of I/O modules requiring I/O field power. If IOP is reported in an input device variable, this status is sent to applications. If OOP is reported in an output device variable, this status is sent to applications. By turning off and then turning on the external field power supply, compare the actual operation of the control application against the IOP and OOP operation and recovery stated in the requirement specification and ensure that requirements are met. Details on IOP and OOP, as well as the behavior of NPAS POUs under these alarm conditions are described in the online help as shown below.

● Operation and Recovery after Communication Disconnection With the FCN-500 or FCN-RTU running, disconnect the communication using any of the following means and check the operation of the control application. 1. Switch off the connected equipment; 2. Pull out the communication cable; 3. Switch off hubs or other relay equipment, if any, on the communication path; 4. If an FCN communication module is used, unmount the communication

module; or 5. Any other means as required to disconnect communication. After communication is temporarily disconnected, restore the original state by reversing the above operation and check that communication is properly restored.

Page 97: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 89

TI 34P02K35-02E Apr. 28, 2016-00

● Recovery from System–wide Power Off Power off and then power on, not just the FCN-500 or FCN-RTU but the entire system. Check the operation after power is restored.

● Operation and Recovery after Failure of One of Two Duplex CPUs (FCN-500 only) To simulate failure of one of two duplexed CPUs, press the RESET button of the corresponding CPU. When the control CPU is made to fail, control right is transferred to the standby CPU and control continues. However, control switchover causes momentary interruption of the communication over the control network, which is restored shortly after. When the standby CPU is made to fail, control continues with the control CPU running like a single CPU. Verify that control switchover and momentary interruption of the control network do not cause control problems. To recover from single CPU state to duplexed CPU state requires execution of APC (All Program Copy). If automatic APC is enabled, APC is automatically executed after control switchover. If automatic APC is disabled, execute APC manually using Resource Configurator. Moreover, control continues during APC execution, but the control cycle is lengthened by 1 to 2 seconds for one cycle. Verify that there is no problem in control operation during APC execution and after duplexed configuration is restored by APC execution.

SEE ALSO For details on the operation specification and precautions of Duplex FCN-500 CPU modules, see: Section B1.3.3, “Precautions on the Creation of Control Applications” of IM “STARDOM FCN/FCJ Guide.” Chapter C2 , “Duplex CPU Module (FCN)” of IM “STARDOM FCN/FCJ Guide.” Section B7.2, “Operation Using Duplex FCN CPU Modules” of TI “STARDOM Technical Guide”

IMPORTANT

The control and standby CPUs synchronize their timing while accessing process I/O. When I/O is put in disconnected state for debug purposes, process I/O is inaccessible, consequently the control CPU and standby CPU cannot be synchronized. Therefore, when disconnecting I/O, switch the CPU to single mode. Testing control switchover with the control CPU and standby CPU in non-synchronized state is not only meaningless but may even cause abrupt changes in control output. To avoid this, cancel I/O disconnection before testing control switch over.

Page 98: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 90

TI 34P02K35-02E Apr. 28, 2016-00

● Operation and Recovery after Failure of One of Two Duplex Power Supply Modules To simulate failure of one of two duplex power supply modules, unmount one power supply module from the base module or interrupt the power supply to one power supply module. When one power supply module fails, verify that a system alarm is generated but control itself is not affected and continues normally. Verify also that operation is not affected when the failed power supply module is restored.

● Operation and Recovery after Failure of One of Two Duplex Control Networks (FCN-500 only) To simulate failure of one of two duplex control networks, disconnect the cable from one of two duplex control network ports, or power off the Hub on one of two duplex transmission paths. As described in Section 2.1.4, “Measures for Duplexing,” when communication unsuccessful communication diagnostic frames are sent two times, communication on that path is diagnosed as error. Therefore, wait several seconds before checking the operation. After that, restore the control network and again check the operation.

● Operation and Recovery after Failure of One of Two Duplex SB Bus Repeat Modules (FCN-500 only) To simulate failure of one of two duplex SB bus repeat modules, unmount one of the SB bus repeat modules from the base module or disconnect one of the two SB bus cables. When one SB bus repeat module fails, verify that a system alarm is generated but control itself is not affected and continues normally. Verify also that operation is not affected when the failed SB bus repeat module is restored.

● Fall-back Operation of Analog/Digital Output Modules As described in Section 8.1.2, “Checking Operation Specification of Analog/Digital Output” of Chapter 8, “Detailed Description,” an analog/digital output module performs fallback if it detects a loss of line access with the CPU module beyond 4 seconds. Cause output fallback using the following procedure and check the control operation after output fallback is activated. 1. Stop control operation on the FCN-500 or FCN-RTU using Logic Designer’s

Project Control dialog. 2. Press the shutdown button of the FCN-500 or FCN-RTU or execute Shutdown

from the Maintenance homepage of the FCN-500 or FCN-RTU to put the FCN-500 or FCN-RTU in “Power Off OK” state.

Page 99: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 91

TI 34P02K35-02E Apr. 28, 2016-00

5.5 Checking CPU Load and Application Size Section 2.2.2, “Checking FCN-500, FCN-RTU Control Application Size" and Section “2.2.3, “Checking FCN-500, FCN-RTU Performance" describe checking of FCN-500 or FCN-RTU control application size and performance before application creation. These checks performed before application creation give desk-calculated values, which must be verified by actual size and performance during function test.

5.5.1 Checking CPU Load In Logic Designer, display the CPU load and verify that the displayed value is 60% or less.

Procedure for checking CPU load 1. Display Logic Designer’s Control Dialog.

2. Click [Info] on the displayed dialog. 3. The CPU load is displayed on the [Resource] tab screen of the displayed Info

dialog. Other than the CPU load, the free space for retain data is also displayed. This

data is used in Section 5.5.2, “Checking Application Size.”

Page 100: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 92

TI 34P02K35-02E Apr. 28, 2016-00

Precautions when checking CPU load The displayed CPU load includes not only CPU load due to control application execution but also CPU load due to I/O module access. Thus, correct CPU load check must be done with all I/O modules installed on target equipment, and I/O disconnection disabled. The CPU load value displayed with I/O modules not installed or with I/O in disconnected state reflects only CPU load due to control application execution and may be lower than the actual CPU load. Moreover, the displayed CPU load reflects the CPU utilization averaged over certain duration, and thus may not reflect an accurate value immediately after FCN-500 or FCN-RTU reboot or immediately after FCN-500 or FCN-RTU startup following an offline download. If the FCN-500 or FCN-RTU has just been rebooted or started, wait for several seconds before checking the CPU load.

5.5.2 Checking Application Size Among the application size related limits, check retain data size and ADLST size, which are the most restrictive, and calculate their respective utilization rates.

● Checking Retain Data Size The free space for retain data can be checked using the procedure described in Section 5.5.1, “Checking CPU Load.” In the figure shown in Section 5.5.1, the free space for retain data is displayed as 769 KB. In the FCN-500, the actual free space is calculated to subtract the system area (173 KB) from the display size. Based on the maximum retain data size of 700 KB, the calculated utilization rate is 15 %. e.g. (700 - (769 - 173)) / 700 = 15 %

Table Calculation example of retain data Controller Retain data

Controller type

Processor type

Free area on Resources tab

System area (*1)

Actual free area

Maximum capacity (*1)

utilization rate

FCN-500 FCX_B 769 KB 173 KB 596 KB 700 KB 15 % FCX_A, FCX 769 KB 523 KB 246 KB 350 KB 30 %

FCN-RTU FCX_A, FCX 337 KB 0 KB 337 KB 350 KB 4 % *1:System area, maximum capacity are a unique value that depends on the type of processor.

Page 101: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 93

TI 34P02K35-02E Apr. 28, 2016-00

● Checking ADLST Size The ADLST file is named “ADLST.edf” and stored on the PC used for creating the application in the following folder: <Logic Designer’s installed path>Projects\<Project name>\C \Configuration\R\<Resource name> If Logic Designer is installed in its default location, this folder corresponds to: C:\YOKOGAWA\FCN-FCJ\LogicDesigner\Projects

\<Project name>\C\Configuration\R\<Resource name> Click the right mouse button on the “ADLST.edf” file and select [Properties] from the pop-up menu. The file size (enclosed by blue box in the figure below) is displayed on the Properties dialog. In the example shown below, the file size is 2.11 MB and the utilization rate is about 53 %.(Maximum ADLST data size is 4MB.)

Page 102: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 94

TI 34P02K35-02E Apr. 28, 2016-00

5.6 Logic Designer’s Debug Mode Before checking the operation of a control application using Logic Designer, switch Logic Designer to Debug mode. This section describes the know-how and precautions when debugging a control application using Logic Designer.

SEE ALSO For details on how to perform debugging in Logic Designer, see Section 4.8, "Hands on: Checking Operation” of TI “STARDOM FCN/FCJ Primer – Fundamental.”

Page 103: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 95

TI 34P02K35-02E Apr. 28, 2016-00

5.6.1 Switching to Debug Mode Switch Logic Designer to Debug mode before debugging.

SEE ALSO For details on how to switch Logic Designer into Debug mode, see ”Switching Logic Designer to Debug Mode” of TI “STARDOM FCN/FCJ Primer – Fundamental.”

If no warning dialog is displayed when switching to Debug mode, as is the case described in the above-mentioned TI document, you can begin debugging after the switchover is completed. When making a switch to Debug mode, however, a warning dialog may be displayed. Some possible warning messages are described below, along with their remedies. 1. If project on FCN-500, FCN-RTU and project in Logic Designer have

different names If the project running on the FCN-500 or FCN-RTU is different from the project

currently open in Logic Designer, the following dialog is displayed.

Explanation of warning The above figure shows that the name of the project currently running on the

FCN-500 or FCN-RTU is “TEST1” while the name of the project currently open in Logic Designer is “TEST2.”

Even if the control applications of the two projects are identical, so long as their project names are different, Logic Designer treats them as different projects.

For this reason, switching to Debug mode is disallowed. Solution for warning This warning will not be displayed if the project running on the FCN-500 or FCN-

RTU and the project currently open in Logic Designer have the same name. In the above example, you can either open project “TEST1”, which is currently

running on the FCN-500 or FCN-RTU, in Logic Designer, or download project “TEST2”, which is currently open in Logic Designer, to the FCN-500 or FCN-RTU .

Either of these solutions will make the two project names identical and thus enable successful switching into Debug mode.

Page 104: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 96

TI 34P02K35-02E Apr. 28, 2016-00

2. If project in Logic Designer has not been recompiled If a control application in Logic Designer is modified, and then try to switch to

Debug mode without recompiling the application, the following warning dialog is displayed.

Explanation of warning This warning message indicates that a control application modified using Logic

Designer has not been recompiled. Even though switching to Debug mode is allowed in this state, the control

application running on the FCN-500 or FCN-RTU is not identical to the control application in Logic Designer.

Thus, this message is displayed to warn that incorrect online values may be displayed in Logic Designer.

Solution for warning Re-compiling the control application and downloading it to the FCN-500 or FCN-

RTU will remove this warning and the possibility of incorrect online values being displayed.

3. If project on FCN-500, FCN-RTU and project in Logic Designer have

different contents If the project on the FCN-500 or FCN-RTU and the project open in Logic

Designer have the same name, but what is compiled in Logic Designer is different from the control application on the FCN/FCJ, the following warning dialog is displayed.

Description of warning This above warning message indicates that the control application on the FCN-

500 or FCN-RTU is not identical to the control application open in Logic Designer.

Specifically, the project currently running on the FCN-500 or FCN-RTU is compiled on “07/02/2008 at 10:50:52 AM” while the project open in Logic Designer is compiled on “07/02/2008 at 10:51:17 AM.”

Even though switching to Debug mode is allowed in this state, this message is displayed to warn that incorrect online values may be displayed in Logic Designer as the two control applications are not identical.

Solution for warning Downloading the control application to the FCN-500 or FCN-RTU will remove

this warning and the possibility of incorrect online values being displayed.

Page 105: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 97

TI 34P02K35-02E Apr. 28, 2016-00

● Checking Project Content by Switching to Debug Mode As described in item 3 above, switching to Debug mode displays a warning message if the control application on the FCN-500 or FCN-RTU and the control application in Logic Designer are not identical. This function can be used to check whether control applications on the FCN-500 or FCN-RTU and in the Logic Designer are identical. Example: Logic Designer projects of the same name are found on multiple PCs but it is

unknown which one is identical to the control application currently running on the FCN-500 or FCN-RTU.

For this example, connect each of the PCs to the FCN-500 or FCN-RTU in turn, open the project on the PC in Logic Designer and switch to Debug mode. If the control application on the PC is not identical to that on the FCN-500 or FCN-RTU , the warning dialog shown in item 3 will be displayed. On the contrary, if the warning dialog shown in item 3 is not displayed, it means that the Logic Designer project on that PC is identical to the project running on the FCN-500 or FCN-RTU.

Page 106: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 98

TI 34P02K35-02E Apr. 28, 2016-00

5.6.2 Basic Operation in Debug Mode Switching Logic Designer to Debug mode enables modification of variable values and device label variable values, use of the Watch window, and thus debugging.

SEE ALSO For details on the use of Debug mode and the Watch window, see Section 4.8, "Hands on: Checking Operation” of TI “STARDOM FCN/FCJ Primer – Fundamental.”

5.6.3 Disconnecting I/O Modification of status information of device label variables and input of value to device label variables can only be carried out by first switching Logic Designer to Debug mode. In a debug environment with no equipment connected to the I/O of the FCN-500 or FCN-RTU, put I/O in disconnected state before modifying status information and entering values to device label variables.

● Overview of I/O Disconnection In normal state, the CPU module of an FCN-500 or FCN-RTU accesses I/O modules to read and write I/O information during each scan cycle. In normal state, even if you switch Logic Designer to Debug mode, and modify status information or I/O values, these values will be overwritten in the next scan cycle.

Moreover, as no equipment is connected to I/O, IOPs and OOPs are generated, and all NPAS POUs reading I/O will reflect BAD status in their data and will not run normally. To resolve this problem requires changing the status information of device label variables from IOP or OOP to Normal. As described above, this change cannot be done in normal state so the NPAS POUs remain in BAD state.

Stopping CPU module’s access to I/O modules and putting I/O in disconnected state allows I/O values and status information to be changed.

CPU module

I/O module

FCN in normal state

Accesses I/O in each task cycle

CPU module

I/O module

FCN in Disconnected I/O state

No I/O access

The above figure shows the relationship between the CPU module and I/O module of an FCN-500 or FCN-RTU, but it applies similar to an FCJ. In an FCN-RTU, the CPU and I/O interface are installed internally. Putting the I/O into disconnected state stops CPU access to the built-in I/O.

Page 107: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 99

TI 34P02K35-02E Apr. 28, 2016-00

● Procedure for Disconnecting I/O Among the list of [SYSTEM] Interface Flags is a global variable named “GS_NFIO_DISCONNF”. To disconnect I/O, switch Logic Designer to Debug mode and change the online value of global variable GS_NFIO_DISCONNF to TRUE.

The initial value of GS_NFIO_DISCONNF is FALSE. To boot up FCN-500 or FCN-RTU in I/O disconnected state, change this initial value to TRUE, perform an offline download, and start the FCN-500 or FCN-RTU.

SEE ALSO For details on how to change the initial value of GS_NFIO_DISCONNF to TRUE and disconnect I/O, see Section 4.4.3, “Disconnecting I/O” of TI “STARDOM FCN/FCJ Primer – Fundamental.”

IMPORTANT

If the initial value of GS_NFIO_DISCONNF has been changed to TRUE for debugging purposes, remember to restore it to FALSE and download the restored project to the boot project before system delivery. If the initial value is left as TRUE, the site FCN/FCJ will be put into disconnected I/O state and no I/O reading and writing will be done.

Page 108: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 100

TI 34P02K35-02E Apr. 28, 2016-00

5.6.4 Entering and Checking Values of Device Label Variables After switching Logic Designer to Debug mode and disconnecting I/O, modify the Status of device label variables to clear IOP and OOP alarms. Then, enter values for device label variables. This section describes the procedure below using the following example device label variables. Analog input : AI001 Analog output : AO001 Digital input : DI001 Digital output : DO001

● Modifying Status Information To modify the status information of the device label variable of an analog or digital input, modify the Status of the variable. To modify the status information of the device label variable of an analog or digital output, modify the Status of its read back variable, which has an “_RB” suffix.

SEE ALSO For details on read back variables with “_RB” suffices, see Section 9.1.3, “_RB and _BOOL Suffix Variables of Device Label Variables” of Chapter 9, “Advanced Engineering.”

The figure on the left shows the read back variable values displayed in the Watch window before I/O disconnection.

Page 109: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 101

TI 34P02K35-02E Apr. 28, 2016-00

Some of the Status values (enclosed by blue boxes) are displayed as “16#8060”, indicating BAD, IOCN and CERR data statuses. In this condition, IOP alarm is generated for analog/digital input and OOP alarm is generated for analog or digital output so NPAS_POU cannot run normally. To remove this condition, modify these Status values from “16#8060” to normal values. Firstly, set the global variable GS_NFIO_DISCONNF to TRUE as shown in the figure on the right to put I/O into disconnected state. This enables Status values to be entered. Next, enter the IOCN status value of 16#0040 (normal status) to Status values enclosed within blue boxes. This modifies the data status of these device label variables to normal.

SEE ALSO For details on how to check data status, see ”● How to Check Modes, Status and Alarm in Logic Designer” of Section 9.2.2, “How to Detect Mode, Status and Alarm” of Chapter 9, “Advanced Engineering.”

● Entering Value to Device Label Variable of Analog Input Analog input values input as 4-20mA or 1-5V electrical signals are converted to range 0-100% by the I/O module, and written to Value of the device label variable. Value of a device label variable is of UINT (unsigned integer) data type, and maps proportionally to 0-100% as shown below.

Value Normalized data Hexadecimal Decimal

16#0000 0 -25% 16#1000 4096 0% 16#2000 8192 25% 16#3000 12288 50% 16#4000 16384 75% 16#5000 20480 100%

To enter a value to the device label variable of an analog input, write a hexadecimal or decimal value to Value of the variable. The written value is converted to normalized data by the following formula. Formula for conversion Normalized value = (Decimal input value – 4096) × (25 / 4096) × 100% If entered Value=16#2852=10322 (in decimal), Normalized value = (10322 – 4096) × (25 / 4096) × 100% = 38.000 = 38.0%

Page 110: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 102

TI 34P02K35-02E Apr. 28, 2016-00

● Checking Value of Device Label Variable of Analog Output Values of device label variables of analog outputs are normally MV values of NPAS_ID or NPAS_MLD, etc. or values set by an application, and therefore are not normally entered directly during debugging with I/O in disconnected state. However, analog output values can be checked using Value of their device label variables in the same manner as for analog inputs. Consider an example where the MV value of NPAS_PID is output as device label variable of an analog output, if the MV value of NPAS_PID is 50%, Value of the device label variable will be displayed as 16#3000 (=12288). After changing the status information of a device label variable, change the value of "Value" of the device label variable.

● Reference: Relationship between Analog I/O and I/O Data Processing POU of NPAS_POU The relationship between device label variable of analog I/O and I/O data processing POU of NPAS_POU are described below for reference. • For analog input PV data measured by field equipment are input to an I/O module of FCN-500 or

FCN-RTU as an electrical signal. The I/O module converts the electrical signal to UINT data type and writes it to

the Value of the device label variable. Input data processing POU of NPAS_POU converts the UINT type Value to

normalized data and CDATA_REAL data structure using the input range and engineering unit.

These data conversions are shown for the following example. Example: - Input range 0-200 l/m 4-20mA or 1-5V electrical signal - NPAS_AI_ANLG (standard analog input POU) is used for input data processing (1)

Measured flow rate

(2) Input electrical signal (3) Conversion by I/O module (4) Conversion by NPAS_AI_ANLG

4-20 mA 1-5 V Value of device label variable Normalized data

(5) Engineering volume Hexadecimal Decimal Cdata_REAL

0 mA 0 V 16#0000 0 -25% -50 l/m 0 l/m 4 mA 1 V 16#1000 4096 0% 0 l/m 50 l/m 8 mA 2 V 16#2000 8192 25% 50 l/m

100 l/m 12 mA 3 V 16#3000 12288 50% 100 l/m 150 l/m 16 mA 4 V 16#4000 16384 75% 150 l/m 200 l/m 20 mA 5 V 16#5000 20480 100% 200 l/m

Page 111: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 103

TI 34P02K35-02E Apr. 28, 2016-00

• For analog output For analog output, the conversions are similar to those of analog input but are

performed in the reverse direction. Example:

Outputs MV value of NPAS_PID 4-20mA or 1-5V electrical signal NPAS_AO_ANLG (standard analog output POU) is used for output processing

(1)

NPAS_PID MV value

(2) Conversion by NPA_AO_ANLG (3) Conversion

by I/O module

(4) Output electrical signal (5) Valve

opening Value of device label variable

4-2 0 mA 1-5 V Hexadecimal Decimal 16#0000 0 -25% 0 mA 0 V

0% 16#1000 4096 0% 4 mA 1 V 0% 25% 16#2000 8192 25% 8 mA 2 V 25% 50% 16#3000 12288 50% 12 mA 3 V 50% 75% 16#4000 16384 75% 16 mA 4 V 75%

100% 16#5000 20480 100% 20mA 5 V 100% The figure below shows the data flow for the above analog input/output. The figure shown is for FCN but applies similarly to FCJ.

D/Aconv.

Ele

ctric

al s

igna

l(5) Analog input value

0 - 200 l/m

FCN

CPU module I/O module I/O module

(2) Electrical signal 4 - 20mA 1 - 5 V

(1) 0 - 200 l/m

A/Dconv.

Device label variable

NPAS_AI_ANLG

(1) Analog output value0 - 100 %

Device label variable

NPAS_AO_ANLG

(2) NPAS_AO_ANLG converts engineering volume data into 16#1000 - 16#5000 data

(4) NPAS_AI_ANLG converts 16#1000 -16#5000 data to engineering volume data

(3) Converts electrical signal into 16#1000 - 16#5000 data

(3) Converts 16#1000 -16#5000 data into electrical signal

(4) Electrical signal 4 - 20mA 1 - 5 V

16#1000 to 16#5000 data

16#1000 to 16#5000 data

(5) 0 - 100 %

Page 112: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 104

TI 34P02K35-02E Apr. 28, 2016-00

● Entering value to device label variable of digital input For each digital input, a device label variable, as well as a variable with a "_BOOL" suffix is generated. To enter a value to a device label variable, either write 0 or 1 to the WORD type Value of its device label variable or write FALSE or TRUE to the variable with "_BOOL" suffix.

● Entering and Checking Value of Device Label Variable of Digital Output To enter or check the value of the device label variable of a digital output, you can use either Value of the device label variable or the variable with “_BOOL” suffix in the same manner as for digital input.

Page 113: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 105

TI 34P02K35-02E Apr. 28, 2016-00

5.7 Software Wiring The software wiring function allows analog input and digital input values to be varied from an application. Software wiring is used for debugging without connecting to I/O equipment and external inputs. This section gives an overview of software wiring, together with precautions on its use.

SEE ALSO For details on definition of software wiring, see Section 4.4, “Hands-on: Software Wiring Setup” of TI “STARDOM FCN/FCJ Primer – Fundamental.” The online help documentation also contains the following description on software wiring.

5.7.1 Overview of Software Wiring Software wiring function provides two input form options for selection: closed loop and time series. Use these input forms as required by the application to be debugged. • Closed loop With closed loop software wiring, the value of an input is varied with the value of

an output. Use closed loop software wiring for varying the value of a digital input with a

digital output or varying the value of an analog input with an analog output or pulse width output.

• Time series With time series software wiring, the value of an analog input is increased or

decreased over a specified duration. Use time series software wiring for increasing or decreasing the value of an

analog input cyclically, independent of any analog output. You can specify the time interval for increasing or decreasing the analog value,

as well as the direction of increase and decrease.

Page 114: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 106

TI 34P02K35-02E Apr. 28, 2016-00

5.7.2 Software Wiring Creation and Precautions This section describes how to create software wiring and the related precautions.

● Using the Wizard Software wiring can be created using Logic Designer's Software Wiring Definition dialog but using the Software Wiring wizard shown in the figure below is simpler. As a general rule, use the Software Wiring wizard to create software wiring.

● Setup Items of Software Wiring Wizard The setup items of Software Wiring wizard are described below. 1. Direct/Reverse Action Specify whether the input value is to be varied directly or inversely to the output value according to actual operation in the plant. This setting is enabled only for closed loop wiring. Direct The input is varied directly with the output. If the analog output increases, the analog input is increased and vice versa. If the digital output is ON, the digital input is also turned ON and vice versa. Reverse The input is varied inversely with the output. If the analog output increases, the analog input is decreased and vice versa. If the digital output is ON, the digital input is turned OFF and vice versa.

Page 115: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 107

TI 34P02K35-02E Apr. 28, 2016-00

2. Gain and Bias Specify the gain and bias as values to be added to analog output values to give analog input values. Specify gain and bias values as required. This setting is enabled only for closed loop wiring. 3. First Order Lag Time Constant Specify the first order lag time for varying input valuse with values of the output. If this value is large, the response of input values to variance in output values is delayed. Investigate the response time in the actual plant environment and specify a first-order lag time constant value accordingly. This setting is enabled only for closed loop wiring. 4. Sampling Cycle and Number of Sample Points Specify the sampling interval and the number of output values to be sampled. This setting is enabled only for closed loop wiring. 5. UP time and DOWN time If time-series wiring input is selected, specify the time interval for increasing the analog input value from 0 to 100% or the time interval for decreasing the analog input value from 100% to 0%.

● Instantiating Software Wiring and Starting its Execution Defining a software wiring creates a logical POU for the software wiring but does not start its execution. Like other logical POUs, the created logical POU must be instantiated in a control task for its execution.

● Starting Execution of Software Wiring Software wiring, even after instantiation, does not start execution if I/O is in connected state. To start the execution of software wiring, set global variable "GS_NFIO_DISCONNF” to TRUE to put I/O in disconnected state as described in Section 5.6.3, “Disconnecting I/O.”

● Disabling Software Wiring Canceling I/O disconnection disables Software wiring. When I/O disconnection is cancelled, however, entering of device label variable values in Logic Designer’s Debug mode will be disallowed. For this reason, do not disable software wiring by canceling I/O disconnection. Instead, delete the logical POU of the instantiated software wiring from the task, and then perform an online download.

Page 116: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 108

TI 34P02K35-02E Apr. 28, 2016-00

5.7.3 Precautions When Creating Software Wiring Software wiring varies input values in an application but its operation is somewhat different from real analog and digital inputs. For instance, in the case of real analog outputs in a plant, it takes time for PV values to vary after the MV value of, say, a control valve, has been manually changed, and input values do not vary in a definite manner with variance in analog output values. Similarly for real digital outputs in a plant, it may take some time for real open/close signals or operation stop inputs to respond to open/close or start/stop signals. To model these response delays and the magnitude of input value variance with analog output variance, first order lag time constant, gain and bias can be specified accordingly. Even so, variance by software wiring of analog I/O is definite – after a change in output value, the input value is always increased by the specified gain and bias after a lapse of time specified by the first-order lag time constant. Similarly, a digital signal always responds to a change in an ON/OFF signal after a lapse of time specified by the first-order lag time constant. On the other hand, the response of a PV value to a manual change of the MV value of, say, a control valve in an actual plant, may take a longer or shorter time than expected. Extremely large or extremely small variance in PV value may follow after a manual change of MV value. Moreover, after an open/close or start/stop digital signal output, equipment may fail to work for whatever reason so that the open/close signal or "operation has stopped” signal does not turn on. These phenomena do not happen with software wiring, so the operation of the application under such circumstances cannot be tested during debugging using only software wiring. To perform such tests, remove software wiring, and enter analog/digital input values directly from the Watch window instead. As described above, debugging using only software wiring means that function test cannot be done for deviations from the behavior of software wiring. To overcome this shortcoming, use software wiring in conjunction with input from the Watch window during debugging.

Page 117: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 109

TI 34P02K35-02E Apr. 28, 2016-00

5.8 Using Loop Check Tool The Loop Check Tool, which can be started from Resource Configurator, can be used to display analog/digital input/output values of I/O modules. During testing with I/O equipment connected to an I/O module, if values cannot be read from or written to the I/O equipment, the Loop Check Tool can be used to help pinpoint whether the cause lies on the application side or the hardware side. For details on the Loop Check Tool, see the online help documentation shown below.

Page 118: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 110

TI 34P02K35-02E Apr. 28, 2016-00

5.8.1 Values Displayed in Loop Check Tool Analog/digital data held by various equipment are input as electrical signals to an I/O module. An I/O module performs A/D conversion to convert the analog (electrical) signals to numerical values. Similarly, an I/O module performs D/A conversion to convert numerical values set by the CPU module to analog (electrical) signals before output to various equipment. The Loop Check Tool displays analog/digital input values after A/D conversion and analog/digital output values before D/A conversion.

Analog output valueEngineering volume

D/Aconv.

Analog input valueEngineering volume

A/Dconv.

Digital output valueBOOL data type

D/Aconv.

WORD data type

Ele

ctric

al s

igna

l

Digital input valueBOOL data type

A/Dconv.

WORD data type

16#1000 to 16#5000

16#1000 to 16#5000

FCN

CPU module I/O module I/O module I/O module I/O module

Value displayed in Loop Check Tool

Ele

ctric

al s

igna

l

Ele

ctric

al s

igna

l Ele

ctric

al s

igna

l

The above figure describes the case for FCN but applies similar to FCJ, which has built-in I/O modules.

Page 119: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 111

TI 34P02K35-02E Apr. 28, 2016-00

5.8.2 Locating Problems Using Loop Check Tool When a problem is encountered during testing with input/output equipment connected to an I/O module, the first thing to do is to check the values of the I/O modules.

● If Values are Displayed in Loop Check Tool If values are displayed in Loop Check Tool but the actual input/output values are different from the values of a device label variable, there are three possible cases.

Case 1: Loop Check Tool and device label variable have the same values, which are different from the value of process I/O

Given that Loop Check Tool and device label variable have the same values, we can see from the figure shown in Section 5.8.1, “Values Displayed in Loop Check Tool” that there is no problem from the CPU module up to A/D conversion or D/A conversion by the I/O module.

Thus, the problem lies not on the application side but on the I/O equipment side from A/D conversion or D/A conversion to the I/O equipment. In this case, check the connection between the I/O module and the equipment, and check the hardware settings.

Case 2: Loop Check Tool and process I/O have the same values, which are different from the values of the device label variable

Given that Loop Check Tool and process I/O have the same values, see from the figure shown in Section 5.8.1, “Values Displayed in Loop Check Tool” that there is no problem from the I/O equipment up to A/D conversion or D/A conversion of the electrical I/O signals by the I/O module.

Thus, the problem lies not on the hardware side but on the application side after conversion. In this case, check Resource Configurator settings, Logic Designer’s device label variable definitions and other aspects on the application side.

Case 3: Loop Check Tool, device label variable and process I/O all have different values

This means that there may be problems in application definitions and settings, as well as hardware connections and settings.

Firstly, check the connections and settings on the hardware side, and after successfully making the Loop Check Tool and process I/O display the same values as described in case 2 above, check the definitions and settings on the application side.

Page 120: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<5. Function Test> 112

TI 34P02K35-02E Apr. 28, 2016-00

● If No Values Are Displayed in Loop Check Tool If grey asterisks ('*') characters are displayed for Loop Check Tool values, check the following items. • 24V analog field power supply As described in Section 2.1.1, some FCN-500 or FCN-RTU I/O modules require

analog field power supply. If the I/O module concerned requires 24 V field power supply, verify that 24 DC is

indeed properly supplied. • Terminal connections Verify that cables are correctly and securely connected to each terminal. • 2-wire/4-wire system setting of analog input module Some input modules support switching between 2-wire and 4-wire system

connections to a transmitter. Verify that the switch settings are correct. • State of I/O disconnection Turning on global variable "GS_NFIO_DISCONNF” disconnects I/O. With I/O in

disconnected state, communication between the CPU module and I/O module is not done so no data is displayed in Loop Check Tool.

Page 121: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<6. User Acceptance Test> 113

TI 34P02K35-02E Apr. 28, 2016-00

6. User Acceptance Test (UAT) Before starting user acceptance test (UAT), verify that all function tests have been completed and all specification changes have been addressed. Equipment to be used in UAT may not always be identical to the actual system. In such cases, it is important to obtain prior consent of the user by explaining the differences between the equipment to be used in UAT and the actual system – what they are, how they will be simulated, and what problems may arise from such simulation. This chapter describes a list of items that should be checked and a list of items that should be explained to the user before UAT.

6.1 Pre-UAT Checklist Before starting UAT, perform the following pre-test checks.

6.1.1 UAT Prerequisites Before starting UAT, ensure that the following preconditions are met. • Function test is completed. Verify that operation of all items described in the function specification or

requirement specification from the user have been validated. • All specification changes have been addressed. Verify that all specification changes, if any, arising during control application

creation have been addressed. For any specification change that cannot be addressed in time for the user

acceptance test, confirm when it will be addressed. • FCN-500, FCN-RTU setup is properly done. Verify that hardware setup of the FCN-500 or FCN-RTU has been properly done

as described in Chapter 2, @Basic Design and Function Design“ and Chapter 3, “Hardware Setup.“

• There are no unused device labels. Using the procedure described in “● Detecting Unused Global Variables Using

Cross References” of Section 9.1.8, “Cross References” of Chapter 9, “Advanced Engineering,” verify that there are no unused device label variables.

Page 122: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<6. User Acceptance Test> 114

TI 34P02K35-02E Apr. 28, 2016-00

6.1.2 UAT Implementation Guidelines Verify that the following guidelines are observed in UAT implementation using the following checklist. • Ample time must be allowed for function test. Compare the UAT schedule against the size of created control applications, and

verify that ample time is reserved for function tests. • The list of test items must be complete. Verify that all created control applications are included within the list of test

items. If not all items are included, clarify which items are excluded from UAT and

confirm when and how they will be tested. • Test procedures must be thorough. Verify that the test procedures for all control applications to be tested during UAT

ensure thorough testing of their functions. Specifically, verify that other than normal execution paths, exception paths are

also tested. • System failure test Among the test items described in Section 5.4.4, “System Failure Test,” confirm

which are to be implemented in UAT. For items not to be tested, confirm when and how they will be tested.

SEE ALSO For details on system failure test, see Section 5.4.4, “System Failure Test.”

• Differences between equipment used in UAT and the actual system If there are differences in the equipment to be used in user acceptance test and

the actual system, explain this to the user beforehand.

SEE ALSO For more details, see Section 6.2, “Items Requiring Prior Explanation to Users.”

Page 123: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<6. User Acceptance Test> 115

TI 34P02K35-02E Apr. 28, 2016-00

6.2 Items Requiring Prior Explanation to Users If there are differences between the equipment to be used for UAT and the actual system, it is necessary to obtain prior consent of the user by explaining what the differences are, how the differences are to be tested, and what possible problems may arise.

6.2.1 Differences in Equipment Used from Actual System As explained in Section 5.4.2, “Equipment Used for Combination Test,” even if function test is started using in-house equipment, it is recommended migrating to target equipment when moving from unit test phase to system-wide testing in combination test phase. If UAT is also carried out using target equipment, this will allow testing conditions to approach the actual system. Nevertheless, UAT sometimes has to be performed by in-house equipment for various reasons such as early shipment of target equipment for convenience of construction and installation or non-availability of production equipment when implementing modifications to an existing system. As described in Section 5.1, “Equipment Used for Testing,” if UAT is carried out by in-house equipment, it is highly likely that there are differences from the actual system. Where there are differences, investigate whether such differences will present problems during UAT, how the affected parts are to be tested, etc. and report the results to the user for their prior consent.

IMPORTANT

If early shipment of target equipment is required for convenience of construction or installation, unless the system on site is scheduled to be powered on by the time the control application is delivered, deliver the FCN-500 or FCN-RTU without the CPU module. If the CPU module of the target equipment can be used during UAT, it would simplify system delivery after UAT.

Page 124: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<6. User Acceptance Test> 116

TI 34P02K35-02E Apr. 28, 2016-00

6.2.2 Differences between Process I/O and Software Wiring If I/O equipment or simulator input devices can be connected to all analog and digital inputs and outputs during UAT, everything will be fine but this is often not the case.

● If No I/O Equipment And Input Simulator Device Is Available In UAT, switch the FCN-500 or FCN-RTU to I/O disconnected state, and input I/O values using either software wiring or Logic Designer’s Watch window. In this case, explain to the user the differences between process input and software wiring as described in Section 5.7.3, “Precautions When Creating Software Wiring” and seek the user’s prior consent.

● If Some I/O Equipment or Input Simulator Devices Are Available In this case, I/Os connected to I/O equipment or input simulator devices can be tested in UAT but IOP or OOP alarms will be generated for unconnected I/Os, and control will stop. As selective disconnection of I/O is not allowed, disconnecting only I/Os connected to I/O equipment and input simulator devices cannot be done. In I/O disconnected state, all I/Os, including those connected to I/O equipment and input simulator devices, are disconnected. Review whether intermixing I/Os connected to process I/Os and unconnected I/Os reporting IOP and OOP alarms will cause any system problem, and whether IOP and OOP alarms will affect the application, and obtain prior consent of the user.

6.2.3 Equipment Communicating with FCN-500, FCN-RTU If equipment communicating with an FCN-500 or FCN-RTU, which uses a communication application, is not available during UAT, review how the communication test is to be carried out.

SEE ALSO For details on how to test a communication application, see “● Testing Communication Applications“ of Section 5.3.3, “Unit Test Know-how.”

If communication equipment is not available, check the operation starting from step 3 described in “● Testing Communication Applications.” Explain this to the user beforehand and obtain his/her prior consent.

Page 125: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 117

TI 34P02K35-02E Apr. 28, 2016-00

7. System Delivery Precautions System delivery is the very last process in STARDOM engineering. An unsuccessful system delivery may put to waste all work up to this point or necessitate rebuilding of the system. Thus it can be said that system delivery is the most important process in STARDOM engineering. This chapter describes a checklist and precautions for application delivery.

Page 126: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 118

TI 34P02K35-02E Apr. 28, 2016-00

7.1 System Delivery Checklist Before starting system delivery, check the items described below.

7.1.1 System Delivery Prerequisites Before starting system delivery, verify that all specification changes and problems identified during use acceptance test have been addressed. For any item that cannot be addressed in time for system delivery, confirm with the user when and by whom it will be rectified, as well as how it will be tested.

7.1.2 Forms of Delivery Determine in what form the control application is to be delivered. The actual form of delivery differs widely for new system jobs, system expansion jobs and system modification jobs. Some typical forms of delivery are described below.

● Forms of Delivery for New System Consider the following forms of delivery for a new system job. 1. Delivering equipment used in user acceptance test as is If the user acceptance test and required program modifications were carried on target equipment, which is to be shipped as is after user acceptance test, no special delivery engineering is required except for control application backup described in Section 7.2, “Delivery for New System.” 2. Delivering CPU module and PC This form of delivery is applicable if the FCN-500 or FCN-RTU was delivered early for convenience of construction or whatever reason, and only the CPU module of the target equipment and PC were used during user acceptance test. No special delivery engineering is required except for control application backup described in Section 7.2, “Delivery for New System.” However, as UAT was carried out on in-house equipment, Resource Configurator configuration information may have been modified. Thus, Resource Configurator configuration information must be checked on the site system. 3. Delivering only the CPU module This form of delivery is applicable if the target equipment except for the CPU module was delivered early for convenience of construction or whatever reason, and in-house equipment was used for user acceptance test. As with case 2 above, all FCN500 or FCN-RTU information is saved on the CPU module so no special delivery engineering is required except for CPU module data backup. For the same reason given in case 2, Resource Configurator configuration information must be checked on the site system. Moreover, it is necessary to backup the control application and prepare a procedure instruction sheet for restoring Logic Designer data to the site system.

Page 127: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 119

TI 34P02K35-02E Apr. 28, 2016-00

● Forms of Delivery for System Expansion The forms of delivery for a system expansion job involving adding a new FCN-500 or FCN-RTU to an existing system is the same for delivery of a new system.

● Forms of Delivery for System Modification For jobs involving modification of an existing system, engineering is usually done using the FCN-500 or FCN-RTU and CPU module of in-house equipment as the existing hardware including its CPU module is usually not available for development and testing purposes. Thus, the form of delivery normally includes only the Logic Designer control application, which is to be downloaded to the existing FCN-500 or FCN-RTU from the site PC. In this case, it is necessary to perform retain data setup and Resource Configurator definitions required for the system modification on the site system. Although it is also possible to deliver retain data specified during user acceptance test, we do not recommend doing so as it requires the same procedure described in “● If Both FCN/FCJ and System Card of In-house Equipment Are Used before Migration“ of Section 5.1.4, “Precautions of Migrating Testing from In-house Equipment to Target Equipment.”

IMPORTANT

The required form of delivery depends on the nature of the job and the conditions at the end of user acceptance test. Before delivery, consider carefully what items are to be delivered and in what forms. For a system modification job, it is especially important to consider how system delivery should be done to minimize adverse impact to the existing system.

Page 128: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 120

TI 34P02K35-02E Apr. 28, 2016-00

7.2 Delivery for New System This section describes know-how and precautions relating to delivery of a new system.

7.2.1 Pre-Delivery Preparation Perform the following steps to prepare for system delivery.

● Download Boot Project and Source Download the latest project in Logic Designer to the boot project and source. At this point, verify that the initial value of global variable GS_NFIO_DISCONNF, which enables I/O disconnection, is set to FALSE.

SEE ALSO For details on the importance of the boot program and source, see Section 4.9.2, “Downloading Boot Project and Source,” Section 4.9.4, “Importance of Boot Project” and Section 4.9.5, “Importance of Source.” For details on global variable “GS_NFIO_DISCONNF”, see Section 5.6.3, “Disconnecting I/O.”

● Save Retain Data Save retain data to the on-board flash memory. For more details, see Section 2.2.5, “Retentive Variables (Retain Data) Considerations.”

● Record Various FCN-500, FCN-RTU Information Keep a record of the following information before system delivery. • Revisions of FCN-500, FCN-RTU, Logic Designer and Resource

Configurator Keep a record of software revisions and service packs applied. This information may be required for troubleshooting system problems after the

system is put into operation. This information is also required for system modification jobs. • FCN-500’s, FCN-RTU’s CPU load Keep a record of the CPU load of the FCN-500 or FCN-RTU at the time of

delivery. Compare the CPU load of the system after it is put into operation against this

record. If there is a significant increase in CPU load, investigate the cause. • Check application size Keep a record of the utilization rates of the application space at the time of

delivery as a measure of comparison for future application modifications.

Page 129: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 121

TI 34P02K35-02E Apr. 28, 2016-00

7.2.2 Control Application Backup Back up a complete set of the control application for archival purpose. There are two method of backup . The first method, the contents are backing up to the PC by the command. The second method, the contents are backing up to SD card by the backup function (FCN-500 only). Perform backup on a PC, and save the backup data on a server or a medium other than the PC as required.

● Backing up CPU module of FCN-500, FCNRTU Using the FcxBackup command, copy the content of the flash memory to a PC as backup. • FcxBackup command’s destination folder The FcxBackup command backs up data to a folder named “BACKUP” on a PC.

To back up data of multiple FCN-500s or FCN-RTUs to the same PC, you need to rename the BACKUP folder (say to “FCX01BACKUP”) before the next command execution to avoid overwriting previous backup data. Moreover, the renamed folder (say “FCX01BACKUP”) must be renamed back to “BACKUP” before data restoration.

• Items saved by FcxBackup command The list of items to be saved by FcxBackup command is defined in a file named

“backuplist.txt” stored in the same folder as the “FcxBackup.exe” executable file. The default backuplist.txt file list covers IEC control applications but does not includes files added by Java applications (FCN-RTU only). Read “README.TXT” and edit the “backuplist.txt” file accordingly to add to or modify the list of items to be saved by FckBackup command as required.

● Backing up to SD card (FCN-500 only) The contents on flash memory are backing up to SD card by the backup function. For details, see D3.4, “Backup of all data to SD card (FCN-500)” of IM “STARDOM FCN/FCJ Guide”.

● Backing up Logic Designer Project Using the procedure described in Section 4.10, “Control Application Backup,” compress and save the Logic Designer project into a zwt format file for backup.

Page 130: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 122

TI 34P02K35-02E Apr. 28, 2016-00

7.2.3 System Delivery 1. If delivering equipment used in user acceptance test as is No special delivery engineering is required except for pre-delivery preparation and control application backup. 2. If delivering FCN-500, FCN-RTU CPU module and PC Same as case 1, for this case where the FCN-500 or FCN-RTU was delivered early and only the CPU module and PC are to be delivered after UAT, no special delivery engineering is required except for pre-delivery preparation and control application backup. In addition, prepare a procedure instruction sheet for checking Resource Configurator configuration information for the site system and redefining the configuration accordingly as this work need to be done on-site. 3. If delivering only the FCN-500, FCN-RTU CPU module Same as cases 1 and 2 above, for this case where the FCN-500 or FCN-RTU and PC were delivered early and only the CPU module is to be delivered, no CPU module related delivery engineering is required except for system card backup. In addition, prepare a procedure instruction sheet for decompressing the delivered zwt format backup file and restoring the Logic Designer control application on the site PC as this work needs to be done on-site.

Page 131: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 123

TI 34P02K35-02E Apr. 28, 2016-00

7.3 Delivery for System Expansion For a system expansion job involving adding a new FCN-500 or FCN-RTU to an existing system, pre-delivery preparation is the same as described earlier for a new system. Moreover, delivery engineering for a system expansion job is the same as that for delivering only the CPU module of the FCN-500 or FCN-RTU for a new system.

Page 132: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 124

TI 34P02K35-02E Apr. 28, 2016-00

7.4 Delivery for System Modification For a system modification job, it is important to download the modified application to the operational site system without adversely affecting its operation. Besides the general precautions described below, some systems may require additional precautions to be observed. Review the state of the existing system, and add other work items as required.

7.4.1 Pre-Delivery Preparation and Application Backup As the CPU module of in-house equipment used during user acceptance test is not included in the system delivery, it is necessary to rebuild the system on-site. To prepare for that, perform pre-delivery preparation and application backup as described earlier for delivery of a new system.

7.4.2 System Delivery Save the control application in Logic Designer into a zwt format file for delivery. If the job includes Java applications (FCN-RTU only), deliver the required files.

7.4.3 Preparation for On-site Installation Before starting on-site installation, save the current state of the existing system. As described in Section 7.2.1, “Pre-Delivery Preparation” and Section 7.2.2, “Control Application Backup,” download the boot project and source, save retain data, backup data on the on-board flash memory of the FCN500 or FCN-RTU and back up the control application in Logic Designer.

Page 133: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 125

TI 34P02K35-02E Apr. 28, 2016-00

7.4.4 On-site Installation A general procedure for on-site installation is described below. Some systems may require other additional work to be performed. Review the state of the existing system, and add additional work items as required. 1. Restore the control application Decompress the delivered Logic Designer zwt file to restore the control application on the site PC. Rename the existing project before restoration and then restore the delivered control application using the original name. Other than the above restoration approach, you can also choose to either overwrite the existing project by restoring the delivered application using the same name, or restoring the delivered application using a different name. As a general rule, restore the delivered application using the same name. 2. Compile and download After restoring the control application, compile the project and then download it to the FCN-500 or FCN-RTU in offline mode. When downloading, include both the boot project and source.

SEE ALSO For more details, see Section 4.9.3, “Detailed Description of Download Dialog.”

3. Start the FCN-500, FCN-RTU After download is completed, warm start the FCN/FCJ. If the warning message “After download no warmstart will be possible!” described in Section 2.2.5, “Retentive Variables (Retain Data) Considerations” is displayed, ignore the warning and proceed with download. 4. Resource Configurator Definitions Using Resource Configurator, connect to the FCN-500 or FCN-RTU. Add, delete or modify configuration information required for implementing the system modification. After that, perform a download. 5. Install Java applictions (FCN-RTU only) and other applications, if any. Install Java applications and other applications as required.

Page 134: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<7. System Delivery Precautions> 126

TI 34P02K35-02E Apr. 28, 2016-00

7.5 Procedure Instruction Sheet and Rehearsal Whether delieverying a new system, a system expansion job or a system modification job, always create a procedure instruction sheet for any site work required and conduct a rehearsal beforehand.

● Site Procedure Instruction Sheet A site procedure instruction sheet should be created assuming that the site work is to be carried out by someone other than the engineer who is in charge of the job. A description may be obvious to the job engineer but interpreted differently by another person carrying out the site work. To prevent this, use of ambiguous words and expressions, which can be interpreted in more than one way, should be avoided in the procedure instruction sheet. For instance, the expression “Download to FCN-500” is ambiguous as it does not clarify whether it should be an offline download or an online download. As another example, the expression “Start the FCN-500” is also ambiguous as it does not clarify whether it should be a cold start or a warm start. In some cases, a cold start, wrongly executed, may cause retain data to be initialized.

● Rehearsal After creating the procedure instruction sheet, conduct an in-house rehearsal beforehand. Restore a copy of the site system in-house, and conduct a rehearsal using the procedure instruction sheet to verify that the instructions are good. The rehearsal should be carried out by someone other than the engineer who has created the procedure instruction sheet. This will enable discovery of presumptions or ambiguous expressions, if any, within the procedure instruction sheet.

Page 135: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 127

TI 34P02K35-02E Apr. 28, 2016-00

8. Detailed Description

8.1 Checking Operation Specifications of I/O Modules

8.1.1 Checking Operation Specification of Analog/Digital Input

Compare the operation specification of each module against the requirement specification to ensure that there is no problem.

SEE ALSO For details on the operation specification of I/O modules, see Section A1.6, “I/O Modules” of IM “STARDOM FCN/FCJ Guide.”

Some I/O modules have module-based settings and channel-based settings. Before starting engineering, determine which settings are module-based and which are channel-based. Specify these settings on the actual hardware.

● Module Based Settings The following settings apply to the entire I/O module.

• Input range of NFAV144 (16-point voltage input module) Two input span options are available: 1 to 5V or -10 to10V. Selecting 1 to 5 V sets the input range of all channels to 1 to 5V. If you select -10 to10V, the input span can be specified on channel basis.

• Burnout settings of temperature input module Configures burnout operation on module basis by specifying whether to enable

or disable: burnout detection and selecting between up-scale burnout and down-scale burnout.

• Filter settings for digital input module To prevent false detection due to input chattering for a contact input module,

specify a filter time. The filter time in milliseconds can be selected from the following options: 2, 4 8,

16, 32, 64, 128 and 256.

Page 136: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 128

TI 34P02K35-02E Apr. 28, 2016-00

● Channel-based Settings The following settings apply to individual channels.

- 2-wire/4-wire system setting of current input module Configure the following current input modules for 4-wire system or 2-wire system

according to the type of transmitter to be connected: NFAI141 NFAI143 NFAI841 The setup is done using setting pins located on the printed circuit board on the

right face of the I/O module. The NFAI141 does not require 24V analog field power supply except when used with a 2-wire transmitter. (NFAI43 and NFAI841 requires 24 V analog field power supply.)

SEE ALSO For the wiring diagram of individual I/O modules, see: Section 4.1, “Connections to Analog I/O modules” of TI “FCN/FCJ Installation Guide” Section C1.8, “Connections between I/O Modules and External Devices” of TI “STARDOM

Technical Guide” For details on how to perform setup using the setting pin, see: Section A1.6, “I/O Modules” of IM “STARDOM FCN/FCJ Guide”

- Temperature input module settings Specify signal type, temperature unit, thermocouple type, reference junction

compensation and RTD type for each channel.

Page 137: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 129

TI 34P02K35-02E Apr. 28, 2016-00

8.1.2 Checking Operation Specification of Analog/Digital Output

Compare the operation specification of each module with the requirement specification to ensure that there is no problem.

SEE ALSO For details of operation specification of analog/digital output, see: Section A1.6, “I/O Modules” of IM “STARDOM FCN/FCJ Guide”

Check the requirement specification regarding output fallback upon CPU failure and reverse output, and perform setup accordingly using Resource Configurator.

● Checking Output Fallback Operation - Detection of CPU failure The CPU module and I/O modules of the FCN-500 or FCN-RTU perform

diagnostic communication at the time of each task for Input and/or Output. When an error is generated in the CPU module of the FCN-500 or FCN-RTU, this diagnostic communication cannot proceed. If an I/O module operating normally detects an interruption in diagnostic communication exceeding the designated line access loss time, it assumes a CPU failure.

Line access loss time: 4 seconds (system-defined and not user-configurable)

SEE ALSO For details on the specification of the output fallback operation, see Section C3.2, “Operation When an I/O Module Malfunctions” of IM “STARDOM FCN/FCJ Guide.”

IMPORTANT

As CPU failure detection is implemented through diagnostic communication, a false CPU failure may be detected by an I/O module under the following circumstances even though the CPU is running normally: - Long execution time of control task If the scan cycle is set to 4 seconds or longer, or if control processing

exceeds 4 seconds for whatever reason, the output module will detect a CPU failure.

- SB bus failure If an extension unit is used and a failure occurs in the SB bus cable or SB

bus repeat module, I/O beyond the point of failure will detect a CPU failure.

- Power supply failure of extension unit 2 In a system that uses extension unit 3, if the power supply module of

extension unit 2 fails, the SB bus repeat module of extension unit 2 stops running so extension unit 3 will detect a CPU failure.

- I/O in disconnected state

- CPU control in STOP state

Page 138: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 130

TI 34P02K35-02E Apr. 28, 2016-00

• Analog output module operation settings To define the operation of an analog output module upon detection of a CPU

failure, enable or disable CPU failure detection (output fallback operation) on module basis and then specify the fallback operation upon CPU failure detection on channel basis.

The channel-based setting is valid only if the module-based setting is set to “YES.”

Output fallback (module-based setting) YES: Performs output fallback operation when CPU failure is detected. NO : Ignores any detected CPU failure. Output fallback operation (channel-based setting) HOLD: Maintains current output state when CPU failure is detected. SETV: Outputs specified value when CPU failure is detected. • Digital output module operation settings Operation of a digital output module upon detection of a CPU module can be

configured using a module-based setting. Configuration cannot be done for individual channels.

Output fallback (module-based setting) HOLD : Maintain current output state when CPU failure is detected. OFF : Turns all channels off when CPU failure is detected. NO : Ignores any detected CPU failure.

● Checking Reverse Output Operation To reverse physical current and voltage output so as to match field equipment, enable reverse output operation on channel basis using Resource Configurator. Reverse output operation: YES Reverses physical output Example: 4 to 20mA current output

MV Normal output Reverse output 0% 4 mA 20 mA

100% 20 mA 4 mA

Page 139: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 131

TI 34P02K35-02E Apr. 28, 2016-00

8.1.3 Checking Specification of Pulse Input Pulse input can be implemented using a pulse input module (NFAP135) or using a digital input module (NFDV151, NFDV161).

● Checking Specification of NFAP135 (Pulse Input Module) Using NFAP135 enables input of higher frequency pulses than using a digital input module. Verify that the specification of the pulse transmitter to be used matches the NFAP135.

SEE ALSO Section A1.6.1, “Analog I/O Module (Specification)" of IM “STARDOM FCN/FCJ Guide.”

• Input mode NFAP135 supports five input modes. Dry contact pulse (open-collector contact) Dry contact pulse (relay contact) Voltage pulse 2-wire transmitter current pulse (4 to 20 mA) 3-wire transmitter voltage pulse The connection method, transmitter power supply type, input resistance, etc.

depends on the selected input mode. Verify which mode is used by the transmitter.

• Input frequency NFAP135’s allowable input frequency range is 0 to 10 kHz. Verify that the transmitter’s pulse frequency is within this range. However, NFAP135’s input frequency range is 0 to 800 Hz when dry contact

pulse (open-collector contact) input mode is selected.

• Minimum input pulse width NFAP135’s minimum allowable input pulse width is 40 µs. Verify that the transmitter’s pulse width is larger than this value.

• Other check items Read IM “STARDOM FCN/FCJ Guide”, which provides more details on the

specification of the module.

● Checking Specification of Digital Input Module (NFDV151, NFDV161) NFDV151 and NFDV161 have a function for counting push button input edges, which can be used for pulse input. Verify that the specification of the pulse transmitter to be used is compatible with the NFDV151 or NFDV161.

SEE ALSO Section A1.6.2, “Digital I/O Module (Specification)” of IM “STARDOM FCN/FCJ Guide.”

Page 140: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 132

TI 34P02K35-02E Apr. 28, 2016-00

• Minimum ON detection time and Maximum ON/OFF cycle NFDV151 and NFDV161 have minimum ON detection time of 20 ms and

maximum ON/OFF cycle of 25 Hz. This means that the modules can be used for input of pulses whose ON time for

one pulse is at least 20 ms and whose frequency is up to 25 Hz.

• Limitations of NFDV161 The NFDV161 input module has 64 input channels, but push button input can

only be defined for input channels 1 to 32.

8.1.4 Checking Specification of Pulse Width Output Pulse width output can be implemented using a pulse width output module (NFDV532) or a digital output module (NFDV551, NFDV557, NFDV561).

● Checking Specification of NFDV532 (Pulse Width Output Module) NFDV532 provides 4 channels of Up Pulse/Down Pulse pair for pulse width output. Although not many points can be installed in one I/O module, the module supports high-resolution pulse width output. Check that the specification of the NFDV532 matches the specification of equipment used.

SEE ALSO For details, see Section A1.6.2, “Digital I/O Module (Specification)” of IM “STARDOM FCN/FCJ Guide.”

• Minimum output pulse width NFDV532’s minimum output pulse width is 2 ms and its output unit is 2 ms.

• Defining operation upon CPU failure The operation of NFDV532 when CPU failure is detected is configurable on

module basis but not on channel basis. Details about CPU failure detection are the same as described in Section 8.1.2.

Output fallback setting HOLD : Resets all output channels to OFF after outputting all pulse signals

when CPU failure is detected. OFF : Resets all output channels to OFF when CPU failure is detected. NO : Do nothing when CPU failure is detected.

Page 141: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 133

TI 34P02K35-02E Apr. 28, 2016-00

● Checking Specification of Digital Output Module (NFDV551, NFDV557, NFDV561) Digital output modules can also be used for pulse width output but the minimum output pulse width and increment is the same as the scan cycle.

• Minimum output pulse width The minimum ON/OFF interval for digital output is the same as the scan cycle. Therefore, when using digital output module, the minimum output pulse width

and increment are the same as the scan cycle of the FCN-500 or FCN-RTU. The example below shows an FCN outputting ON/OFF signals at each scan

cycle of 100 ms. As the FCN cannot output ON/OFF signals at intervals shorter than the scan

cycle, the minimum output pulse width is the same as the scan cycle (i.e. 100 ms).

For the same reason, the output increment is also the same as the scan cycle (i.e. 100 ms).

100ms 100ms 100ms 100ms 100ms 100ms 100ms Verify that this specification matches the specification of equipment used. To shorten the minimum output pulse width, shorten the scan cycle.

SEE ALSO For details on how to decide the scan cycle, see Section 2.2.4, “Determining FCN/FCJ Scan Cycle.”

• Defining operation upon CPU failure A digital output module can be used for pulse width output, but unlike a pulse

width output module, its operation remains unaltered upon detection of a CPU failure.

SEE ALSO For details on operation upon CPU failure, see Section 8.1.2, “Checking Operation Specification of Analog/Digital Output”

Page 142: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 134

TI 34P02K35-02E Apr. 28, 2016-00

8.2 Checking Specification of Serial Communication

Serial communication for FCN-500 or FCN-RTU can be implemented by using the serial port of the CPU module or by installing a serial communication module (NFLR111, NFLR121) in the FCN-500.

● When Using Serial Port Some items to be checked and precautions when using the serial port of an CPU module for serial communication are described below. - Serial port name Names of COM ports are system-defined and not configurable by a user. Serial communication port 1: COM1 Serial communication port 2: COM2 to COM4 (for FCN-RTU only) - Confirm transmission specification and perform setup Confirm the transmission specification for the serial port. Perform the required setup from the FCN/FCJ maintenance homepage. - Connecting to RS-422/485 communication equipment If the remote equipment uses RS-422/485 interface, install a RS-232-C/

RS-422/485 converter between the serial port of the CPU module and the remote equipment.

- Precautions when using FCN-500 configured with duplex CPUs When an FCN-500 is configured with duplex CPUs, data transmitted via the

serial port of one CPU module is not copied to the other CPU. As such, serial communication using COM port is not allowed for duplexed FCN-500s, and serial communication modules should be used instead.

Page 143: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 135

TI 34P02K35-02E Apr. 28, 2016-00

● When Using Serial Communication Module Some items to be checked and precautions when using serial communication module for serial communication are described below. The following settings can be specified for each port of the serial communication module using Resource Configurator. - Serial port name The port name of a serial communication module comprises up to 24

alphanumeric, underscore (‘_‘) and hyphen (‘-‘) characters. “COM1”, “COM2”,…,”COM9” are system-defined names and so cannot be

specified as user serial port names. - Confirm transmission specification and perform setup Confirm the following transmission specification items. Connection type (for NFLR121 only) : 2-wire system or 4-wire system Transmission mode : Full duplex or half duplex

Baud rate (bps) : 300, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 76800, 115200

Data bits : 7-bit data or 8-bit data Parity : NONE (no parity bit) ,

EVEN (even parity) or ODD (odd parity) Stop bits : 1 stop bit or 2 stop bits Monitoring of input signal for sending : NONE, DSR, CD or DSR_CD Flow control for receiving : NONE (Always set RTS)

RTS (Set RTS only on sending) API notification on communication error : YES (API notification on communication error)

NO (No API notification on communication error)

IMPORTANT

In NFLR111, the CD is used for the monitoring of the received input signal, and the CS is used for the send flow control. The connection of these signal lines is required.

Page 144: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 136

TI 34P02K35-02E Apr. 28, 2016-00

8.3 Precautions about Multi-tasking The section describes some precautions when creating a control application with multiple tasks. 1. Device Label Definition When defining a device label, in addition to signal type and data range, specify a task for updating the data of the device label. For a multi-tasking control application, specify a task that uses the device label for updating its data. If a task not using a device label is specified for updating its data, this may sometimes affect control adversely. The figure below shows an example of system operation with Task A specified for updating analog input (AI001) and analog output (A001). When Task A runs, input processing is first performed and the value of AI001 is read. Next, this value is used in control calculation processing and the output value at AO001 is determined. After control calculation is completed, output processing is performed and the written value is output at AO001.

AI001 AO001 AI001 AO001

Scan cycle 1

Input proces-

sing

Control/ calculation processing

Output proces-

sing

Input proces-

sing

Control/ calculation processing

Output proces-

sing

Scan cycle 2

Task A

Next, let’s consider a multi-tasking scenario where Task A and Task B have different execution intervals and Task B is incorrectly specified for updating device labels AI001 and AO001, which are used by Task A. In the figure shown below, the value of AI001 is updated by Task B’s input processing. In Task A’s control cycle 1, the updated value is used for control calculation and the output result is written to AO001. However, as the output of AO001 is done by Task B’s output processing, the written output value is not output yet. Next, Task A’s scan cycle 2 is executed. At this time, as Task B is still executing its control calculation, the value of AI001 is not updated. In other words, although the actual value has changed, control calculation is performed using the same value used in scan cycle 1. Moreover, the output result of scan cycle 2 is written to AO001, overwriting the output result of scan cycle 1. As AO001 is output by Task B's output processing, the output result of scan cycle 1 is, in effect, ignored. Next, Task A’s scan cycle 3 is executed. Even at this point, the value AI001 is not updated so even though the actual value has changed, control calculation is done using the same value used in scan cycle 1 and scan cycle 2. Moreover, even though the output result of scan cycle 3 is written to AO001, it is overwritten by the output value of a subsequent cycle and thus ignored.

Page 145: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 137

TI 34P02K35-02E Apr. 28, 2016-00

Scan cycle 1

Task A

Input processing Control/calculation processing Output

processing

Scan cycle

Task B

AI001 AO001

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/ calculation processing

Output proces-

sing

Scan cycle 2 Scan cycle 3

XX

As shown above, with multiple tasks, if the task specified for updating a device label at device label definition is different from the task using the device label in actual control calculation, this may affect control adversely. In the above example, Task A, which uses AI001 and AO001 in its control calculation, must be specified as the task for updating AI001 and AO001. 2. Sharing of Global Variables When sharing data between tasks for a multi-task control application, use global variables, but observe the precautions described below for the sender task and the recipient task. Recipient task Do not read global variables directly. Instead, copy its data to another

variable at the beginning of the recipient task, and then read the copied value.

In the example shown in the next figure, global variable P, which is turned on and off by Task A, is read by Task B, which has a different control cycle. Variable P is read in the first half (at Logic M) and latter half (at Logic N) of Task B’s control/calculation processing, but changed from ON to OFF by Task A between Logic M and Logic N. If Task B reads variable P directly, the value will be ON when Logic M is executed but OFF when Logic N is executed. Similarly, if an application uses a global variable directly, its value may change within the same control cycle.

Page 146: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 138

TI 34P02K35-02E Apr. 28, 2016-00

Scan cycle 1

Task A

Input processing Control/calculation processing Output

processing

Scan cycle

Task B

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/calculation processing

Output proces-

sing

Scan cycle 2 Scan cycle 3

Logic M Logic N

Variable P ON

In the next figure, Task B copies the data of global variable P into variable Q at the beginning of control/calculation processing and reads variable Q during control and calculation processing. In this way, even if the value of variable P changes during Task B’s control/calculation processing, the value read remains unchanged within the same control cycle as the value change will only be reflected in variable Q at the beginning of the next control/calculation processing cycle.

Logic M Logic N

Scan cycle 1

Task A

Input processing Control/calculation processing Output

processing

Scan cycle

Task B

Variable P

ON

Input processing Control/calculation processing

Scan cycle 2 Scan cycle 3

Logic MLogic N

ON

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/calculation processing

Output proces-

sing

Variable Q

Sender task When sending data for a BOOL-type global variable, maintain its ON or

OFF state for a duration not shorter than the recipient's scan cycle. In the example shown in the figure below, pulse-type data of global variable P turned on by Task A, is read by Task B, which has a different control interval at Logic M in the latter half of Task B’s control/calculation processing. Moreover, in compliance with the precaution described earlier for a recipient task, data of variable P is copied at the beginning of Task B into variable Q, which is read during control/calculation processing. The value of variable P is OFF when it is copied into variable Q by Task B. When variable P is subsequently turned on during the Task A’s control interval, this change is not propagated immediately to variable Q so Task B may fail to receive ON states of variable P.

Page 147: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 139

TI 34P02K35-02E Apr. 28, 2016-00

Scan cycle 1

Task A

Input processing Control/calculation processing Output

processing

Scan cycle

Task B

Logic M

OFF

Input processing

Control/calculation processing

Scan cycle 2 Scan cycle 3

Logic M

Variable P

Input proces-

sing

Control/calculation processing

Output proces-

sing

Variable Q

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/calculation processing

Output proces-

sing

To avoid this problem, when sending pulse data via a BOOL-type variable, make the pulse interval longer than the scan cycle of the recipient task. In the figure below, the pulse interval of variable P is longer than the scan cycle of Task B so even though the ON state of variable P is not received by Task B in the first cycle, it is received in the next cycle.

Logic M Logic M

Scan cycle 1

Task A

Input processing Control/calculation processing Output

processing

Scan cycle

Task B

OFF

Input processing

Control/calculation processing

Scan cycle 2 Scan cycle 3

Variable P

Input proces-

sing

Control/calculation processing

Output proces-

sing

Variable Q

Input proces-

sing

Control/calculation processing

Output proces-

sing

Input proces-

sing

Control/calculation processing

Output proces-

sing

3. Sharing of Global Variables on FCN-500 configured with Duplex CPUs When sharing global variables among multiple tasks running on an FCN-500 with duplex CPU configuration, use inter-FCN communication for global variable sharing to guarantee identity of data values on the control and standby sides.

SEE ALSO For details on precautions when creating control applications for an FCN-500 with duplex CPU configuration, See Section B1.3.3, “Precautions on the Creation of Control Applications” of IM “STARDOM FCN/FCJ Guide.”

Page 148: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 140

TI 34P02K35-02E Apr. 28, 2016-00

8.4 Criteria for Selecting Programming Languages in Logic Designer

This section describes the criteria for selecting programming languages to be used in Logic Designer.

8.4.1 Selection Criteria for FBD, LD and ST Graphical languages FBD and LD, and text-based language ST differ greatly in their representation and coding of applications but can all be used to create a given application. Programming language selection is often decided by personal discretion based on an engineer’s knowledge, experience and competency in specific languages rather than a well-defined, standard set of programming language selection criteria. Nevertheless, the same application, coded in different languages, results in different levels of coding complexity and ease of understanding. Given an application, a suitable programming language should be selected not just based on personal discretion but also consideration of its language characteristics.

● Representation Differences between Languages For purpose of comparison, sample applications are used below to illustrate how the same application is represented differently when coded in three different languages, namely, FBD, LD and ST. FBD and LD, both being graphical languages, may have the same representation for some applications.

Page 149: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 141

TI 34P02K35-02E Apr. 28, 2016-00

1. Example of Single-loop NPAS_PID This sample application comprises one analog input, one analog output and one single-loop PID controller. Analog input : AI001 Analog output : AO001 NPAS_PID : FIC001 Tag comment : TEST

The earlier figure shows the sample application represented in FBD or LD, while the above figure shows the same application represented in ST. Comparing these two applications, it can be seen that FBD and LD logic allows easy visualization of the data flow from left to right. In ST logic, inter-block connections are coded using expressions so it is harder to visualize the data flow.

Page 150: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 142

TI 34P02K35-02E Apr. 28, 2016-00

2. Example of Single-loop NPAS_PID with CAS connection to NPAS_PG_L30_BP This sample application adds a program set POU (NPAS_PG_L30BP) to the earlier single-loop NPAS_PID sample by making a cascade connection to terminal CAS_IN of the NPAS_PID. Analog input : AI002 Analog output : AO002 NPAS_PID : FIC002 Tag comment : TEST NPAS_PG_L30_BP : FIC002_PG Tag comment : TProgram The following first figure shows the application represented in FBD or LD, while the following second figure shows the same application represented in ST. It can be seen that FBD and LD logic allows easy visualization of not only the data flow from left to right but also the CAS connection between NPAS_PG_L30BP and NPAS_PID. In the ST application, adding one NPAS_PG_L30_BP adds 11 lines of expressions. The cascade connection between NPAS_PG_L30BP and NPAS_PID is expressed by line 21 of the application.

With the ST application, it is relatively harder to visualize the data flow and CAS connection.

Page 151: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 143

TI 34P02K35-02E Apr. 28, 2016-00

3. Calculation Example This sample application performs the following calculations: b1 = me / ( P/1000.0 ) b2 = WC b3 = P2 / (P2_60F/1000.0) V2 = (b1 * b2 * b3) V2 = V2 * 6.3 / 1000000.0

The left picture shows the FBD, LD application, while the right picture shows the ST application. The FBD, LD application captures the data flow visually, but does not allow intuitive understanding of the computations involved. In comparison, the ST application, which represents the calculations exactly as they are, allows intuitive understanding of the application.

Page 152: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 144

TI 34P02K35-02E Apr. 28, 2016-00

4. Conditional Example 1 This sample application combines a condition with a calculation. Using an IF statement, b=b+1 is executed when variable ‘a’ is OFF.

In the top figure, the FBD application is shown on the left while the LD application on the right. The two applications, though represented somewhat differently, are essentially the same. The lower figure shows the ST application. The FBD and LD applications implement the IF statement using the Return function and Jump function, which is less intuitive for understanding. The ST application, in contrast, represents the IF statement as a conditional and a calculation, which enables intuitive understanding of the application.

TIP Return function: The Return function is coded as “<RETURN>” in Logic Designer. When the condition

of a Return function is true, logic following “<RETURN>” in the logical POU are skipped over, and not executed.

Jump function: The Jump function is implemented using a jump and a label. In the above picture, “-->> THEN_RETURN” represents the jump. When this part of the logic is true, control jumps to the “THEN_RETURN:” part, skipping the execution of the logic in between.

For details on the Jump function and Return function, see Section 9.1.7, “Jump, Connector and Return Functions” of Chapter 9, “Advanced Engineering.”

Page 153: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 145

TI 34P02K35-02E Apr. 28, 2016-00

5. Conditional Example 2 This sample application combines a condition with a calculation. Using a FOR statement, b=b+1 is executed 10 times.

In the top figure, the FBD application is shown on the left while the LD application on the right. The two applications, though represented somewhat differently, are essentially the same. The lower figure shows the ST application. The FBD and LD applications implement the FOR statement using the Jump function, which is less intuitive for understanding. The ST application, in contrast, represents the conditional statement as an expression, which enables intuitive understanding of the application.

Page 154: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 146

TI 34P02K35-02E Apr. 28, 2016-00

● Language Characteristics and Selection • Characteristics of FBD and LD In FBD and LD, data connections and inter-function-block connections are represented as signal lines, which enables easy visualization of data flow, as well as inter-block relationships. FBD and LD languages are thus ideal for programming regulatory control of analog signals. FBD and LD differ in that FBD handles all data as variables, while LD represents BOOL-type data using contacts and coils embedded in ladder circuits. Therefore, among the application examples described earlier, those not using BOOL-type data, namely, “1. Example of Single-loop NPAS_PID“, “2. Example of Single-loop NPAS_PID with CAS connection to NPAS_PG_L30_BP“, “3. Calculation Example“ are identical in LD and FBD. On the other hand, as can be seen from “3. Calculation Example”, “Conditional Example 1” and “Conditional Example 2,” even simple calculations and conditionals are not intuitively represented in FBD and LD. A conditional represented using Jump function and Return jump looks complicated. For all the above reasons, FBD and LD are not suitable for programming calculations, and especially conditionals. • Characteristics of ST In ST, applications are coded as text so data connections and inter-function block connections are represented using “:=”. As such, it does not allow easy visualization of the data flow, as well as inter-block relationships. However, as calculations and conditionals are coded as text, it allows intuitive understanding of even complex calculations. For the above reasons, ST is not suited for programming regulatory control of analog signals but is well-suited for programming applications that involve calculations and conditionals.

Page 155: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 147

TI 34P02K35-02E Apr. 28, 2016-00

● Selecting a Suitable Language The table below summarizes the characteristics of the FBD, LD and ST programming languages.

Regulatory control of analog signals Calculation Conditional

FBD ◎ △ ×

LD △ △ ×

ST × ◎ ◎

◎: Most suitable △: Suitable ×: Not suitable

When selecting a programming language for an application, besides the engineer’s personal competency, consider and investigate the suitability of each language before making a decision. Selection of a language marked as “△: suitable” in the above table should be done only after thorough investigation, while selection of a language marked as “×: not suitable” is not recommended unless the application is very simple. • Investigating “△: suitable” In the example described later in Section 8.4.3, “Combining FBD, LD and ST,”

the part for finding PV values of the two NPAS_PVIs is programmed using FBD, while the part for calculating their difference and turning on a signal according to mode is programmed using ST.

The PV value difference involves a calculation, for which FBD, LD are indicated

as “△: suitable,” while ST is indicated as “ ◎: most suitable,” so programming using any of the three languages should be fine. However, in this particular example, the calculation is combined with a conditional, for which FBD and LD are indicated as “ ×: Not suitable” so finally ST Is selected.

If the requirement specification contains only the PV value difference calculation,

then even programming using only FBD or LD, without combining with ST, would not produce a complicated application.

• Investigating “×: Not suitable” In the same example referred to above, the conditional is a compound

conditional involving both mode and difference. Using FBD or LD, which is marked as “×: Not suitable” for conditional, to program this part would result in complicated logic.

If the requirement specification is a simple comparison between the difference

and a preset value, however, a simple logic can still be created by placing a comparison function (EQ, GT, GE, LT, LE).

Investigate the complexity of conditionals, if any, as described above, and if a

conditional is simple and can be created easily, using FBD or LD is fine. For compound conditions, use ST, which is more suitable than FBD or LD for

programming conditionals.

Page 156: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 148

TI 34P02K35-02E Apr. 28, 2016-00

8.4.2 Selecting between FBD and LD In Logic Designer, one logical POU is generally created using one language. FBD and LD, however, are the exceptions and can be easily combined in the code. For instance, an application can be coded in LD on an FBD logical POU, or coded in FBD on an LD logical POU. As described in Section 8.4.1, “Selection Criteria for FBD, LD and ST,” both FBD and LD are suitable for programming regulatory control of analog signals, and have similar application representation and coding method. Thus, there is no need to differentiate strictly between FBD and LD. Engineering can begin with either FBD or LD, and if required, the application can be subsequently coded with the other language that was not selected initially.

IMPORTANT

If both FBD and LD are used on the same code worksheet, the criterion for deciding the execution sequence of the control application part coded in FBD changes. When coding FBD and LD on the same code sheet, always verify the execution order. For details, see Section 9.1.4, “Execution Order of Control Application” of Chapter 9, “Advanced Engineering.”

Page 157: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 149

TI 34P02K35-02E Apr. 28, 2016-00

8.4.3 Combining FBD, LD and ST Logic Designer does not allow an application to be coded in ST, which is a text-based language, on an FBD or LD logical POU, which is graphical-based. Similarly, it does not allow an application to be coded in FBD or LD on an ST logical POU. However, some applications may be better implemented by combining the features of graphical languages and text-based languages. In these situations, application parts coded in ST can be registered as user function blocks, and combined with application parts created in FBD or LD. This enables creation of an application that exploit the features of both graphical languages and text-based languages.

● Example Combining FBD, LD and ST To illustrate how FBD, LD and ST can be combined, consider the following application: Calculate difference between PV values of two NPAS_PVIs. If control mode is “a” and the calculated difference exceeds a preset value, turn

on signal “A”. If control mode is “b” and the calculated difference exceeds a preset value, turn

on signal “B”. In this application, the part for finding the PV values of two NPAS_PVIs is regulatory control of analog signals, for which FBD and LD are well suited, while the part for difference calculation, comparison against a preset value and mode comparison comprises calculations and conditionals, for which ST is well suited.

PV1

PV2

AI1

AI2

difference = | PV1 - PV2 |If mode = “a”

If difference ≥ preset value, turn on signal A

If mode = “b” If difference ≥ preset value,

turn on signal B

Regulatory control of analog signals

Calculations and conditional decisions

FBD, LD is suitable ST is suitable

NPAS_PVI_2

NPAS_PVI_1

If this application is created entirely using FBD or LD, the part for finding PV values of NPAS_PVIs would be nicely represented but the part for the calculations and conditional decisions would have to be implemented using Return function and Jump function, leading to complicated coding; if created entirely using ST, the difference calculation, preset value and mode comparisons would be simple but the regulatory control of analog signals would not be easily comprehensible. For an optimal solution, the calculations and conditional decisions are coded in ST and registered as a user function block, and then combined with NPAS_PVIs created using FBD and LD. This allows the part for regulatory control of analog signals to be coded in FBD or LD and the part for the calculations and conditional decisions to be coded in ST.

Page 158: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 150

TI 34P02K35-02E Apr. 28, 2016-00

PV1

PV2

AI1

AI2

Regulatory control of analog signals

Calculations and conditional decisions

NPAS_PVI_2

NPAS_PVI_1PV1

PV2 Signal B

difference = | PV1 - PV2 |If mode = “a” If difference ≥ preset value, turn on signal AIf mode = “b” If difference ≥ preset value, turn on signal B

Signal A

Create a user function block containing the calculations and conditional decisions coded in ST, and combine it with FBD or LD.

User function block

In this way, calculation and conditional decision application parts, for which FBD and LD are not suited, are created in ST and then registered as user function blocks so that ST can be combined with FBD or LD to create an easily comprehensible application.

SEE ALSO For details on user function blocks, see Section 4.7, “Application Encapsulation.”

Page 159: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 151

TI 34P02K35-02E Apr. 28, 2016-00

8.4.4 Selecting between SFC and Stepped FBD or LD

● Characteristics of SFC Programming Language The SFC is a step execution type of language, which processes one step after another, and is thus ideal for building process progress type applications and sequence control applications. The figure below shows a schematic of an SFC application.

STEP0

STEP1 ACTION1

STEP2 ACTION2

STEP3 ACTION3

TRANSITION1

TRANSITION2

TRANSITION3

TRANSITION4

In the application shown in the above picture, while the SFC process is at initial step STEP0 and the process transition condition TRANSITION1 becomes true, the process moves to STEP1 and ACTION1 is executed. While the process is at STEP1 and TRANSITION2 becomes true, the process moves to STEP2 and ACTION3 is executed. Similarly, while the process is at STEP2 and TRANSITION3 becomes true, the process moves to STEP3 and ACTION3 is executed. While the process is at STEP3 and TRANSITION4 becomes true, the process moves to initial step STEP0. In this way, processing in SFC progresses one step at a time so SFC is well suited for building process progress type applications and sequence control applications. Moreover, actions of ACTION 1, ACTION 2 and ACTION3 can be coded in FBD, LD, IL or ST language.

IMPORTANT

For ease of explanation, a simple description of actions of ACTION1, ACTION2 and ACTION3 is shown in the above figure; the actual operation of SFC is a little more complex. For details, see Logic Designer’s online help documentation.

Page 160: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 152

TI 34P02K35-02E Apr. 28, 2016-00

● Stepped FBD or LD Application Stepped applications that behave like SFC can be created using FBD or LD. The figure below shows three logical POUs, namely, STEP0, STEP1 and STEP3, created using FBD or LD. In normal FBD or LD applications, STEP0 to STEP3 will be executed in each scan cycle. By using Logic Designer’s Jump and Return functions, however, stepped FBD or LD applications that behave like SFC can be created.

STEP0

STEP1

STEP2

STEP3

JUMP1

JUMP3

JUMP2

RETURN

RETURN

RETURN

Specifically, in STEP0, which is the initial step, transition conditions are monitored. If the transition condition to STEP1 becomes true, it causes a jump to STEP1. After processing in STEP1 is executed, executions of STEP2 and STEP3 are skipped using a Return function, and STEP0 is executed in the next control scan. In STEP0, when the condition for transition to STEP2 becomes true, a jump is made to STEP2, skipping STEP1. After processing in STEP2 is executed, execution of STEP3 is skipped using a Return function, and STEP0 is executed in the next control scan. As described above, to create a stepped application using FBD or LD, monitor transition conditions in each scan cycle in a specific logical POU, and when a transition condition is true, jumps to the corresponding logical POU and executes only that logical POU.

SEE ALSO For details on the Jump function and Return function, see Section 9.1.7, “Jump, Connector and Return Functions” of Chapter 9, “Advanced Engineering.”

Page 161: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<8. Detailed Description> 153

TI 34P02K35-02E Apr. 28, 2016-00

● Selecting between SFC and Stepped FBD or LD There are no definite criteria for selecting between SFC and stepped FBD or LD. The decision is generally by personal discretion based on an engineer’s knowledge, experience and competency. However, the execution of an SFC action block is selected from multiple qualifiers so it is important to understand the the differences about action qualifiers. Moreover, an SFC action block is executed twice, once each on step entry and exit. Before creating applications using SFC, it is important to fully understand these unique behavioral characteristics of SFC.

Page 162: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

Blank Page

Page 163: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 155

TI 34P02K35-02E Apr. 28, 2016-00

9. Advanced Engineering

9.1 General Application Development Know-how This section describes know-how about IEC application development using Logic Designer.

9.1.1 Variable Definitions Variables, function blocks and NPAS POUs used in Logic Designer have variable names for each and they must be registered on the variable worksheet. A variable name not registered in the variable worksheet generates an error at compilation. The figure below shows an example where NPAS_PID_3 on the code worksheet of a logical POU is copied to the code worksheet of another logical POU. In this example, only the image on the FBD is copied but no corresponding variables are defined on the variable worksheet. When compilation is done in Logic Designer in this state, the errors shown on the right of the following picture are displayed. These errors indicate that some variable, function block or NPAS_POU is not defined on the variable worksheet.

To fix such errors, right-click the mouse button on the variable, function block or NPAS_POU causing the error, and select [Object Properties] from the pop-up menu. Simply click [OK] button of property dialog. The variable name of variable, function block and NPAS POU pre-registered by this procedure and fix the error.

Page 164: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 156

TI 34P02K35-02E Apr. 28, 2016-00

9.1.2 Local Variables versus Global Variables When creating an application, local variables and global variables can be defined. This section describes the differences between local variables and global variables, some precautions when defining local variables and global variables, the relationship between device label variables and global variables and other topics.

● Differences between Local Variables and Global Variables Local variables can only be used within the logical POU in which it is defined. Global variables, on the other hand, can be used in all logical POU. The figure below shows four created logical POUs, namely, Main, LogicA, LogicB and LogicC and three code worksheets, namely, LogicA1, LogicA2 and LogicA3, created within LogicA.

Local variables defined on LogicA’s variable worksheet can be used only within the LogicA logical POU, that is, within any of the three code worksheets LogicA1, LogicA2 and LogicA3 but not within Main, LogicB and LogicC. Similarly, a local variable defined on the variable worksheet of Main, LogicB or LogicC can only be used within the logical POU in which it is defined. On the other hand, global variables defined on the variable worksheet for global variables can be read and written in any of the Main, LogicA, LogicB and LogicC logical POUs.

Page 165: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 157

TI 34P02K35-02E Apr. 28, 2016-00

LogicA Worksheet A1 Worksheet A2 Worksheet A3

Localvariables

accessibleLogicC Worksheet Local

variables

accessible

LogicB Worksheet Local

variablesaccessible

Main Worksheet Local

variables

accessible

Globalvariables

accessible accessible

accessibleaccessible

TIP In Logic Designer, local variables have type “VAR”, while global variables have type "VAR_EXTERNAL" or "VAR_GLOBAL." "VAR_EXTERNAL” and “VAR_GLOBAL” are just different type names having the meaning. Logical POUs can have local variables defined with the same name. For instance, in the above example, local variable V001 can be defined in LogicA, while another local variable with the same name V001 can be defined in LogicB.

● Precautions When Defining Variables Up to 15,000 global variables can be defined within one resource. So long as this limit is not exceeded, the system allows a global variable to be defined even if it is in fact used only within one specific logical POU and should really be defined as a local variable. Defining a global variable that really need not be a global variable does not cause a system problem but may lead to confusion in engineering and control application bugs. To avoid this, do not define a variable as a global variable for no good reason. Rather, define a variable as a global variable only when necessary.

SEE ALSO Section 4.1.6, “Application Size”

Page 166: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 158

TI 34P02K35-02E Apr. 28, 2016-00

● Device Label Variable Device labels defined using DeviceLabelDefinition in Logic Designer are automatically converted into device label variables. These device label variables are global variables and so can be used within any logical POU. These created device label variables are sorted by I/O type into four variable groups on the global variable worksheet. DeviceLabel_Input_A : Group for analog inputs DeviceLabel_Input_D : Group for digital inputs DeviceLabel_Output_A : Group for analog outputs DeviceLabel_Output_D : Group for digital outputs

Precautions about device label variables As the four variable groups described above are dedicated to device label variables, do not define other types of global variables within these groups. Defining non device label variables within these groups does not affect control itself but any attempt to open the DeviceLabelDefinition will be disallowed with the following error message displayed.

If this error message is displayed, move non device label variables included within the above four groups to other groups. This will allow DeviceLabelDefinition to be opened.

Page 167: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 159

TI 34P02K35-02E Apr. 28, 2016-00

9.1.3 _RB and _BOOL Suffix Variables of Device Label Variables

When a device label variable is defined, other variables with “_RB” and “_BOOL” suffices may be automatically created. The figure below shows examples of “_RB” and “_BOOL” variables created for each device label variable. Analog input AI001 : no “_RB” and “_BOOL” variable created Analog output AO001 : AO001_RB Digital input DI001 : DI001_BOOL Digital output DO001 : DO001_BOOL, DO001_RB_BOOL, DO001_RB

To summarize, a “_BOOL” suffix variable is generated for the device label variable of a digital input or digital output ,and a “_RB” suffix variable is generated for the device label variable of an analog output or digital output .

● “_BOOL” Suffix Variable of Digital Input/Output Device label variables for digital inputs and digital outputs have data types DTag_I_Sts and DTag_O_Sts respectively. Both of these structure data type have members named Status and Value.

However, as can be seen from the above figures, member Value of DTag_I_Sts and DTag_O_Sts have WORD data type. When accessing ON/OFF data of digital inputs or outputs in a control application, conversion of Value into BOOL data type using the “WORD_TO_BOOL” data type conversion function is necessary. This conversion is automatically performed by the system, which stores the converted result in the variable with “_BOOL” suffix. Specifically, ON/OFF data is extracted from DI001, converted from WORD type to BOOL type, and stored in DI001_BOOL. The same applies to DO001.

Page 168: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 160

TI 34P02K35-02E Apr. 28, 2016-00

DO001: DTag_O_StsAttr : WORD

Value : WORD

Status : WORD

MvRaw : UINT

DO001_BOOL : BOOL

DI001: DTag_I_StsAttr : WORD

Value : WORD

Status : WORD

dummy1 : WORD

DI001_BOOL : BOOL

Conversion from WORD to BOOL data type

Conversion from WORD to BOOL data type

When accessing only ON/OFF data of a digital input or digital output in a control application, use the variable with “_BOOL” suffix. When accessing not only ON/OFF data but also Status data as in NPAS_SIO_**, use the device label variable.

● “_RB” Suffix Variable of Analog/Digital Output For the device label variable of each analog/digital output, a variable with “_RB” suffix is automatically created for read back input. AO001 and DO001, which are device label variables of analog output and digital output respectively, are used for output to external equipment but not for read back. Read back input is via the variable with "_RB" suffix.

FCN

AO001 AO001_RB

FCN

DO001DO001_BOOL

DO001_RBDO001_BOOL_RB

Analog output Digital output

This picture is for FCN but applies similarly to FCJ.

The data type of the read back input variable is the same as the device label variable (DTag_O_Anlg or DTag_O_Sts) and contains structure members named Status and Value. Status stores the status, while Value stores the output value of external equipment.

Page 169: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 161

TI 34P02K35-02E Apr. 28, 2016-00

9.1.4 Execution Order of Control Application For an FCN-500 or FCN-RTU, the execution order of control has major significance. This section describes the concept of execution order, as well as how to determine the execution order and related precautions.

● Synchronization and Execution Order between Multiple Tasks For a multi-tasking control application, each task executes independently without synchronization so execution order of the control application between multiple tasks cannot be considered.

● Execution Order within a Task The execution order of the control application within a task is according to the order of assignment to the control task. In the figure below, three logical POUs are instantiated in control task “Task0.” In this example, the order of execution is according to the order of assignment: LogicA → LogicB → LogicC.

Page 170: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 162

TI 34P02K35-02E Apr. 28, 2016-00

● Execution Order within a Logical POU Multiple code worksheets created within one logical POU are executed from top to bottom. In the figure below, three code worksheets, namely LogicA1, LogicA2 and LogicA3, are created within logical POU “LogicA”. In this execution, the order of execution is from top to bottom: LogicA1 → LogicA2 → LogicA3.

Page 171: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 163

TI 34P02K35-02E Apr. 28, 2016-00

● Displaying Execution Order within a Code Worksheet For a project which has been successfully compiled or “make”, open the code worksheet for which execution order is to displayed and select [Layout]-[Execution Order] from the menu bar. The execution order of POUs within a code worksheet is displayed.

In the figure below, two ANDs are created. The green number displayed within each AND indicates its execution order. In this example, the POUs are executed from left to right.

Page 172: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 164

TI 34P02K35-02E Apr. 28, 2016-00

● Execution Order between Sets of Line-Connected POUs Within a code worksheet coded in FBD or LD, sets of POUs connected by lines (circuit units) are executed from top to bottom, and from left to right. In the following example, the two POUs at the same height on top are executed from left to right, followed by the POU at the bottom.

● Execution Order within a Set of Line-Connected POUs Within a set of POUs connected by lines (that is, within a circuit unit), the execution order of flow branches cannot be specified by a user. To control the execution order, split the circuit. In the single circuit example shown below, POUs indicated with execution order numbers 3 to 5 are not executed from top to bottom.

When the circuit is split into three pieces, the POUs indicated with execution order numbers 3 to 5 are now executed from top to bottom, as described in the case “Execution Order between Sets of Line-Connected POUs.”

Page 173: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 165

TI 34P02K35-02E Apr. 28, 2016-00

● Concept of Reference Position The reference position used for determining relative heights of POUs within a code worksheet differs between FBD and LD. • Reference position for FBD Within a code worksheet created using only FBD, the highest point of each

function, function block and NPAS POU, as indicated in the figure below, is used as the reference position for deciding relative heights.

Reference position

Functions, function blocks and NPAS POUs are executed from top to bottom

according to their reference positions. POUs whose reference positions are at the same height are executed from left

to right. • Reference position for LD Within a code worksheet created using only LD, the reference position for

deciding relative heights is the lowest line connecting the left and right power rails.

In the figure below, two LD logics are coded. It looks like the left LD is higher and would be executed first but in terms of the reference position, which is the lowest line connecting the power rails, the left LD is actually lower and is therefore executed after the right LD.

Page 174: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 166

TI 34P02K35-02E Apr. 28, 2016-00

Reference position

Reference position

In the figure below, the input to contact C006 in the left LD has been changed. As the input to contact C006 no longer connects to the left power rail, the line

connecting contact C006 and coil C007 is no longer the reference position. The new reference position is the line connecting contact C004 and coil C005 as it is the lowest line connecting the left and right power rails. The reference position of the left LD is now higher than that of the right LD so the left LD is executed before the right LD.

Reference position

Reference position

To control the execution order for LDs, do not place two or more LD circuits on

the same row. When inserting circuits in the LD editor, place one LD on each line.

• Reference position for logic combining FBD and LD Within a code worksheet coded with FBD and LD, the reference position of each

function, function block and NPAS POU changes from its highest point to its lowest point.

In the figure below, the reference position of the AND logic is changed from its highest point to its lowest point, which is lower than the reference position of the LD logic so the AND logic is executed after the LD logic.

Reference position

Reference position

Page 175: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 167

TI 34P02K35-02E Apr. 28, 2016-00

In the figure below, the LD logic is connected to the EN terminal of the rightmost OR logic so the reference position of FBD logic is changed to the lowest point.

Moreover, the LD logic has the highest reference position among all logics so it is executed first.

The LD logic is connected to the OR logic so the rightmost OR logic is executed before the AND and MOVE logics on the left.

Reference position

IMPORTANT

The execution order of a control application is decided by a combination of factors including relative height, manner of connection and mixed use of FBD and LD. When determining the execution order, do not rely on visual inspection but rather display the execution order in Logic Designer. Moreover, adding LD to a code worksheet created in FBD or deleting LD logic from a code worksheet created in FBD and LD may cause its execution order to change drastically so always check the execution order after adding or deleting LD logic.

Page 176: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 168

TI 34P02K35-02E Apr. 28, 2016-00

9.1.5 Inter-FCN/FCJ Communication Concept The Inter-FCN-500, FCN-RTU Communication Function Block is used for exchanging data between FCN/FCJs. This section describes inter-FCN/FCJ communication – communication types, overview, selection criteria and related precautions. For details on inter-FCN/FCJ communication, see: “Inter-FCN/FCJ Communication Function/Function Block” of Logic Designer’s FB/FU online help documentation The online help documentation also describes how to use system provided sample

programs for inter-FCN/FCJ communication.

● Types of Inter-FCN/FCJ Communication Two types of inter-FCN/FCJ communications are available: confirmed communication and unconfirmed communication. The required engineering is different depending on which is selected. Confirmed communication In confirmed communication, responses for Read/Write requests are received

from the destination FCN/FCJ. Unconfirmed communication In unconfirmed communication, no response for Read/Write requests is received

from the destination FCN/FCJ. In general, use unconfirmed communication for inter-FCN/FCJ communication unless otherwise required for a specific application. The reasons and selection criteria are described hereafter.

● Overview of Inter-FCN/FCJ Communication To communicate between two FCN-500s or FCN-RTUs, first a connection is established with the destination FCN/FCJ using a function block for connection. After the connection is successfully established, data is sent and received via the connection using function blocks for data access.

FCX02

Function block for data access

Communication data

Function block for connection

FCX01

Function block for data access

Communication data

Function block for connection Connection

Function blocks for connection are required for both confirmed and unconfirmed communications. Either the CONNECT or SD_FCS_CONNECT the function block can be used for this purpose. However, between confirmed and unconfirmed communications, the methods for sending and receiving data differ greatly and the function blocks to be used for data access are also different.

Page 177: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 169

TI 34P02K35-02E Apr. 28, 2016-00

TIP The CONNECT and SD_CFCX_CONNECT_EX function blocks for connection have identical functions except that the assignment of destination IP address and communication port is simple for SD_CFCX_CONNECT_EX so its use is recommended.

● Characteristics and Limitations of Confirmed Communication Characteristics In confirmed communication, READ and WRITE are used as function blocks for data receiving and sending. Confirmed communication allows the source FCN-500 or FCN-RTU to receive responses for READ/WRITE requests from a destination FCN-500 or FCN-RTU, as well as to detect communication errors if no response is received. Communication errors may be due to CPU module failure of the destination FCN/FCJ, communication interruption caused by CPU load increase or communication interruption caused by failure of communication equipment or cables. Moreover, as the source FCN-500 or FCN-RTU directly reads from and writes to variables of the destination FCN-500 or FCN-RTU, a READ/WRITE application needs to be created only on the source FCN-500 or FCN-RTU but not on the destination FCN-500 or FCN-RTU. In the figure below, FCX01 writes data directly into variables of FCX02, and reads data of variables of FCX02 directly.

FCX02

Function block for connection

FCX01

Function block for sending

Transmission data

Function block for connection Connection

Variables written into

Variables read fromFunction block for

receiving

Received data

Limitations As described earlier, in confirmed communication, a source FCN/FCJ directly accesses the variables of the destination FCN/FCJ to read and write data. For this function to work, the PDD (Process Data Directory) property must be turned on for the destination variables. By adding the PDD property, variable data is stored in the PDD database to enable directly reading and writing by other FCN/FCJs. However, as PDD has a size limitation, and the process alarm function of NPAS_POU also uses the PDD, if much data is communicated via confirmed communication, the number of NPAS POUs that can be defined is reduced. Moreover, as writable name of destination FCN-500 or FCN-RTU is specified in source FCN-500 or FCN-RTU, any change in the instance name of destination variables will require modification of the application on the source FCN-500 or FCN-RTU.

Page 178: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 170

TI 34P02K35-02E Apr. 28, 2016-00

● Characteristics and Limitations of Unconfirmed Communication Characteristics In unconfirmed communication, USEND and URECV are used as function blocks for data sending and receiving. These function blocks for sending and receiving must be created on both the source FCN-500 or FCN-RTU and destination FCN-500 or FCN-RTU as a pair. In the figure below, transmission data of FCX01 are transmitted by USEND and received by URECV of FCX02. Similarly, data of FCX02 are sent by USEND and received by URECV of FCX01.

FCX02

Function block for receivingURECV

Received data

Function block for connection

Function block for sendingUSEND

Transmission data

FCX01

Function block for sendingUSEND

Transmission data

Function block for connection Connection

Function block for receivingURECV

Received data

Limitations In unconfirmed communication, a destination FCN/FCJ dose not sent responses so any communication error also cannot be detected. On the other hand, as unconfirmed communication does not require the PDD property to be turned on for destination variables, it does not affect the PDD size even if much data is sent or received. Moreover, as the application on the source FCN/FCJ is programmed using USEND/URECV without variable name of destination, any change in communication variables will only require modification of the assignment of USEND/URECV on the FCN/FCJ affected by the change.

● Criteria for Selecting between Confirmed Communication and Unconfirmed Communication Although unconfirmed communication does not use check mechnism by responses from a destination FCN-500 or FCN-RTU, it allows normal inter-FCN/FCJ communication so long as the source and destination FCN/FCJs are running normally, and there is no problem in the control network. Moreover, The PDD-related limit does not apply. Thus, unconfirmed communication should be used for inter-FCN/FCJ communication in general unless there is a requirement to detect communication error, in which case confirmed communication should be selected.

Page 179: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 171

TI 34P02K35-02E Apr. 28, 2016-00

● Limit on Number of Destination FCN/FCJs Up to 15 connections can be established for one FCN-500 or FCN-RTU. This means that one FCN-500 or FCN-RTU can communicate with up to 15 destination FCN-500s or FCN-RTU s. Moreover, multiple connections can be established with the same destination FCN-500 or FCN-RTU but this would reduce the maximum number of destination FCN-500s or FCN-RTU s allowed for communication. For instance, if 5 connections are established with the same destination FCN-500 or FCN-RTU, this leaves 10 connections remaining so the maximum number of destination FCN/FCJs allowed for communication would be 11. If 15 connections are established with the same destination FCN-500 or FCN-RTU , communication with other FCN-500s or FCN-RTU s will not be allowed.

IMPORTANT

Although multiple connections can be established with the same destination FCN-500 or FCN-RTU, it is really not required. One connection is adequate for communicating with one destination FCN-500 or FCN-RTU even if the communication involves both unconfirmed and confirmed communications, as well as much communication data. If you specify a virtual IP address in the control network duplexed setting, the control network duplex communicaion in inter-FCN/FCJ is possible . The control network duplexed communication is possible only in the ports 1 and 2 of the FCN-500. The port 3 and 4 in NFCP502 can't be used it. The control network duplexedx communication can not be carried out beyond the router.

● Setup of Inter-FCN/FCJ Communication via Routers In inter-FCN/FCJ communication, the role of an FCN/FCJ as server (waiting for connection) or client (initiating connection) is decided automatically from the destination IP address and own IP address by comparing which value is larger. However, when communication is via routers, IP address values cannot be compared so an FCN-500 or FCN-RTU must be explicitly specified as a server or client in Logic Designer. For inter-FCN/FCJ communication via routers, one FCN-500 or FCN-RTU must be specified as a server while the other FCN-500 or FCN-RTU must be specified as a client. This is done by including “-srv” (for server) or “-clt” (for client) when specifying the IP address for the CONNECT or SD_CFCX_CONNECT_EX function block for connection. Example: Using SD_FCS_CONNECT Specify '192.168.1.1 -srv' to run a server. Specify '192.168.1.1 -clt' to run as client.

Page 180: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 172

TI 34P02K35-02E Apr. 28, 2016-00

● Efficient Data Sending/Receiving Inter-FCN/FCJ communication processing is performed for each function block for sending/receiving. Thus, for send/receiving the same data size, reducing the number of function blocks for sending/receiving increases communication efficiency. Example: Sending 10 data using unconfirmed communication USEND_1V x 10 USEND_5V x 2 USEND_10V x 1 Any of the above ways can be used. However, using USEND_1V requires 10

send processing while using USEND_10 requires only one send processing, thus reducing the total time required for send processing.

Moreover, using array data allows more data to be transmitted each time. Example: Sending 100 REAL-type data using unconfirmed communication Sending one data each time : USEND_10V x 10 Sending data collectively using AR_REAL61 : USEND_10V x 1 Again, any of the above ways can be used. Sending one data each time requires ten USEND_1Vs. AR_REAL61 is a system-defined array type for storing 61 REAL-type values. Consolidating the 100 data in this array type requires two variables, and one USEND_10V for sending.

Page 181: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 173

TI 34P02K35-02E Apr. 28, 2016-00

● Example Applications of inter-FCN/FCJ Communication Two example applications using inter-FCN/FCJ communication are briefly described below. - Data sharing by multiple tasks on duplex CPU configuration In an FCN-500 configured with duplex CPUs, if global variables are shared by

multiple tasks, data identity on the control and standby CPUs cannot be guaranteed.

This program can be resolved using, inter-FCN-500 communication to the FCN-500 itself.

As inter-FCN/FCJ communication is executed during the CPUs’ idle time, the

received data is updated at the beginning of the task on both the control and standby CPUs.

This guarantees identity of the control and standby CPUs and enables sharing of global variables.

Specifically, specify a its own IP adress for inter-FCN communication. This

establishes a connection from an FCN-500 to itself for inter-FCN communication. As the two IP addresses are identical so that automatic assignment of client and

server roles by comparison of IP addresses cannot be done, specify one of the inter-FCN communication applications explicitly as a client, and the other as a server.

- Checking the status of remote FCN-500, FCN-RTU using confirmed

communication As described earlier, confirmed communication allows the source FCN-500 or

FCN-RTU to receive responses for READ/WRITE requests from a destination FCN-500 or FCN-RTU, as well as to detect communication errors if no response is received.

Communication errors may be due to communication interruption caused by

CPU load increase of the destination FCN-500 or FCN-RTU, CPU module failure, or communication interruption caused by failure of communication equipment or cables.

Using confirmed communication, an FCN-500 or FCN-RTU can detect whether

there is a communication error and thus determine whether the destination FCN-500 or FCN-RTU is normal.

Page 182: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 174

TI 34P02K35-02E Apr. 28, 2016-00

9.1.6 How to Create User Data Types Logic Designer allows an engineer to define customized data types, known as user data types. This section describes how to define user data types, and provides some examples on the use of user data types.

● Creating a WorkSheet for User Data Type Definitions To create user data types, first create a worksheet for user data type definitions, and then define data types on the created worksheet. The procedure is described below. 1. Click the right mouse button on “Data Type” in Logic Designer’s Project Tree

window, and then select [Insert]-[Datatypes] from the pop-up menu.

2. On the displayed dialog, enter a worksheet name to create a worksheet for

coding user data types. 3. In the figure below, a worksheet named “User_Data_Type” is created. User data

types can now be defined on this worksheet.

Page 183: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 175

TI 34P02K35-02E Apr. 28, 2016-00

● User Data Type Definitions Some sample user data type definitions are shown below. - Lines 2 to 4 in the figure below Defines a data type named “AR_LREAL20”, which is an array of 20 LREAL-type

data. - Lines 7 to 9 in the figure below Defines a data type named “CData_REAL20”, which is an array of 20

CData_REAL-type data; CData_REAL is a system-defined structure data type. - Lines 13 to 20 in the figure below

Defines a structure data type named “TEST_TYPE” comprising one BOOL-type data named “A”, one REAL-type data named “B” and one DINT-type data named “C”.

● How to Define a 2-dimensional Array In the figure below, line 2 defines an array data type of 20 REAL-type data, while line 3 defines an array data type of 3 data of the type defined in line 2.

The above two lines creates a two-dimensional array comprising 20 rows and 3 columns as shown below.

Data[1][1] Data[1][2] Data[1][3] Data[2][1] Data[2][2] Data[2][3]

: : : : : :

Data[20][1] Data[20][2] Data[20][3]

Page 184: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 176

TI 34P02K35-02E Apr. 28, 2016-00

● Examples on Use of User Data Types Described below are some examples where definition of a user data type simplifies programming of the application.

- Buffer for storing timestamp data and REAL-type data Example: To store REAL-type data of an FCN-500 or FCN-RTU together with

timestamp Define a structured data type of STRING-type and REAL-type data to be used as

data buffer. Get the FCN-500’s or FCN-RTU’s clock time as STRING-type data using

PAS_GETTIME, and store it in STRING data. Store the REAL-type value inREAL data.

In this way, REAL-type data can be stored with FCN-500’s or FCN-RTU’s clock time (timestamp) in one variable.

- Data type used for inter-FCN/FCJ communication Example: To send 100 CDATA_REAL type data using inter-FCN/FCJ

communication As described in Section 9.1.5, “Inter-FCN/FCJ Communication Concept,” consolidating data before transmission helps to increase efficiency of inter-FCN/FCJ communication. In this example, if one data is sent each time, 10 data communication function blocks are required. Defining an array data type of 100 CData_REAL type data, however, enables the same data to be sent/received using one variable, thus increasing the efficiency of inter-FCN/FCJ communication.

● System-defined Array Types The figure below shows system-defined array data types available in Logic Designer. When programming an application, if the required number of array elements matches one of the system-defined array data types, it can be used without the need to define a new user data type.

Page 185: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 177

TI 34P02K35-02E Apr. 28, 2016-00

9.1.7 Jump, Connector and Return Functions Logic Designer provides the Jump, Connector and Return functions. This section describes how these functions can be used.

● Overview of Jump, Connector and Return Functions - Jump function The Jump function causes execution of an application to jump from one point

(the source) to another specified point (the destination) on a code worksheet, skipping the execution of logic between the source and destination of the jump. This function can be used just like a GOTO statement.

- Connector function In FBD or LD, terminals are connected using connection lines. When a

connection cannot be made directly because the terminals are too far apart, there are intervening blocks, or some other reason, the Connector function can be used instead.

The Connector function enables connection of faraway terminals. - Return function The Return function returns execution to the higher level, skipping the execution

of processes that are after the Return in the execution order.

● Common Characteristics All three of the Jump, Connector and Return functions can be used only within the same program. In the figure below, program LogicA has 3 code worksheets named LogicA1, LogicA2 and LogicA3.

Page 186: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 178

TI 34P02K35-02E Apr. 28, 2016-00

When creating a jump in program LogicA, jumping into LogicA1, LogicA2 or LogicA3 is allowed but jumping from LogicA into another program such as LogicB or LogicC is not allowed. Similarly, when creating a connector in program LogicA, connecting into LogicA1, LogicA2 or LogicA3 is allowed but connecting from LogicA to another program is not allowed. If a return is created in LogicA1 of LogicA, LogicA2 and LogicA3, which are after the Return in the execution order, will not be executed but other programs such as LogicB and LogicC will be executed.

● How to Create Jumps, Connectors and Returns To create a jump, connector or return, select [Objects] from Logic Designer’s menu bar, followed by [Connector/Jump] or [Return].

In the case of a jump or connector, the following dialog is displayed. Enter a name for the connector or jump.

Page 187: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 179

TI 34P02K35-02E Apr. 28, 2016-00

● Jump Example In the logic below, the output of AND is connected to jump “>>JUMP01” and a label “JUMP01” is coded below ADD. In this example, while the AND is true, execution jumps from jump "JUMP01" to label "JUMP01" so the ADD, which lies in between, is not executed.

● Connector Example In the logic below, connector “CONNECT” is connected to the output of the topmost AND, and also connected to the AND and OR on the bottom row. As shown here, one connector can be connected to multiple terminals to implement connection branching. A connector link has the same meaning as a line connection, and thus produces the same execution order for logic.

Page 188: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 180

TI 34P02K35-02E Apr. 28, 2016-00

● Return Example In the logic below, a “RETURN” is connected to the output of the topmost AND. In this example, when the topmost AND is true, processing of the program ends so both the ADD and the bottommost AND are not executed.

● Language Restrictions The table below shows the language combinations allowed for Jump, Connector and Return functions.

Jump function

Connector function

Return function

FBD

LD

ST × ×

: Allowed ×: Prohibited

Page 189: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 181

TI 34P02K35-02E Apr. 28, 2016-00

9.1.8 Cross References Cross references can be used to investigate on which variable worksheet variables, function blocks and NPAS_POUs used in Logic Designer are defined, and on which code worksheets they are used.

● How to Create Cross References To create cross references, select [Build]-[Build Cross References] from the menu bar, or press the [F12] key.

● How to Use Cross References The figure below shows examples of generated cross references.

This example indicates that variable “V000” is written in one place but referenced (read) in 4 places in Logic Designer. Double-clicking the mouse button on any cross reference line displays the corresponding worksheet.

Page 190: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 182

TI 34P02K35-02E Apr. 28, 2016-00

● Printing Cross References Generated cross references cannot be printed directly. To print cross references, first export the data to a CSV formatted file, and then print the CSV file. • How to export cross references Select [File]-[Export] from Logic Designer’s menu bar. On the displayed dialog shown on the right below, select [Cross references] to

export cross reference data to a file.

● Detecting Unused Global Variables Using Cross References A variable defined on the variable worksheet of a Logical POU but not used within its code worksheet generates a warning during compilation. A global variable, however, even if not used in any code worksheet, does not generate any warning during compilation. Unused global variables, however, can be identified using the Filter function of cross references. • Procedure for detecting unused global variables Global variables can be classified into system global variables or user global

variables. The procedure for detecting unused user-defined variables is described below.

1. Save the Logic Designer's project in zwt format for backup. 2. Open the global variable worksheet. 3. Global variables belonging to groups displayed with “[SYSTEM]” in their

group names are system global variables. With all system global variables selected, click the right mouse button and select [Disable/enable variable] from the pop-up menu. The system global variables are crossed-out in the display and disabled.

Page 191: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 183

TI 34P02K35-02E Apr. 28, 2016-00

4. Generate cross references in this state.

5. Right-click on the Cross References window, and select [Filter]. On the

display dialog, tick the “Unreferenced Variables” and “Global” checkboxes. Click [OK]. Only global variables with no reference, in other words, unused variables, are displayed.

6. From the figure below, we can see that device label variable DI001, DO001, etc. are unused.

Page 192: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 184

TI 34P02K35-02E Apr. 28, 2016-00

9.1.9 Specifying Retain Data and OPC Property Variables used in Logic Designer are, by default, neither specified as retain data nor specified with OPC property. To configure a variable as retain data or to access a variable from other equipment using the OPC function requires the variable to be explicitly specified as retain data and specified with OPC property.

● Procedure for Specifying Retain Data and OPC Property A variable can be specified as retain data or specified with OPC property either from the Variable Properties dialog or the variable worksheet. The left figure below shows the Variable Properties dialog while the right figure below shows the variable worksheet. In either case, ticking the RETAIN (or Retain) checkbox or OPC checkbox displayed within blue boxes specifies the corresponding variable as retain data or adds the OPC property to the variable.

● Parameters of NPAS_POUs Access parameters and engineering parameters of NPAS_POUs are specified as retain data and specified with OPC property within the system. Hence, all these parameters can be treated as retain data and data with OPC property without need of any setup.

● Specifying Retain Data and OPC Property for User-defined Variables Variables of user-defined data types can also be specified as retain data or specified with OPC property. However, a large array of a user-defined data type cannot be specified as retain data if the array size exceeds 32768 bytes.

Page 193: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 185

TI 34P02K35-02E Apr. 28, 2016-00

9.1.10 Getting FCN-500, FCN-RTU Time The following function blocks can be used in a control application to get the current time of an FCN-500 or FCN-RTU . PAS_GETTIME (get local time) PAS_GETTIME2 (get current time in milliseconds or convert current time to

milliseconds) The time returned by these two function blocks is the time when they are executed.

TIP Although both PAS_GETTIME and PAS_GETTIME2 functions have “PAS” in their function names, they are not included in PAS_POU but in the FCN/FCJ basic function blocks. As such, the PAS_POU license is not required for using these functions, which can also be used in applications using NPAS_POU.

● Selecting between PAS_GETTIME and PAS_GETTIME2 Both PAS_GETTIME and PAS_GETTIME2 function blocks return FCN-500 or FCN-RTU time information but PAS_GETTIME2 can return time information in milliseconds. Moreover, PAS_GETTIME2 has all the functions of PAS_GETTIME and more so its use is recommended.

● Programming Precautions Some control applications require performing certain processing at a specific time of the day. When programming this kind of application, observe the precaution described below. Example: To perform certain processing daily at 02:00 hours This sample control application gets the current time using PAS_GETTIME or

PAS_GETTIME2, and executes certain processing when the returned time matches a preset time.

If the preset time is 02:00:00 hours, this condition will be true for only one second. During this second, PAS_GETTIME or PAS_GETTIME2 may fail to return the current time if CPU load on the FCN-500 or FCN-RTU is heavy.

To avoid problems, do not compare the returned time against 02:00:00 hours but rather check for change of time from 01:59 hours to 02:00 hours.

IMPORTANT

In duplex CPU configuration, the output value of this POU may be inconsistent. When this output value is used in control logic, results of the left and right CPUs may be inconsistent. Therefore, do not use the output value of this POU in logic for duplex CPU systems.

Page 194: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 186

TI 34P02K35-02E Apr. 28, 2016-00

9.1.11 Precautions When Using Terminal EN of Functions Functions used in Logic Designer have an EN terminal. This section describes some precautions regarding the use of the EN terminal.

● Function of EN terminal When no variable is connected to the EN terminal of a function, the function is executed in every scan cycle. If a BOOL-type variable is connected to the EN terminal of a function, the function is executed only when the variable is TRUE. To illustrate the use of the EN terminal, consider the AND logic shown in the figure below.

No variable is connected to the EN terminal of the AND logic on the left so this logic is executed in every scan cycle. Variable EN01 is connected to the EN terminal of the AND logic on the right. In this case, the AND logic is executed and its result is stored in OUT01 only while EN01 is TRUE. On the other hand, while EN01 is FALSE, execution of the AND logic stops, but its calculation result is not reset. Specifically, while EN01 is TRUE, if both IN01 and IN02 are TRUE, a TRUE value will be stored to OUT01. If only EN01 becomes FALSE in this state, execution of the AND logic stops but OUT01 remains TRUE. In other words, setting the EN terminal to FALSE stops the execution but does not reset terminal OUT01, which remains unchanged. When programming an application, do not presume that setting the EN terminal to FALSE would also reset the calculation result.

AND

IN01

IN02

OUT01

EN ENO

AND

EN01

IN01

IN02

OUT01

EN ENO

Page 195: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 187

TI 34P02K35-02E Apr. 28, 2016-00

● Connecting Functions When Using EN Terminal To use the EN terminal to start or stop the execution of logic connecting multiple functions, you must connect the ENO terminal of the upstream function to the EN terminal of the downstream function. In the logic shown below, calculation D= (A+B)*C is performed only while EN01 is TRUE.

In the above figure, the ENO terminal of the upstream ADD logic is connected to the EN terminal of the downstream MUL logic. The ENO terminal of a function is TRUE when the function is executed so if its EN terminal is TRUE, its ENO terminal is also TRUE. Conversely, if its EN terminal is FALSE, its ENO terminal is also FALSE. Therefore, the EN terminal of the MUL logic is TRUE only when the EN terminal of the ADD logic is true so the above calculation logic is executed only when EN01 of the ADD logic is TRUE.

● Incorrect Connection of EN Terminals The figure below shows an example of an incorrect connection whereby the ENO terminal of the ADD logic is not connected to the EN terminal of the MUL logic.

In this case, the ADD logic is stopped or started depending on the value of variable EN01, but the MUL logic is executed in every scan cycle. In the above example, the calculation result of the ADD logic is connected to and passed to the terminal of the MUL logic. When EN01 is FALSE, the output result of the ADD logic is an indefinite value (not guaranteed to be the calculated value in the preceding task control cycle), which is then used in the calculation of the MUL logic to produce an indefinite calculation result. If the upstream ENO terminal is connected to the downstream EN terminal as shown in the example of correct connection, when EN01 is FALSE, the MUL logic is not executed so even if the calculation result of the ADD logic is indefinite, there is no problem.

EN01 ADD MUL

B C

D A

EN ENO

EN ENO

EN01 ADD MUL

B C

D A

EN ENO

EN ENO

(* Example of Correct Connection *)

(* Example of Incorrect Connection *)

Page 196: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 188

TI 34P02K35-02E Apr. 28, 2016-00

However, in the example shown in the figure above, when EN01 is FALSE, the ADD logic is not executed. On the other hand, the MUL logic performs calculation in every scan cycle using values stored in the memory area. To avoid this problem, if a variable is connected to the EN terminal of an upstream function block, connect the ENO terminal of the upstream function block to the EN terminal of the downstream function block. For reference, we describe the example logic shown below. In this logic, If EN01 is TRUE, the result of the ADD logic is used by the MUL logic to perform calculation; if EN01 becomes FALSE, the result just before EN01 becomes FALSE is used by the MUL logic to perform calculation. In the figure below, the result of the ADD logic is not passed downstream via a connection line, but stored into variable ADD01, which is used by the MUL logic in its calculation.

In this case, when variable EN01 is FALSE, the ADD logic stops execution but its last value is retained in ADD01. As the MUL Logic uses this value in its calculation, its calculation result does not become indefinite. In the case of a function connected to a function block, the problem described earlier does not occur.

EN01

ADD MUL

B C

DA ADD01 ADD01

EN ENO

EN ENO

Page 197: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 189

TI 34P02K35-02E Apr. 28, 2016-00

9.1.12 Logic for Saving Retain Data To save retain data on the on-board flash memory, change the system global variable "GS_RETAIN_SV_SW” to TRUE. This section describes some relevant programming precautions.

● Operation of GS_RETAIN_SV_SW When a program or user sets GS_RETAIN_SV_SW to TRUE, the FCN-500 or FCN-RTU begins saving retain data to the flash memory. When saving is completed, the system automatically resets GS_RETAIN_SV_SW to FALSE. The time required for saving retain data depends on the retain data size; the larger the retain data size, the longer the required time. Moreover, in order not to affect control, saving of retain data is carried out during the idle time of the FCN-500 or FCN-RTU so the shorter the idle time, the longer the required time for saving. Therefore, saving of retain data may sometimes require several seconds.

IMPORTANT

After setting GS_RETAIN_SV_SW to TRUE to initiate saving of retain data, if a user or an application then sets GS_RETAIN_SV_SW to FALSE before it is automatically set to FALSE by the system upon completion of saving, saving will be aborted immediately, leaving incomplete retain data on the system card.

● Programming Precautions As described in the above precaution, after setting GS_RETAIN_SV_SW to TRUE, if an application then sets GS_RETAIN_SV_SW to FALSE before it is automatically set to FALSE by the system upon completion of saving, incomplete retain data will be saved on the flash memory. Note this precaution when creating applications for saving retain data. • Application Example for Saving Retain Data The application shown below gets the FCN/FCJ time as STRING-type data using

PAS_GETTIME2, and compares it against "0000" (00:00 hours). When a match occurs, it sets GS_RETAIN_SV_SW to TRUE once.

As the application does not set GS_RETAIN_SV_SW to FALSE thereafter, GS_RETAIN_SV_SW remains TRUE until it is set to FALSE by the system.

Page 198: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 190

TI 34P02K35-02E Apr. 28, 2016-00

• Example of incorrect saving of retain data The application shown below gets the FCN/FCJ time using PAS_GETTIME2,

and compares it against "000000" (00:00:00 hours). When a match occurs, it sets GS_RETAIN_SV_SW to TRUE.

As this application sets GS_RETAIN_SV_SW to TRUE only at 00:00:00 hours, GS_RETAIN_SV_SW will become FALSE at 00:00:01 hours.

In this application, GS_RETAIN_SV_SW remains TRUE for only one second. If saving of retain data takes longer than one second, the saving will be aborted

by the application, leaving incomplete retain data on the flash memory.

PAS_GETTIME2

TRUE

FALSE

'%H%M%S'

STRING_TIME

STRING_TIME

EQ_STRING

'000000' GS_RETAIN_SV_SW

MOVER_TRIG_1

TRUE

PAS_GETTIME2

R_TRIG EN ENO

IN1

IN2

EN ENO

EN_I

B_GMT

CNV_SECOND

STR_FORMAT

EN_O

YEAR

MONTH

DAY

HOUR

MINUTE

SECOND

MILLISECOND

TOTALSECOND

WDAY

YDAY

STR_TIME

CLK Q

PAS_GETTIME2

TRUE

FALSE

'%H%M%S'

STRING_TIME

STRING_TIME

EQ_STRING

'000000'

GS_RETAIN_SV_SW

PAS_GETTIME2

EN ENO

IN1

IN2

EN_I

B_GMT

CNV_SECOND

STR_FORMAT

EN_O

YEAR

MONTH

DAY

HOUR

MINUTE

SECOND

MILLISECOND

TOTALSECOND

WDAY

YDAY

STR_TIME

Page 199: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 191

TI 34P02K35-02E Apr. 28, 2016-00

9.1.13 Comparing Logic Designer Projects Logic Designer R2.01.01 and later versions allow two projects on a PC to be compared easily. The comparison detects differences in code worksheets, variable worksheets and data worksheets, and is useful both during application development and maintenance. Before comparing projects, they must be compiled. Comments within programs are excluded from comparison. Moreover, a program running on a controller cannot be compared. For details, read Logic Designer’s online help documentation.

Logic Designer R4.02.01 and later versions allow a project on a PC and a project on FCN-500 or FCN-RTU to be compared. For compared, please download the project to turn on the "project comparison function". 1. Turn ON the “Project Compare” in the option. 2. Download the project to FCN-500 or FCN-RTU. (*1) 3. Select the “Project Comparison” of the “Project menu”, and compare it. *1: If the “project comparison” is "ON", the operation will be slowed. When

debugging usually is, turn OFF the “Project Comparison”.

Page 200: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 192

TI 34P02K35-02E Apr. 28, 2016-00

9.1.14 Avoidance of the Error during Execution The control task stops when division by zero (integer variables) or access exceeding the range of the array occurs. It is recommended to insert a code to avoid a careless stop.

● Avoidance of Division by Zero (integer variables) IF I_COUNT > 0 THEN V_AVE := V_SUM/I_COUNT; END_IF;

● Avoidance of Access Exceeding the Range of the Array IF I_REPORT_M > 0 AND I_REPORT_M < 13 THEN BUFFER_M [I_REPORT_M] := 10; END_IF

Page 201: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 193

TI 34P02K35-02E Apr. 28, 2016-00

9.2 Know-how in Use of NPAS_POU This section describes know-how, settings and precautions relating to the use of NPAS_POU.

9.2.1 Scan Cycle and Control Cycle Scan cycle is described in Section 2.2.4, “Determining FCN-500, FCN-RTU Scan Cycle” and Section 4.1.2, “Control Task Setup.” When using an NPAS POU, besides scan cycle, the control cycle must also be considered. Details about the control cycle of NPAS POU can be found in Logic Designer’s NPAS POU online help documentation.

● What is Control Cycle? NPAS POU has four processing functions, namely input processing, control/calculation processing, output processing and alarm processing.

• Input processing In NPAS POUs, input processing processes input signals and convert them into

data suited for control calculation and numerical calculation, etc. In regulatory control POUs, input processing gets PV values from input signals,

while in calculation POUs, input processing gets the CPV (calculated process value). Totalization and calibration functions are also included in input processing.

• Control/calculation processing Control/calculation processing performs the calculation function and control

function of each NPAS POU.

Page 202: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 194

TI 34P02K35-02E Apr. 28, 2016-00

• Output processing Output processing of NPAS_POU processes the result of control calculation

before its output as output signal. Output processing includes output limiter, output velocity limiter, output clamp, output tracking, CPV pushback, etc.

• Alarm processing Alarm processing detects process failures by monitoring process values (PV)

and manipulated output values (MV), and upon detection of a failure, informs the operation and monitoring functions by sending an alarm message.

Of these processing functions, input processing, output processing and alarm processing are executed in each scan cycle, while calculation processing is executed in each control cycle. In other words, while updating of PV values and totalization, output processing to I/O modules and alarm monitoring are performed in every scan period of a control task, NPAS_POU control/calculation processing is performed in every control period. Consider an example of the Moving Average POU (NPA_AVE_M) running on an FCN/FCJ with scan cycle defined as 200 ms. As described later, the default control cycle is 1 second, so average computation is done once per second.

● NPAS POUs with Control Cycle and NPAS POUs without Control Cycle Some NPAS POUs have a control cycle, while others have no control cycle. The former, such as NPAS_PID and NPAS_AVE_M, performs internal calculation processing, while the latter, such as NPAS_TM, NPAS_CT, NPAS_SIO** and NPAS_SW**, performs no internal calculation processing. When using an NPAS POU with control cycle, check its control cycle setting. For a list of POUs with control cycle and a list of POUs without control cycle, see the above-mentioned NPAS POU online help documentation.

● Default Control Cycle In Logic Designer, the default control cycle of each NPAS POU is determined by the system. As described later, the default control cycle is 1 second or longer and at times may be longer than the scan cycle.

● How to Specify Control Cycle If there is a need to perform control/calculation processing at intervals shorter than 1 second, you can modify the control cycle of an individual NPAS POU from its default value. Specifically, every NPAS POU with control cycle has an engineering parameter named “_CTL_CYCLE”, which defaults to value 0. With this default setting, its control cycle is determined by the system. However, the control cycle of an individual NPAS POU can be modified by assigning a TIME-data type numerical value to its “_CTL_CYCLE” parameter.

Page 203: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 195

TI 34P02K35-02E Apr. 28, 2016-00

● System-determined Control Cycle The system determines the control cycle of an NPAS POU by auto-setting, general setting or individual setting.

• Auto-setting The control cycle is determined by the "I: totalization time" access parameter

according to the following mapping: Totalization Time (s) Control Cycle (s)

1 to 30 1 31 to 60 2 61 to 300 4

301 to 1000 8 1001 to 2000 16

2001 to 10000 32 • General setting The system determines the default control cycle by general setting, which adopts

the value of global variable “GM_GNRL_CTL_CYCLE", whose initial value is 1 second.

• Individual setting The control cycle is determined the engineering parameter “_CTL_CYCLE" for

each. Initial value is 0 second and no effect.

● Control Cycle in Summary When using an NPAS POU having a control cycle, you can either explicitly specify its control cycle using Logic Designer or leave its default setting unchanged.

Table Control Cycle of POU Type POU type Control cycle

NPAS_PID, NPAS_PI-HLD These POUs work by auto-setting with access parameter “I” as default. By setting non-Zero value to _CTL_CYCLE, POU work by specified control cycle as individual setting. Individual setting is useful to make control cycle faster than 1 second.

NPAS_PVI, NPAS_ONOFF, NPAS_ONOFF_G, NPAS_MLD, NPAS_MLD_PB, NPAS_MLD_BT, NPAS_RATIO, NPAS_RATIO_RT, NPAS_PG_L30, NPAS_PG_L30_BP, NPAS_VELLIM, NPAS_VELLIM_PB, NPAS_AS_H, NPAS_AS_M, NPAS_AS_L, NPAS_FFSUM, NPAS_FFSUM_BL, NPAS_LDLAG, NPAS_DLAY, NPAS_AVE_M, NPAS_AVE_C, NPAS_FUNC_VAR, NPAS_TP_CFL, NPAS_T_CFL, NPAS_P_CFL, NPAS_ASTM1, NPAS_ASTM2, NPAS_BSET_F, NPAS_BSET_LW

These POUs work by general setting as default. By setting non-Zero value to _CTL_CYCLE, POU work by specified control cycle as individual setting.

NPAS_FOUT, NPAS_XLMT_S, NPAS_XLMT_D, NPAS_SW13, NPAS_SW31, NPAS_SW19, NPAS_SW91, NPAS_BDBUF_R, NPAS_BDBUF_T, NPAS_SI_1, NPAS_SI_2, NPAS_SO_1, NPAS_SO_2, NPAS_SIO_11, NPAS_SIO_12, NPAS_SIO_21, NPAS_SIO_22, NPAS_TM, NPAS_CT

These POUs do not have control cycle. They work by scan rate.

Page 204: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 196

TI 34P02K35-02E Apr. 28, 2016-00

9.2.2 How to Detect Mode, Status and Alarm Each NPAS POU has mode, status and alarm status information. In addition, each device label variable has status information. This section describes how to read this status information in Logic Designer or from a control application. Details on mode, status and alarm can be found in Logic Designer’s NPAS POU online help documentation.

● Data Type of Mode, Status and Alarm of NPAS POU In an NPAS_POU, mode, status and alarm status are stored as DWORD-type data, while statuses of device label variables are stored as WORD-type data. DWORD-type data comprises 32 bits while WORD-type data comprises 16 bits, with each bit representing a specific mode, status or alarm condition and turned on when its associated condition is true.

Page 205: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 197

TI 34P02K35-02E Apr. 28, 2016-00

As an example, the bitmap of the alarm data of NPAS_POU is described below.

Bit No. 31 30 29 28 27 26 25 24 Status Not used Not used Not used Not used Not used Not used Not used Not used

Bit No. 23 22 21 20 19 18 17 16 Status NR OOP IOP+ IOP- HH LL Not used Not used

Bit No. 15 14 13 12 11 10 9 8 Status HI LO Not used Not used DV+ DV- Not used Not used

Bit No. 7 6 5 4 3 2 1 0 Status VEL+ VEL- MHI MLO Not used Not used Not used CNF

- Example with high limit alarm (HI) detected for the NPAS POU In the alarm bitmap of NPAS_POU, bit 15 maps to the high limit alarm (HI)

condition. If only a high limit alarm (HI) is detected, only bit 15 is set to 1 to give bit pattern “00000000000000001000000000000000”. When converted to DWORD data type, this gives the alarm status value of DWORD#00008000 for the NPAS POU.

- Example with high-high limit (HH) and high limit alarms (HI) detected In this case, in addition to bit 15 for HI described above, bit 19 associated with

the high-high limit alarm (HH) is also set to 1 such that 2 bits are on concurrently. The bit pattern is “00000000000010001000000000000000”, which converts to the alarm status value of DWORD#00008000.

● How to Check Mode, Status and Alarm in Logic Designer To check mode, status or alarm conditions of an NPAS POU in Logic Designer, you can either use the Watch window or use the bit conversion utility described in the NPAS POU online help documentation.

Page 206: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 198

TI 34P02K35-02E Apr. 28, 2016-00

In the figure below, the value of device label variable AI001 of the NPAS_PVI loop and the value of the variable for reading and writing access parameters, NPAS_PVI_1_PRM, are displayed in the Watch window.

In the Watch window, Status of AI001, Alarm of NPAS_PVI_1 and Status of PV value of NPAS_PVI_1, which are enclosed within red boxes, are displayed with the following values: - Status of AI001 : 16#8060 - Alarm of NPAS_PVI_1 : 16#00200000 - Status of PV value of NPAS_PVI_1 : 16#00008000 Each of these values can be converted to bit data by entering the value into the input box under “■ Data Conversion” of the bit data conversion utility as shown below. As the input box accepts DWORD data type, the input value for WORD-type status of AI001 must be prefixed with “0000”. The figure below shows the display after the value 16#8060 is entered for the status of AI001.

The figure shows that bits 15, 6 and 5 are set to 1. From the DataStatus row, which displays the meaning of each bit, we can see that the BAD, IOCN and CERR condition bits are set for status of AI001. Online help information on these conditions can be displayed by clicking on DataStatus displayed in the leftmost column. Using the same procedure, we know that value 16#00200000 for the alarm of NPAS_PVI_1 indicates an IOP+ alarm, and value 16#00008000 for the status of the PV value indicates a BAD condition.

Page 207: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 199

TI 34P02K35-02E Apr. 28, 2016-00

From all these values, we know that device label AI001 is in error (BAD) condition due to severed wire or hardware failure, and as a result, an IOP+ (High Input Open) alarm is generated in NPAS_PVI_1, and the status of the PV value becomes BAD.

● Reading Mode, Status and Alarm from an Application Values corresponding to each mode, status and alarm condition of NPAS_POU are predefined as system global variables. These global variables can be used in control applications to check for specific mode, status or alarm conditions. The figure below shows a subset of system global variables related to alarms. A complete list of system global variables accessible in NPAS POUs is given in Appendix A, “List of Global Variables” of IM34P02P25-01E, “NPAS_POU – Overview.”

For instance, the high-high limit alarm (HH) value of DWORD#00080000 is set as the initial value of global variable GM_ALRM_HH. By comparing the alarm of an NPAS POU against GM_ALRM_HH, a control application can check for the HH alarm condition. However, multiple mode, status and alarm condition bits may sometimes be set as described earlier in the "Example with high-high limit (HH) and high limit alarms (HI) detected.” In the example, the alarm value is DWORD#00088000, which is not identical to DWORD#00080000 (GM_ALRM_HH) so a direct comparison using an EQ function will fail to detect the HH alarm condition. Instead, the logic shown below should be used for the comparison.

Page 208: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 200

TI 34P02K35-02E Apr. 28, 2016-00

This logic performs an AND calculation of the alarm of NPAS_PVI and GM_ALRM_HH. In this way, even if multiple bits, including the HH limit bit, of the alarm of NPAS_PVI are set to 1, only the HH limit bit is extracted for comparison with GM_ALRM_HH. This method of performing an AND calculation before comparison can be applied similarly when checking for a specific condition for the mode or status of NPAS_POU, or the status of a device label variable.

TIP Consider an example where both HH limit and HI limit alarms are generated. The alarm status bit pattern is: 00000000000010001000000000000000 The bit pattern of GM_ALRM_HH (DWORD#00080000) is: 00000000000010000000000000000000 ANDing the two bit patterns gives: 00000000000010000000000000000000 Performing an AND computation this way extracts only the target bit.

Page 209: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 201

TI 34P02K35-02E Apr. 28, 2016-00

9.2.3 NPAS_POU Status Propagation When creating a loop by joining NPAS POUs, it is important both to pass status information from upstream POUs to downstream POUs, as well as read back status information from downstream POUs to upstream POUs. This section describes the basics of status propagation, followed by application programming precautions. The figure below shows an NPAS_PID cascade loop for controlling the PV value of AI001, where NPAS_PID_1 is the primary (upstream) control and NPAS_PID_2 is the secondary (downstream) control. This example will be used to explain status propagation.

Page 210: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 202

TI 34P02K35-02E Apr. 28, 2016-00

● Upstream to Downstream Status Propagation In the figure below, input information of AI001 and AI002 are converted to CData_ REAL data type by input processing POU NPAS_AI_ANLG, and passed to NPAS_PID. At this time, status information of the device label variables are converted from WORD data type to DWORD data type, and passed as Status in a CData_REAL type structure to NPAS_PID. In the figure below, AI001 information enclosed by a green box is passed from NPAS_AI_ANLG_1 to NPAS_PID_1. Similarly, AI002 information enclosed by a red box is passed from NPAS_AI_ANLG_2 to NPAS_PID_2. Information of NPAS_PID_1 is passed from the OUT terminal of NPAS_PID_1 to the CAS_IN terminal of NPAS_PID_2, as indicated by the green arrow line.

● Downstream to Upstream Status Read Back Next, let’s consider the read back of downstream status to upstream. Read back connection is described in the NPAS POU online help and in Section 2.2, “Flow of Read Back Data” of IM34P02P25-01E “NPAS POU – Overview.”

Page 211: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 203

TI 34P02K35-02E Apr. 28, 2016-00

As described in the online help, when a terminal is connected to another terminal via a link in FBD or LD, data can only be passed through the link in one direction. Bi-directional data communication though a link is not allowed. Read back of status information from downstream to upstream can, however, be implemented by connecting the same variable to the RB_IN terminal of an upstream NPAS POU and the RB_OUT terminal of a downstream NPAS POU. In the cascade loop example, device label AO001 of analog output is at the most downstream. The read back input of device label AO001, AO001_RB, returns the state of output equipment such as a valve. In the figure below, AO001_RB is connected to the RB_IN terminal of output processing POU NPAS_AO_ANLG_1, and written to variable RB_AO001 of the RB_OUT terminal. By connecting variable RB_AO001 (enclosed by red box) to the RB_IN terminal of NPAS_PID_2, status information of AO001_RB is passed to NPAS_PID_2. Status information of NPAS_PID_2 is written to variable RB_PID2 (enclosed by brown box), which is connected to its RB_OUT terminal. By connecting variable RB_PID2 to the RB_IN terminal of NPAS_PID_1, status information of NPAS_PID_2 is passed to NPAS_PID_1.

IMPORTANT

If the read back connection between two POUs is implemented using a direct link instead of a variable, the execution order of the two POUs will be decided solely by their relative vertical positions. To avoid this problem, implement the read back connection using a variable instead.

Page 212: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 204

TI 34P02K35-02E Apr. 28, 2016-00

● Example of Correct Status Propagation In the example given in Section 9.2.3, "NPAS_POU Status Propagation," two NPAS_PIDs are connected in cascade. If the application is correctly programmed, the control modes and operations of the two NPAS_PIDs will be interlocked as shown below.

No. Mode Operation 1 NPAS_PID_1 AUT Outputs result of PID calculation to SV value of PID_2. NPAS_PID_2 CAS Performs PID calculation using MV value of PID_1 as SV value. ↓ 2 NPAS_PID_1 AUT IMAN Stops PID calculation as cascade connection is open.

The MV value tracks the SV value of PID_2. NPAS_PID_2 AUT Continues PID calculation. The SV value can be changed freely. ↓ 3 NPAS_PID_1 AUT Restarts PID calculation , and outputs SV value to PID_2. NPAS_PID_2 CAS Performs PID calculation using MV value of PID_1 as SV value.

When transiting from state 1 to state 2, the upstream NPAS_PID_1 switches to AUT IMAN mode, and stops PID calculation. Moreover, its MV value tracks the SV value of NPAS_PID_2. When transiting from state 2 to state 3, NPAS_PID_1 restarts PID calculation, and NPAS_PID_2 uses the MV value of PID_1 as its SV value. This series of operation is closely related to the propagation of upstream status information downstream and the read back of downstream status information upstream. When transiting to state 2, NPAS_PID_2 stores information about an open cascade connection condition in RB_PID2, which is connected to its RB_OUT terminal. Specifically, bit 24, which represents “CND: CoNDitional” in the status bitmap shown below, is set to 1.

Bit No. 31 30 29 28 27 26 25 24 Status Reserved QST Reserved Reserved PTPF CLPP CLPM CND

Bit No. 23 22 21 20 19 18 17 16 Status CAL Reserved OS Reserved MINT SINT NSEL PRST

Bit No. 15 14 13 12 11 10 9 8 Status BAD IOMT IOPP IOPM OOP NRDY PFAL LPFL

Bit No. 7 6 5 4 3 2 1 0 Status SIM IOCN CERR Not used Not used Not used Not used Not used

As RB_PID2 is connected to the RB_IN terminal of NPAS_PID_1, downstream CND (CoNDitional) information is propagated upstream to NPAS_PID_1, which then switches to AUT IMAN mode. Moreover, as RB_PID2 also contains the SV value of NPAS_PID_2, its own MV value tracks this value. Next, when transiting to state 3, the CND bit of RB_PID2 is reset to 0, and bit 19 (MINT: Master INiTialize request) is set to 1. NPAS_PID_1 accepts the MINT (Master INiTialize request) from NPAS_PID_2, and begins preparation to restart PID calculation. After preparation is completed, bit 18 (SINT: Settled INiTialize) of Status of the OUT terminal is set to 1.

Page 213: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 205

TI 34P02K35-02E Apr. 28, 2016-00

NPAS_PID_2 accepts the SINT (Settled INiTialize) from NPAS_PID_1, and performs PID calculation using the MV value of NPAS_PID_1 as its SV value. This example involves two NPAS_PIDs in cascade connection but the importance of status information propagation and read back input apply similarly in other forms of NPAS POU connection.

TIP The following information is extracted from the NPAS_POU online help documentation. CND CoNDitional Indicates the cascade connection is open.

This status occurs when a downstream POU has entered a non-CAS mode or the route of the cascade conection is disconnected by a switch, etc.

MINT Master INiTialize Upon receiving this status, the upstream POU performs output tracking. SINT Settled INiTialize It is sent to the downstream POU as a respone to MINT.

The downstream POU waits after sending MINT until it receives the corresponding SINT.

Page 214: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 206

TI 34P02K35-02E Apr. 28, 2016-00

9.2.4 Blocked NPAS_POU Status Propagation If incorrect application programming results in incorrect upstream to downstream propagation of status or incorrect downstream to upstream read back of status, it may affect control.

● Blocked Status Propagation or Read Back If a control application is incorrectly programmed so that upstream to downstream propagation of status information or downstream to upstream read back of status information is blocked, upstream and downstream exchange of status information fails and correct control operation will be affected. For purposes of explanation, consider the control loop example described in Section 9.2.3, "NPAS_POU Status Propagation" and suppose that there is a missing connection between RB_OUT of NPAS_PID_2 and RB_IN and NPAS_PID_1. As the state of NPAS_PID_2 is not passed to NPAS_PID_1, even if the cascade connection is open, NPAS_PID_1 continues with PID calculation without switching to IMAN mode. Moreover, as SINT is not passed to NPAS_PID_2, NPAS_PID_2 cannot use the MV value of NPAS_PID_1 as its own SV value.

● Examples of Application Errors Some examples of application errors are briefly described below.

1. No Read back connection If there is no read back connection, downstream status information of course cannot be passed upstream. Read back connection must be done always.

2. Calculation application error In calculations involving Value of CData_REAL type data, status information is sometimes lost. In the example shown in the figure below, the logic extracts Value from the output (of CData_REAL data type) of NPAS_PID_1 using NPAS_CDR_DESTR, performs some calculation and then returns the data as CData_REAL data type.

Page 215: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 207

TI 34P02K35-02E Apr. 28, 2016-00

In this application, only bit 15 (BAD bit) of Status of the output from the OUT terminal of NPAS_PID_1 is extracted by NPAS_CDT_DESTR_1, which is then used by NPAS_CDR_STR_2 to reconstruct the CData_REAL type data. The other bit information such as MINT, SINT and CND are not propagated and hence lost. To avoid this problem, use the correct logic shown in the figure below.

In this logic, CData_REAL-type variable “PID_1_OUT” is connected to the OUT terminal of NPAS_PID_1. Only Value is extracted from the variable for calculation and the result is then returned in Value. This way, calculation can be performed without losing status information.

Page 216: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 208

TI 34P02K35-02E Apr. 28, 2016-00

3. When distributing cascade signal When distributing the output from one controller to multiple blocks, read back will be incorrect if the distribution is implemented using link branching. In the figure below, the output of NPAS_PID_1 is distributed to NPAS_PID_1 and NPAS_PID_2 using link branching. In this logic, a read back connection is made between NPAS_PID_1 and NPAS_PID_2 but not between NPAS_PID_1 and NPAS_PID_3.

To split this kind of cascade signal, use an NPAS_FOUT. In the figure below, the read back input from NPAS_PID_2 and NPAS_PID_3 is connected to NPAS_FOUT_1, and the read back of NPAS_FOUT_1 is connected to NPAS_PID_1. This allows the read back inputs of both NPAS_PID_2 and NPAS_PID_3 to be connected to NPAS_PID_1.

Page 217: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 209

TI 34P02K35-02E Apr. 28, 2016-00

9.2.5 Selection of Timers and Counters When creating logic related to elapsed time for FCN-500 or FCN-RTU, either a timer function block or the NPAS_TM POU can be used. When creating logic related to counting, either a counter function block or the NPAS_CT POU can be used. • Timer function blocks TP : Pulse TON : On-delay timer TOF : Off-delay timer Use these timer function blocks for programming simple pulse generation, on-

delay or off-delay logic. • Counter function blocks CTU : Up-counter CTD : Down-counter CTUD : Up-down counter Use these counter function blocks for programming simple counting logic. NPAS_TM and NPAS_CT POUs, which are included in NPAS_POU, provide the following additional functions over the timer/counter function blocks: - Suspend/resume timer or counter - Modify current timer/counter value Moreover, NPAS_TM and NPAS_CT include access parameters for the preset and current counter/timer values. As described in Section 9.1.9, “Specifying Retain Data and OPC Property,” access parameters are specified as retain data and specified with OPC property within the system. To summarize, use NPAS_TM or NPAS_CT in logic related to elapse time or counting when there is a need to suspend/resume the timer/counter, or modify the current timer/counter value, or set OPC property of timer/counter values.

Page 218: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 210

TI 34P02K35-02E Apr. 28, 2016-00

9.2.6 Engineering Parameters Engineering parameters of an NPAS POU are used to configure its operation, and these parameter values can be assigned individually for each NPAS POU using Logic Designer. For convenience, engineering parameters of an NPAS POU are preset with default values, which defines the default operation of an NPAS POU, unless the values are otherwise modified during engineering. Failure to modify engineering parameter values as required by a requirement specification will result in an NPAS POU behaving differently from what is required. To avoid such problems, always investigate what engineering parameters are present in each NPAS POU used, what their default values are and whether any of these default values need to be changed. For reference, we describe some representative engineering parameters below. As these parameters comprise only a subset, remember to check all engineering parameters for each NPAS POU used. • _SUM_SW (Totalization switch) Default: No totalization This switch defines totalization for PV values. By default, no totalization is

performed. • _CTL_DIR_SW (Control action direction switch) Default: Backward This parameter specifies the direction of control for NPAS_PID, NPAS_PI_HLD,

NPAS_ONOFF, etc. • _CTL_CYCLE (Control cycle) Default: auto-setting or general-setting For details on control cycle, see Section 9.2.1, “Scan Cycle and Control Cycle.” • _CLP_ACT_SW (Clamp activation switch) Default: ON This switch defines the behavior when an NPAS POU in a cascade connection is

in a clamped state. For details on the operation of output clamp and the _CLP_ACT_SW setting, read the NPAS POU online help documentation.

• _VN_ACT_SW (I/O compensation switch) Default: OFF • _GAP_ACT_SW (Gap action switch) Default: OFF • _DB_ACT_SW (Deadband action switch) Default: OFF

Page 219: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<9. Advanced Engineering > 211

TI 34P02K35-02E Apr. 28, 2016-00

• _MVTRK_ACT_SW (Output tracking SW) Default: OFF • _AUT_FLBK_SW (AUT fallback switch) Default: OFF To enable I/O compensation, gap, deadband, output tracking or AUT fallback

function, modify the respective switch to ON. • _ANS_IN_SW (Answerback input action direction switch) Default:

Forward • _ANS_CHK_SW (Answerback check monitoring action switch) Default:

both sides • _ANS_TRK_SW (Answerback tracking action switch) Default: ON • _SIO_OUT_DIR_SW (Output signal conversion action direction switch)

Default: Forward These engineering parameters are related to switch instrument POUs

(NPAS_SIO_**). Modify these parameter values as required.

Page 220: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

Blank Page

Page 221: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<Appendix 1 Engineering Flow chart > 213

TI 34P02K35-02E Apr. 28, 2016-00

Appendix 1 STARDOM Engineering Flow Chart

Design Development Steps

Remove Errors

Start

Design Inputs

A

Errors

Pre-Development Arrangements ・Install Resource Configurator (RC) and Logic Designer (LD)

with suitable portfolios in Eng. Laptop ・Prepare the Stardom system and connect to Eng. Laptop ・Upgrade/Downgrade Stardom System card firmware to match

the version of Engineering Software i.e. (RC) & (LD). ・Ensure that selected IP address for Stardom is complying with

rules for duplex networking.

Stardom Resource Configuration: ・If IP address is not assigned or is unknown, reboot Stardom in

IP address setting mode and set IP address. Otherwise connect through the known IP address.

・Set the Network Type (Single/Duplex/Separated). ・Perform settings related to the CPU module duplex for SB

Bus, memory backup, and use of JAVA,. ・Setup the FCX Time synchronization through SNTP settings

in JEROS files. ・Configure tags as Analog & Digital I/O as per the approved

tag list - Using Resource Configurator. ・Configure serial port parameters for Subsystems' interfaces (if

required). ・Configure IO module setting. ・Configure FF devices or Profibus devices ( if Required)

Download the Configuration

No Yes

・Tag List with Descriptions. ・Data Types of I/O Variables. ・Scale High & Low Ranges. ・Engineering Units ・Logic Narratives & Interlocks. ・Override Conditions ・Redundancy Conditions ・Subsystem Details.

Communication Interface Communication Protocol Configuration Parameters IO Mapping Details

Page 222: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<Appendix 1 Engineering Flow chart > 214

TI 34P02K35-02E Apr. 28, 2016-00

Remove Errors

Logic Designer Development

B

Errors

Initiate New Project-Adding Libraries ・Initiate a new Logic Designer Project by selecting either of

below templates (this will add all necessary libraries) STARDOM FCN-500 - In case of FCN-RTU (NFLF111/NFLP121/NFLC121 not

used) STARDOM FCX

- In case of FCN-RTU (NFLF111/NFLP121/NFLC121 not used)

STARDOM FCX_A

Physical Hardware Configuration ・If FCN-RTU, change a type of PLC TYPE to SH04_40.

Compile Project

No

Yes

A

Logic Development-Environment Setup ・Add relevant User and Firmware Libraries ・Define relevant Data types ・Specify IP address to target FCN/FCJ (Target setting) - This is same IP

which is assigned to Controller using Resource Configuration. ・Copy "Device Label Definitions" tags from Resource Configurator, and

Assign IO Type descriptions, ranges, engineering units.

Download: ・Download to Controller before implementing Control

Application/ Subsystem communication.

Page 223: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

<Appendix 1 Engineering Flow chart > 215

TI 34P02K35-02E Apr. 28, 2016-00

Note: Based on the project requirement, specific setup/configuration files need to be modified, by taking Stardom into the Maintenance mode, such as COM, SNTP, DUONUS, DUOUSERS, HOSTS file etc.

Remove Errors

END

B

Errors

Logic Development-Application Creation ・Building Function Block Diagram

Add POUs for logic building, such as AI, AO, DI, DO, Serial, Create Variables in Variable Sheets and check for Retain, PDD, OPC and

Initial value setup etc., Add required Function Blocks/Functions to the POU and give unique names.

- Link the Function Blocks/Functions for creating interlocks (if applicable).

- Assign appropriate variables to formal parameters of relevant POU, this include the Device Labels, Data Variables & Data structures (e.g. Dtag_I_Anlg, Real, CData_Real).

Add required Communication POUs for external interfaces (e.g. Modbus Slave/Master, DNP3 etc.)

- Assign appropriate variables to formal parameters of Comm. POUs. Create required security settings such as Read, Write protection and

Password protection for POU’s etc.

Download & Online Monitoring: ・Download application to target FCN/FCJ - Include "Boot

Project Download" option. ・Go to "Debug mode" for online monitoring. ・Loop checks can be performed using I/O Loop Check Tool

available in Resource configurator

Save & Compile/Rebuild Application

No

Yes

Page 224: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

Blank Page

Page 225: Technical STARDOM Information 1 TI 34P02K35-02E Apr. 28, 2016-00 1. Overview STARDOM engineering can be divided into phases as shown in the diagram below. Check

i

This manual is subject to change without prior notice.

TI 34P02K35-02E Apr. 28, 2016-00

Revision Information Document name: STARDOM Engineering Guide (FCN-500/FCJ-RTU) Document No.: TI 34P02K35-02E Apr. 2016/1st Edition/ R4.02 or later*

• New issue

*: Denotes the release version of the software corresponding to the contents of the technical information in question. The revised contents are valid until the next edition is issued.

■ For Questions and More Information

If you have any questions, you can send an E-mail to the following address.

E-mail:[email protected]

■ Written by Yokogawa Electric Corporation

■ Published by Yokogawa Electric Corporation

2-9-32 Nakacho, Musashino-shi, Tokyo 180-8750, JAPAN