**2. LINX and LIFA and the embedded model**

LIFA and LINX are the open-source but their approaches are different. LIFA provides a base succeed procedures installed in the file named as LabVIEWInterface.h, the users, based-on this procedure can program other procedures in the hardware devices to control their functions. To use LIFA, beside the graphical programming in LabVIEW, the procedure programming for the device firmware is required. On the other hands, LINX considers the LabVIEW graphical programming rather than the firmware programming, the compatible firmware are designed the loaded to the correspondent hardware devices respectively, therefore, with a simple functions, the embedded system with LINX is simpler than use of LIFA. Because of that, LINX is better error handling but does not flexible to develop functions like LIFA. For some unique embedded system, LIFA is preferred than LINX.

**Figure 1** show diagram of typical embedded system using LINX and LIFA. To use LINX, users should install the package into LabVIEW as a function of the LabVIEW and then choose a compatible firmware to load into the hardware flash

**105**

*LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

hardware devices or download data to the PC.

model of LINX or LIFA for their embedded systems.

configuration, the LINX toolbox should not be chosen.

defined as serial port through USB connection.

memory, the diagram shows in **Figure 1(a)**. The LIFA users, instead of uploading the firmware as the LINX users do, edit the LIFA codes in IDE software (Integrated Development Environment) to function their system then upload to the hardware devices. For the graphical programming, both users have to download the packages and install them though VIPM (VI Package Manager), then the modules included in LINX and LIFA will appear in the menu windows of LabVIEW program. To communicate with the hardware devices, the LabVIEW graphical program can use the modules of read and write presented in the packages to upload commands to the

Because of the independent projects to National Instrument, both LINX and LIFA occurred errors which caused by the compatibility with LabVIEW versions especially in LIFA applications, the common errors are 5002 and 5003 represented by the lost connection establishment. The LINX applications do not present the such errors and contains more various hardware firmware compatible with Arduino versions and Rashberry PI as well, however, the setup for sampling frequencies for data acquisitions are limited and much depended on the loop LabVIEW cycle. Therefore, depending on the requirements of applications, users can choose the

There are number of studies used LINX to apply Arduino module for low-cost embedded systems such as 3D object reconstruction with 3-axis scanning [9], temperature acquisition and control [10], DC motor control using PID (Proportional Integrated Derivative) controller [11], study transient response of RC circuit [12], an control the traffic signal [13]. Almost of the studies focused on the process control where the objects responses are limited in few milliseconds considering to few kilohertz sampling frequency. In the case of requirement for faster sampling frequency which has to be set on an optimum code to obtain, because of the fixed

For the real-time applications using Arrduino and LabVIEW, a number of users considered LIFA as the toolbox for LabVIEW which toward embedded systems based on Arduino. Some typical applications such as a real-time simulation of the PV (Photo-Voltaic) panel [14], a ECG 12 leads (ElectroCardioGraphy) signal real-time observation [15], a digital stethoscope for body sound signal real-time collection [16], a design of real-time battery monitoring [17], Robotic arm real-time controller design [18], and a water level observer implementation [19]. Because of open source in LIFA and the users have to program the firmware procedures in Arduino code, the sampling frequency can be improved. Here is the reason that LIFA is preferred for professional users who are requested some skills in program-

ming for hardware device such as micro-processors or micro-controllers.

For the LINX users, after the correspondent firmware chose and uploaded to the flash memory of the hardware devices, the graphical programs designed in LabVIEW response for all functions of the embedded systems. An example of the program is shown in **Figure 2** represents a typical analog signal acquisition using LINX. To initiate the program, a block named as "Open" addresses the in/out port of the connected hardware devices, here, is used of Arduino Uno which the port is

As the figure detailed, the block called "Analog Read" collects the signal from the channel corresponding to the analog input pin of the Arduino Uno module. The signal acquisition procedure is performed in the while loop until users stop it through the stop button or an error occurred. When the while loop is stopped, the block of "Close" terminate the program procedure. Here, to control the sample frequency a block named as "Wait" can be used. When the "Wait" block added with a constant or control parameter, the cycle of the while loop is controlled, hence, the sampling frequency is handled. Because of the dependency of the while loop cycle

