electronics ii physics 3620 / 6620

Download Electronics II Physics 3620 / 6620

If you can't read please download the document

Post on 31-Dec-2015




1 download

Embed Size (px)


Electronics II Physics 3620 / 6620. Apr 29, 2009 Part 1 Projects, Formula Nodes, Error Handling Application Builder…etc. Project Explorer. - PowerPoint PPT Presentation


  • Electronics IIPhysics 3620 / 6620Apr 29, 2009Part 1Projects, Formula Nodes, Error Handling Application Builderetc.

  • Project ExplorerInstead of editing VIs and sub-VIs separately and managing them by hand (one drawback is platform-independence), you can package VIs and sub-VIs into projectsNew feature in Labview 8.0Project explorer similar to other integrated development environmentStart new project from start menu Empty Project

  • Make Simple ProjectA project explorer window pops up (in the picture shown I have already saved the project as exa01.lvprojEither File SaveOr Project Save ProjectProject rootContains all other items in the Project Explorer window. This label on the project root includes the filename for the project. My ComputerRepresents the local computer as a target in the project. DependenciesIncludes items that VIs under a target require. Build SpecificationsIncludes build configurations for source distributions and other types of builds available in LabVIEW toolkits and modules. If you have the LabVIEW Professional Development System or Application Builder installed, you can use Build Specifications to configure stand-alone applications (EXEs), shared libraries (DLLs) , installers, and zip files.

  • Project ExplorerA project explorer window pops up (in the picture shown I have already saved the project as exa01.lvprojEither File SaveOr Project Save ProjectTo add a new VI to the project:Project Add To Project New VIThis will pop up a front-panel + block diagram pairIf you make a sub-VI remember to link the controls and indicators to the connector panel

  • ExamplesubVI that converts Farenheit input temperature to Celsius and Kelvin outputsWe demonstrate the use of a formula node in this caseNote that formula nodes can also have conditionalsYour cannot declare then input the variableYou can but dont need to declare the output variables

  • Error HandlingCan add if () { } else { } structure in formula nodeCan also use this feature to detect error conditionUse Error Cluster from Error Code.viFunctions Programming Dialog & User Interface - Error Cluster from Error Code.vi(also see others)Put both err-in and err-out onto the connector panel

  • Make Main VIAdd main VI that checks for error condition (Farenheit temp below absolute zerousing the simple error handlerStops the program if error condition metSave and close both

  • Project FileWe now open exa01.lvproj with Wordpad (or Notepad)It is an Extensible Markup Language (XML) fileSee http://en.wikipedia.org/wiki/XML for a descriptionCan be edited by hand in an emergencyThis is the GUI equivalent of the old UNIX Make file

  • Adding Build SpecificationWe can specify a stand-alone application to be builtNotice the five different options

  • Application InformationApplication Information Window pops up: modify/fill in the top three at least

  • Source FilesClick on Source Files in the window on left,Put the startup VI and supporting objects into the containersClick OK and then DONT forget to save the Project.

  • Building the ApplicationFrom the project file, a Test01 target should appear under the Build specificationsRight Click on Test01 Build will cause Test01.exe to be builtThis file can now be run as a stand-alone applicationAccording to NI, neither the base nor the student version of Labview has the standalone applications builder (but projects are supported). Only the Professional Development Version has this built-in.

  • Other Build OptionsInstallers Provider -- installs applications, source files, and shared libraries created with the Application Builder. The providers offers new features, such as Media Spanningto span the installer file over multiple disks, setting System Requirements, creating custom Registry Keys, creating shortcuts to files in the installation, specifying file attributes, including End-User license agreements and a Readme File.Shared Library (DLL) Provider --creates a Dynamic Linked Library (DLL) allowing LabVIEW code to be called from text-based programming languages. Developers must define the function prototypes for each of the exported VIs.Source Distribution Provider -- allows the user to organizesource files for distribution to another machine. It creates a copy of the project files (including the dependencies) for easy distribution to another computer. This feature is similar to Save with Options from previous versions of LabVIEW.Zip File Provider -- creates a compressed Zip file, containing the selected sources files. It allows you to distribute a large amount of code as a single, portable file.

  • NI Recommendations and CAVEATSCreate a separate directory of files for each project you create. Include the project file (.lvproj) and any other files that are only used in the project in the same directory. Place any files that are shared with other projects outside of the project directory. Organizing project files into separate directories makes it easier to identify files related to specific projects on disk.Directories on disk are not required to match the project structure of folders. After you add a directory on disk to a project, LabVIEW does not automatically update the folder in the project if you make changes to the directory on disk.Try to avoid changing the location on disk of files in a project. If you move a file on disk, you must update the location of the file in the project.Windows: If you are building an installer, make sure you save the files that are in a project on the same drive as the .lvproj file. If some files are on a different drive, such as a network drive, links can break if you include the project in an installer.The structure of files in a source distribution does not have to match the structure in the Project Explorer window. You can specify a different structure when you build source distribution.If you plan to edit files that appear under Dependencies, move the files from Dependencies to under the target. Items that a VI calls dynamically do not appear under Dependencies. If you plan to distribute files, add any items that a VI calls dynamically under a target. When you build an application, you can apply settings to an entire folder, so consider grouping all dynamic items in a folder under the target.

  • Building a ZIP file for distributionTo build a zip file for distribution, right click build-spec. New ZIP fileWindow pops upyou should set the title and the pathHere I put the .zip file in the same folder as the exa01 filder containing the project itself

  • Building a ZIP file (continued)Do nothing with source filesGo to Preview, click on Generate Preview buttonYou now see a preview of the directory/folder tree that will be generateedClick OK to exit, and a zip file icon will appearRight-Click the zip file entry and select buildthis will create the zip fileThis zip file will be posted along with this representation