Assignment_quizsem12021, Exams of Computer Science

This is an assignment for computer science

Typology: Exams

2020/2021

Uploaded on 11/21/2022

naman-gill
naman-gill 🇮🇳

3 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
By: Xyrex A. Calang BS ECE
EE 179 Laboratory
Exercise 1-1 Concept: Exploring a VI
Goal
Identify the parts of an existing VI..
Block diagram
Front panel
This is an example of the front panel
after we input 60 seconds.
In this exercise, we are introduced with virtual instruments (Vis) with components: the block
diagram and the front panel. The last is used to represent the VI in the block diagrams of other,
Free
Control
Indicator
Numeric
Constant
String
Constant
Control
Indicator
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Assignment_quizsem12021 and more Exams Computer Science in PDF only on Docsity!

EE 179 Laboratory

Exercise 1-1 Concept: Exploring a VI

Goal

Identify the parts of an existing VI.. Block diagram Front panel This is an example of the front panel after we input 60 seconds. In this exercise, we are introduced with virtual instruments (Vis) with components: the block diagram and the front panel. The last is used to represent the VI in the block diagrams of other, Free Control Indicator Numeric Constant String Constant Control Indicator

EE 179 Laboratory calling VIs. The front panel is built using controls and indicators. We are introduced to the basic parts of each component.

Exercise 1-2 Concept: Locating Controls, Functions, and VIs

Goal

Learn to use the palettes and search for controls, functions, and VIs.

In this exercise, we are introduced with using the palettes, controls, functions

and some other virtual instruments.

A step by step process was slowly explained from creating a project to

introducing some shortcuts for some controls and functions.

All introductions were some basics of components of the labview.

EE 179 Laboratory

Exercise 1-4 Concept: Dataflow

Goal

Understand how dataflow determines the execution order in a VI.

  1. Which node executes first? Is there any dependency between the File Dialog function and the Simulate Signal Express VI? Either the File Dialog function or the Simulate Signal Express VI can execute first. There is no data dependency between the two nodes so either of them can execute first or they can execute simultaneously.
  2. Which node executes last? The last node to execute is the Simple Error Handler VI.
  3. Because a green wire connects the File Dialog function to the TDMS File Viewer VI, can the TDMS File Viewer VI execute before the TDMS Close function? No. The TDMS File Viewer VI cannot execute before the TDMS Close function because the yellow error wire connecting the TDMS Close function and the TDMS File Viewer VI forces data dependency. Remember, the data to all inputs of a node must be available before a node can execute. Therefore, the TDMS File Viewer VI must receive data from both the green Boolean wire and the yellow error wire before the VI can execute.
  4. How many nodes must execute before the TDMS Write function can execute? Three nodes must execute before the TDMS Write function can execute: File Dialog, TDMS Open, and Simulate Signal. The TDMS Write function also depends on the Simulated Signal string constant, but that input is instantaneous.
  5. Should a well-designed block diagram flow in a particular direction? Yes. A well-designed block diagram typically flows from left to right. This makes it easier to see the flow of data on the block diagram. However, do not assume

EE 179 Laboratory left-to-right or top-to-bottom execution when no data dependency exists.

  1. In Figure 1-8, which Express VI executes last? Either the Statistics Express VI or the Write to Measurement File Express VI executes last or they execute in parallel. The DAQ Assistant Express VI cannot execute last because both the Statistics Express VI and the Write to Measurement File Express VI are dependent on the data signal from the output of the DAQ Assistant Express VI. 21
  2. In Figure 1-9 an error wire (shown in yellow) connects the Express VIs. Which Express VI executes last? The Write to Measurement File Express VI executes last. It has a data dependency on both the DAQ Assistant Express VI and the Statistics Express VI.
  3. In Figure 1-10, which Tone Measurements Express VI executes last? . Either one of the Tone Measurement Express VIs can execute last. Even though the Tone Measurements 2 Express VI has an extra dependency on the Filter

EE 179 Laboratory rate of 1,000 Hz retrieves 0.1 seconds worth of data. The graph indicator displays a sine wave and the Average Value indicator displays a number with a very sall value or close to zero.

Exercise 2-1 Concept: Debugging

Goal

Use the debugging tools built into LabVIEW. After running the program, multiple errors occur. Labview shows clear explanation of what and where is the error or which part. To fix the error, replace this component with greater than (>). This is the result of probing the wires.

EE 179 Laboratory With Continued debugging of the subVI. Block diagram of the Area and Validity of a Triangle VI After debugging and examining the wires. Results after testing the area of the triangle VI were acquired

EE 179 Laboratory

Exercise 3-2 Auto Match VI

Goal

Use a While Loop and an iteration terminal and pass data through a tunnel.

