Tuesday, 12 September 2017

CHAPTER 3 : ANALYZING AND SAVING A SIGNAL




1) Modifying a VI Created from a Template

  • Firstly, click New to display the New dialog box and then Create New list, select VI»From Template»Tutorial(Getting Started)»Generate, Analyze, and Display.
  • Click the OK button or double-click the name of the template to create a VI from the template.
  • Display the front panel and remove the RMS indicator, shown at left (student will not use the RMS functionality of the Amplitude and Level Measurements Express VI for this exercise).
  • Display the block diagram and remove any broken wires that result from removing the RMS indicator.
  • Then return to the front panel window and right-click the waveform graph indicator.
  • Select Properties from the shortcut menu. The Graph Properties dialog box appears.
  • On the Appearance page, place a checkmark in the Visible checkbox in the Label section and enter Unfiltered Signal in the text box then click OK and RUN (the signals will appear).
  • Then Stop.



2) Adding a Signal
  • Drag Simulate Signal Express VI to create an additional Simulate Signal Express VI.

  • Double-click the Simulate Signal2 Express VI to display the Configure Simulate Signal dialog box.

  • Select Sine from the Signal type pull-down menu and Enter 60 in the Frequency (Hz) text box then Enter 0.1 in the Amplitude text box. 
  • Place a checkmark in the Add noise checkbox to add noise to the sine signal.
  • Select Uniform White Noise from the Noise type pull-down menu.
  • Enter 0.1 in the Noise amplitude text box and  Enter -1 in the Seed number text box.
  • In the Timing section, select the Run as fast as possible option.
  • In the Signal Name section, remove the checkmark from the Use signal type name checkbox.
  • Enter 60 Hz and Noise in the Signal name text box and then click OK.




3)Adding Two Signals
  • In the block diagram window, triple-click the wire that connects the Sine output of the Simulate Signal Express VI to the Signals input of the Amplitude and Level Measurements Express VI and to the Unfiltered Signal indicator. Remove the wire.
  • Click Functions palette, click the Search button to search for the Formula Express VI and add to the block diagram.
  • The Configure Formula dialog box appears.
  • In the Label column, change the label for X1 to Sine and the label for X2 to 60 Hz and Noise.
    The Formula Express VI automatically enters the first input, Sine, in the Formula text box.
  • Click the + button and then the X2 button to add Sine and 60 Hz and Noise together in the Formula text box.
  • Then click OK.

  • Use the Wiring tool to wire the Sine output of the Simulate Signal Express VI to the Sine input of the Formula Express VI.
  • Wire the 60 Hz and Noise output of the Simulate Signal2 Express VI to the 60 Hz and Noise input of the Formula Express VI.
  • Wire the Result output of the Formula Express VI to the Unfiltered Signal indicator and to the Signals input of the Amplitude and Level Measurements Express VI.
  • Run the VI, then the signal with noise will appears.


  • Click the STOP button to stop the VI.
  • Select File»Save As and save the VI as Analysis.vi in an easily accessible location.





3) Filtering a Signal

  • Display the block diagram window and remove the wire that connects the 
    Result output of the Formula Express VI to the Signals input of the 
    Amplitude and Level Measurements Express VI.
  • Remove all broken wires.

  • Search for the Filter Express VI, shown at left, and add it to the block diagram between the Simulate Signal2 Express VI and the Amplitude and Level Measurements Express VI. The Configure Filter dialog box appears.
  • In the Filter Specifications section, change the Cutoff Frequency (Hz) to 25.
  • Click the OK button to save the configuration and close the Configure Filter dialog box and the Display the front panel and duplicate the Unfiltered Signal waveform graph indicator. 
aina
  • Triple-click the Unfiltered Signal 2 label above the new waveform graph indicator and enter Filtered Signal to change the label of the indicator.

  • On the block diagram, wire the Result output of the Formula Express VI to the Signal input of the Filter Express VI and to the Unfiltered Signal waveform graph indicator.
  • Wire the Filtered Signal output of the Filter Express VI to the Signals input of the Amplitude and Level Measurements Express VI and to the input of the Filtered Signal waveform graph indicator.


  • Then save.


