DOC PREVIEW
PSU EE 200 - Lab_21_EE200_s14

This preview shows page 1-2-3-4-5-6-41-42-43-44-45-46-83-84-85-86-87-88 out of 88 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 88 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ColorGrayscaleEE 200 Spring 2014Lab 21.EE 200Design ToolsLaboratory 21Professor Jeffrey SchianoDepartment of Electrical Engineering1EE 200 Spring 2014Lab 21.Laboratory 21 Topics• LabVIEW Programming– Methods for Front Panel Objects– Implicitly and Explicitly Linked Invoke Nodes– Properties and Methods for VIs– Control References and sub VIs: Control Refnums– Weakly and Strictly Typed Control Refnums– Synchronization using Notifiers2EE 200 Spring 2014Lab 21.Methods of Front Panel Objects• Front panel objects have methods– Methods are things that a front panel object can do• Different types of front panel objects have different methods– Controls have the method reinitialize to default– Waveform Charts and Graphs have a method to save the image to a file– Invoke nodes invoke methods3EE 200 Spring 2014Lab 21.Invoke Nodes• Use the Invoke Node to perform actions, or methods, on referenced items• Invoke nodes can be explicitly or implicitly linked to front panel objects• Most methods have parameters4EE 200 Spring 2014Lab 21.Implicitly Linked Invoke Nodes• Right-click the object and select Create >> Invoke Node and choose a method• A method common to all controls is Reinitialize to Default• The Waveform Graph has the method Export Image5EE 200 Spring 2014Lab 21.Exercise 1• Open Exercise_1.vi• Run the VI two or three times and observe that the origin of the time axis does not automatically reset to zero6EE 200 Spring 2014Lab 21.Exercise 1• Modify the VI as follows:– Clear the chart data using an implicitly linked property node; wire an empty array to the chart history terminal– Use an implicitly linked invoke node to export the data to an Excel file7EE 200 Spring 2014Lab 21.Exercise 18EE 200 Spring 2014Lab 21.• Programming >> Application Control Explicitly Linked Invoke Nodes9EE 200 Spring 2014Lab 21.Exercise 2• Repeat Exercise 1 using– an explicitly linked property node to clear the chart and set the plot color to red• use the color box constant available in the Dialog & User Interface palette on the block diagram– an explicitly linked invoke node to export the data to Excel10EE 200 Spring 2014Lab 21.Exercise 211EE 200 Spring 2014Lab 21.Distinguishing Explicitly Linked Property and Invoke Nodes12• Property Nodes indicated by a wrench• Invoke Nodes indicated by an arrowEE 200 Spring 2014Lab 21.Properties and Methods for VIs• In addition front panel objects, VIs also have Properties and Methods• Explicitly link to the VI using a VI server reference available in the Programming >> Application Control palette13EE 200 Spring 2014Lab 21.VI Properties14EE 200 Spring 2014Lab 21.VI Methods15EE 200 Spring 2014Lab 21.Exercise 3• Use an invoke node to center the front panel of Exercise_1.vi; do not save the data to an Excel file16EE 200 Spring 2014Lab 21.Control References and sub VIs• It useful to have a subVI set properties and methods on front panel objects of the calling VI• How do we pass control references to subVIs?• The subVI accepts the control reference using a Control Refnum17EE 200 Spring 2014Lab 21.Techniques for Creating aControl Refnum in a subVI• Method 1: Create a subVI by encircling code on the block diagram• Method 2: Select a Control Refnum from either the Modern or Classic palette on the front panel of the subVI18EE 200 Spring 2014Lab 21.Exercise 4: Part 1• Open Exercise 4 Part 1.vi in the Exercise 4 subdirectory• This VI produces a response that is the square of the input• A vertical fill indicator shows the response level• The fill color changes to warn the use of large responses– Blue fill when the response is less than 75 – Red fill when the response is greater than 75• Run the VI and note its operation19EE 200 Spring 2014Lab 21.Exercise 7: Part 120• Exercise 4 Parts 2 and 3 demonstrate the two methods on slide 18 for generating a Control Refnum and subVI that sets fill colorEE 200 Spring 2014Lab 21.Exercise 4: Part 2 – Method 11. Select the block diagram portion that will be in the subVI2. Select Edit >> Create SubVI; LabVIEW automatically creates the control refnum needed for the subVI21EE 200 Spring 2014Lab 21.Exercise 4: Part 2 – Method 13. Customize and save the sub VI22EE 200 Spring 2014Lab 21.Exercise 4: Part 3 – Method 21. Create the subVI less the control refnum23EE 200 Spring 2014Lab 21.Exercise 4: Part 3 – Method 22. Place a Control Refnum on the subVI front panel24EE 200 Spring 2014Lab 21.Exercise 4: Part 3 – Method 23. Add a label to the Control Refnum4. Drag a vertical fill slide control into the Control Refnum25EE 200 Spring 2014Lab 21.Exercise 4: Part 3 – Method 25. Complete the subVI wiring to obtain the same subVI as on slide 2226EE 200 Spring 2014Lab 21.Weakly and Strictly TypedControl Refnums• A weakly typed refnum does not contain information about the type of data that the refnum points to• A strictly typed refnum does contain the data type for the object that it points to– A red star designates that the refnum is strictly typed27Strictly Typed RefnumsEE 200 Spring 2014Lab 21.Strictly Typed Control Refnums• Control references created from a control are strictly typed by default• Strictly typed control refnums accept only control refnumsof exactly the same data type• For example, if the type of a strictly typed control refnumis 32-bit integer slide, you can wire only the refnum for a 32-bit integer slide to the control refnum terminal28EE 200 Spring 2014Lab 21.Weakly Typed Control Refnums• More flexible in the type of data they accept• For example, if the type of a weakly typed control refnum is 32-bit integer slide, you can wire the refnum for a 16-bit integer slide, a single-precision slide, or a cluster of 32-bit integer slides to the control refnum terminal– As long as the control is a slide control, it will be accepted by the weakly typed control refnum regardless of its data type– A broken wire will result if the control is not a slide control, for example, a 1D array of 32-bit integers29EE 200 Spring 2014Lab 21.Example 130EE 200 Spring 2014Lab 21.Exercise 5• Generate a VI that determines and displays the square of a double type numeric• Place the square function in a subVI. Pass the control reference for the front panel control and indicator using refnums• Use strictly typed refnums31EE 200 Spring 2014Lab 21.Exercise 532EE 200 Spring 2014Lab 21.Exercise 5• Verify the code works• Right click on the Control


View Full Document

PSU EE 200 - Lab_21_EE200_s14

Download Lab_21_EE200_s14
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab_21_EE200_s14 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab_21_EE200_s14 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?