LABORATORY ACTIVITY 2 : Simulate Analog and Digital Function Blocks GROUP 1 BRETANIA, Josua Rama ECONAR, Crester Vone Villanosa MANSUETO, Judilyn Magarso OGUIMAS, Melville June Bacalso PEROTE, Reven Jaye Navarro January 2023 0 TABLE OF CONTENTS Page I. LIST OF FIGURES …………………………………………………… 2 II. LIST OF TABLES …………………………………….……………… 2 III. LIST OF ABBREVIATIONS …………………………….…………… 3 IV. INTRODUCTION ………………………………………………………. 4 A. Background Information ………………………………………….. 4 B. Objectives ….……………………………….……………………… . C. Materials …….………………………...………………………….. 4 V. PROCEDURE …………………………………………………………. 5 VI. RESULTS/OBSERVATION …………………………………………... 6 VII. CONCLUSION ……………………………………………………...….. 10 VIII. REFERENCE …………………………………………………………. 10 1 4 I. LIST OF FIGURES Page Figure 1 - Analog I/O function block simulation sample………………….….………..….6 Figure 2 - Digital I/O function block simulation…………………………………………….6 Figure 3 - Crossing connection between Analog and Digital I/O………………………..7 Figure 4 - AND logic operator with many inputs and one output………………………..7 Figure 5 - OR logic operator with many inputs and one output………………….………8 Figure 6 - AND logic operator with two inputs and one output………………….……….8 Figure 7 - AND logic operator with two inputs and one output…………………………..8 Figure 8 - NOT logic operator with one input and one output …………………………..9 II. LIST OF TABLES Page Table 1 - AND/OR logic operators simulation results………………………………….…9 Table 2 - NOT logic operator simulation results……………………………………….….9 2 III. LIST OF ABBREVIATIONS Abbreviation Full description AI Analog Input AO Analog Output DCS Distributed Control System DI Discrete (digital) Input DO Discrete (digital) Output FBD Functional Block Diagram I/O Input/Output IL Instruction List LD Ladder Logic PID Pulse Input SFC Sequential Flow Charts ST Structured Text 3 IV. INTRODUCTION A. Background Information Programmer have all been battling to figure out how to build massively efficient programs over years. They encounter many problems that must be resolved when creating software application. The client-server architecture, which serves as the foundation for cross architectures and separates services like display, application logic, and information management, is an example of a distributed system (Maltseva, 2018). The previous experiment discusses the hardware and software related to the distributed control system. The topic of software and programming is covered in this experiment. For developing logic, a variety of computer languages are employed. Ladder logic (LD), structured text (ST), instruction lists (IL), sequential flow charts (SFC), and functional block diagrams are the languages mentioned in the IEC 61131 standard (FBD). Programming in DCS typically uses Functional Block Diagrams (FBD). In essence, such language is a visual programming language that allows users to program objects in the structure of blocks. The blocks can then be connected in circuit-like fashion. It outlines the connection between an input and an output. DCS is programmed using a graphical interface. FBD can be used to build functional algorithms as well as control schemes for a specific plant. The DCS system treats the control modules like a distinctive element. A specific algorithm, including AI, AO, DI, DO, or PID, as well as the data needed for the method, are contained in each function block. Simple input conversion blocks to complicated control strategies are all examples of function blocks (Technicals, 2022). Instance data is used to store and handle the inputs and outputs of functions and function blocks. They make it easier to implement systematic operations and sequences since an instance may be made quickly. A defined function is implemented specifically in instances (Edema, 2023). In DCS, it commonly used library functional blocks such as Analog Input function Block, Analog Output function Block, Discrete (digital) Input (DI) Function Block, and Discrete (digital) Output (DO) Function Block. A single analog measurement value and its state are accessed by the Analog Input (AI) Function Block through the AI channel. Through a specified AO channel, the analog output (AO) function block can allocate an output value to field devices such control valves. Together with condition varying between different states of the field devices, the discrete input (DI) function blocks allow access to a single digital input value. Data from the operation is taken by the digital output block, which then writes it onto a particular digital output channel. B. Objective This activity aims to simulate analog and digital function blocks. Also, it aims to achieve the following objectives: Study various function blocks available in DCS. Develop FBD program using basic digital and analog function blocks. C. Materials Using fundamental digital and analog function blocks, an FBD software may be created. The tools required to use the program are as follows: - Laptop - Simulator App Algorithm (I/O Blocks) - AI - AO - DI - DO 4 V. PROCEDURE In this laboratory activity, software and programming concepts have been discussed. To execute the said activity, a DCS simulator has been used that has been provided for simulating analog and digital function blocks with the required logic operators. There are three parts to the procedures that have been given for executing this activity. The first part is to understand the operation of the AI and AO function blocks; the second part is to understand the operation of the DI and DO function blocks; and the last part is to understand the operation of the logic function block using DI and DO as input and output, respectively. For the first part, the AI and AO tabs under the IO tab in the upper left of the simulator had been dragged and positioned inside the workspace. The setup was then compiled and activated by clicking the compile and run tab. The output value of the AI block can be altered by right-clicking the block, selecting edit, and entering an input value in the range 0-100. Blocks can be disconnected by selecting the question mark on the block's output side and pressing the delete key. After simulating the first part, the clear tab was used to clear the workspace. The same procedures were used to simulate the activity's second part, which is the DI and DO function block. The only difference is that the output of the DO block only varies between 0 and 1 in response to the DI block's input, which also varies between 0 and 1. The AND, OR, and NOT logic circuits were configured for the third part of the procedure. Two DI blocks were used as inputs for the logic circuits, and a DO block was used for its output. The AND logic function was put in the workspace for simulation, and two DI blocks were connected to the AND logic block. The input values of two DI blocks had been changed by toggling DI values from 0 to 1, and the output in the DO block had been observed. For executing the OR operator, the AND operator has been deleted and replaced with the OR block from the logic operators. Finally, the OR block was replaced by the NOT block from the logic operators to execute the NOT logic circuit. This time, the input was only one from the DI block. The input value of the DI block has been changed by toggling the DI values from 0 to 1, and the output in the DO block has been observed. 5 VI. RESULTS/OBSERVATIONS The first and second parts of the procedure demonstrated the functions of the analog and digital input/output function blocks. Upon executing the analog input/output, it can be observed that the output value of an AO block is the same as the input value of an AI block. The output value is the same as the input value, as with digital input and output. The only difference is that the analog input can vary from 0 to 100, while the digital input can only vary from 0 to 1. It can also be observed that an analog input can only be connected to the analog output, and a digital input can only be connected to the digital output. The results are shown in the figures below. Figure 1. Analog I/O function block simulation sample Figure 2. Digital I/O function block simulation 6 Figure 3. Crossing connection between Analog and Digital I/O The third part of the procedure demonstrated the operation of the AND, OR and NOT logic function blocks. These logic operators use digital input and also make a digital output. Upon exploring the DCS simulator, it can be observed that the AND logic operator can have many inputs with only one output. Same with AND logic operator, OR logic operator can also have many inputs with only one output. But for simplicity, the activity only requires two inputs for AND/OR logic operators. Unlike the previous operators, the NOT logic operator requires only one input and produces only one output in digital form also. Documentations and results for the said observations are shown in the figures below. Figure 4. AND logic operator with many inputs and one output 7 Figure 5. OR logic operator with many inputs and one output Figure 6. AND logic operator with two inputs and one output Figure 7. AND logic operator with two inputs and one output 8 Figure 8. NOT logic operator with one input and one output Various results are recorded based on the observations from the procedure and were summarized in the tables that is shown below. Logic Operator AND OR DI1 DI2 0 0 1 0 1 1 0 0 1 0 1 1 Table 1. AND/OR logic operators simulation results Logic Operator NOT DI 1 0 Table 2. NOT logic operator simulation results 9 DO 0 0 1 0 1 1 DO 0 1 VII. CONCLUSIONS In this activity, the basic FBD program has been developed using basic digital and analog function blocks with basic logical operators AND, OR and NOT. As being discussed in the introduction, Functional Block Diagrams are commonly used in DCS programming (FBD). In essence, such a language is a visual programming language that allows users to create objects with a block structure. After then, the blocks can be joined in a circuit-like method. Analog Input function Block, Analog Output function Block, Discrete (digital) Input (DI) Function Block, and Discrete (digital) Output (DO) Function Block are the basic functional blocks were used in this activity. Based on the results and observations, the Analog Input (AI) Function Block uses the AI channel to access a single analog measurement value and its state. The analog output (AO) function block can assign an output value to field devices such as control valves through a defined AO channel. The discrete input (DI) function blocks, when combined with condition altering between multiple states of the field devices, give access to a single digital input value. The digital output block receives data from the operation and publishes it to a specific digital output channel. A logical operator is a symbol or word used to connect two or more expressions such that the value of the compound expression produced depends only on that of the original expressions and on the meaning of the operator. Common logical operators include AND, OR, and NOT (Busbee & Braunschweig, 2021). According to the summary results and observations, the AND logic operator returns 1 if all component conditions are 1, and 0 if at least one of the inputs is 0. The OR logic operator returns 1 if at least one component has a value of 1 and 0 if all component conditions have values of 0. Finally, the NOT logic operator returns 1 if the value of the input is 0 and 0 if the value of the input is 1. VIII. REFERENCES Edema., V. (2023). Function Block Programming and Troubleshooting. SolisPLC. Retrieved January 28, 2023, from https://www.solisplc.com/tutorials/Mitsubishi GX Works2 Function Block Programming and Troubleshooting (solisplc.com) Maltseva., D. (2018). 5 concepts of Software Distributed Systems. Benefits of Distributed Architectures. DEV Community. Retrieved January 28, 2023, from https://dev.to/dianamaltseva8/5 concepts of Software Distributed Systems. Benefits of Distributed Architectures - DEV Community Technicals., N. (2022). Logical Function Blocks available in DCS. nandantechnical. Retrieved January 28, 2023, from https://www.nandantechnicals.com/2022/07/Logical Function Blocks available in DCS (nandantechnicals.com) Leroy, K. & Braunschweig, D. (2021). Programming Fundamentals. Retrieved January 28, 2023, from https://press.rebus.community/programmingfundamentals/chapter/logicaloperators/#:~:text=A%20logical%20operator%20is%20a,AND%2C%20OR%2C %20and%20NOT. 10