资源目录
压缩包内文档预览:
编号:503694
类型:共享资源
大小:2.43MB
格式:ZIP
上传时间:2015-11-09
上传人:QQ28****1120
认证信息
个人认证
孙**(实名认证)
辽宁
IP属地:辽宁
12
积分
- 关 键 词:
-
机械毕业设计 论文
- 资源描述:
-
LW01-104@虚拟相位差测量仪的设计,机械毕业设计 论文
- 内容简介:
-
英语翻译原文备注: 2. Clusters group like or unlike components together. Equivalent to a record in Pascal or a struct in C. Cluster components may be of different data types. Examples: Error informationGrouping a Boolean error flag, a numeric error code, and an error source string to specify the exact error. User informationGrouping a string indicating a users name and an ID number specifying their security code. All elements of a cluster must be either controls or indicators. You cannot have a string control and a Boolean indicator. Clusters can be thought of as grouping individual wires (data objects) together into a cable (cluster). 3. Demonstrate how to create a cluster front panel object by choosing Cluster from the Array & Cluster palette. This option gives you a shell (similar to the array shell when creating arrays). You can size the cluster shell when you drop it. right-click inside the shell and add objects of any type. Note: You can have a cluster inside of a cluster. The cluster becomes a control or an indicator cluster based on the first object you place inside the cluster. Create a cluster constant on the block diagram by choosing Cluster Constant from the Cluster palette. This gives you an empty cluster shell. You can size the cluster when you drop it. Put other constants inside the shell. Note: You cannot place terminals for front panel objects in a cluster constant on the block diagram, nor can you place “special” constants like the Tab or Empty String constant within a block diagram cluster shell. 4. You create a cluster constant on the block diagram by selecting a cluster constant on the FunctionsAll FunctionsCluster palette, placing it on the block diagram, and dragging a constant into the cluster shell. If you have a cluster control or indicator on the front panel and you want to create a cluster constant containing the same elements on the block diagram, you can either drag that cluster from the front panel to the block diagram or right-click the cluster on the front panel and select CreateConstant from the shortcut menu. 5. Elements are assigned an order based on the order in which they are added to the cluster. For example, if you have two Booleans and you want to update one of them, you need to know which is which. You can change the order of the elements by popping up on the edge of the cluster and choosing Cluster Order. A small number appears next to each object. You can then change the order. (Hint: Click on each object in the order in which you want the cluster order. This will renumber the objects as desired.) Demonstrate how to create a cluster with two Booleans, a numeric control, an array, and a ntsstring. Show that if you change one object to an indicator, all objects are changed to indicators. Modify the cluster order. Emphasize how to easily make clusters using the Create Constant/Control/Indicator options on the block diagram, and by copying/pasting clusters on the front panel. This will save the students significant time when working on a program, and prevent possible bad wires due to incorrect cluster order. 6. One advantage of clusters is that you can use them to group information together to pass into and out of subVIs. Clusters overcome the limit of 28 terminals for passing data between VIs. If you have a great deal of information to pass, group it into logical units using clusters, pass a single cluster into the subVI, and then unbundle the cluster in the subVI. Clusters can reduce the number of wires in diagrams, so there are fewer wires going into and out of the subVIs. Explain the diagram on the slide. 7. Bundle functionForms a cluster containing the given objects (explain the example). Bundle by Name functionUpdates specific cluster object values (the object must have an owned label). Note: You must have an existing cluster wired into the middle terminal of the Bundle By Name function. Available in FunctionsCluster Explain the examples on the slide. Demonstrate these functions with the example you have been using. Copy all objects inside the cluster on the front panel and drag them out so that they are individual controls. Then use the Bundle and Bundle by Name functions. This is a good place to remind students about the difference between owned and free labels. All controls or indicators in a cluster must have an owned label to be able to be used with the Bundle by name (or unbundle by name) function. 8. Unbundle functionUse to access all of the objects in the cluster. Unbundle by Name functionUse to access specific objects (one or more) in the cluster. Note: Only objects in the cluster having an owned label can be accessed. Explain the examples on the slide. Use the Unbundle and Unbundle by Name functions with the cluster you created. Show how to change the element on the Unbundle by Name function. Point out that you must know the cluster order to access a given switch with the Unbundle function. Resize the function to add terminals to the Bundle and Unbundle functions. The Unbundle function must have exactly the same number of terminals as there are elements in the cluster. Adding or removing elements to the cluster breaks wires on the diagram. 9. When you perform any kind of I/O, consider the possibility that errors will occur. Almost all I/O functions return error information. Include error checking in VIs, especially for I/O operations such as file, serial, instrumentation, data acquisition, and communication operations, and provide a mechanism to handle errors appropriately. Checking for errors in VIs can help you identify the following problems: You initialized communications incorrectly or wrote improper data to an external device. An external device lost power, is broken, or is not working properly. ntsYou upgraded the operating system software, which changed the path to a file or the functionality of a VI or library. You might notice a problem in a VI or a system program. 10. The error clusters located on the ControlsArray & Cluster palette include the components of information shown. 11. Error handling in LabVIEW follows the dataflow model. Just as data flow through a VI, so can error information. Wire the error information from the beginning of the VI to the end. Include an error handler VI at the end of the VI to determine if the VI ran without errors. Use the error in and error out clusters in each VI you use or build to pass error information through the VI. As the VI runs, LabVIEW tests for errors at each execution node. If LabVIEW does not find any errors, the node executes normally. If LabVIEW detects an error, the node passes the error to the next node without executing. The next node does the same thing, and so on. Use the Simple Error Handler, shown in the following example, to handle the error at the end of the execution flow. The Simple Error Handler is located on the FunctionsAll FunctionsTime & Dialog palette. Wire the error cluster to the Error In (no error) input. 12. As the VI runs, LabVIEW tests for errors at each execution node. If LabVIEW does not find any errors, the node executes normally. If LabVIEW detects an error, the node passes the error to the next node without executing. The next node does the same thing, and so on. Many students will ask what the difference between the Simple Error Handler and the General Error Handler are. Have them investigate by looking at the block diagram of the Simple Error Handler. They will see that it calls the General Error Handler. Explain that the Simple Error Handler can recognize all of LabVIEWs built in error functions, but if they want to create their own errors for their code, that they can use the General Error Handler. If they want more information, tell them that it is not covered in the scope of this course but that information is in the Help VI, Function, & How-To Help under the index of “error codes, defining custom”. 13. You can wire an error cluster to the conditional terminal of a While Loop to stop the iteration of the While Loop. When you wire the error cluster to the conditional terminal, only the TRUE or FALSE value of the status parameter of the error cluster is passed to the terminal. When an error occurs, the While Loop stops. When an error cluster is wired to the conditional terminal, the shortcut menu items Stop if True and Continue if True change to Stop on Error and Continue while Error. I would demo how to use error codes for a more effective approach by using the unbundle by name function to get the status and use an OR function so that a stop button OR an error would stop the loop. 14. Do not immediately display this slide. Suggested questions for class participation: What is the difference between an array and a cluster? What items are contained in the error cluster? 16. LabVIEW has three types of charts: Strip chart: Scrolling display. Scope chart: Retracing display. The plot is erased after reaching the right border of the plotting area. Sweep chart: Like the scope chart, but the plot is not erased. Instead, a vertical line marks new data and moves across the display as data is added. ntsPlace on the front panel by selecting the Graph subpalette of the Controls palette. Because less overhead is involved in retracing the plot, scope and sweep charts are much faster. To increase the speed of the strip chart, disable the X axis. Describe the graphic: A chart may have one trace or multiple traces. 17. For a single plot, wire from the numeric control to the chart terminal. For multiple traces, bundle each number together and then wire to the strip chart. Open the chart example with the Example Wizard. It is important that students know that these examples are shipped with the package. If they have questions about how to wire to a strip chart, they have a good resource that shows all possible ways to display data on a chart. Transition to next topic: Now we will discuss topics related to plotting: chart properties and mechanical action of booleans. 19. You can extensively customize charts and graphs. Use the Show option in the pop-up menu to add Digital Displays for the traces, the Palette for the chart, and Scroll Bars for the X axis. You can change the font style and color for the axis labels by highlighting one of the numbers on the axis you want to change with the Labeling tool and then choosing the style and color you want from the Text menu. Instructor: Demonstrate the zooming tools on your computer. Go slowly so the students can absorb the information and practice. 20. A graph is a 2D display of one or more data arrays. Data arrays are called plots. Two types of graphs: Waveform Graph: Plots array of numbers vs. its index. Ideal for arrays with evenly distributed data points. Used for time-varying waveforms. XY Graph: Plots one array vs. another. General purpose. Good for multivalued functions, such as circular shapes or waveforms with a varying timebase. Both look similar on front panel. To place a graph on the front panel, choose the appropriate graph from the Graph subpalette of the Controls palette. 21. Because the Bundle function is used with graphs, be sure to briefly introduce the idea of clusters. Clusters allow you to group different data types together into one structure. In this lesson, they are useful to control the x-axis scaling attributes. Bundle function: Used to combine two or more elements of like or different data types. Remind the class that they used this function to bundle arrays in multiplot strip chart. There are several different ways to plot a waveform graph: Example 1: Bundle the array with the initial X value (Xo) and interval between X values (Delta X). The terminal looks like a cluster of objects because the data was bundled. (Called a cluster). ntsExample 2: For simple plots, the array can be passed directly to the waveform graph terminal. Assumes the initial X value is 0 and the X increment is 1. The terminal is an array of double-precision numbers. Note that auto-indexing is used in the above examples. 22. If a 1D array is wired to a waveform graph, the graph assumes it is one plot. When a 2D array is wired to a waveform graph, the graph assumes each row in that array is a separate plot. Use the Build Array function to create a 2D array input for multiplot graphs: Example 1: A combination of two single-plot examples without Xo and Delta X defined (Example 2 from the previous slide). The Build Array function creates a 2D array input to the waveform graph. The terminal is a 2D array of double-precision numbers. Example 2: A combination of two single-plot examples with Xo and Delta X defined (Ex 1 from previous slide). The Build Array function creates a cluster array input to the waveform graph. The terminal is an array of clusters, because each graph is a cluster. 23. The XY graph looks identical to the waveform graph on the panel. Does not assume that the X-axis has a constant interval. Array of X values and array of Y values must be provided. More flexible than the waveform graph. Explain the slide: Generate two arrays, one for X values and other for Y values. Bundle arrays wire into the XY graph. Explain that an X array 1,2,3,4,5 and a Y array 0,1,0,1,0 will result in a graph with points (1,0)(2,1)(3,0)(4,1)(5,0). Show the class some graph examples using the Example Wizard: Examples of ways to graph charts (Charts.vi), waveform graphs (Waveform Graph.vi), and XY graphs (XY Graph.vi). Very useful reference. 24. Demonstrate to the students how the Help window gives you valuable wiring information about charts and graphs and which one you have. 26.Do not immediately display this slide. Suggested questions for class participation: What are the three update modes for a chart? What is the different between a chart, graph and XY graph? What would you use to plot data if you wanted to see the temperature versus the pressure? What would you use to plot the temperature map of an X-Y plane? 29. Every VI we have encountered so far has executed in an order dependent on the flow of data. There are many cases when a decision must be made in a program: if a happens, do b; else if c happens, do d. In text-based programs, this can be accomplished with if-else statements, case statements, switch statements, etc. In LabVIEW, there are also many different ways of making decisions. The simplest of these methods is the Select function. 30. Explain how this example differs from the previous example. One benefit of case structure: can have more than one output based on the choice made. 31. The Case structure allows you to choose a course of action nts depending on an input value. In the Structures subpalette of the Controls palette. Analogous to a case statement in Pascal or if-then-else statement in other languages. Like a deck of cards. You can see only one case at a time. Customers often think that when separate cases are shown, it means to create two or more case structures. Stress that you need only one case structure. (See next slide for example of this idea.) 32. Discuss the examples on the slide. Be sure to mention the difference between the numeric and Boolean Case structures. Also, remind the students that all cases must provide a value for all output tunnels. Demonstrate using the Text Ring from the Ring & Enum subpalette of the Controls palette. A text ring is simply a numeric control with text associated with each number. Demonstrate some of the features of Case structures: Directly typing into the Cases Setting ranges in the Case Reordering the Cases The Default Case Explain that not all cases must be wired, but it is good programming practice to do so. A default value can be used in unwired cases. 34. Sometimes it is preferable to program mathematical expressions with text-based function calls, rather than icons (which can take up a lot of room on the diagram). Formula Node: allows you to implement complicated equations using text-based instructions: Located in the Structures subpalette. Resizable box for entering algebraic formulas directly into block diagrams. To add variables, right-click and choose Add Input or Add Output. Name variables as they are used in formula. (Names are case sensitive.) Statements must be terminated with a semicolon. When using several formulas in a single formula node, every assigned variable (those appearing on the left hand side of each formula) must have an output terminal on the formula node. These output terminals do not need to be wired, however. Compare examples on the slide. 35. There are many other functions and statements available in a formula node. Use Help to explore these possibilities. 36.Do not immediately display this slide. Suggested questions for class participation: How can you make a decision in a VI? How do you use a case structure? When would it be best to use a formula node? 38. A string is a sequence of displayable or non-displayable (ASCII) characters. Strings often are used to send commands to instruments, to supply information about a test (such as operator name and date), or to display results to the user. Strings in LabVIEW: String controls and indicators are in the String subpalette of the Controls palette. Enter or change text by using the Operating or Text tool and clicking in the string control. ntsStrings are resizable. String controls and indicators can have scrollbars: Right-click and select VisibleScrollbar. The scroll bar will not be active if the control or indicator is not tall enough. 39. String controls and indicators can be configured for several different display modes. You can change display modes by popping-up on the control or indicator while in edit mode. Password Display: Asterisks replace the string text on the front panel. This is useful for concealing passwords for logging into VI. Codes Display: Replaces all “unprintable” characters in the string with a followed by a letter. Hex Display: Replaces every character in the st
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。