Scenario

Create a VI that continuously generates random numbers between 0 and 1000 until it generates a number that matches a number selected by the user. Determine how many random numbers the VI generated before generating the matching number. A new project and a new VI (Auto match) was created with the components: Number to match, current number, number of iterations. Default values and desired properties were established in each component. This block diagram was produced. Running the VI. These are the results. And applying an out of range value of the match number, the 3rd picture shows that LabVIEW coerces the out-of-range value to the nearest value in the data range specified in the previous steps.

EE 179 Laboratory This shows the highlighted process of the block diagram.

Exercise 3-3 Concept: While Loops versus For Loops

Goal

Understand when to use a While Loop and when to use a For Loop.

Description

For the following scenarios, decide whether to use a While Loop or a For Loop. Scenario 1 Acquire pressure data in a loop that executes once per second for one minute.

  1. If you use a While Loop, what is the condition that you need to stop the loop? While Loop: Time = 1 minute
  2. If you use a For Loop, how many iterations does the loop need to run? For Loop: 60 iterations
  3. Is it easier to implement a For Loop or a While Loop? Both are possible. Scenario 2 Acquire pressure data until the pressure is greater than or equal to 1400 psi.
  4. If you use a While Loop, what is the condition that you need to stop the loop? While Loop: Pressure = 1400 psi
  5. If you use a For Loop, how many iterations does the loop need to run? For Loop: unknown
  6. Is it easier to implement a For Loop or a While Loop? A While Loop. Although you can add a conditional terminal to a For Loop, you still need to wire a value to the count terminal. Without more information, you do not know the appropriate value to wire to the count terminal. Scenario 3 Acquire pressure and temperature data until both values are stable for two minutes.
  7. If you use a While Loop, what is the condition that you need to stop the loop? While Loop: [(Last Temperature = Previous Temperature) for 2 minutes or more] and [(Last Pressure = Previous Pressure) for 2 minutes or more]
  8. If you use a For Loop, how many iterations does the loop need to run? For Loop: unknown
  9. Is it easier to implement a For Loop or a While Loop? A While Loop. Although you can add a conditional terminal to a For Loop, you still need to wire a value to the count terminal. Without more information, you do not know the appropriate value to wire to the count terminal.

EE 179 Laboratory With multiple input receivers, The graph shows less spikes and much faster input-output reactions. This serves a more reliable observation.

Exercise 3-5 Temperature Monitor VI—Plot Multiple Temperatures

Goal

Plot multiple data sets on a single waveform chart and customize the chart view.

Scenario

Modify the VI from Exercise 3-4 to plot both the current temperature and the running average on the same chart. In addition, allow the user to examine a portion of the plot while the data is being acquired. Applying a little modification with the previous block diagram (adding the Bundle which passes the current temperature and average temperature to the Temperature History chart), this is the resulting block diagram. Also, the front panel was modified, showing 2 plots (average and current temperature), adding the graph palette and scale legend of the temperatire history. This is the result after running the new VI.

EE 179 Laboratory The two plots are quite different as the current temperature shows a lot of spikes while the average shows the mean of the current temperature, hence its smoother.

Exercise 3-6 Temperature Warnings VI—With Error Handling

Goal

Modify a VI to use a Case structure to make a software decision.

Scenario

You created a VI where a user inputs a temperature, a maximum temperature, and a minimum temperature. A warning string generates depending on the relationship of the given inputs. However, a situation could occur that causes the VI to work incorrectly. For example, the user could enter a maximum temperature that is less than the minimum temperature. Modify the VI to generate a different string to alert the user to the error: Upper Limit < Lower Limit. Set the Warning? indicator to TRUE to indicate the error. Modifying a much previous block diagram (temperature warnings), a new block diagram was developed. With added case structures based on the manual instructions and components. A true and false case was created. This first one shows the Temperature Warnings VI Block Diagram—No Error, False Case.

EE 179 Laboratory This Front panel shows the behavior of the output after putting the values: Current temperature: 25 Max temperature: 20 Min temperature: 30

EE 179 Laboratory

EE 179 Laboratory

Exercise 4-1 Temperature Warnings VI—As SubVI

Goal

Create the icon and connector pane for a VI so that you can use the VI as a subVI.

Scenario

You have created a VI that determines a warning string based on the inputs given. Create an icon and a connector pane so that you can use this VI as a subVI.

EE 179 Laboratory

Exercise 5-1 Concept: Manipulating Arrays

Goal

Manipulate arrays using various LabVIEW functions.

Description

You are given a VI and asked to enhance it for a variety of purposes. The front panel of this VI is built. You complete the block diagram to practice several different techniques to manipulate arrays.