**Figure 1.** *The diagram of LINX system (a) and LIFA system (b).*

#### *LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

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

as LIFA and LINX which the communication procedure is designed.

some unique embedded system, LIFA is preferred than LINX.

**2. LINX and LIFA and the embedded model**

tion for embedded system.

discrete sampling as well as response frequency not over than 100 kHz, this device will be the considered options for experimental arrangement. Since the first time released in 2005 [4], Arduino is used to develop many applications in automation systems. However, until 2013, a proposal for LabVIEW interface toolkit as LIFA (LabVIEW Interface for Arduino Toolkit) was announced [5] and introduced [6]. Another interface named as LINX designed by Digilent [7]. So far, these toolkit is widely known for the users using Arduino and Raspberry Pi in LabVIEW applica-

The LabVIEW VI is programmed to communicate with hardware devices though a package called NI-VISA [8]. This package provides some interface with communication protocol such as PXI, GPIB, VXI, Serial, USB. The LabVIEW compatible hardware devices has to be set their communication procedures in the flash or ROM memory to handshake with the VI program, then, the data can transfer from the devices to PC and the command can receive from the PC to the devices. The main problems of any embedded system is how to build the communication procedure set on the device to match with the communication procedures installed in LabVIEW designed by National Instrument. This is solved by some independent projects such

LIFA and LINX are the open-source but their approaches are different. LIFA provides a base succeed procedures installed in the file named as LabVIEWInterface.h, the users, based-on this procedure can program other procedures in the hardware devices to control their functions. To use LIFA, beside the graphical programming in LabVIEW, the procedure programming for the device firmware is required. On the other hands, LINX considers the LabVIEW graphical programming rather than the firmware programming, the compatible firmware are designed the loaded to the correspondent hardware devices respectively, therefore, with a simple functions, the embedded system with LINX is simpler than use of LIFA. Because of that, LINX is better error handling but does not flexible to develop functions like LIFA. For

**Figure 1** show diagram of typical embedded system using LINX and LIFA. To use LINX, users should install the package into LabVIEW as a function of the LabVIEW and then choose a compatible firmware to load into the hardware flash

**104**

**Figure 1.**

*The diagram of LINX system (a) and LIFA system (b).*

memory, the diagram shows in **Figure 1(a)**. The LIFA users, instead of uploading the firmware as the LINX users do, edit the LIFA codes in IDE software (Integrated Development Environment) to function their system then upload to the hardware devices. For the graphical programming, both users have to download the packages and install them though VIPM (VI Package Manager), then the modules included in LINX and LIFA will appear in the menu windows of LabVIEW program. To communicate with the hardware devices, the LabVIEW graphical program can use the modules of read and write presented in the packages to upload commands to the hardware devices or download data to the PC.

Because of the independent projects to National Instrument, both LINX and LIFA occurred errors which caused by the compatibility with LabVIEW versions especially in LIFA applications, the common errors are 5002 and 5003 represented by the lost connection establishment. The LINX applications do not present the such errors and contains more various hardware firmware compatible with Arduino versions and Rashberry PI as well, however, the setup for sampling frequencies for data acquisitions are limited and much depended on the loop LabVIEW cycle. Therefore, depending on the requirements of applications, users can choose the model of LINX or LIFA for their embedded systems.

There are number of studies used LINX to apply Arduino module for low-cost embedded systems such as 3D object reconstruction with 3-axis scanning [9], temperature acquisition and control [10], DC motor control using PID (Proportional Integrated Derivative) controller [11], study transient response of RC circuit [12], an control the traffic signal [13]. Almost of the studies focused on the process control where the objects responses are limited in few milliseconds considering to few kilohertz sampling frequency. In the case of requirement for faster sampling frequency which has to be set on an optimum code to obtain, because of the fixed configuration, the LINX toolbox should not be chosen.

