Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS.

Similar presentations


Presentation on theme: "Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS."— Presentation transcript:

1 Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS

2 Structures A type of node mimicking loops and case statements in text based languages. Used for repeating sections of code and for controlling the sequence of execution. Types are For Loop, While Loop, Timed Structures, Case Structures, Event Structures, stacked Sequence Structures, Flat Sequence Structures, Condition Disable Structures and Condition Enable Structures. Structures

3 Have distinct, resizable borders. Contain piece of code called a Subdiagram. Connected to other block diagram objects by input/ output points called Tunnels. Subdiagram Tunnels

4 For Loop and While Loop Structures For Loop  Execute a section of the code, a specified number of times.  Auto indexing enabled by default.  The Count Terminal determines the number of times the For Loop is going to execute.  The Iterations Terminal specifies the current iteration the loop is executing. Iterations start from 0 and end at N-1.  Check out the example Lab4.VI.

5 While Loop  Executes until a predetermined condition is met.  Condition is evaluated at the end of each iteration. Two types of conditions are present: Stop if True Loop executes its subdiagram until the conditional terminal receives a TRUE value. Continue if True Loop executes its subdiagram until the conditional terminal receives a FALSE value. Check Lab4.VI

6 Shift Registers Used for passing a data value from the current iteration to the next one. Has two terminals, one on the left border and the other on the right border. Always initialize Shift Registers. Stacked shift registers for getting data from multiple iterations.

7 Appears automatically when the output of a block is connected to the input of another. Feedback Node Initializer Terminal Feedback Node: Consists of a number of cases/subdiagrams of which only one subdiagram is visible at a time, and the structure executes only one case at a time. Can have boolean, string or numeric based case selections depending on the type of input on the Selector Terminal. Case Structures

8 Lists and ranges can also be entered. For e.g: o …10 represents all numbers less than 10 o …10,12…14 represents numbers less than 10&between 12 and 14 o a…c represents a,b o a..c,c represents a,b,c Inputs available to all cases, output tunnels need to be defined for each case.

9 A sequence structure contains one or more subdiagrams, or frames, that execute in sequential order. Enables changing execution order. Sequence Structure

10 Event Structure Has one or more subdiagrams, or event cases, exactly one of which executes when the structure executes. User interface(mouse clicks, key presses), or created programmatically

11 Tasks


Download ppt "Lab 2 : Structures Muhammad Zaigham Abbas Shah DIGITAL INSTRUMENTATION SYSTEMS."

Similar presentations


Ads by Google