You are on page 1of 57

USE OF FOR LOOP

EXPT NO: 1-A DATE: 30-07-2010 AIM To create a VI to increment the frequency of the sine wave up to 10Hz using FOR Loop. SOFTWARE USED LabVIEW software THEORY A FOR loop executes a sub diagram a set of number of times. The value in the count terminal indicates how many times to repeat the sub diagram. Set the count explicitly by wiring a value from outside the loop to the left side or top side of the count terminal or set the count implicitly with auto-indexing. The iteration terminal contains the number of completed iterations. The iteration count always starts at zero. During the first iteration, the iteration terminal returns to zero. Both the iteration and count terminals are signed long integers. If you wire a floating point number to the count terminal, Lab VIEW rounds it within the range. If you wire zero or a negative to the count terminal, the loop does not execute. Add shift registers to the FOR loop to pass data from the current iterations to the next iteration. PROCEDURE Open A Blank VI. Front Panel Select Wave Form Graph From Controls >> Graphical Indicators >> Waveform Graph. Select Knob From Controls >> Numeric Controls >> Knob And Name It As Frequency.

FRONT PANEL

BLOCK DIAGRAM

Block Diagram Select Simulate Signal From Functions >> All Functions >> Analyze >> Sine Waveform. Select FOR Loop From Functions >> All Functions >> Structures >> FOR Loop. Select Increment From Functions>>All Functions>>Numeric>>Increment. Select Conditional Terminal>>Create Constant. Wire The Terminal. Save And Run The VI.

OBSERVATIONS The wave form is displayed whose frequency is varying. RESULT Thus, a VI was built to increment the frequency of a sine wave up to 10Hz using FOR Loop.

USE OF WHILE LOOP


EXPT NO: 1-B DATE : 30-07-2010 AIM To create a VI to work as a signal generator using WHILE Loop. SOFTWARE USED LabVIEW software. THEORY A WHILE Loop executes a sub program until a condition is met. The default behavior and appearance of the conditional terminal is continuing if true. When a conditional terminal is continuing if true, the WHILE Loop executes its sub program until the conditional terminal receives a true value. Because the VI checks conditional terminal at the end of each iteration, the WHILE Loop always executes at least one time. The iteration terminal contains the number of completed iterations. The iteration count always starts at zero. PROCEDURE Open a blank VI. Front Panel Select wave form graph from Controls >> Graphical Indicators >> Waveform Graph. Select Controls >> Numeric Controls >> Knobs and name it as Amplitude and Frequency. Select Controls>>Text Controls>> Text Ring.

Block diagram Select All Functions >> Structures >> While Loop. Select All Functions >> Analyze >> Wave Form Generations >> Basic Function Generator. Wire the circuit and save the VI.
4

FRONT PANEL

BLOCK DIAGRAM

OBSERVATIONS Run the VI. Give the frequency by using the knobs to the function generator. Choose the wave form that is to be created in the function generator. The resultant output waveform will be shown in the waveform graph in the front panel. RESULT Thus, a function generator using WHILE Loop was created using Lab VIEW.

USE OF CASE STRUCTURE


EXPT NO: 2-A DATE AIM To create a VI to enter some data using strings on front panel and use control switch to erase the data by using case structure. SOFTWARE REQUIRED LabVIEW Software. THEORY Case structure has one or more sub diagrams or cases exactly one of which executes when the structure executes. The value wired to the selected terminal determines which case to execute and can be Boolean, string, integer or enumerated type. Right click the structure border to add or deleted cases. Uses the labeling tool to enter value in the case selector label and configure the value handled by each case. The case selector identifier at the top of case structure contains the case selector identifier in the centre and decrement and increment buttons on each side. Use the decrement and decrement buttons to scroll through the available cases. If Boolean is wired to the selector terminal, the structure has a TRUE case and a FALSE case. If an integer, string or enumerated type values are wired to the selector terminal, the structure can have up to 2^31 1 cases. Right click the case structure border to add, duplicate, remove or rearrange cases and to select a default case. PROCEDURE Open a blank VI. Front Panel Select Controls >> Text Controls>>String Indicators. Select controls >> Buttons & Switches>>Push Buttons. : 06-08-2010

FRONT PANEL

BLOCK DIAGRAM TRUE CASE

FALSE CASE

