<< Chapter < Page Chapter >> Page >
Use the LabVIEW documentation resources to build a VI that generates a signal, reduces the number of samples in the signal, and displays the resulting data in a table on the front panel.

In the following exercises, you will open a blank VI and add Express VIs and structures to the block diagram to build a newVI. When you complete the exercise, the front panel of the VI will appear similar to the .

Opening a blank vi

If no template is available for the task you want to create, you can start with a blank VI and add Express VIs toaccomplish the specific task. Complete the following steps to open a blank VI.

  • In the LabVIEW dialog box, click the arrow on the New button and select Blank VI from the shortcut menu or press the Ctrl-N keys to open a blank VI.Notice that a blank front panel and block diagram appear.
  • If the Functions palette is not visible, right-click any blank space on the block diagram to displaythe Functions palette. Click the thumbtack, shown in , in the upper left corner of the Functions palette to place the palette on the screen.
You can right-click a blank space on the block diagram or the front panel to display the Functions or Controls palettes.

Adding an express vi that simulates a signal

Complete the following steps to find the Express VI you want to use and then add it to the block diagram.

  • If the Context Help window is not visible, press the Ctrl-H keys to open the Context Help window. You also can press the Show Context Help Window button, shown in , to open the Context Help window.
  • Select the Input palette on the Functions palette and move the cursor over the Express VIs on the Input palette.Notice that the Context Help window displays information about the function of each Express VI.
  • From the information provided in the Context Help window, find the Express VI that can simulate a sine wave signal.
  • Select the Express VI and place it on the block diagram. The Configure Simulate Signal dialog box appears.
  • Idle the cursor over the various options in the Configure Simulate Signal dialog box, such as Frequency (Hz) , Amplitude , and Samples per second (Hz) . Read the information that appears in the Context Help window.
  • Configure the Simulate Signal Express VI to generate a sine wave with a frequency of 10.7 and amplitude of 2 .
  • Notice how the signal displayed in the Result Preview window changes to reflect the configured sine wave.
  • Close the Configure Simulate Signal dialog box by clicking the OK button.
  • Move the cursor over the Simulate Signal Express VI and read the information that appears in the Context Help window.Notice that the Context Help window now displays the configuration of the Simulate Signal Express VI.
  • Save this VI as Reduce Samples.vi in the C:\Exercises\LabVIEW Basics I directory.

Modifying the signal

Complete the following steps to use the LabVIEW Help to search for the Express VI that reduces the number of samples in a signal.

  • Select Help>>VI, Function,&How-To Help to open the LabVIEW Help .
  • Click the Search tab and type sample compression in the Type in the word(s) to search for text box.Notice that this word choice reflects what you want this Express VI to do-compress, or reduce, the number of samplesin a signal.
  • To begin the search, press the Enter key or click the List Topics button.
  • Double-click the Sample Compression topic to display the topic that describes the Sample Compression Express VI.
  • After you read the description of the Express VI, click the Place on the block diagram button to select the Express VI.
  • Move the cursor to the block diagram.Notice how LabVIEW attaches the Sample Compression Express VI to the cursor.
  • Place the Sample Compression Express VI on the block diagram to the right ofthe Simulate Signal Express VI.
  • Configure the Sample Compression Express VI to reduce the signal by a factor of 25 using the mean of these values.
  • Close the Configure Sample Compression dialog box.
  • Using the Wiring tool, wire the Sine output in the Simulate Signal Express VI to the Signals input in the Sample Compression Express VI.

Customizing the front panel

In a previous exercise , you added controls and indicators to the front panel using the Controls palette. You also can add controls and indicators from the block diagram. Complete the followingsteps to create controls and indicators as shown in .

  • Right-click the Mean output in the Sample Compression Express VI and select Create>>Numeric Indicator from the shortcut menu to create a numeric indicator.
  • Right-click the Mean output of the Sample Compression Express VI and select Insert Input/Output from the shortcut menu to insert the Enable input.
  • Right-click the Enable input and select Create>>Control from the shortcut menu to create the Enable switch.
  • Right-click the wire linking the Sine output in the Simulate Signal Express VI to the Signals input in the Signal Compression Express VI and select Create>>Graph Indicator from the shortcut menu.Notice that you can create controls and indicators from the block diagram. When you create controls and indicators usingthis method, LabVIEW automatically creates terminals that are labeled and formatted correctly.
  • Using the Wiring tool, wire the Mean output in the Sample Compression Express VI to the Sine graph indicator terminal created in the previous step.Notice that the Merge Signals function appears.
  • Arrange the objects on the block diagram so that they appear similar to .
    You can right-click any wire and select Clean Up Wire from the shortcut menu to automatically route an existing wire.
  • Display the front panel.Notice that the controls and indicators you added automatically appear on the front panel with labels thatcorrespond to their function.
  • Save this VI.

