LabVIEW Chapter 2


👉LabVIEW Chapter 2👈




Building a VI from a Blank VI
In this chapter we will build a VI that generate a signal, reduce the number of samples in the signal and display the resulting data in front panel table.

1. Opening a Blank VI 
- Getting Started > click Blank VI > New > a blank front panel window and block diagram window appear

2. Adding an Express VI that Simulates a Signal
- Select Help > Show Context Help to display Context Help.
- Or click Show Context Help Window at the left on front panel to display the Context Help


- Function palette > Express > Input, when the cursor over a VI, the Context Help dislay information about VI.


- Use Context Help to find the Express VI that can simulate a sine wave signal. Select Express VI that can simulate a sine wave signal and place on block diagram, Configure Simulate signal appear.


- Move cursor over various option Configure Simulate Signal dialog box such as Frequency (Hz) and Amplitude. Read information appears in Context Help.
- Set frequency of 10.7 and amplitude of 2, signal in the Result Preview changes > click OK.





 - Cursor over Simulate signal Express VI, read information in Context help that display information about how to configured the Simulate Signal Express VI > Save the VI



3. Searching the Help and Modifying a Signal
- On block diagram, move cursor > Simulate signal Express VI to display Context Help > click Detailed Help to display Simulate Signal topic in LabVIEW Help.



-  Also can access LabVIEW Help by > right clicking VI > Help > LabVIEW Help
- Click search > type "sample compression" > ENTER > double click > Add to the block diagram.




- Or you can use Quick Drop from View menu



- Configure the Sample Compression Expression Express VI > reduce the signal by a factor of 25 > OK > Save and Close


- Use wiring tool > wire the Sine output to Signal input 



4. Customizing a User Interface from the Block Diagram
- Right click Mean output > select Create > Numeric Indicator
- Right click the Mean output of the Sample Compression Express VI > select Insert Input/Output 
- Right click Enable input > select Create > Control
- Right click the wire that connect the Sine output to the Signals input > select Create > Graph Indicator.
- Use wiring tool to wire the Mean output of Sample Compression Express VI to the Sine graph
- Display the front panel
- Save the VI



5. Configuring a VI to Run Continuously until the User Stops It
- Display front panel and run VI
-VI runs once and stop, front panel does not have stop button
- Display block diagram
- Click Search > on the Function palette > enter "while" > double click While Loop <<Execution Control>> to display Execution Control
- Select while Loop on Execution Control
- While loop appears with STOP button.
- Display front panel and run VI
- The VI now runs until you click STOP button.



6. Using the Error List Window
- Display the front panel > move cursor over Mean indicator

  

- Click the Mean indicator > select it and press Delete key



- Display block diagram
- A wire appears as dashed black line with red x in the middle. Run button appear broken to indicate the VI cannot run


- Click the broken Run button > display the Error list
- The Error list windows lists all errors in the VI


- In the errors and warning list > select wire: has loose ends error > click Help button
- In the errors and warning > double click wire: has loose ends > press Ctrl-B to delete the broken wire



- Select View > Error List to display the Error list window. No errors appear in the errors and warning field.
- Click Close button to close Error list. Run button no longer appears broken




7.  Controlling the Speed of Execution
- On the block diagram > search for the Time Delay Express VI > enter 0.25 in the Time delay (seconds) text box > click OK > close the Configure Time Delay





- Display front panel and run VI



- Click Enable button switch to on the display graph, if the Enable switch off the graph does not display the reduced signal.


- Click STOP button to stop the VI

8. Using a Table to Display Data
- Display front panel
- On the Control palette > search Express Table indicator > add to right of the waveform graph



- Display block diagram
- LabVIEW wired the Table terminal to the Build Table Express VI
- Drag the object into the While Loop to the right of the Sample Compression Express VI
- Use Wiring tool to wire the Mean output to the Signals input



- Run the VI
- Click Enable switch
- If the Enable switch is on, the table display the mean values of every 25 samples of the sine wave. If the Enable is off the table does not record the mean values > Stop the VI > Save







CHAPTER 2 DONE✔✔


.

Comments