For the real-time applications using Arrduino and LabVIEW, a number of users considered LIFA as the toolbox for LabVIEW which toward embedded systems based on Arduino. Some typical applications such as a real-time simulation of the PV (Photo-Voltaic) panel [14], a ECG 12 leads (ElectroCardioGraphy) signal real-time observation [15], a digital stethoscope for body sound signal real-time collection [16], a design of real-time battery monitoring [17], Robotic arm real-time controller design [18], and a water level observer implementation [19]. Because of open source in LIFA and the users have to program the firmware procedures in Arduino code, the sampling frequency can be improved. Here is the reason that LIFA is preferred for professional users who are requested some skills in programming for hardware device such as micro-processors or micro-controllers.

For the LINX users, after the correspondent firmware chose and uploaded to the flash memory of the hardware devices, the graphical programs designed in LabVIEW response for all functions of the embedded systems. An example of the program is shown in **Figure 2** represents a typical analog signal acquisition using LINX. To initiate the program, a block named as "Open" addresses the in/out port of the connected hardware devices, here, is used of Arduino Uno which the port is defined as serial port through USB connection.

As the figure detailed, the block called "Analog Read" collects the signal from the channel corresponding to the analog input pin of the Arduino Uno module. The signal acquisition procedure is performed in the while loop until users stop it through the stop button or an error occurred. When the while loop is stopped, the block of "Close" terminate the program procedure. Here, to control the sample frequency a block named as "Wait" can be used. When the "Wait" block added with a constant or control parameter, the cycle of the while loop is controlled, hence, the sampling frequency is handled. Because of the dependency of the while loop cycle

**Figure 2.** *Diagram of a typical acquisition LabVIEW program using LINX.*

to the computer system cycle, the sampling frequency in the case of LINX using is not stable. Moreover, the hardware sampling frequency is set as constant in LINX firmware, therefore the embedded system sampling frequency should be slower than the value set in the firmware.

To use the LIFA, the applicants should compile a code through the IDE software. The mostly simple code can work with LabVIEW program called "LIFA\_Base. ino" which usually packed in the LIFA package software. The codes are listed in **Figure 3** below:

#### **Figure 3.**

*The codes written in LIFA\_Base.Ino file.*

where, the syncLV() is a function defined in LabVIEWInterface.h which provides a handshaking procedure with LabVIEW NI-VISA port configuration. For Arduino hardware devices, the USB port assigned as serial communication is used. When the connection with LabVIEW program is synchronized, both loops of the LabVIEW program and the Arduino firmware are operated. The loop in the Arduino firmware always check the code sent from LabVIEW then run the correspondent procedures otherwise the code of "sampleContinously()" is operated. The sampling procedure of the LIFA firmware requires a sampling frequency parameter to control the sampling cycle. Therefore, for the LabVIEW program, the users can completely control the sampling time which is one of the significant parameters for embedded systems especially in discrete control and data acquisition.

**Figure 4** shows a typical acquisition LabVIEW program. The connection process initiated by the block called"Init". Throughout the initialization procedure, the parameters include baud rate, communication, Arduino board type, communication protocol, and data packet sized should be configured. When the connection is successful established, the analog signal is read via an analog input pin with

**107**

*LabVIEW and Open Embedded System DOI: http://dx.doi.org/10.5772/intechopen.98271*

*Diagram of a typical LabVIEW program using LIFA.*

**Figure 4.**

the block of "Analog Read", then, the converted numerical data collected through the block named as "Continuous Acquisition" located on the Arduino menu in the popup programming menu. The data acquisition procedure requests parameters such as "samples to read" and "sample rate" to collect data with a certain sampling cycle and a pack of samples. The collected data is used to display with a graph panel called "Waveform Graph" originated in LabVIEW software. The data acquisition is

Unlike the procedure using LINX, the data acquisition program using LIFA does not depend on the loop cycle in PC since the sampling frequency is configured to the Arduino board and with requirement of each issues, the sampling time can be adjusted appropriately. However, the users have to code the program for hardware device to adapt with the LabVIEW program. Beside the hardware coding skills, the compatibility of LIFA firmware with LabVIEW is also a problem. With each version of LabVIEW software, some LIFA package version has bugs errors of connection such as 5002 and 5003 but this errors does not occurred while use of another LIFA package version. Therefore, the user should test their program with some LIFA

