<< Chapter < Page Chapter >> Page >

First, build a front panel as shown in [link] a. For the inputs, consider two Knobs ( Controls Modern Numeric Knob ) . Adjust the size of the knobs by using the Positioning tool. One can modify knob properties such as precision and data type by right-clicking and choosing Properties from the shortcut menu. A Knob Properties dialog box opens and an Appearance tab is shown by default. Edit the label of one of the knobs to read Input 1. Select the Data Type tab, click Representation and select Byte to change the data type from double precision to byte. One can also perform this by right-clicking on the knob and choosing Representation Byte from the shortcut menu. In the Data Type tab, a default value needs to be specified. In this example, the default value is considered to be 0. The default value can be set by right-clicking on the control and choosing Data Operations Make Current Value Default from the shortcut menu. Also, this control can be set to a default value by right-clicking and choosing Data Operations Reinitialize to Default Value from the shortcut menu.

Label the second knob as Input 2 and repeat all the adjustments as carried out for the first knob except for the data representation part. Specify the data type of the second knob to be double precision to demonstrate the difference in the outcome. As the final front panel configuration step, align and distribute the objects using the appropriate buttons on the front panel toolbar.

To set the outputs, locate and place a numeric indicator, a round LED ( Controls Modern Boolean Round LED ) and a gauge ( Controls Modern Numeric Gauge ) . Edit the labels of the indicators as shown in [link] .

Example of Structure and SubVI: (a) Front Panel, (b) Block Diagram.

Locate a Greater or Equal? function from Functions Programming Comparison Greater or Equal? to compare the average output of the subVI with a threshold value. Create a wire branch on the wire between the Average terminal of the subVI and its indicator via the Wiring tool. Then, extend this wire to the x terminal of the Greater or Equal? function. Right-click on the y terminal of the Greater or Equal? function and choose Create Constant to place a numeric constant. Enter 9 in the numeric constant and wire the round LED, labeled as Warning, to the x>=y? terminal of this function to provide a Boolean value.

To run the VI continuously, use a while loop structure. Choose Functions Programming Structures While Loop to create a while loop . Change the size by dragging the mouse to enclose the objects in the while loop , as illustrated in [link] .

While Loop Enclosure.

Once this structure is created, its boundary, together with the loop iteration terminal and conditional terminal , get shown on the block diagram. If one creates the while loop by using Functions Programming Structures While Loop , the Stop button is not included as part of the structure. One can create this button by right-clicking on the conditional terminal and choosing Create Control from the shortcut menu. It is possible to wire a Boolean condition to a conditional terminal, instead of a Stop button, to stop the loop programmatically.

Next run the VI to verify its functionality. After clicking the Run button on the toolbar, adjust the knobs to alter the inputs. Verify whether the average and sum are displayed correctly in the gauge and numeric indicators. Note that only integer values can be entered via the Input 1 knob while real values can be entered via the Input 2 knob. This is due to the data types associated with these knobs. The Input 1 knob is set to byte type, in other words, I8 or 8-bit signed integer. As a result, one can enter only integer values within the range -128 and 127. Considering that the minimum and maximum values of this knob are set to 0 and 10, respectively, one can enter only integer values from 0 to 10 for this input.

Front Panel as VI Runs.

Debugging vis: probe tool

Use the Probe tool to observe data that are being passed while a VI is running. A probe can be placed on a wire by using the Probe tool or by right-clicking on a wire and choosing Probe from the shortcut menu. Probes can also be placed while a VI is running.

Placing probes on wires creates probe windows through which one can observe intermediate values. As an example of using custom probes, use four probe windows at the probe locations 1 through 4 in the Sum and Average VI to probe the values at those locations. These probes and their locations are illustrated in [link] .

Probe Tool.

Profile tool

With the Profile tool, one can gather timing and memory usage information. Make sure to stop the VI before selecting Tools Profile Performance and Memory to open a Profile window.

Place a checkmark in the Timing Statistics checkbox to display timing statistics of the VI. The Timing Details option offers more detailed VI statistics such as drawing time. To profile memory usage as well as timing, check the Memory Usage checkbox after checking the Profile Memory Usage checkbox. Note that this option can slow down VI execution. Start profiling by clicking the Start button on the profiler, then run the VI. Obtain a snapshot of the profiler information by clicking on the Snapshot button. After viewing the timing information, click the Stop button. The profile statistics can be stored in a text file by clicking the Save button.

An outcome of the profiler is shown in [link] after running the Sum and Average or L1.1 VI. [link] provides more details on the Profile tool.

Profile Window after Running Sum and Average VI.

Lab exercises

Build a VI to compute the variance of an array x size 12{x} {} . The variance σ size 12{σ} {} is defined as:

σ = 1 N j = 1 N ( x j μ ) 2 size 12{σ= { {1} over {N} } Sum cSub { size 8{j=1} } cSup { size 8{N} } { \( x rSub { size 8{j} } - μ \) rSup { size 8{2} } } } {}

where μ size 12{μ} {} denotes the average of the array x. For x, use all the integers from 1 to 1000.

Insert Solution Text Here

Build a VI to check whether a given positive integer n size 12{n} {} is a prime number and display a warning message if it is not a prime number.

Insert Solution Text Here

Build a VI to generate the first N size 12{N} {} prime numbers and store them using an indexing array. Display the outcome.

Insert Solution Text Here

Build a VI to sort N size 12{N} {} integer numbers (positive or negative) in ascending or descending order.

Insert Solution Text Here

Questions & Answers

how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
what is inflammation
Shelly Reply
part of a tissue or an organ being wounded or bruised.
Wilfred
what term is used to name and classify microorganisms?
Micheal Reply
Binomial nomenclature
adeolu
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, An interactive approach to signals and systems laboratory. OpenStax CNX. Sep 06, 2012 Download for free at http://cnx.org/content/col10667/1.14
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'An interactive approach to signals and systems laboratory' conversation and receive update notifications?

Ask