**3. The TeraVision software**

### **3.1 Brief introduction to LabVIEW**

LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a software development environment by National Instruments (NI). One of the most significant difference between LabVIEW and many other computer languages is the use of a graphical interface for editing codes, resulting in the form of block diagrams. Besides this, LabVIEW is quite straightforward to use especially for people (like us) with no professional training for software coding, thanks to many routines and libraries which have been developed with a special focus on laboratory work, automation and instruments control, together with a pleasant and user friendly graphic interface for the software end user. This software is the core of the NI design platform and it is also an ideal choice for developing measurement or control systems. LabVIEW development environment integrates all the tools that engineers and scientists need to quickly construct various applications, designed to help engineers and scientists to concentrate on their principal tasks, to solve problems and to improve productivity.

LabVIEW is a graphical programming environment for creating applications using icons instead of text lines. The traditional text programming languages determine the order of program execution according to the order of statements and instructions, while the LabVIEW adopts the method of data flow programming. LabVIEW's graphical source code is similar to a flowchart to some extent, so it is also called the block diagram. The data flow between nodes in the program block diagram determines the execution order of subroutines (Virtual Instruments – VI) and functions. LabVIEW provides many controls that look similar to traditional instruments, such as oscilloscopes and multimeters, for simplified user interface creation. The user interface in LabVIEW is called the front panel. With icons and wires in the block diagram, one can programmatically control the objects on the front panel.

#### **3.2 Main concepts about the TeraVision software**

The TeraVision software is meant to perform two main types of measurements: 1) as a function of time (THz-TDS); 2) as a function of time and wavelength (THYR). In addition, it can perform two ancillary measurements: 3) as a function of wavelength only (Spectrum); 4) as a function of input/output polarizations (Signal Anisotropy). The latter two can be performed with and without a THz pulse applied on the sample. More features are very relevant for system optimization, and therefore the software includes: 5) a routine for signal optimization, in order to observe a real-time scan of the signal on screen, although with a large noise; 6) a signal-channel monitor, which displays the actual values of each channel of the DAQ before averaging; 7) a Delay Stage control to check for the device performance and to drive it manually and independently on the measurements. We note incidentally that point 6 can be used also as a signal monitor to manually measure the signal as

**51**

*TeraVision: A LabVIEW Software for THz Hyper-Raman Spectroscopy*

done by means of a single external unit, such as a digital oscilloscope.

a function of any variable which is not under the software control (temperature, external electric or magnetic fields, and so on…). Since the signal is revealed as the difference between THz-ON and THz-OFF trains of pulses, this reading cannot be

The software can manage automatically the creation of folders and data files for saving the experimental results and the parameters are checked at each input in order to ensure that any possible mistake by the user cannot create problems during the measurement execution. At every startup the initialization procedure is collecting data from all devices to set the safety breaks which are forcing the user to set all parameters in within a safe range. Moreover every value is rounded to the minimal time/angle/wavelength resolution, so that the device can be driven with no overlap between subsequent points. The measurements files are numbered incrementally in order to ensure that two runs with identical parameters and names will be stored in different files, which are saved automatically during each run, but can be deleted at the end of the run upon user command. The software also has the ability to ring a bell when the measurement is finished, and the bell stops ringing as soon as the mouse is moved or any key is pressed. In this way the user can save time and energy by working on other things while the measurement is running, still without losing any time at the end of each run. The basic idea below TeraVision is that the user must be concentrated uniquely on the measurement and not be bored by many

The software produces three distinct files for each single measurement: a large data file in which every single point of every scan is saved before averaging, a short data file in which only the average on all points and scans is saved, and an image file which contains a summary of the measurement with graphs and all relevant parameters and comments by the user. This ensures that during data analysis the user will find quickly what he/she is searching for, he/she will be able to quickly analyze the averaged data, but he/she will also be able to perform a deep data analysis on individual points if needed, so to maintain the full information content of the measurement. The data files are saved point-by-point during the run, in order to prevent information losses due to system crash, electrical black-out or whatever

All these features are meant to create a very friendly and free-of-worries user experience, to make unnecessary for the user to have any specific knowledge about the software code and to achieve 100% safety about data loss and device

From the point of view of the performances, and in particular in order to reduce

the measurement time as much as possible, several solutions have been imple-

We begin to describe the operation of the TeraVision software starting from the final user interface, in order to explain in some details all the features included in the software. In a second moment, we will describe the "backstage", i.e. how we implemented the proposed solutions in the software code. **Figure 5** shows the TeraVision front panel. In the upper line of the panel there is the software name and version, and the Quit button. This button is important, for it drives the correct quitting procedure of the software, as better explained in the dedicated section. The user can quit the software in other ways, but then he/she will need to close manually all ports used by the program and all set parameters of that experimental session will be lost and the software will load the previously saved ones at next startup. Below the first line, we can locate two main blocks: the central Tab panel, which is

mented, and they will be discussed in the next sections.

*DOI: http://dx.doi.org/10.5772/intechopen.96663*

irrelevant tasks.

unpredictable problems.

**3.3 The TeraVision front panel**

operation.

#### *TeraVision: A LabVIEW Software for THz Hyper-Raman Spectroscopy DOI: http://dx.doi.org/10.5772/intechopen.96663*

*LabVIEW - A Flexible Environment for Modeling and Daily Laboratory Use*

**3. The TeraVision software**

**3.1 Brief introduction to LabVIEW**

problems and to improve productivity.