Block Diagram Select all functions>>structures>>Case Structures.

CASE 1: TRUE Wire The String Terminals.

CASE 2: FALSE Select all functions>>strings>>empty string constant. Wire the terminals.

OBSERVATION Enter the string data. Run the VI. The resultant output will be shown in front panel. RESULT Thus, to create a VI to enter some data using strings on front panel and use control switch to erase the data by using case structure was done.

USE OF FLAT SEQUENCE STRUCTURE


EXPT NO: 2-B DATE : 06-08-2010 AIM To create a VI for controlling automatic tank level using flat sequence structure in Lab VIEW. SOFTWARE USED LabVIEW software. THEORY The Flat Sequence structure contains multiple sub diagrams or frames, which execute in sequential order. A sequence structure executes frame 0, then frame 1, then frame 2, until the last frame executes. Frames in a Flat Sequence structure execute in order and when all data wired to the frame is available. The data leave each frame as the frame finishes executing. The Flat Sequence structure is used to avoid using sequence locals and to better document the block diagram. Use the flat sequence structure to control the execution order when natural data dependency does not exist. A node that receives data from another node depends on the other node for data and always executes after the other node completes execution. Within each frame of a sequence structure, as in the rest of the block diagram, data dependency determines the execution order of nodes. PROCEDURE Open a blank VI. Front panel Select controls>>Numeric Indicators>>Tank.

Block diagram Select All functions >> Structures >> While Loop.

10

FRONT PANEL

BLOCK DIAGRAM

FLAT 1

FLAT 2

11

Select All Functions>>Structures>>Flat Sequence.

FLAT 1 Select All functions>>Numeric>>Increment. Right click in the Leds >> Go to Create .And create the local variable for the same. Select All functions>>Comparison>>Greater Than or Equal To Right click in the Tank and Boolean>>Go to create>>Local variable for the same. Wire the terminals.

FLAT 2 Select All functions>>Numeric>>Decrement. Right click in the Leds >> Go to Create. And create the local variable for the same. Select All functions>>Comparison>>Less Than or Equal To. Wire the terminals.

OBSERVATION Run the VI resultant output is viewed in the front panel. RESULT Thus, the controlling of automatic tank level was done using flat structure in LabVIEW software.

12

USE OF STACK SEQUENCE


EXPT NO: 2-C DATE : 06-08-2010 AIM To create a VI for simulating a traffic light display using stack sequence in Lab VIEW. SOFTWARE USED LabVIEW software. THEORY The Stacked Sequence contains multiple sub diagrams, or frames, which execute in sequential order. A Stacked sequence structure executes frame 0, then frame 1, then frame 2, until the last frame executes. It does not complete execution or return any data until the last frame executes. It can be used to conserve space on the block diagram. The structure selector label is at the top of the Stacked Sequence structure, it contains the current frame number and range of frames in the center and decrement and increment arrow buttons on each side.

The tunnels of Stacked Sequence structures can have only one data source, unlike Case structures. The output can emit from any frame, but data leave the Stacked Sequence structure only when all frames complete execution, not when the individual frames complete execution. PROCEDURE Open a blank VI. Front Panel Select Control >> Round LED and assign Red, Yellow and Green colours to the Led.

Block Diagram Select Function >> All Functions >> Structure >> Stack Sequence. Now add frames by using add frame before or after.

13

FRONT PANEL

BLOCK DIAGRAM

STACK 1:

STACK 2:

STACK 3:

14

STACK 1: Select all Functions >> Time Delay >> Click Count (Rms). Right click in the leds>>go to create>>local variable for the same. Wire the terminals.

STACK 2: Select all Functions >> Time Delay >> Click Count (Rms). Wire the terminals.

STACK 3: Select all Functions >> Time Delay >> Click Count (Rms). Wire The Terminals.

OBSERVATION Run the VI resultant output is viewed in the front panel. RESULT Thus, simulation of the traffic light was done using stack sequence in Lab VIEW.

15