4) Modifying the Appearance of Graphs

  • In the front panel window, right-click the Unfiltered Signal graph indicator and select Properties from the shortcut menu. The Graph Properties dialog box appears.
  • On the Display Format page, select Time (X-Axis) from the top pull-down menu.
  • Select the Default editing mode option.
  • In the Type list, select Automatic formatting.
  •  In the Digits field, enter 6 and select Significant digits from the Precision Type pull-down menu.
  •   Place a checkmark in the Hide trailing zeros checkbox.
  •  Select Amplitude (Y-Axis) from the top pull-down menu and repeat steps from  Display Format page so the y-axis configuration matches the x-axis configuration.

  • On the Scales page, select Amplitude (Y-Axis).

  • Remove the checkmark from the Autoscale checkbox.
  • Enter -2.5 in the Minimum text box and 2.5 in the Maximum text box.
  • Click OK.







  • Repeat the same steps to the Filtered signal.



5) Analyzing the Amplitude of a Signal
  • On the block diagram, double-click the Amplitude and Level Measurements Express VI to display the Configure Amplitude and Level Measurements dialog box.
  • In the Amplitude Measurements section, remove the checkmarkfrom the RMS checkbox.
  • Place a checkmark in the Peak to peak checkbox. Peak to peak appears in the Results section with the corresponding value of the measurement.
  • Then click OK button.




6)Controlling the Speed of Execution


  • On the block diagram, search for the Time Delay Express VI and place inside the While Loop and Configure Time Delay dialog box appears
  •  .
  • Enter 1.000 in the Time delay (seconds) text box and click the OK Button.
  •  Display the front panel and run the IV.
  • The VI run more slowly and it rates once every second and stop the VI.




7) Adding a Warning Light

  • Display the Controls palette by right-clicking any blank space in the front panel window.
  • On the Express palette, select the LEDs palette.
  • Select the round LED indicator and add it to the front panel to the left of the waveform graphs.
  • Double-click the Boolean label above the LED and enter Warning to change the label of the LED.

  • Save the file and read the various dialog box options. Select the Copy and Substitute copy for original options to create a copy of the original VI and immediately edit the copy and then Click the Continue button and save the VI as Warning Light.vi in an easily accessible location.





8) Setting a Warning Level Limit
  • On the block diagram, search for the Comparison Express VI and place it to the right of the Amplitude and Level Measurements Express VI. The Configure Comparison dialog box appears.

  • In the Compare Condition section, select the > Greater option.
  • In the Comparison Inputs section, select Value and enter 2 in the Value numeric control to assign a constant value at which you want the LED to light.
  • Click the OK button to save the current configuration and close the Configure Comparison dialog box.
  • Wire the Peak to Peak output of the Amplitude and Level Measurements Express VI to the Operand 1 input of the Greater Express VI.
  • Move the cursor over the wire that connects the Peak to Peak output to the Operand 1 input.
  • When the Positioning tool appears, right-click the wire that connects the Peak to Peak output to the Operand 1 input and select Create» Numeric Indicator from the shortcut menu.



9)Warning the User

  • In the block diagram window, move the Warning terminal to the right of the Greater Express VI. Make sure the Warning terminal is inside the While Loop.
  • Wire the Result output of the Greater Express VI to the Warning terminal.


  • Display the front panel and A numeric indicator labeled Peak to Peak appears in the front panel window. This indicator displays the peak-to-peak value of the signal and run the VI.
  • When the peak-to-peak value exceeds 2.0, the Warning indicator lights. Then Click the STOP button to stop the VI.



