Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Will trigger Timeout event if no mouse click or event occur on front Can Run if no Time out event added in the event structure Panel object.
3. What is the value of next multiple ms wait if 10ms wired to the input at the next iteration, supposedly after the end of the 4 th iteration the time was 37ms. A. 10ms B. 100ms C. 370ms
D. 470ms
1) What type of graph to use if 100 points of uneven data plot over a period time. A. Chart B. Graph C. XY Graph D. Intensity Graph 2) What is the value of x=y? indicator ?
B. unknown
C. 17 D. 20
1. CLAD QUESTIONS:
TDMS file. 2. Use datalog files to access and manipulate data only in LabVIEW and to store complex data structures quickly and easily. 3. Producer and consumer loop can be synchronous or asynchronous (queue).
SWITCH
Latch when released Boolean is the most commonly use. It changes after you release the mouse button and reverts to the old value. Local variables can not be used with latch action For complex machine control, use switch Use latch for dialogs and switch for machine control Latch when released generate only one event. Reset to its orignial state
Switch when released mimic the window dialog Switch until released: two events click and released.
I8 (byte)= 1 byte
Comparision
3 row 2 coln
2x2
Use Bundle function to assemble individual element into a cluster (or to create/replace cluster) When wire the cluster to bundle function, bundle function display all data inputs, where bundle by name function does not display all by default. See Figure 1 Bundle by name can not create new cluster. It can only replace an element in an existing cluster.
These cannot be wired together because their data types (numeric, array) do not match.
Once string value change, the even structure interact with the event. Stop button wont stop the loop. Program must use Stop button on menu bar to stop the loop.
DATA TYPES U8 (positive only) : all 8 bits are being used to represent the value of the number. For example 2-8 = 250 because 2^8 = 256 6 I8: first bit is used to denote the sing of the number. 7 bits remaining to represent the value -128 to 127 Coersion always select the larger data type. For more information about data type Go to Labview help >> search >> ente rdata types table boolean : 8 bits data type 6 choices of mechanical actions: Switch When Pressed: change control value each time we click it with the operating tool Switch when released: only after we release the mouse button during a mouse click. Switch until released: retains the new value until we release the mouse button. At this time, the control reverts to its default value, as is the case with the operation of a door buzzer. Note that latch button will not work with local variab le Latch when pressed: change the value of the control when we click it and retain the value unitl the VI reads it once. At this point, the control reverts to its default value, even if we continue to prese the mouse button. This action is useful for stopping a while loop or getting the VI to perform an actionl only once each time we se the control Latch when released: changes the control value only after we release the mouse button. (dialog box). When the VI reads once, it reverts to its default value. Latch until released: changes the control value when we click it and retains the value until the VI reads it once or we release the mouse button depending on which one occurs last. Undefined numeric number NaN : not a number (operation divide by 0) Error Cluster Includes the following Status : boolean data type returns true if an error occurs Code : signed 32 bits integer that identifies the error numerically. Code 0 indicates everything is fine String: explain error or warnings Use Simple Error Handling to pop up the dialog.
What Are Strings Code Display: display more details of the ASCII characters and all nondisplayable characters as their backslash code. This includes spaces, tabs, linefeeds, and the like. Hex display is useful to communicate with instruments.
Dynamic Data Dynamic data stores the information generated or acquired by an Express VI. Most other Vis and functions in LabVIEW do not accept the dynamic data types. Therefore to be used, the data must be converted. For the numeric, waveform, and boolean terminals, this conversion is automatically handle by LabVIEW.
While Loops: Repeating the code While Loop always execute once. Iteration terminal indicator can tell us how many times the loop has executed. However, its important to know that the value being displayed will always be one less than the number of times the codes has been executed because loop starts from 0
CLAD QUIZ 1. Condition terminal accepts a boolean data type: Stop when error occur 2. 3. Loop count does not exist in while loop. A While loop can run zero times. False
For Loop
loop iteration starts from 0, similar with while loop. Ultimiately the value will be one less than the number of times the loop executes. A For loop can execute zero times, whereas a while loop will always executes at least once.
The loop will only execute once without regard to whether or not the condition was met.
Right click border, and select conditional terminal
Arrays
An array can have one or more dimension and as many as (2^31 -1) elements per dimension. Contain same data type. Can not create array within an array Array range is n-1, where n is the number of elements in the array. Top control changes the index of the row. Bottom index changes the index of the column.
And if arrays of different sizes are wired to auto-indexed tunnels, the actual number of iterations becomes the smallest of the choices.
POLYMORPHISM
Creating an Icon
By double click on terminal on the right corner of the front panel Or by right click on the icon, edit icon Save template The maximum number of terminals that we can use is 28
In general we should not use more than 16 terminals as this makes it more difficult to wire the block diagram.
Clusters
Plot Data
Both chart and graph are used to display even sampled data. Chart update a constant rate. Chart have 3 update modes: strip chart, scope chart, and sweep chart. Right click chart >> advance >> update modes Strip chart: flow left to right scope chart: plot data from left to right, and when it reaches the right border. Labview erases the data and Begin plotting again from left border. Similar to an oscilloscope Waveform graph: plot all points at once. to, dt, and y (data). Distribute evenly in time. XY graph: spacing of data is non-uniform. A bundle is used to assemble X data and Y data.
Sweep chart: similar to scope but veritical separate. Not erase data.
Type Definition Type definitions can be used as controls, indicators, and constants. three types: control, type def, and strict type def.
In Customize mode, we can move and resize the individual components of the control.
In Customize mode, we can also import picture with the same size.
File I/O
Include 3 steps as shown above where errors may not be needed. Types of files: Binary Files, ASCII, LVM, TDMS Binary Files: are the underlying file format of all other file formats, least amount of overhead associated with the data. This means they take less space and write faster. ASCII File is a specific type of binary file that is a standard used by most programs, conists of ASCII codes, also called text file. Tab delimited to separate columns.
LVM: the labview measurement data file is a tab-delimited text file you can open with a spreadsheet application, including date and time that the data was generated.
TDMS file format: is a specific type of binary file created for NI products. It contains two separate files: a binary file contains data and a binary index file that provides details about the information stored in the binary file. Append to file? True: append new file to end of file. False: overwrite data.
File I/O
LabVIEW can use or create the following file formats: binary, ASCII, LVM, and TDM: Binary Files are the underlying file format of all other file formats ASCII file is a specific type of binary file that is a standard used by most programs. They are also called text files. LVM is a tab delimited text file you can open with spreadsheet application
TDM binary file created for national instruments. It is usually consists of two separate files: an XML and binary file for waveform.
When to Use Test (ASCII) Files Use text format files for your data to make it available to other users or applications if disk space and file I/O speed are not crucial. Text Files normally takes more memory than binary and datalog files since its ASCII takes one byte for each character. For example: -123.4567 takes 9 bytes
WHAT IS DAQ? There are 3 pieces of DAQ sosftware that we will explore in this module: 1. 2. Measurement and Automation Explorer (which is called MAX for short). Any installed DAQ acquisition devices would automatically appear under this tab. NI-DAQmx is the driver level software that can be installed with LabVIEW. Most importantly the NIDAQmx installed the DAQmx API, which is a set of Vis used to program DAQ applications.
1000/10000 = 1/10
USING SUBVI
Drag an drop the terminal into the block diagram to create a subVI CTL + Double Click to go to subVI block diagram. Required option terminal is only available for inputs, and not for outputs. (appear in bold) Optional showed dim with no labels.
Instrument control
PCs usually offer multiple bus options for instrument control: General Purpose Interface Bus (GPIB) Serial Ethernet Universal Serial Bus (USB) IEEE 1394 (FireWire) If instrument does not natively have the bus that the instrument uses, it can usually be added as a plug-in board or an external converter.
Generally instrument driver Vis communicate with an instrument using the LabVIEW VISA application programming interface, or API.
Using Sequential programming Wiring the error wire through Vis and SubVIs is a very common and preferred method for ensuring sequential execution. Flat sequence/stack sequence executes frame after frame.
What Is State Machine? State Machine is a very common and useful design pattern
Create Constant
Parallelism LabVIEW can run in parallel. One of the benefit in parallelism is that running tasks completely in parallel means that one loop will not prevent the other from running. It allows us to keep one loop running continuously while we interact with the first loop.
What is Modularity?
Code is easily written, easily debugged, and can be easily modified. Modularity refers to the degre to which a program is composed of discrete modules, such that a change to one module has minimal impact on other modules. Modularity means that well be able to build code faster using reusable pieces. It also allow us to change the code quickly in one location, instead of multiple places and debug small pieces of code at a time.
Example: Changing a type definition in one place, changes all instances of it automatically (control, indicators, and constants)
VARIABLES
Shared variable is similar to local variable, but they can share data across a network (multiple VIs).
To use the shared variable, drop a Shared variable shell into the block Diagram (in program structure)
Race condition is difficult to debug because the outcome depends upon the order in which the operating system executes scheduled tasks.
An ideal way to avoid race conditions is to simply allow only one section of the code to write to any one variable whenever possible. (use Functional Global Variable or Semaphores) only one task enter at a time