You are on page 1of 29

Analysis of Cesium-137 data via LabVIEW

REPORT OF GRADUATE LAB PROJECT

PROJECT TITLE: Analysis of Cesium-137 data via LabVIEW

SUPERVISOR:

DR. ASIF MALIK

SUBMITTED BY: GROUP 7


Imran Parvez Khan ! Akhtar Iqbal !! Obaidullah Jan ! ! Ashfaq Ahmed ! ! FA10-RPH-016 FA10-RPH-027 FA10-RPH-025 FA10-RPH-001

! ! !

! ! !

! ! !

! ! !

! !

COMSATS Institute of Information Technology Islamabad

Analysis of Cesium-137 data via LabVIEW

ACKNOWLEDGEMENTS

!" praise and gra#tude, behooves $e Almigh% A"ah, in Whose con&ol, is my life, my 'a(. He is )e only cause of every e*ect, He is )e sole Crea+r of )e cosmos. $is project, however &ivial, is not mine, it is a re,ec#on of $ee. - am earnestly indeb(d + $e Holy Prophet ( Peace be upon him ), had he not been )e .essenger of A"ah, mankind would never have gained enligh(nment of mind and soul. /r. A"ama Iqbal, once composed )e fo"owing verse, in )e praise of $e Holy Prophet:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" #$%&' %() *+ ,- ./0 123$ 45 6" !!!!!!!!!!!!!!!!!!!*7 89 *7 :0$ 89 0$ :8;%/ 89 8;%/ :8+*7 89 8+*7
0e kind supervision of Dr. Asif Malik and Dr. Nasim Zafar was indeed invaluable. 1e are greatly indeb(d + our families.

Analysis of Cesium-137 data via LabVIEW

DEDICATION

!o "e blood, of "e mar#$ !o "e cry, of "e %ars, !o "e agony... Of "is weeping worl&

Analysis of Cesium-137 data via LabVIEW

TABLE OF CONTENTS

CHAPTER 1 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 3 4 4 6 ! !

INTRODUCTION TO LabVIEW ! ! Importance of LabVIEW ! ! How are we using LabVIEW ?! Phases of LabVIEW programming!

CHAPTER 2 ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! 21 23 25 9 11 12 13 17

LabVIEW Basics! Running a VI!! LabVIEW Code! ! ! ! ! !

Basic Controls and Indicators!

How to get Microsoft Excel spreadsheet into LabVIEW ?!

CHAPTER 3 ! !

Results and Observations!! Quantitative Analysis!! References! ! !

Analysis of Cesium-137 data via LabVIEW

Abstract

In this project, we use a graphical programming language LabVIEW to do some statistical analysis of the activity of Cesium-137. Although the real utility of LabVIEW is computer interfacing, but still our work can be categorized as a post-computer interfacing exercise which is equally important in its own regard. We have shown that LabVIEW yields as accurate results as any other software with far more ease and user-friendliness. To achieve this end, we have also provided a very general and useful method to make LabVIEW read a Microsoft Excel spreadsheet le.

Analysis of Cesium-137 data via LabVIEW

CHAPTER 1 INTRODUCTION

Analysis of Cesium-137 data via LabVIEW

INTRODUCTION TO LabVIEW

Computer programming is the art of modern problem solving. A set of instructions that tells a computer what to do is called a program or code. This code is written in a particular environment called programming language. The most essential component of this environment in the interpreter, which of course, interprets the code from its high-level syntax to a low-level language which the computer hardware can understand. Since this procedure requires learning the exact syntax of computer languages, people started working on the idea of Visual Programming Language. Any programming language that allows users to create programs by controlling objects graphically rather than by writing them is called a Visual Programming Language (VPL). A VPL allows programming with visual expressions with visual expressions, spatial arrangements of text, icons and graphic symbols. A3 very famous example is Microsoft Visual Basic. A visual programming environment provides all objects as built-in components to develop a graphical user interface. The programmer is not required to create these objects. Whatever he needs, he selects it from a toolbox. These components can then be moved, resized and renamed as required by the programmer. Most modern visual programming environments are equipped with highly interactive displays to facilitate fast explanation and presentation of results. Such softwares considerably simplify simulation procedures. The VPL we have used for our work is LabVIEW (Laboratory Virtual Instrumentation Engineering Workbench). It is a platform and development environment for visual programming by an American organization known as National Instruments. The programming language used at the back end of LabVIEW is called G which is a dataow programming language.

What is Graphical Programming ? Since there are no lines, so LabVIEW code does not execute line by line. The control works through the principle called dataow. Stated simply, a node executes only when data arrives at all its input terminals; the node supplies data to all of its output terminals when it nishes executing; and the data passes immediately from source to designation terminals. 3
3

Analysis of Cesium-137 data via LabVIEW

Dataow contrasts strikingly with the control ow method of executing a text-based program, in which instructions are executed in the sequence in which they are written. Although traditional execution ow in instruction driven, dataow execution is data driven or data dependent.

Importance of LabVIEW: Today LabVIEW is being used by experimental setups as large as CERN. Following is a comment by a CERN scientist: "We selected the LabVIEW and PXI solution for the deployment platform due to the small size, ruggedness, and cost savings over the traditional VME and programmable logic controller-based model. " Roberto Losito, CERN The Challenge: Measuring and controlling, in real time, the position of bulk components to absorb energetic particles out of the nominal beam core with high reliability and accuracy at the world!s most powerful particle accelerator, the Large Hadron Collider (LHC). The Solution: Using LabVIEW, the LabVIEW Real-Time Module, the LabVIEW FPGA Module, and NI SoftMotion software with NI R Series recongurable I/O hardware for PXI to develop an FPGA-based motion control system capable of intercepting misguided or unstable particle beams. Where is LabVIEW used ? LabVIEW is compatible with most of the operating systems, for instance, Microsoft Windows, UNIX and Mac OS. It is used for following purposes: data acquisition instrument control industrial automation analysis and signal processing industrial control embedded design Phases of LabVIEW programming The following are the main divisions of problem solving via LabVIEW: Acquiring data Analyzing data Presenting data
4

Analysis of Cesium-137 data via LabVIEW

Acquiring Data: LabVIEW is designed in such a way to interface with any measurement hardware in a simple manner. It has the ability to have connectivity with thousands of devices. So LabVIEW makes acquiring data as simple as possible, by providing connectivity to virtually any measurement device. Analyzing Data: After data acquisition, the next step is to analyze the data. For this purpose, LabVIEW offers many built-in functions that cover different areas and methods of extracting information from acquired data. Users can also modify these functions as per requirement. Presenting Data: The last phase then is the presentation of data. LabVIEW offers very powerful tools for data presentation. The user can graphically present their data with a wide variety of patterns such as charts, graphs, analog and digital indicators, etc.

Analysis of Cesium-137 data via LabVIEW

How are we using LabVIEW ? What we are doing is basically that we have obtained the data of Cesium activity from the Radiation Lab, Physics Dept. CIIT. We have shown how to make LabVIEW read data stored in some other format, say excel. Then we have plotted the data using LabVIEW and this plot is very accurate. We have then done some statistical analysis on the data. Since we have used Cesium-137 data as an example, we would like to give some facts about cesium in general and cesium-137 in particular: Historical background of Cesium Cesium is a soft, silver white gray metal that occurs in nature as cesium-133.mostly it exist in nature in oxide form. The melting point of cesium is 280C. It is liquid at normal temperatures. It reacts very explosively with cold water. There are 11 major radioactive isotopes of cesium. Three have long half lives, cesium-134, cesium-135 and cesium-137. Each of these decays by emitting a beta particle, and their half life from about 2 to 2 million years. The half-lives of the other cesium isotopes are less than two weeks. Of these three, the most important is cesium-137.

Radioactive Properties of Key Cesium Isotopes and an Associated Radionuclide isotopes Half life specific active (Ci/g) 1300 0.0012 88 540 million Decay Modes

Cs-134 Cs-135 Cs-137 Ba-137m (95%)

2.1years 2.3 million years 30 years 2.55 minutes

! ! ! IT

Fig 1.1. IT = isomeric transition, Ci = curie, g = gram, and MeV = million electron volts; a dash indicates that the entry is not applicable. (See the companion fact sheet on Radioactive Properties, Internal Distribution, and Risk Coefcients for an explanation of terms and interpretation of radiation energies.) Certain properties of barium-137m are included here because this radionuclide accompanies the cesium decays. Values are given to two signicant gures.

Caesium-137 In 1860, Gustav Kirchhoff and Robert Bunsen discovered nonradioactive cesium in mineral water in Germany. Radioactive cesium-137 and many other radionuclides that are used in nuclear medicine were discovered in the late 1930s by Glenn T. Seaborg and his coworker, Margaret Melhase. Caesium-137 () is a radioactive isotope of cesium which is formed as a ssion product by nuclear ssion. It has a half life of about 30.17 years. It

Analysis of Cesium-137 data via LabVIEW

decays by emission of a beta particle and gamma rays to barium-137m. Here m" stands for metastable state. About 95% of the nuclear decay leads to this isomer. The other 5% directly comes in to the ground state which is stable. Ba-137m has a half-life of about 2.55 minutes and it is responsible for the emissions of gamma rays. The photon energy of Ba-137m is 662 keV. These photons can be useful in food irradiation and in the radiotherapy of cancer. Caesium-137 is not widely used for industrial radiography because it is quite chemically reactive and it is difcult for someone to handle. Also the salts of cesium are very soluble in water so this complicates the safe handling of cesium.

Analysis of Cesium-137 data via LabVIEW

CHAPTER 2 EXPERIMENTAL TECHNIQUES

Analysis of Cesium-137 data via LabVIEW

LabVIEW Basics Virtual Instrument Hardware instruments are made up of predened hardware components such as multimeters, oscilloscopes, signal generators that work according to their pre-dened limits. The main difference between between hardware instrumentation and virtual instrumentation is that by using the software, users can replace a large amount of hardware. By using the software users can replace the complex and expensive hardware to computer hardware. By using the software designing and simulating the experiments virtually when no hardware is actually present is known as Virtual Instrumentation (VI). VI has grown signicantly since its start in the late 1970s.

Front Panel The front panel is the window through which the user interacts with the program. When a VI is run, the front panel must be open so that the data can be entered into the executing program. In fact, front panel is where you see the output of your program. (see Fig 2.1)

Fig 2.1: Example of Front Panel.

Block Diagrams The block diagram window holds the graphical source code of LabVIEW VIs. LabVIEW block diagram corresponds to the lines of text found in a more conventional language like
9

Analysis of Cesium-137 data via LabVIEW

C or MATLAB. It is the actual executable code. Block diagram is constructed by wiring together the various components in the block diagram. (see Fig 2.2)

Fig 2.2: Example of Block Diagram.

Node A node in simple words means a program execution element. Nodes are analogous to statements, operators, functions, loops and subroutines in standard programming languages. LabVIEW, in addition has Formula nodes, which are used to evaluate mathematical formulas or expressions. Wires A LabVIEW VI is held together by wires connecting nodes and terminals. Wires are the data paths between source and destination terminals; they deliver data from one source terminal to one or more destination terminals. Note : If you connect more than one source or no source at all to a wire, LabVIEW disagrees with such operation, and the wire will appear broken. A wire can only have one data source, but may have several data sinks.

10

Analysis of Cesium-137 data via LabVIEW

Fig 2.3: Numeric Indicators.

Basic Controls and Indicators LabVIEW has four types of simple controls and indicators: numeric, boolean, string and paths. But as we have used only the numeric indicators, so we explain them as follows. Numeric Indicators
Numeric indicators display numeric values you wish to see. LabVIEW has many types of numeric objects: knobs, slides, tanks, thermometers, and, of course, the simple digital display. To use numerics, select them from the Numeric subpalette of the Controls palette. (see Fig 2.3)

Boolean Control Besides this, we have employed a Boolean control and a String constant. A boolean variable is one that can either have a value of 1 (TRUE) or 0 (FALSE). String Constant A string is a combination alphanumeric or any other symbols. Thus a string constant is where we store such symbol that remains constant throughout the course of the program.

11

Analysis of Cesium-137 data via LabVIEW

Running a VI

You can run a VI using the Run command from the Operate menu, the associated keyboard shortcut, or by clicking on the Run button. While the VI is executing, the Run button changes appearance.

Run Button(Active) The VI is currently running if the Run button is black.

Run Button(subVI) The VI is executing as a subVI. We have not used any subVI in our program.

Continuous Run Button If you want to run a VI continuously, press the continuous run button, but be careful, this is not good programming habit to get into. You can accidentally catch your program in an endless loop and have to reboot to get out !

Abort Button Press the Abort button to abort execution of the VI. Using the Abort button causes an immediate halt of execution and is not good programming practice, as your data may be invalid.

Pause Button The pause button pauses execution when you press it, and then resumes execution when pressed again.

NOTE : You can run multiple VIs at the same time. After you start the rst one, switch to the panel or diagram window of the next one and start it.

12

Analysis of Cesium-137 data via LabVIEW

How to get Microsoft Excel spreadsheet into LabVIEW ? This was the most important and challenging task of our code ! STEP 1. Import Microsoft Excel le into LabVIEW The method to read spreadsheet data into LabVIEW is with the Read from spreadsheet le VI which is available in File I/O. This VI can read any type of spreadsheet provided the delimiter is known. A delimiter is a sequence of one or more characters used to specify the boundary between cells in the spreadsheet le. For example, the comma character is good example of a delimiter. But by default, the delimiter of an Excel le is not the comma. So we rst need to save our excel le as a comma-separated value le (i.e, with a .csv extension). LabVIEW can then read this le type with the Read from spreadsheet le VI and import the desired data. (see Fig 2.4 and Fig 2.5) NOTE: .csv le format does not support multiple sheets.

13

Analysis of Cesium-137 data via LabVIEW

Fig 2.4: Save As in Excel.

14

Analysis of Cesium-137 data via LabVIEW

Fig 2.5: Select the CSV le format.

Now in LabVIEW, bring up the Functions Palette and select File I/O >> Read from spreadsheet le VI. Then right click on the delimiter input located on the bottom edge of the VI and select create >> constant. The default value for this input is tab(/t) ( which of course is a type of delimiter ). But since we saved our le in the comma-separated le format so we change it to comma, by typing a comma (,) in the string constant we created. (see Fig 2.6)

15

Analysis of Cesium-137 data via LabVIEW

Fig 2.6: File I/O Menu.

By default, the VI will display a le dialog box to locate the le each time you run the VI.
16

Analysis of Cesium-137 data via LabVIEW

LabVIEW Code The gure on the next page is the code we have written in LabVIEW. What this code does is simply getting the cesium radioactivity data from a spreadsheet le saved in csv format via File I/O function. The arguments of this function are delimiter and transpose. It then plots the data. Secondly it uses the Histogram function to generate the histogram of the data and then plots it too using the Waveform graph indicator. The argument of histogram function is the interval length. Lastly, it uses the Statistics function to provide many useful stats about our data such as mean, deviation, maximum, minimum, root mean square. Here is the algorithm of our code.

17

Analysis of Cesium-137 data via LabVIEW

START

PRE-SET VALUE OF DELIMITER = ,

PRE-SET VALUE OF TRANSPOSE = TRUE

IF TRANSPOSE = TRUE

INPUT SPREADSHEET DATA IN .CSV FORMAT

INPUT INTERVAL LENGTH = 50

CALCULATE STATISTICS

PREPARE HISTOGRAM

PLOT DATA

DISPLAY STATISTICS

DISPLAY HISTOGRAM

DISPLAY DATA GRAPH

END

18

Analysis of Cesium-137 data via LabVIEW

19

Fig 2.4: Code of our program.

Analysis of Cesium-137 data via LabVIEW

CHAPTER 3 RESULTS AND DISCUSSION

20

Analysis of Cesium-137 data via LabVIEW

Results and Observations: Fig 3.1 shows the count vs. channel graph of cesium-137. It is energy graph which is obtained by decay of cesium-137. The energy is not known. On the vertical side of the graph there is number of counts while in horizontal side channel numbers. Number of counts count the number of photons that strike detector while channel numbers arrange the number of photons in different energy. If two photons of same energies strike detector horizontally it would be counted as one in channel numbers while vertically it would be counted two on numbers of counts. In the given graph there are three large peaks. The statistical analysis in Fig 3.2 quantitatively tells us that the rst peak is at channel 5. Here the numbers of photons strike the detector are 28021. In the second peak exists at channel 136. The number of counts 15552. The third peak present at channel number 165 and the number of counts at this peak are 15130.

21

Analysis of Cesium-137 data via LabVIEW

Fig 3.1: Plot of the Cesium-137 data.

22

Analysis of Cesium-137 data via LabVIEW

Quantitative Analysis Our program has provided us with the following important statistics (see Fig 3.2) about the specic Cesium-137 data: Mean:" RMS:" " " " " " " " " " " " " " " 1572.75 3506.03 3136.04" " 28021 5 0 0 28021 613 1

Deviation:"" Maximum:""

Channel No. At Maximum:"" Minimum" " " " "

Channel No. At Minimum" " Range of Values:" Total Samples:" " " " " "

Channel interval length:" "

23

Analysis of Cesium-137 data via LabVIEW

Fig 3.2: Histogram and Statistics.

24

Analysis of Cesium-137 data via LabVIEW

References : LabVIEW for Everyone: Graphical Programming Made Easy and Fun, Third Edition By Jeffrey Travis, Jim Kring, Publisher: Prentice Hall Synchronous Generator Simulation Using LabVIEW, World Academy of Science, Engineering and Technology 39 2008, Student Paper, M. Usama Sardar. Visual Programming using Visual Basic, Second Edition, By Tasleem Mustafa, Ahsan Raza Sattar, Tariq Mahmood, Imran Saeed. http://en.wikipedia.org http://www.ni.com

25

You might also like