Configuring the vi to run continuously until the user stops it

In the current state, the VI runs once, generates one signal, then stops executing. To run the VI until a condition is met,you can add a While Loop to the block diagram. Complete the following steps to add a While Loop .

  • Display the front panel and run the VI.Notice how the VI runs once and then stops. Also notice how there is no Stop button.
  • Display the block diagram and select the While Loop on the Functions>>Execution Control palette.
  • Move the cursor to the upper left corner of the block diagram. Place the top left corner of the While Loop here.
  • Click and drag the cursor diagonally to enclose all the Express VIs and wires, as shown in .
    Notice that the While Loop , shown in , appears with a Stop button wired to the condition terminal. This While Loop is configured to stop when the user clicks the Stop button.
  • Display the front panel and run the VI.Notice that the VI now runs until you click the Stop button. A While Loop executes the functions inside the loop until the user presses the Stop button. Refer to Repetition and Loops for more information about While Loops .

Controlling the speed of execution

To plot the points on the waveform graph more slowly, you can add a time delay to the block diagram. Complete the followingsteps to control the speed at which the VI executes.

  • On the block diagram, select the Time Delay Express VI on the Functions>>Execution Control palette and place it inside the loop.
  • Type .250 in the Time delay (seconds) text box.This time delay specifies how fast the loop runs. With a .250 second time delay, the loop iterates once every quarter of asecond.
  • Close the Configure Time Delay dialog box.
  • Save this VI.
  • Display the front panel and run the VI.
  • Click the Enable switch and notice the change on the graph.Notice how if the Enable switch is on, the graph displays the reduced signal. If the Enable switch is off, the graph does not display the reduced signal.
  • Click the Stop button to stop the VI.

Using a table to display data

Complete the following steps to display a collection of meanvalues in a table on the front panel.

  • On the front panel, select the Express Table indicator on the Controls>>Text Indicators palette and place it on the front panel to the right of the waveform graph.
  • Display the block diagram.Notice that the Table terminal appears wired to the Build Table Express VI automatically.
  • If the Build Table Express VI and the Table terminal are not selected already, click an open space on the block diagram to the left of the Build Table Express VI and the Table terminal. Drag the cursor diagonally until the selection rectangle encloses the Build Table Express VI and the Table terminal, shown in .A moving dashed outline called a marquee highlights the Build Table Express VI, the Table terminal, and the wire joining the two.
  • Drag the objects into the While Loop to the right of the Mean terminal.Notice that the While Loop automatically resizes to enclose the Build Table Express VI and the Table terminal.
  • Using the Wiring tool, wire the Mean terminal of the Sample Compression Express VI to the Signals input of the Build Table Express VI.The block diagram should appear similar to .
  • Display the front panel and run the VI.
  • Click the Enable switch.The table displays the mean values of every 25 samples of the sine wave. Notice if the Enable switch is off, the table does not record the mean values.
  • Stop the VI.
  • Experiment with properties of the table by using the Table Properties dialog box. For example, try changing the number of columns to one.
  • Save and close this VI.

Questions & Answers

what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
What would be the best educational aid(s) for gifted kids/savants?
Heidi Reply
treat them normal, if they want help then give them. that will make everyone happy
Saurabh
What are the treatment for autism?
Magret Reply
hello. autism is a umbrella term. autistic kids have different disorder overlapping. for example. a kid may show symptoms of ADHD and also learning disabilities. before treatment please make sure the kid doesn't have physical disabilities like hearing..vision..speech problem. sometimes these
Jharna
continue.. sometimes due to these physical problems..the diagnosis may be misdiagnosed. treatment for autism. well it depends on the severity. since autistic kids have problems in communicating and adopting to the environment.. it's best to expose the child in situations where the child
Jharna
child interact with other kids under doc supervision. play therapy. speech therapy. Engaging in different activities that activate most parts of the brain.. like drawing..painting. matching color board game. string and beads game. the more you interact with the child the more effective
Jharna
results you'll get.. please consult a therapist to know what suits best on your child. and last as a parent. I know sometimes it's overwhelming to guide a special kid. but trust the process and be strong and patient as a parent.
Jharna
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, Labview graphical programming. OpenStax CNX. Apr 09, 2015 Download for free at https://legacy.cnx.org/content/col11408/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Labview graphical programming' conversation and receive update notifications?

Ask