10) configuring a VI to Save Data to a File
  • Search for the Write To Measurement File Express VI and add it to the block diagram below and to the right of the Amplitude and Level Measurements Express VI.

  • In the Configure Write to Measurement File dialog box, locate the If a file already exists section and select the Append to file option to write all the data to the test.lvm file without erasing any existing data in the file
  • .In the Segment Headers section, select the One header only option to create only one header in the file to which LabVIEW writes the data
  • Enter the following text in the File Description text box: Sample of peak to peak values. LabVIEW appends the text you enter in this text box to the header of the file.
  • Click the OK button to save the current configuration and close the Configure Write To Measurement File dialog box.


11) Saving Data to a File 
  • On the block diagram, wire the Peak to Peak output of the Amplitude and Level Measurements Express VI to the Signals input of the Write To Measurement File Express VI.
  • Select File»Save As and save the VI as Save Data.vi in an easily accessible location.
  • Display the front panel and run the VI and Click the front panel STOP button.
  • To view the data student saved, open the test.lvm file in the LabVIEW Data directory with a spreadsheet or text-editing application. The file has a header that contains information about the Express VI.
  • Close the file after you finish looking at it and return to the Save Data VI.

12) Adding a Button That Stores Data When Clicked


  • Display the front panel and search the Controls palette for a rocker button. Select one of the rocker buttons and place it to the right of the waveform graphs.

  • Right-click the rocker button and select Properties from the shortcut menu to display the Boolean Properties dialog box.
  • Change the label of the button to Write to File.
  • On the Operation page of the Boolean Properties dialog box, select Latch when pressed from the Button behavior list.
  • Click the OK button to save the current configuration and close the Boolean Properties dialog box. Save the VI.

13) Saving Data When Prompted by a User
  • In the block diagram window, double-click the Write To Measurement File Express VI to display the Configure Write To Measurement File dialog box.
  • Change the filename test.lvm in the Filename text box to Selected Samples.lvm to save the data to a different file.
  • Click the OK button to save the current configuration and close the Configure Write To Measurement File dialog box.
  • Right-click the Signals input of the Write To Measurement File Express VI and select Insert Input/Output from the shortcut menu to insert the Comment input.
  • Right-click the Comment input of the Write To Measurement File Express VI and select Select Input/Output»Enable from the shortcut menu to replace the Comment input with the Enable input.

  • Move the Write to File terminal to the left of the Write To Measurement File Express VI.
  • Wire the Write to File terminal to the Enable input of the Write To Measurement File Express VI.

14) Viewing Saved Data


  • Display the front panel and run the VI. Click the Write to File button several times.
  • Click the STOP button.
  • Open the Selected Samples.lvm file with a spreadsheet or text-editing application.
  • Close the wordpad.
  • Save and close the VI.




Tuesday, 5 September 2017

CHAPTER 2 : CUSTOMIZING A VI

1.Opening a Blank VI


  • If there are no template available, thus start with blank VI and add Express VIs to accomplish a specific task.
  • click Getting started and then choose the blank VI in the New section.


  • The Blank front panel window and block diagram window appear.


  • If the Function palette not visible then right click any blank space on the block diagram to display Function Palette.

2.Adding an Express VI that Stimulates a Signal


Click help and choose the show context help which are from the block diagram and front panel.




On the Function Palette right click the express and choose input palette

Then move the cursor over one of the input palette. When students move the cursor over a VI, the Context Help window displays information about that VI.

Information in the Context Help window will help to find the Express VI that can simulate a sine wave signal.

Select Express VI and click the Configure Stimulate Signal ( dialog box appear).

Move the cursor over the various option in the “ Configure Stimulate Signal”


The dialog box will appear. 

Frequency and Amplitude will appear.

Read the information that appears in the context help windows.




Next, generate a sine wave with frequency = 10.7 and amplitude =2.

The signal in the Result Preview window changes to reflect the configured sine wave.
 
Click the OK button to save the current configuration and close the Configure Simulate Signal dialog box.



Students need to move the cursor over the stimulate signal express VI and read the information that appears in the context help window it will display the addition standard context help description.

Then, student have to save the VI.




3. Searching the help and modifying a signal.