USE OF ARRAYS
EXPT NO: 3-A DATE AIM To understand the use of array functions to create and manipulate arrays. SOFTWARE USED LabVIEW Software THEORY An array is used to store a set of elements. Array can be a n-dimensional array of any type. Arrays can be created in 3 ways. 1) Use for loop 2) Using initialized array 3) Using build array Initialize array: Create an n-dimensional array in which every element is initialized to the value of element. Build array: concatenates multiple arrays or appends elements to a n-dimensional array. All inputs must have the same base type. Appended array is the resultant array. Array size: Returns the number of elements in each dimension of array. Index array: Returns the element or sub array of n-dimension array at index. Index 0.n-1 must be numeric. Array subset: Returns a portion of array starting at index and containing length elements. Rotate ID array: Rotates the element of the array the number of places and in the direction indicated by n. Reverse ID array: Reverse the order of the elements in array.
16

: 13-08-2010

FRONT PANEL

BLOCK DIAGRAM

17

Array max and min: Returns the max and min values found in array, along with index fit in each value. PROCEDURE Open a blank VI. Block Diagram Select all Functions >> Numeric. Select all Functions >> Numeric >> Multiplier and round up. Select all Functions >> Structures >> For Loop. Right click on loop tunnel >> enable indexing and create tunnel. Select all Functions >> Array >> Index Array. Select all Functions >> Array >> Array Subset. Select all Functions >> Array >> Rotate 1D array. Select all Functions >> Array >> Reverse 1D array. Select all Functions >> Array >> Array Max And Min and create indicators at all input ports. Select all Functions >> Numeric >> Multiplier and round up. Select all Functions >> Arrays >> Initialize Array and create indicator at its output port. Select all Functions >> Array >> Build Array >> and create indicator at the output port. Complete wiring and run the VI.

OBSERVATION The resultant output shall be seen in the front panel. RESULT The VI is built to understand the array functions.

18

USE OF CLUSTER
EXPT NO: 3-B DATE AIM To study the use of Clusters in LabVIEW. SOFTWARE REQUIRED LabVIEW Software. THEORY Clusters group data elements of mixed types, such as a bundle of wires, as in a telephone cable, where each wire in the cable represents a different element of the cluster. A cluster is a similar to a record or a structure in text based programming languages. Bundling several data elements into clusters eliminates wire cutter on the block diagram and reduces the number of connector panel terminals that Sub Vis need. The connecter panel has at most 28 terminals. If a front panel contains more than 28 controls and indicators that you want to use programmatically, group some of them into a cluster and assign the cluster to a terminal on the connector panel. Like an array, a cluster is either a control or an indicator. A cluster cannot contain a mixture of controls and indicators. Although cluster and array elements are both ordered, you must unbundle all cluster elements at once rather than index one element at a time. You also can use the unbundle by name function to access specific cluster elements. PROCEDURE Open a blank VI. Front Panel Select all controls >> array and cluster >> cluster and place it in the Front panel. Select numeric controls >> numeric control and place it inside the cluster in the Front panel. : 13-08-2010

19

FRONT PANEL

BLOCK DIAGRAM

20

Select controls >> LEDs and place it inside the cluster. Select numeric indicators >> tank and place it inside the cluster.

Block Diagram Select all functions >> cluster >> unbundle by name and place in the Block diagram. Select all functions >> numeric >> add. Select all functions >> comparison >> greater than or equal. Select all functions >> Booleans >> OR. Select all functions >> cluster >> bundle and place it in the block diagram. Right click the output of the bundle and select indicator. Complete wiring and save the VI.

OBSERVATION The resultant output shall be seen in the front panel. RESULT Thus, the integer and Boolean functions are displayed using a cluster in LabVIEW.

21

USE OF SUB VI
EXPT NO: 4-A DATE: 20-08-2010

AIM To understand the use of creating subVIs and VIs. SOFTWARE USED LabVIEW software. THEORY The power of LabVIEW lies in the hierarchical nature of the VI. After we create a VI, we can use it on the block diagram of another VI. There is no limit on the number of layers in the hierarchy. Using modular programming helps us manage changes and debug the block diagram quickly. A VI within another VI is called a subVI. A subVI corresponds to a subroutine in text-based programming languages. When we double-click a subVI, a front panel and block diagram appear, rather than a dialog box in which we can configure options. The front panel includes controls and indicators that might look familiar. The block diagram includes wires, front panel icons, functions, possibly subVIs, and other LabVIEW objects that also might look familiar. Every VI displays an icon in the upper right corner of the front panel and block diagram windows. An icon is a graphical representation of a VI. It may contain text, images or a combination of both. If we use VI as a subVI the icon identifies the subVI or the block diagram of the VI. Creating An Icon Right click the icon in the upper right corner at the front panel or block diagram. Select edit icon from the short cut menu to display the icon editor dialog box. Use the tools on the left side of the icon editor dialog box to create the icon design in the editing area.

