DOC PREVIEW
PSU EE 200 - Lab_17_EE200_s14

This preview shows page 1-2-3-4-5-36-37-38-39-40-72-73-74-75-76 out of 76 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 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 76 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 76 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ColorGrayscaleEE 200 Spring 2014Lab 17.EE 200Design ToolsLaboratory 17Professor Jeffrey SchianoDepartment of Electrical Engineering1EE 200 Spring 2014Lab 17.Laboratory 17 Topics• LabVIEW– Parallelism– Variables• Local variables• Global variables (GVs)• Functional global variables (FGVs)• Instrument Control2EE 200 Spring 2014Lab 17.Parallelism• Passing data among parallel loops is a challenge• Will pressing the Stop button stop both loops?• Run Exercise_1.vi and observe what happens when the Stop button is pressed3EE 200 Spring 2014Lab 17.Parallelism• Will both loops operate in parallel?• How may times will Loop 2 iterate?• Verify by running Exercise_2.vi4EE 200 Spring 2014Lab 17.Parallelism• Read the Stop button state from a file– Each loop independently accesses the file– However, reading and writing to files consumes processor time and introduces undesirable delay time5EE 200 Spring 2014Lab 17.Variables• Variables: Block diagram elements that allow you to access or store data in another location• Types of Variables– Local: Stores data in front panel controls and indicators– Global: Stores data in special repositories that can be accessed from multiple VIs– Functional Global: Stores data in While Loop shift registers– Shared: Transfers data between various distributed targets connected together over a network6EE 200 Spring 2014Lab 17.Creating Local Variables: Method I• Right-click the control or indicatorCreate >> Local Variable• Right-click the local variable to select whether to read from or write to the local variable7EE 200 Spring 2014Lab 17.Creating Local Variables: Method II• Select the local variable shell form the Structures Palette• Right-click the local variable and click on Select Item to specify a control or indicator8EE 200 Spring 2014Lab 17.Boolean Control and Local Variables• If a Boolean control has associated local variables, it cannot use latch mechanical action• Consider what would happen if a given Boolean control is referenced by several local variables• The first local variable to read a Boolean control with latch action would reset its value to the default• Use a switch mechanical action, for example, switch when released9EE 200 Spring 2014Lab 17.Exercise 3• Use a local variable to stop both loops in Exercise 1 by completing Exercise_3.vi as shown below• Will the code execute if the Boolean control uses latch mechanical action?• What happens after you stop the VI from running then try to restart it?10EE 200 Spring 2014Lab 17.Exercise 4• Modify the Exercise 3 VI so that the stop button is released (output set to false) after Loop 2 stops executing• Complete Exercise_4.vi as shown below11EE 200 Spring 2014Lab 17.Local Variables Blur the Distinction Between Controls and Indicators• Exercise 4 shows that local variables allow us to write to a control• Local variables allow you to– Write to a control– Read from an indicator12EE 200 Spring 2014Lab 17.Exercise 5• Implement a count down timer using a local variable to a single control that sets the time duration and indicates the remaining time• Complete Exercise_5.vi as shown below13EE 200 Spring 2014Lab 17.Scope of Variables• Local Variables provide access to front panel objects within a single VI• Global Variables provide access to values of any data type among several VIs on a single compute• Shared Variables provide access to values of any data type among VIs on multiple computers14EE 200 Spring 2014Lab 17.Creating Global Variables• Access from the Structures palette15EE 200 Spring 2014Lab 17.Creating Global Variables• Double click the global variable icon to open a screen pop-up that is virtually identical to a VI’s front panel• Define a global variable by adding either controls or indicators to the front panel• It makes no difference whether you choose an indicator or control, as you can read or write to global variables• To use the global variable, use the Select Item submenu 16EE 200 Spring 2014Lab 17.Exercise 6• Use a global variable to simultaneously stop two VIs17EE 200 Spring 2014Lab 17.Exercise 6 Step 1• Open Exercise_6_Loop_1.vi• Create a global variable called Stop Button using a Boolean indicator• Save the global variable as Global Stop Button.vi• Wire the global variable to the Stop Button18EE 200 Spring 2014Lab 17.Exercise 6 Step 2• Open Exercise_6_Loop_2.vi• Place the global variable Stop Button by clicking on Select a VI and choosing Global Stop Button.vi• Right click on the global variable and select Change to Read 19EE 200 Spring 2014Lab 17.Exercise 6• Start Exercise_6_Loop_2.vi• Start Exercise_6_Loop_1.vi • Does pressing the Stop Button on the front panel of Exercise_6_Loop_1.vi stop both VIs?20EE 200 Spring 2014Lab 17.Functional Global Variables• Functional Global Variables (FGVs) are VIs that behave as Global Variables (GVs), providing multiple VIs data access• FGVs often use uninitialized shift registers • The shift register stores data between successive runs of the FGV VI, as long as it remains in memory• FGVs are more powerful then GVs by allowing the programmer to introduce states that clear, set, and read the FGV21EE 200 Spring 2014Lab 17.Exercise 7• Repeat Exercise 6 using a FGV• First create a FGV_stop_button.vi – Use an enumerated type FGV action that has two items: SET and GET22EE 200 Spring 2014Lab 17.Exercise 7• Complete Exercise_7_Loop_1.vi as shown below• Complete Exercise_7_Loop_2.vi as shown below23EE 200 Spring 2014Lab 17.Exercise 7• Start Exercise_7_Loop_2.vi• Start Exercise_7_Loop_1.vi • Does pressing the Stop button on the front panel of Exercise_7_Loop_1.vi stop both VIs?24EE 200 Spring 2014Lab 17.Instrument Drivers• Organized set of VIs that control programmable instruments– Each VI performs multiple instructions– Grouped by operation type (configuration, data, etc)• Reduce development time– Simplify instrument control– Reusable– Common architecture and interface25EE 200 Spring 2014Lab 17.Commonly used Instrument Drivers• Plug and Play Instrument Drivers • Virtual Instrumentation Software Architecture (VISA) • Interchangeable Virtual Instrument (IVI) Drivers 26EE 200 Spring 2014Lab 17.IVI Drivers• IVI  Interchangeable Virtual Instrument• Maintained by a consortium known as the IVI Foundation– http://www.ivifoundation.org/• Builds on VXI plug and play drivers• Uses the VISA I/O library


View Full Document

PSU EE 200 - Lab_17_EE200_s14

Download Lab_17_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_17_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_17_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?