**3.2 Main concepts about the TeraVision software**

(NI). The latter is a X-series multifunction I/O Device, which offers analog (16 bit) and digital I/O, four 32-bit counter/timers for encoder, frequency, event counting etc. It relies on a high-speed PCI Express bus. In our TeraVision software we used NI-VISA which is an API (Application Programming Interface) that provides a programming interface to control GPIB, serial, USB, PXI, VXI etc. instruments in National Instruments application development environments like LabVIEW.

LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a software development environment by National Instruments (NI). One of the most significant difference between LabVIEW and many other computer languages is the use of a graphical interface for editing codes, resulting in the form of block diagrams. Besides this, LabVIEW is quite straightforward to use especially for people (like us) with no professional training for software coding, thanks to many routines and libraries which have been developed with a special focus on laboratory work, automation and instruments control, together with a pleasant and user friendly graphic interface for the software end user. This software is the core of the NI design platform and it is also an ideal choice for developing measurement or control systems. LabVIEW development environment integrates all the tools that engineers and scientists need to quickly construct various applications, designed to help engineers and scientists to concentrate on their principal tasks, to solve

LabVIEW is a graphical programming environment for creating applications using icons instead of text lines. The traditional text programming languages determine the order of program execution according to the order of statements and instructions, while the LabVIEW adopts the method of data flow programming. LabVIEW's graphical source code is similar to a flowchart to some extent, so it is also called the block diagram. The data flow between nodes in the program block diagram determines the execution order of subroutines (Virtual Instruments – VI) and functions. LabVIEW provides many controls that look similar to traditional instruments, such as oscilloscopes and multimeters, for simplified user interface creation. The user interface in LabVIEW is called the front panel. With icons and wires in the block diagram, one can programmatically control the objects on the

The TeraVision software is meant to perform two main types of measurements:

1) as a function of time (THz-TDS); 2) as a function of time and wavelength (THYR). In addition, it can perform two ancillary measurements: 3) as a function of wavelength only (Spectrum); 4) as a function of input/output polarizations (Signal Anisotropy). The latter two can be performed with and without a THz pulse applied on the sample. More features are very relevant for system optimization, and therefore the software includes: 5) a routine for signal optimization, in order to observe a real-time scan of the signal on screen, although with a large noise; 6) a signal-channel monitor, which displays the actual values of each channel of the DAQ before averaging; 7) a Delay Stage control to check for the device performance and to drive it manually and independently on the measurements. We note incidentally that point 6 can be used also as a signal monitor to manually measure the signal as

**50**

front panel.

a function of any variable which is not under the software control (temperature, external electric or magnetic fields, and so on…). Since the signal is revealed as the difference between THz-ON and THz-OFF trains of pulses, this reading cannot be done by means of a single external unit, such as a digital oscilloscope.

The software can manage automatically the creation of folders and data files for saving the experimental results and the parameters are checked at each input in order to ensure that any possible mistake by the user cannot create problems during the measurement execution. At every startup the initialization procedure is collecting data from all devices to set the safety breaks which are forcing the user to set all parameters in within a safe range. Moreover every value is rounded to the minimal time/angle/wavelength resolution, so that the device can be driven with no overlap between subsequent points. The measurements files are numbered incrementally in order to ensure that two runs with identical parameters and names will be stored in different files, which are saved automatically during each run, but can be deleted at the end of the run upon user command. The software also has the ability to ring a bell when the measurement is finished, and the bell stops ringing as soon as the mouse is moved or any key is pressed. In this way the user can save time and energy by working on other things while the measurement is running, still without losing any time at the end of each run. The basic idea below TeraVision is that the user must be concentrated uniquely on the measurement and not be bored by many irrelevant tasks.

The software produces three distinct files for each single measurement: a large data file in which every single point of every scan is saved before averaging, a short data file in which only the average on all points and scans is saved, and an image file which contains a summary of the measurement with graphs and all relevant parameters and comments by the user. This ensures that during data analysis the user will find quickly what he/she is searching for, he/she will be able to quickly analyze the averaged data, but he/she will also be able to perform a deep data analysis on individual points if needed, so to maintain the full information content of the measurement. The data files are saved point-by-point during the run, in order to prevent information losses due to system crash, electrical black-out or whatever unpredictable problems.

All these features are meant to create a very friendly and free-of-worries user experience, to make unnecessary for the user to have any specific knowledge about the software code and to achieve 100% safety about data loss and device operation.

From the point of view of the performances, and in particular in order to reduce the measurement time as much as possible, several solutions have been implemented, and they will be discussed in the next sections.

#### **3.3 The TeraVision front panel**

We begin to describe the operation of the TeraVision software starting from the final user interface, in order to explain in some details all the features included in the software. In a second moment, we will describe the "backstage", i.e. how we implemented the proposed solutions in the software code. **Figure 5** shows the TeraVision front panel. In the upper line of the panel there is the software name and version, and the Quit button. This button is important, for it drives the correct quitting procedure of the software, as better explained in the dedicated section. The user can quit the software in other ways, but then he/she will need to close manually all ports used by the program and all set parameters of that experimental session will be lost and the software will load the previously saved ones at next startup. Below the first line, we can locate two main blocks: the central Tab panel, which is

**Figure 5.** *TeraVision front panel.*

the core of the software, and a lateral column. This column will be always on screen for any Tab selected. Let us describe the column content, and then we will describe each individual Tab of the central panel in separate subsections.