22

Connector Pane We also need to build a connector pane to use VI as a subVI. The connector pane is a set of terminals that corresponds to control and indicators of that VI, similar to the parameter lst of function call in text based programming languages. The connector pane defines inputs and outputs that you can wire to the VI so we can use as a subVI. The connector pane receives data at input terminals and passes the data to block diagram code to the front panel controls or receives the results at its output terminals from the front panel indicators. Placing Sub VI After we built VI and creates icon and connect pane we can use the vi in another VI. The VI use of another VI is called a sub VI. A sub VI mode corresponds to the subroutine call in the text based programming language. PROCEDURE Open a blank VI. Front Panel SUB VI Select controls >> numeric indicator >> thermometer display the rise in temperature Select controls >> numeric controls>>to give temperature in degree Celsius

Block Diagram F = C*9/5+32 F - Temperature in Fahrenheit C - Temperature in degree Celsius Select all functions >> numeric >> multipliers to multiply the input value with constant 9/5. Select controls >> numeric control >> numeric >> adder >> to add the multiplied value with constant 32. Thus output is fed to the thermometer whose rise in temperature is indicated in F.

23

SUB VI FRONT PANEL

BLOCK DIAGRAM

ICON EDITOR

MAIN VI FRONT PANEL

24

BLOCK DIAGRAM
CASE: TRUE

CASE: FALSE

25

Creating an Icon Right click the icon in the upper right corner of the front panel or block diagram and select edit icon from the shortcut menu to display icon editor dialog box. Click 16 colours or 256 colours box to select which icon we want to create. Use the tools on the left side of the icon editor dialog box to create the icon design in the editing area. Right click on the icon, click connector. Select patterns for connector pane. Click the input and first half of the connector pane to wire the input. Click the output and second half of the connector pane to wire the output.

MAIN VI Front Panel Select controls >> numeric indicators >> tank to display rise in level Select controls >> numeric control to set the set point Select controls >> numeric indicator >> thermometer to indicate rise in temperature for every unit rise in level Block Diagram Select function >> all functions >> structures >> while loop. Right click on while loop >> add shift register. Right click on shift register >> create >> constant. Put value as 0 for initialization. Select >> function >> all function >> numeric >> multiplier to multiply a constant 0.5 with the tank level. This output is fed to a numeric indicator to display the value which is fed to sub VI. Right click multiplier icon >> create >> indicator. Select >> functions >> all functions >> select a VI and select subVI. Give output of multiplier to sub VI. Give output of multiplier to sub VI. Output of sub VI is given to the thermometer.

26

Select function >> all function >> comparison >> greater or equal to compare set point with tank level. Output of the comparator is given to the stop button. Complete wiring and save VI.

OBSERVATION For every rise in tank level there is a rise in temperature. The temperature conversion is done using subVI. RESULT Thus a VI is created using subVI.

27

USE OF FILES
EXPT NO: 4-B DATE: 20-08-2010

AIM To design a VI that creates array data into a spread sheet using LabVIEW. SOFTWARE USED LabVIEW software. THEORY Write to spread sheet file. Converts 2D or 1Darray of single precision numbers to a text string and writes the string to a new byte stream file or appends the string to an existing file. It can also transpose the data. The VI opens or creates the file before writing to it and closes it afterwards. It can use this VI to create a text file readable by most spreadsheet applications. This VI calls the array to spreadsheet string function to convert the data. PROCEDURE Open a new VI. Front Panel Select Control >> Numeric >> Tank. Select Control >> Numeric Indicators >> Thermometer.

Block Diagram Select all functions >> Structures >> For Loop. Select all functions >> File I/O >> write to spreadsheet file.vi Select all functions >> Array >> Build array. Select all functions >> Numeric >> Multiply. Write the file path in string constant and wire it to the Write to spreadsheet icon. Select all functions >> Execution Control >> Time delay.
28

FRONT PANEL

BLOCK DIAGRAM
CASE: TRUE

29

CASE: FALSE

OUTPUT FILE

30