One of the application categories in use of embedded system is digital signal processing. The embedded system with numerical processes is much convenient than the analog or hardware process even if the low response time in the numerical system. LabVIEW is one of the options for embedded system development. The integration of LabVIEW program with hardware devices such as Arduino is great deal to reduce the cost. In this section, there are two examples are introduced: ECG

ECG signal is a biomedical signal used to diagnose pathology related to cardiovascular disease. A simple ECG measurement system is designed with 3 leads placed on to human limbs to observe flutter wave and detect the complex waves include P, Q, R, S, T. To obtain the spatial signal of a heart, the electrodes should be placed on the chest with 6 leads assigned from v1 to v6. Here, with 4 electrode placed on all limbs, the 12 leads ECG measurement system is built. The 10 electrodes are used to

The low-cost hardware design for 12 leads ECG measurement based on Arduino

Uno was reported [15]. To obtain the signal for storage and analysis, the signal is numerical converted and transferred to PC with software. For convenience, LabVIEW programming software was chosen. Because of the low spectrum range of ECG signal (0 to 100 Hz), the required sampling frequency is also low as well. The amplitude of ECG signal is weak (millivolts level), to observe the signal the

monitor 12 signal of a cardiovascular system from the limbs to heart.

stopped by the block named as "Close" to release the PC memory.

package version to complete the embedded system.

signal processing and body sound signal processing.

**3. Examples in signal processing**

**Figure 4.**

than the value set in the firmware.

*Diagram of a typical acquisition LabVIEW program using LINX.*

**Figure 3** below:

**Figure 3.**

*The codes written in LIFA\_Base.Ino file.*

**Figure 2.**

to the computer system cycle, the sampling frequency in the case of LINX using is not stable. Moreover, the hardware sampling frequency is set as constant in LINX firmware, therefore the embedded system sampling frequency should be slower

The mostly simple code can work with LabVIEW program called "LIFA\_Base. ino" which usually packed in the LIFA package software. The codes are listed in

where, the syncLV() is a function defined in LabVIEWInterface.h which provides a handshaking procedure with LabVIEW NI-VISA port configuration. For Arduino hardware devices, the USB port assigned as serial communication is used. When the connection with LabVIEW program is synchronized, both loops of the LabVIEW program and the Arduino firmware are operated. The loop in the Arduino firmware always check the code sent from LabVIEW then run the correspondent procedures otherwise the code of "sampleContinously()" is operated. The sampling procedure of the LIFA firmware requires a sampling frequency parameter to control the sampling cycle. Therefore, for the LabVIEW program, the users can completely control the sampling time which is one of the significant parameters for

embedded systems especially in discrete control and data acquisition.

**Figure 4** shows a typical acquisition LabVIEW program. The connection process

initiated by the block called"Init". Throughout the initialization procedure, the parameters include baud rate, communication, Arduino board type, communication protocol, and data packet sized should be configured. When the connection is successful established, the analog signal is read via an analog input pin with

To use the LIFA, the applicants should compile a code through the IDE software.

**106**

*Diagram of a typical LabVIEW program using LIFA.*

the block of "Analog Read", then, the converted numerical data collected through the block named as "Continuous Acquisition" located on the Arduino menu in the popup programming menu. The data acquisition procedure requests parameters such as "samples to read" and "sample rate" to collect data with a certain sampling cycle and a pack of samples. The collected data is used to display with a graph panel called "Waveform Graph" originated in LabVIEW software. The data acquisition is stopped by the block named as "Close" to release the PC memory.

Unlike the procedure using LINX, the data acquisition program using LIFA does not depend on the loop cycle in PC since the sampling frequency is configured to the Arduino board and with requirement of each issues, the sampling time can be adjusted appropriately. However, the users have to code the program for hardware device to adapt with the LabVIEW program. Beside the hardware coding skills, the compatibility of LIFA firmware with LabVIEW is also a problem. With each version of LabVIEW software, some LIFA package version has bugs errors of connection such as 5002 and 5003 but this errors does not occurred while use of another LIFA package version. Therefore, the user should test their program with some LIFA package version to complete the embedded system.