A part from that, move the cursor over the stimulate signal express VI on the block diagram to display the context help and then click the detailed help link to display the stimulate signal topic in the Labview help.


Search tab > sample compression > enter > double click

Later, click add to the block diagram and then move the cursor to block diagram then click add sample compression express VI to the block diagram


Use View then click Quick drop to find easily the item and choose configure the sample compression expres VI to reduce the signal by a factor 25 using the mean of these values and then click  ok  and choose close the configure sample compression dialog box.



  

Next, use the Wiring tool to wire the Sine output of the Simulate Signal Express VI to the Signals input of the Sample Compression Express VI.





4.Customizing a user interface from the block diagram

Later, student need to Right click the Mean output of sample and then Create and choose the Numeric Indicator and click mean indicator appear shown at left.

Right-click the wire that connects the Sine output of the Simulate Signal Express VI to the Signals input of the Sample Compression Express VI and select Create and then choose the Graph Indicator from the shortcut menu.

Later on, students need to use the Wiring tool to wire the Mean output of the Sample Compression Express VI to the Sine graph indicator.

The merge signals function will appears.


Next, rearrange the object  and click the display the front panel.


5.Configuring a Vi to run cointinously until the user stops it.

Then add the while loop and click the execution control and move the cursor to the upper left corner of the block disgram and drag the cursor diagnostically to enclose all the express VIs   and then release the while loop and hit the  stop button will appear.





Next, display the front panel and run the VI.

Then, the VI now runs until students click the STOP button. Later, a While Loop executes the VIs and functions inside the loop until the user clicks the STOP button.



Click the STOP button and save the VI.





6.Using the error list window

Display front panel and click mean indicator that shown at left and press delete key

Next, display block diagram  and a wire appears as a dashed black line with a red X in the middle, shown at left. The dashed black line is a broken wire. 

The Run button, shown at left, appears broken to indicate the VI cannot run.





Then, click the broken run and choose to display error list window and in the error and warnings list select the  wire has loose ends error  click help.


Select view and choose the error list then click close button to close the error list window and run button no longer appears broken.



7.Controlling the speed of execution

On the block diagram, search for the Time Delay Express VI, shown at left, on the Functions palette and place it inside the While Loop. Students can use the Time Delay Express VI to control the execution rate of the VI.

Enter 0.25 at time delay text box and click ok then choose close the configuration time delay dialog box.






Display the front panel  and run the VI next click enable switch and examine the graph
If the enable switch is on, the graph display reduced the signals but If the enable switch off, thus the graph does not display the reduced signal.





Click stop button to stop the VI



8.Using a table to display data

click Control and search for Express Table indicator then add to the right waveform graph.


Display the block diagram and choose lab view wired the table terminal to the build table express VI and then drag the cursor diagonally until the selection rectangle encloses the build table express VI and table terminal.

Drag the object into the while loop to the right sample compression Express VI.

Use the Wiring tool to wire the Mean output of the Sample Compression Express VI to the Signals input of the Build Table Express VI.


Display the front panel and  arrange the controls indicator then click run VI and click enable switch  and choose stop 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 the VI.



9.Searching for example


click Help and choose Getting started and select Lab view then click search tab and type time delay express VI then press enter.


Then,click location column header and search results by content type and choose the reference topics that contains the reference information about labview  objects such as VIs, functions, palette, menus and tools.

Double click time delay exprexx VI > click ope example > run > move the vertical pinter slides> the amplitudes value A and B changes the pointer slides > stop VI

Next, select  window and show block diagram and read the block diagram comments then close the example VI and open labview help window. Students need to click find the related examples button to open the NI example finder and display a list of example similar to example that used in this VI.

Lastly, click at Help  and find example. Then, after experiment the NI example finder and choose close.

End of chapter 2.


CHAPTER 3 : ANALYZING AND SAVING A SIGNAL

1) Modifying a VI Created from a Template Firstly, click New to display the New dialog box and then  Create New list, select VI...