Wire The Icon In Block Diagram. Save And Run VI

OBSERVATION The data is written into the spreadsheet file and displayed. RESULT A VI is built to write data into a spreadsheet file.

31

TWO BUTTON DIALOG BOX


EXPT NO: 5 DATE: 27-08-2010

AIM To create a VI that rolls two dice. If we roll a 7 then the light indicator comes and saying that You Win. If anything else other than 7 we have an indicator pop up You Lose. Use a Boolean Stop button, so that program knows when we are done playing. Use Boolean Roll button to roll the dice again. SOFTWARE USED LabVIEW software. THEORY Two dice are rolled. A dice shows number from 1-6. In order to get a number from 1-6, random number between 0-5 is generated, and scaled to 1-6. The dice is rolled and say that the number after 20th roll is taken. The sum of numbers show on two dice is compared with 7 and indicator glows showing Win or lose. Simultaneously it should ask for rolling again. This is achieved by using a two button dialog box. The two button display box displays a dialog box that contains a memory and two buttons. It has three inputs. a) Message: it is the text to display in the dialog box. b) T Button Name: it is the name displayed on the dialog box. c) F Button Name: it returns a value of True if you check the dialog box button named T Button name. If you click the dialog box button named F. T Button returns a value of FALSE. If we are selecting false condition, again it will ask for stop or not. PROCEDURE Open a blank VI.

32

FRONT PANEL

BLOCK DIAGRAM
CASE: TRUE
TRUE

33

FALSE

CASE: FALSE

34

Front Panel Select Controls>> Boolean >> Round LED, right click on the LED and select show Boolean text and lock text in centre. In the ON text column, write You Win and in the off text column, write You Lose. Select Controls >> Numeric >> Numeric indicator. Select Function >> Structure >> While Loop. Select Function >> Structure >> Case Structure. Select Function >> Time & Delay >> two button display and connect it to the case selector. ON the message wire of two button dialog. Create >> constant and type ROLL. Select Function >> Structure >> For Loop to roll the dice for 20 times. Select Functions >> Numeric >> Random number. Select Functions >> Numeric >>multiply to multiply the random number with 5. Select Functions >> Numeric >> round to nearest which rounds off generated number to a whole number. Select Function >> Numeric >> Increment to scale it to 1-6. Repeat the above 5 steps to generate another set of numbers between 1-6. Select Functions >> Array >> Index Array to obtain the last value shown in the dice after rolling for 20 times. Select Functions >> Numeric >> Add the dice numbers. Select Functions >> Comparison >> Equal to compare the sum value with 7. The comparison output which is Boolean is out of case structure and is connect to the stop button of while loop outside in the false case. Select Function >> Time & Dialog >> two button dialog. Give stop in the message area. The output is wired to the stop button outside. The wiring is completed and VIs saved.

Block Diagram Select Function >> Structure >> While Loop. Select Function >> Structure >> Case Structure. Select Function >> Structure >> For Loop. Select Function >> Time & Delay >> Two button display
35

Select Functions >> Numeric >> Random number. Select Functions >> Numeric >>Multiply Select Functions >> Numeric >> round to nearest which rounds off generated number to a whole number. Select Functions >> Numeric >> Add the dice numbers. Select Functions >> Comparison >> Equal to compare the sum value with 7. The comparison output is given as a selector of the case where the two button dialog box is kept. Wire the circuit appropriately and run the VI

OBSERVATION When the sum of two numbers became 7, the LED glows saying you win else you lose. If will then ask for rolling again. If yes it starts again else it asks to stop. RESULT The flowchart function is implemented using a VI.

36

AMPLITUDE MEASUREMENT
EXPT NO: 6 DATE: 17-09-2010

AIM To create a VI for displaying amplitude measurement using LabVIEW. SOFTWARE USED LabVIEW software. THEORY The Signal Measurement deals with accepting an input signal of a single waveform or an array of waveforms and measures the transition duration (rise or fall time), slew rate of a selected positive or negative transition in each waveform. Using VI we also are measuring the amplitude, high level, low level period, pulse duration of the input signal. Amplitude is the objective measurement of the degree of change of the wave. Reference levels specify the high and low reference levels required to determine the transition interval. Mid reference level is not used in transition measurements. Reference levels provide a means to identify the position in time of the waveform feature measured. High reference level specifies high reference level of the waveform present (default) or absolute units. A rising high level crossing defines the end of a raising transition and a falling high reference level defines the beginning of a falling transition. Mid reference level specifies the middle reference level in percent (default) or absolute unite. Low reference level specifies the low reference level of the waveform in percent (default) or absolute units. A rising low reference level crossing defines the beginning of a rising transition and a falling low reference level crossing defines the end of a falling transition. PROCEDURE Open a blank VI. Front Panel Select a waveform graph from Controls >> Graph Indicators >>waveform graph
37

FRONT PANNEL

BLOCK DIAGRAM

38

Select numeric control from Controls >> Numeric Controls >> knob and label as frequency. Select numeric indicator from Controls >> all controls>>enum and label as signal type Select the properties of the graph and go to the cursors. Add two cursors with different names. And choose the style and color.

Block Diagram Select All Functions >> Analyze >> Wave Form Generations >> Basic Function Generator. Select All Functions >> Analyze >> Wave Form Generations >>tones and noise waveform.vi Select amplitude measurements and level .vi from functions >>All Functions >> Analyze >> Waveform measurements >>amplitude measurements and level.vi. Select one add function from Functions >> Arithmetic and Comparison >> Express Numeric >> Add. Select property node of the waveform graph by right click on the graph icon>>Select Properties >> Active Cursor. Select property node of the waveform graph by right click on the graph icon>>Select Properties >> Cursor>>Cursor Position>>Cursor Y. Create a constant to the terminal and put the same as given in the cursor properties. Complete wiring and save the VI.

OBSERVATION Run the VI. Control the frequency. The waveform graph showed the signal as well as the cursors. Cursors that are represent the reference levels of the parameters and we got direct numeric values from the front panel. RESULT The amplitude measurement is performed successfully.

39

INTRODUCTION OF SPEEDY 33
EXPT NO: 7 DATE: 18-09-2010

AIM To familiarize the DSP kit by doing an example using SPEEDY-33 and to implement an equalizer. SOFTWARE USED LabVIEW 7.1embedded Software THEORY Frequency is the number of vibrations or oscillations second, which is measured in cycles per seconds or Hertz. It is said that the human ear can perceive a range of sound frequencies from 20 Hertz (twenty cycles per second) to 20 kilohertz (twenty thousand cycles per second), but of course, that does not apply to all of us. Audio equalizers allow you to adjust levels at set of points in a range of frequencies.

Each set of point is called a band and the more bands available for adjustment within a frequency range, the more precise the audible adjustments become. Many digital audio playing programs include an equalizer with anything from two bands, such as treble and bass sliders, up to over 100 bands each adjusting a certain frequency and surrounding frequencies.

A better way is to divide the audible spectrum into five or more frequency bands, and allow adjustments to each band via its own boost/cut control. Instead of broad adjustments of treble, bass, and maybe the midrange, one has independent control over the low bass, mid-bass, high bass, low midrange, and so forth. The gain of a frequency can be boosted (an increase in gain of a frequency) or cut (reduction in gain of a frequency) by decibels (dB), increasing or decreasing the volume, noise or intensity of that frequency. In this way it is possible to target certain frequencies in a range to improve (or distort) the sound.

40

FRONT PANEL

BLOCK DIAGRAM

41

PROCEDURE Click LabVIEW icon in the main menu. Select execution target pull down menu and select SPEEDY33 as the target.

Take Blank VI. Operate>>switch task to>>SPEEDY 33

PROCEDURE TO IMPLEMENT EQUALISER Front Panel Select Numeric Control >> fill slide (6) and rename it according to the frequency range. Set the range of all slide controls between 0 and 10. Select Numeric Indicator>> fill slide(6) Select Numeric Control>>knob to add an additional knob control for the volume.

Block Diagram The input and output blocks are selected from the function palette by choosing the analog input and analog output nodes respectively found in elemental input output. Select Functions >> Elemental Input Output >> Analog Input. Double click on the analog input and configure the input to 1 channel multiple samples. Set Sampling rate to 8000Hz and Frame Size is 512. Spectral Measurements Express VI, Express Signal Analysis Spectral Measurement. Select Functions >> Structures >> While loop. Select Signal Processing Filters Filter VI. To choose the frequency range 0-50,50100 Hz, 100-250 Hz, 250-750 Hz, 700-1500 Hz, and >1500 Hz. Double click in the VI and configure each IIR filter with Sampling Rate: 8000 Hz, IIR filter: Elliptic, Order 7, the filter type and cut off frequency as required for each filter. Using a low pass and a high pass filter in cascade with the lower frequency of the band being the cutoff of a high pass filter and the higher frequency of the region being the cutoff of a low pass filter Repeat the same for the other bands Connect the output of the Analog Input to the input of the Filters.
42

Select Functions >> Numeric >> multiply to multiply the output of the filters along with the output of the Volume control. Select Functions >> Numeric >> Multiply to multiply the output of the previous Multiply functions with the Frequency Slide Controls Select Functions >> Numeric >> add to Add the six signals together to get the signal at all frequencies by placing five Add functions. Wire the output of the last Add to the Analog Output node and the signal input of the Spectral Measurements Express VI. Select Functions>> Array>> Index array (5). Connect the output of the Spectral Measurements to the array of each of the five Index Arrays output of each array to the corresponding slide indicator Select Functions >> Structures >> While loop.

OBSERVATION By varying the gains we can boost/attenuate the various frequency ranges RESULT Equalizer was implemented using SPEEDY 33

43

STEPPER MOTOR
EXPT NO: 8 DATE: 24-09-2010

AIM To design and operate a stepper motor drive circuit in VI using LabVIEW. SOFTWARE USED LabVIEW Software with DAQ. THEORY Stepper motors operate differently from DC brush motors, which rotate when voltage is applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. The electromagnets are energized by an external control circuit, such as a micro controller. To make the motor shaft turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted to the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet, they are slightly offset from the next electromagnet. So when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one, and from there the process is repeated. Each of those slight rotations is called a "step," with an integer number of steps making a full rotation. In that way, the motor can be turned by a precise angle. PROCEDURE Open a blank VI. Front Panel Select Control >> Round LED (4) to show the change in the sequence. Select Controls >> Numeric control >> Numeric control to control the time delay in each frame

44

FRONT PANEL

BLOCK DIAGRAM

45

Block Diagram Select Function >> All Functions >> Structure >> flat Sequence. Now add frames by using add frame before or after. Right click in the Leds >> Go to Create >> local variable in each frame Select function >> Arithmetic & Comparison >> Boolean >> True constant & false constant. Repeat this in each frame and wire the circuit Select Functions >> Execution Control >> Time Delay and place it in each flat structure Select functions >> Output >> DAQ Assist. Select functions>>programming>> array >> build array in each frame Wire the circuit

OBSERVATIONS By using DAQ Assist output, the circuit is connected to Stepper Motor and the direction of rotation is observed.

RESULT Thus a VI is built in LabVIEW for designing a control circuit for Stepper Motor using NI DAQ card.

46

USE OF NI ELVIS
EXPT NO: 9 DATE: 01-10-2010

AIM To study Band Pass Filter using NI ELVIS SOFTWARE USED LabVIEW with NI ELVIS COMPONENTS REQUIRED NI-ELVIS PC Capacitors Resistors Op-amp Connecting wires

THEORY NI Educational Laboratory Virtual Instrumentation Suite (ELVIS) uses LabVIEW based software instruments, a multifunction DAQ device, and a custom designed bench top workstation and prototyping board to provide the functionality of suite of common laboratory instruments. A 68 pin E series cable is the connection cable between the ELVIS kit and DAQ in the PC. The NI ELVIS LabVIEW soft front panel instruments combined with the functionality of the following SEP instruments. Arbitrary waveform generator Bode analyzer Digital bus writer Digital Multimeter (DMM) Dynamic System Analyser (DSA) Function Generator (FGEN) Impedance Analyzer
47

Oscilloscope (scope) Two-wire current voltage analyzer Three-wire current voltage analyzer Variable Power Supplies

DESIGN OF BAND PASS FILTER Specifications FL = 130 Hz FH = 90 Hz Design of high pass filter Let =0.01F

FH = 90 Hz = 1/2FH = 1/2900.0110-6 = 176k GAIN, A=2 A=1+ R1/ R2 R1/ R2 =1 TAKE R1 = R2 = 10k Design of low pass filter Let =0.01F

FL = 130 Hz = 1/2FL = 1/21300.0110-6 = 122k


48

GAIN, A=2 A=1+ R3/ R4 R3/ R4 =1 TAKE R3= R4= 10k PROCEDURE Wire the circuit as given in the diagram Connect it to the NI-ELVIS board Interface the NI-ELVIS to the PC Select NI-ELVIS from the national instruments in start menu Configure the hardware and ensure the connectivity between the a PC and EL-VIS Select the bode analyzer from the menu Set the start frequency, stop frequency and steps Run the bode analyzer and observe the bode plot

PROCEDURE FOR ACQUIRING SIGNAL Front Panel Select Controls >> Graph Indicators >> Graph-2 times. Select Controls >> Numeric Controls >> Knob for the selection of frequency. Select Controls >> Numeric Controls >> Numeric Control.

Block Diagram Select All Functions >> NI Measurements >> Data Acquisition >> Analog Output >> AO Generation Waveform. Select All Functions >> NI Measurements >> Data Acquisition >> Analog Input >> AI Generation Waveform.

49

CIRCUIT DIAGRAM
R2 R1 R3 R4

Vi

FRONT PANEL

BLOCK DIAGRAM

50

BODE ANALYSER OF BAND PASS FILTER

51

OBSERVATION Depending upon the type of filter, observe the amplitude variation in oscilloscope by changing the frequency in the Function Generator. Here, we are using a Band Pass Filter having band of frequencies between 50 Hz and 100 Hz. From the oscilloscope, we can observe that the amplitude increases up to 50 Hz and then remains constant till 100 Hz and then decreases. Gain and Phase Plot is observed from the Bode Plot. RESULT Thus a second order Butterworth Band Pass Filter is designed and the output is observed using NI ELVIS.

52

SIMULATION OF TANK PROCESS


EXPT NO: 10 DATE: 22-10-2010

AIM To obtain a level control of a tank with temperature as the manipulated variable with DAQ in VI. SOFTWARE USED LabVIEW software with DAQ. THEORY The DAQ assistant bundled with NI-DAQ provides a step-by-step dialogue guide for configuring, testing and programming measurement tasks we can automatically generate code for low level customization. Along with other configuration based Vis in LabVIEW, the DAQ assistant makes it easier and faster to develop data acquisition. Measurement & Automation Explorer, bundled with NI-DAQ simplifies the configuration of the measurement hardware. We can quickly detect and configure all hard ware and verify its operations with interactive test panels. We can also view the date of the last external device calibration and perform the internal self calibration. With NI-DAQ, we can choose from 22 preconfigured measurement ready virtual channels including voltage, strain, current, output, pulse width and digital port output. We can configure these virtual channels in the units you actually want to measure and let NI-DAQ figure out how to configure your DAQ and signal conditioning device to take the measurements. The DAQ assistant bundled with NI-DAQ provides a step by step dialogue guide for configuring testing and programming measurement tasks and channels. PROCEDURE Front Panel Select All Functions >> Controls >> Classic >> Classic Numeric >> Tank Select All Functions >> Numeric Indicators >> Thermometer
53

FRONT PANEL

54

BLOCK DIAGRAM
CASE: TRUE

CASE: FALSE

55

Select All Functions >> Numeric Control>>Boolean Switch Select All Functions >> Structure>>Case Structure

Block diagram Case 1 Case 2 Select Function >>Structure >> While loop Add shift register in the While loop by right clicking Select Function >>Express >> Arithmetic and comparison>> Numeric>>Decrement Select Function >>Express >>Arithmetic and comparison>>Boolean>>less than or equal to Right click in the tank>> Go to Create >> local variable Select Functions >> Execution Control >> Time Delay Select all function >> input >> DAQ assistant Select Function >>Structure >> While loop Add shift register in the While loop by right clicking Select Function >>Express >> Arithmetic and comparison >>Numeric>>Increment Select Function >>Express >>Arithmetic and comparison>>Boolean>>greater than or equal to 50 Right click in the tank>> Go to Create >> local variable Select Functions >> Execution Control >> Time Delay Select all function >> input >> DAQ assistant Wire the circuit

Wire the circuit

OBSERVATION We can see the increment & decrement of the tank with respect to rise in temperature in thermocouple RESULT The tank level control with temperature as manipulated variable with DAQ is obtained in VI.
56

57

You might also like