Switching Circuit Energy Balance in iLabs on Experimental Lab Server Architecture

Switching Circuit Energy Balance in iLabs on

Experimental Lab Server Architecture

by

Letitia Weixia Li

B.S.,Massachusetts Institute of Technology (2011)

Submitted to the Department of Electrical Engineering and Computer

Science in partial fulfillment of the requirements for the degree of

Master of Engineering in Electrical Engineering and Computer Science at the

MASSACHUSETTS INSTITUTE OF TECHNOLOGY

February 2015 c Massachusetts Institute of Technology 2015. All rights reserved.

Author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Department of Electrical Engineering and Computer Science

April 29, 2015

Certified by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Jesús A. del Alamo

Professor of Electrical Engineering

Thesis Supervisor

Accepted by . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Albert R. Meyer

Chairman, Masters of Engineering Thesis Committee

2

Switching Circuit Energy Balance in iLabs on Experimental Lab

Server Architecture

by

Letitia Weixia Li

Submitted to the Department of Electrical Engineering and Computer Science on April 29, 2015, in partial fulfillment of the requirements for the degree of

Master of Engineering in Electrical Engineering and Computer Science

Abstract

In Electrical Engineering courses, it is important that students have hands-on experience with a circuit and components to witness their behavior and compare it with theoretical models. The MIT iLab Project develops online laboratories that allow students to perform experiments through a web browser from anywhere in the world. One such lab used in the Introduction to Circuits class, the NMOS Resistor Amplifier Lab, allows students to analyze the switching waveforms of a transistor. This thesis describes the integration of a thermal camera to the NMOS-Resistor Amplifier Lab to educate students about energy dissipation. The first version of this lab, built entirely in LabVIEW, on iLabs’ existing

Shared Architecture could not support an interactive lightweight client. In response, the

Experimental Lab Server Architecture (ELSA) was developed as a new interface connecting an experiment, client, and Service Broker. In the first prototype of the Thermal Lab in

ELSA, a Java Applet Client uses REST calls to send commands and acquire data from the

LabVIEW experiment running on the server.

Thesis Supervisor: Jesús A. del Alamo

Title: Professor of Electrical Engineering

3

4

0.1

Acknowledgments

As my Masters of Engineering thesis comes to a conclusion, I think of everyone involved with the Center for Educational Computing Initiatives and iLabs, whose work provided the technologies and architectures upon which the Switching Circuit Energy Balance iLab is built. I would like to thank my academic and thesis advisor, Professor del Alamo, the creator of iLabs who began this entire project. Professor del Alamo has not only guided me through my undergraduate years at MIT, but also through the preliminaries of a research path, whever that may take me. I thank the staff of CECI, whose continued work on iLabs improve the educational experience of students in circuits classes, so they may see

Electrical Engineering as more than abstract formulas. I especially thank Kirky DeLong, for managing the systems and administrative side of CECI, and setting me up in iLabs, and

Phillip Bailey, the resident expert on iLabs, who taught me an introduction to LabVIEW, cameras, iLab Shared Architecture, and helped me through all my problems with them.

I would like to thank Luciano Mendes from the Pontifical Catholic University of Parana

(PUCPR), the developer of the new Experimental Lab Server Architecture around which this iLab is based. In his year here at CECI, he helped me extensively with the integration into his new architecture and introducing me to all the web service technologies. I also thank Joseph Church, the student who began the development of a energy balance lab, for providing the preliminary tools and equipment for this lab. I hope that this thesis will contribute to iLabs’ continuing development into hands-on online laboratories.

5

6

Contents

0.1

Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5

1 Introduction 17

1.1

iLab Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

1.2

iLab Shared Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18

1.3

ELVIS System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19

1.4

MOSFET-Resistor Logic Inverter Lab . . . . . . . . . . . . . . . . . . . . .

20

1.5

Educational Goals of Switching Circuit Energy Balance iLab . . . . . . . .

21

1.5.1

MOSFET characteristics . . . . . . . . . . . . . . . . . . . . . . . .

21

1.5.2

MOSFET Inverter Behavior . . . . . . . . . . . . . . . . . . . . . .

22

1.6

Thesis Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

2 Switching Circuit Energy Balance iLab in iLab Shared Architecture 23

2.1

Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

2.2

Vision Acquisition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

2.2.1

FLIR Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

2.2.2

Direct Streaming from Camera . . . . . . . . . . . . . . . . . . . .

26

2.2.3

IP Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

2.2.4

Integration of Camera through LabVIEW . . . . . . . . . . . . . .

30

2.3

Data Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

2.4

Waveform Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34

7

2.5

Data Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

2.6

Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

2.7

Issues from Demo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

2.8

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

3 ELSA Architecture 41

3.1

Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

41

3.2

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

42

3.3

Communication Across Web Services . . . . . . . . . . . . . . . . . . . . .

43

3.3.1

REST Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

44

3.3.2

Deployed Web Services . . . . . . . . . . . . . . . . . . . . . . . . .

44

3.3.3

Network Shared Variables . . . . . . . . . . . . . . . . . . . . . . .

45

3.3.4

Operations Manager . . . . . . . . . . . . . . . . . . . . . . . . . .

47

3.3.5

Experiment Control . . . . . . . . . . . . . . . . . . . . . . . . . . .

48

3.3.6

Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51

3.3.7

Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

52

3.4

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

58

4 Thermal Lab in Experimental Lab Server Architecture - Server Side 59

4.1

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

59

4.2

Experiment Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . .

60

4.3

Cluster Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

64

4.4

Remote Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

67

4.5

Remote Stop of Experiment . . . . . . . . . . . . . . . . . . . . . . . . . .

68

4.6

Parameter Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

69

4.7

Data Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

71

4.8

Image Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

72

4.9

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

73

8

5 Experimental Lab Server Architecture - Client Side 75

5.1

Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

75

5.2

Applet Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

77

5.3

Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

77

5.4

Data Acquisition and Display . . . . . . . . . . . . . . . . . . . . . . . . .

78

5.4.1

Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

78

5.4.2

Image Stream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

81

5.5

Communication Across Web Services . . . . . . . . . . . . . . . . . . . . .

82

5.5.1

Start and Stop of Lab . . . . . . . . . . . . . . . . . . . . . . . . .

82

5.5.2

Update Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . .

83

5.6

Data Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

84

5.7

Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

87

5.8

Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

88

5.9

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

89

6 Conclusions and Future Work 91

6.1

Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

92

6.1.1

Adaptation to Class Use . . . . . . . . . . . . . . . . . . . . . . . .

92

6.1.2

Improved Display . . . . . . . . . . . . . . . . . . . . . . . . . . . .

93

6.1.3

Thermal Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . .

94

A Client Source Code 95

B Lab Server Config File

C Experiment Config File

117

119

9

10

List of Figures

1-1 iLab Shared Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . .

19

1-2 ELVIS II Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

1-3 MOSFET-Resistor Logic Inverter iLab after run . . . . . . . . . . . . . . .

21

2-1 FLIR Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25

2-2 Measuring temperatures using FLIR Tools . . . . . . . . . . . . . . . . . .

26

2-3 FLIR Camera configuration through GEV Player . . . . . . . . . . . . . .

28

2-4 Configuration of Camera through NI MAX . . . . . . . . . . . . . . . . . .

29

2-5 Configuration of Acquisition Settings through NI Vision Acquisition Express 31

2-6 Configuration of Accessible Controls and Indicators . . . . . . . . . . . . .

32

2-7 Fuzzy Image due to Calibration . . . . . . . . . . . . . . . . . . . . . . . .

32

2-8 Temperature Measurement within LabVIEW . . . . . . . . . . . . . . . . .

33

2-9 Voltage Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34

2-10 Function Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

2-11 Introduction Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

2-12 Documentation Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

37

2-13 Active Lab Panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

3-1 ELSA Components and Communication Methods . . . . . . . . . . . . . .

43

3-2 National Instruments Web Services Management . . . . . . . . . . . . . . .

44

3-3 IWLcontrols VI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

45

11

3-4 IWdata VI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

47

3-5 Operations Manager State Diagram . . . . . . . . . . . . . . . . . . . . . .

48

3-6 Operations Manager Launch of Experiment . . . . . . . . . . . . . . . . . .

50

3-7 Conversion of String to IW Data Cluster Variable . . . . . . . . . . . . . .

51

3-8 Operations Manager Traffic Tab . . . . . . . . . . . . . . . . . . . . . . . .

53

3-9 Operations Manager Session Tab . . . . . . . . . . . . . . . . . . . . . . .

54

3-10 Operations Manager Experiment Tab . . . . . . . . . . . . . . . . . . . . .

55

3-11 Operations Manager Log Tab . . . . . . . . . . . . . . . . . . . . . . . . .

56

3-12 Operations Manager OpM Tab . . . . . . . . . . . . . . . . . . . . . . . .

57

4-1 Operations Manager read of configuration files . . . . . . . . . . . . . . . .

60

4-2 Setup Tool –Current Setup Tab . . . . . . . . . . . . . . . . . . . . . . . .

61

4-3 Setup Tool –Lab Server Tab . . . . . . . . . . . . . . . . . . . . . . . . . .

62

4-4 Setup Tool –Process Agent Tab . . . . . . . . . . . . . . . . . . . . . . . .

63

4-5 Setup Tool –Experiment Tab . . . . . . . . . . . . . . . . . . . . . . . . . .

65

4-6 Control and Output Cluster Type Definition . . . . . . . . . . . . . . . . .

66

4-7 Asynchronous Call within Operations Manager . . . . . . . . . . . . . . . .

67

4-8 Asynchronous Launch within Experiment . . . . . . . . . . . . . . . . . . .

68

4-9 Close Experiment upon Stop Command . . . . . . . . . . . . . . . . . . . .

69

4-10 Remote Function Generator . . . . . . . . . . . . . . . . . . . . . . . . . .

70

4-11 Remote Temperature Measurement . . . . . . . . . . . . . . . . . . . . . .

71

4-12 Output Data from Experiment . . . . . . . . . . . . . . . . . . . . . . . . .

72

4-13 Streaming within Experiment . . . . . . . . . . . . . . . . . . . . . . . . .

72

5-1 Java Applet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

76

5-2 Original Batched Lab Graph . . . . . . . . . . . . . . . . . . . . . . . . . .

80

5-3 Teal Package Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

80

5-4 File Prompt for Recording Data . . . . . . . . . . . . . . . . . . . . . . . .

85

12

5-5 Output Data File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

86

5-6 Documentation Window . . . . . . . . . . . . . . . . . . . . . . . . . . . .

87

13

14

List of Tables

3.1

IWL RESTful Web Services . . . . . . . . . . . . . . . . . . . . . . . . . .

46

3.2

Network Shared Variables between Operations Manager and Web Services 48

3.3

Operations Manager States . . . . . . . . . . . . . . . . . . . . . . . . . . .

49

4.1

Experiment Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

64

5.1

Payload data transfer rates for 600s (normalized) test time. . . . . . . . . .

88

15

16

Chapter 1

Introduction

A mission of MIT in recent years is to expand online global learning through Open Course

Ware and edX. While lecture slides and homework alone may be adequate for theoretical classes such as biology or mathematics, the theory alone is not adequate preparation for engineering and science students taking Electrical Engineering courses. It is essential that students perform experiments in which they see the phenomena that are predicted by models, so that the equations they may memorize become more real to them. However, with larger introductory classes, universities may lack the resources and time to prepare lab stations for all the students. There are also difficulties in having course staff on hand to train students in usage of lab equipment and prevent breakages, as well as scheduling lab availability based around student and staff availability. [1]

1.1

iLab Project

The MIT iLab Project, started by Professor del Alamo, was developed in 1998 was launched to facilitate hands-on electronics laboratory experience. An iLab includes an online graphical interface capable of controlling a physical circuit remotely through a conventional web browser. Instead of requiring a lab station for each student, only one circuit needs to be

17

set up. The Center for Educational Computing Initiatives explores the development of new iLabs, maintains the circuits and server for accessing labs, and coordinates with professors from many universities to make iLabs available to students. Educators can develop their own device characterization labs and students are able to access these labs over the internet, choose various parameters, and record and store measurements all from their own room. [9, 10] Many MIT classes such as 6.002 Circuits and Electronics and 6.012 Microelectronic Devices and Circuits use iLabs for labs such as device and circuit characterization.

Students may generate the voltage-current graphs of a 2N7000 transistor and then download the measurements to extract device parameters such as threshold voltage, lambda,

VDSAT, etc. Based on the unified MOSFET model learned in class, students may then compare the actual measurements to the predicted ones. [3, 6]

1.2

iLab Shared Architecture

In 2002, after the development of the first-generation labs, the iLabs Project began to move towards a more modular, shared architecture. For efficiency, as much code as possible should be reusable across labs. If there is one central framework for authenticating users, it is unnecessary to redevelop an authentication protocol each time. In addition, developers of labs should not be required to keep track of which users are allowed to access a lab.

Remote cCourse instructors are able to add students to a class group, and iLabs managers can manage which groups are allowed access to which labs. [3, 10] The resulting iLabs

Shared Architecture divides a lab into modules: Client, Service Broker, and Lab Server as shown in Figure 1.1. The Lab Client is the student’s graphical interface with the lab, the Service Broker facilitates communication between the Client and Server, and the Lab

Server runs the lab with the parameters set. The Service Broker is reused across all labs with minimal configuration. Labs can be either scheduled or "batched", where multiple students can have the lab interface open at the same time, and queue their lab setups to

18

be run on lab hardware one at a time. [10]

Figure 1-1: iLab Shared Architecture

1.3

ELVIS System

Circuit-based labs require an interface to process and control signals from a circuit. The

National Instruments Educational Laboratory Virtual Instrumentation Suite (ELVIS) is a platform providing access to instruments including a function generator and oscilloscope on a prototyping board. The ELVIS board contains variable power supplies, as well as

+15, +5, and -5 V power supplies. The complete board is shown in Figure 1.2. [16] The prototyping board connects to a PC using USB, and can be accessed using LabVIEW software. LabVIEW is a graphical programming language which involves a Front Panel which displays controls and indicators for a user, and a back-end "Block Diagram" which the programmer fills with logic controlling any devices and displays. Using LabVIEW, one is capable of designing programs controlling and measuring a signal by accessing channels

"Analog Input" and controlling "Analog Output" within a VI. [16]

19

Figure 1-2: ELVIS II Board

1.4

MOSFET-Resistor Logic Inverter Lab

The MOSFET-Resistor Logic Inverter Lab used in the introductory Circuits and Electronics class teaches students about MOSFET characteristics. The lab is set up as shown in Figure

1.3, controlled by an input voltage waveform as labeled by FGEN and measuring output at the drain of the transistor as labeled by SCOPE. For the Function Generator, students set the offset and amplitude of a pulse train . For the oscilloscope, students set the sampling rate and the duration of the run. The Lab Server then runs the experiment, and then the client plots the returned data as shown in Figure 1.3. [9, 16]

20

Figure 1-3: MOSFET-Resistor Logic Inverter iLab after run

1.5

Educational Goals of Switching Circuit Energy Balance iLab

1.5.1

MOSFET characteristics

Students in 6.002 have learned about the operating regions of a transistor: cutoff, triode, and saturation. If the transistor is in cutoff, then no current flows across the transistor and the output voltage of the circuit illustrated in Figure 1.3 will be a constant 2.5V since no voltage drops across the resistor. The students first should determine the threshold voltage by sweeping the offset until the output voltage drops. [2] Based on the voltage drop across

21

the resistor, students may calculate the drain to source current of the transistor. Students may then use the measurements 𝑉

𝐺𝑆

, 𝑉

𝐷𝑆

, and 𝐼

𝐷 to plot the 𝑉

𝐷𝑆 vs 𝐼

𝐷 curves, and note how closely they match the model equations. [2]

1.5.2

MOSFET Inverter Behavior

With a square-wave input of the right characteristics, the voltage at the gate of the MOS-

FET oscillates turning the MOSFET on and off during a single period. The output voltage waveform follows the input waveform, except inverted. When input voltage is below threshold, the MOSFET is off. Since there is no drain current, no voltage drop takes place across the resistor, and the capacitor is charged to the supply voltage. [2] When input voltage increases above threshold voltage, current flows, and output voltage drops to ground. The energy stored in capacitor when output voltage was high must be dissipated through the resistor. As seen in Figure 1.3, the output voltage waveform is the exponential waveform of a RC circuit. [2]

1.6

Thesis Organization

We would like to visualize the energy dissipation in the lab and correlate it with the voltage waveforms measured. In this thesis, we adapt the existing MOSFET-Resistor Logic

Inverter iLab to additionally teach students heat dissipation through integration of a thermal camera. Chapter 2 describes the development of the lab in LabVIEW in iLab Shared

Architecture to integrate the thermal camera. Chapter 3 describes a new experimental architecture: Experimental Lab Server Architecture (ELSA). Chapter 4 describes the adaptation of the Switching Circuit Energy Balance iLab into the new ELSA system on the server side. Chapter 5 describes Chapter 6 describes the conclusions of the Switching Circuit Energy Balance iLab along with future work for the continued development of the lab for class use.

22

Chapter 2

Switching Circuit Energy Balance iLab in iLab Shared Architecture

This chapter describes the preliminary lab built in MIT ISA and its components: Image

Acquisition, Function Generator, Oscilloscope, and built-in Documentation. We describe our evaluation of the software used to stream from the thermal camera, and then the

LabVIEW tools used to build up the rest of the lab.

2.1

Learning Objectives

The Switching Circuit Energy Balance iLab aims to teach students about the function and heat dissipation of a switching electronic circuit, such as an MOSFET-Resistor Logic

Inverter. The circuit remains the same as that of the original lab, but we have changed the lab from batched to interactive and added a thermal camera. In changing the lab to interactive, a student is given a certain time period in which they have control of the client.

They can freely adjust function generator parameters, as well as which spot in the image of which they would like to measure the temperature, and then they run the experiment. [6]

By examining the thermal image of the circuit while the transistor is on, students should

23

notice that the transistor and capacitor remain relatively cool while the resistor heats up, helping them visualize the concept that most power dissipation occurs at the resistor. A transistor cannot sustain much heat dissipation before burning out, and the only significant voltage drop occurs across the resistor. [6] Students may also calculate power dissipation, and thermal time constants. If a student continually measures the temperature, he/she can see that the rise and drop of the temperature waveform is approximately exponentially rising on a rising input and exponentially decaying on a falling input. By setting the gate voltage to 0, students effectively turn off the transistor. By reducing voltage drop across the resistor and allowing it to cool, students may then calculate the thermal time constant. [6]

2.2

Vision Acquisition

To determine the energy dissipation in the circuit, the experiment requires the live stream from a thermal image and the ability for users to choose the location whose temperature is measured. This section describes our evaluation of the available software for integration with the MOSFET-Resistor Logic Inverter iLab.

2.2.1

FLIR Tools

A previous Undergraduate Researcher began development of this lab and ordered a FLIR

A35 camera, as shown in Figure 2.1. The camera has resolution 320 x 256, 50 mK temperature sensitivity, 60 frames per second, and is GigE Vision compatible. The manufacturerdeveloped software, FLIR tools, displays a full color image and supports temperature measurement and recording. Figure 2.2 shows FLIR Tools, with the available cameras and recording menu on the left sidebar, image and tools in the center, and camera parameters, such as emissivity, on the right toolbar. After locations in the image have been set using the "Set Measurement Spot" tool, the corresponding temperatures are displayed on the top right. [8] To access the live stream captured outside of FLIR Tools proved to be a challenge

24

Figure 2-1: FLIR Camera as the software did not support web streaming or anything similar. It was possible to save the entire video capture to file with the Camera Capture tool, but with no corresponding temperature measurements. We considered continuously recording the FLIR Sequence

".seq" file, and extracting the last frame to display. However, the increasing size of the file would be undesirable, and FLIR Tools estimates that it can only record 9 hours before running out of memory. [8] In addition, the extra programming required to extract and display the image from a video file may be more of a delay than we would desire. Even if we turned this lab into a batched experiment, while we would not be concerned about the time to process the video, FLIR Tools does not provide an interface where we can programmatically start and stop capture. The lack of control over the image stream in

25

Figure 2-2: Measuring temperatures using FLIR Tools

FLIR Tools suggested to us that we should consider other options.

2.2.2

Direct Streaming from Camera

With no options to export the image stream from FLIR Tools, we next attempted to use the webcam as an IP camera and stream to a web page. However, the suggestion to embed the stream in a java client with the following code did not work. [5]

<img s r c ="h t t p :// < IP Address >" o n l o a d =’ s e t T i m e o u t ( f u n c t i o n ( ) { s r c = s r c . s u b s t r i n g ( 0 , ( s r c . l a s t I n d e x O f ( " t =")+2) ) +(new

Date ( ) ) . getTime ( ) } , 1 0 0 0 ) ’ o n e r r o r =’ s e t T i m e o u t ( f u n c t i o n ( ) { s r c = s r c . s u b s t r i n g ( 0 ,

( s r c . l a s t I n d e x O f ( " t =")+2) ) +(new Date ( ) ) . getTime ( ) } , 5 0 0 0 )

’ a l t =’’/>

26

Another option we explored was to use a webcam to stream the FLIR Tools window.

While the resulting image stream would be high quality, to have a webcam intermediary is undesirable for multiple reasons. The temperatures of points set to be measured would be displayed, but there would be no way for the user to measure the temperature of any other points. To limit students from being able to measure any location in the circuit creates a far more constrained system, not allowing them to explore and take charge of their own learning. In addition, to stream using a webcam appears more like a temporary hack, and leaves us with more room for error than streaming directly from the camera. In investigating

FLIR customer support forums, we found directions to access the camera stream in VLC player, which is capable of creating a stream accessible anywhere on the web. However, with the camera connected and accessible through FLIR, VLC player did not connect to the camera stream. We contacted FLIR support only to receive a reply that the procedure described used rstp streaming, which our model of the camera did not support. [17] After many more exchanges with FLIR customer support, we did discover from their help forum that while Ax5 Camera possesses an IP address, it cannot be operated as an IP camera.

They suggested that it may be possible to develop web streaming using the Pleora eBus

Software Development Kit available, but due to time constraints, uncertainty in its success, and lack of documentation, we did not pursue this option. [17]

2.2.3

IP Address

To use the FLIR camera as an IP camera, it was necessary to set a static IP address for it. After many attempts, however, we find that this setup did not allow us to stream from the camera anymore. The camera is not detected unless the first three numbers in its IP

Address match those of its adapter/NIC, which by default is not true as shown in Figure

2.3. Instead, the IP address of the camera must be changed using GEV Player, a software compatible with all GigE Vision cameras. If in the future it becomes certain that the static

IP address of the camera is not needed, it may be preferable to set its default IP Address

27

Figure 2-3: FLIR Camera configuration through GEV Player to match that of its adapter. [15, 20] An error message "NI-IMAQdx: (Hex 0xBFF6901D)

Unable to load the camera’s XML file" often appeared during set up of the camera. This error has disappeared after another attempt at connection without downloading another

XML file, which contradicts the error message. According to National Instruments forums, this error occurs when the camera detects any error during start up. Therefore, it is likely that there is not actually a problem with the camera’s XML file. [21] As directed by the documentation for troubleshooting GigE Vision cameras, it is necessary to configure the network adapter to accept jumbo packets. As described in National Instrument’s tutorial on using GigEVision Cameras, we increased the packet size for Jumbo Frames. Originally, we attempted to connect the camera directly into a wall Ethernet port, for access anywhere in the network. However, while we may detect the camera, this arrangement results in an error

28

"Error 0xBFF69031: The system did not receive a test packet from the camera. The packet size may be too large for the network configuration or a firewall may be enabled." Instead, we must use a network cable to connect the camera to a power supply, and use another network cable to connecting directly to the computer from which we stream. [15, 20] Once

Figure 2-4: Configuration of Camera through NI MAX the IP address is set, we can check if the camera is accessible through NI MAX (National

Instruments Measurement and Automation Explorer), as shown in Figure 2.4. NI MAX allows us to configure the camera parameters, such as calibration method, packet size, etc.

We may then preview the camera stream to verify the connection was successful before attempting to set up Vision Acquisition in LabVIEW. [20]

29

2.2.4

Integration of Camera through LabVIEW

FLIR does sell a LabVIEW SDK, but the difficulty in acquiring either a quote or demonstration version encouraged us to use the tools already available in LabVIEW. The LabVIEW

Vision Acquisition system allows users to view the image stream within a LabVIEW front panel. Within a LabVIEW VI, we create access to the camera stream with the "Vision

Acquisition Express" tool. The output of this tool is an IMAQ Image, which can now be displayed on the front panel or processed. [7] To initialize the Vision Acquisition Express tool to acquire images based on our specifications, first we select an available camera. In the next tab, we select the Acquisition Type. Since we want to acquire multiple images continuously, acquisition type is set to the "Continuous Acquisition with inline Processing" option. It does not matter if a single image is missing, as the thermal changes are not especially fast, so it is necessary to only acquire the most recent image. The tab "Configure Acquisition Settings" controls parameters of the image stream as shown in Figure

2.5. [13] Image Logging is disabled since it is unnecessary and memory intensive. In the final tab, the accessible controls and indicators are set as shown in Figure 2.6. The image acquired from the thermal camera is originally in grayscale, with range from 0 to 255. For better display, LabVIEW allows use of different color palettes. The palette "Rainbow" best matches the feed expected from a thermal camera, with blue corresponding to cold regions and red corresponding to hot regions. Figure 2.7 shows the image with the color palette applied. [13] Initially, LabVIEW auto-focused and calibrated the images, resulting in a temporarily fuzzy image as shown in Figure 2.7. It has been determined that using any auto-focus preference would result in a few minutes before the camera could calibrate.

In addition, if the camera is allowed to automatically adjust its brightness and contrast, as the resistor heats up, the camera parameters will change as well, and while we can visualize the contrast in color relative to the rest of the circuit, it becomes impossible for us to quantify the temperature itself. The calibration mode was changed from "Plateau

30

Figure 2-5: Configuration of Acquisition Settings through NI Vision Acquisition Express

Histogram" to "Manual". [13] Contrast and Brightness were chosen for the best display in the front panel. The image must contain visual contrast, and display the full range of the colors. It is preferable that users are able to see the circuit board grid and components, but it is essential that the heated resistor’s value does not exceed the maximum grayscale range of 255 at its maximum temperature, or else there is no technique to accurately measure temperatures from the image.

31

Figure 2-6: Configuration of Accessible Controls and Indicators

Figure 2-7: Fuzzy Image due to Calibration

2.3

Data Display

The "NI Vision Development Module IMAQ Light Meter (Point) tool measures the average

32 grayscale value of a 3x3 block of pixels centered at the indicated point. The points mea-

sured are outlined with a black square. These grayscale values were then converted into temperature values by finding the formula to convert between the two. As it is not possible to simultaneously connect the camera to FLIR Tools and LabVIEW, it was necessary to choose an object with high specific heat, in order the location to have the same temperature in both measurements despite the time to transition between programs. [13] We then measured the grayscale values and temperature of a large cup of water colder than ambient temperature and of one hotter than the maximum temperature of the heated resistor.

Since the temperature and grayscale values are linear, we used a linear fit to calculate the formula as:

𝑇 π‘’π‘šπ‘π‘’π‘Ÿπ‘Žπ‘‘π‘’π‘Ÿπ‘’ ( π‘‘π‘’π‘”π‘Ÿπ‘’π‘’π‘ πΆπ‘’π‘™π‘π‘–π‘’π‘  ) = πΊπ‘Ÿπ‘Žπ‘¦π‘†π‘π‘Žπ‘™π‘’π‘‰ π‘Žπ‘™π‘’π‘’ * 0 .

16 + 20

The measurement and conversion in LabVIEW are shown in Figure 2.8. Converted temperature measurements of the circuit board and its components in LabVIEW were identical to the temperature measured by FLIR Tools, confirming the formula above. Voltages in the

Figure 2-8: Temperature Measurement within LabVIEW

33

circuit are connected to the ELVIS board Analog Inputs and measured using the DAQmx tool as shown in Figure 2.9. We configure the sample rate, input sources, and minimum and maximum voltage. All the signals are then displayed using the Waveform Chart graph.

The graph displays both Voltage and Temperature using two y-Axes, and each plot is set to correspond to its matching axis. To have data continuously scroll instead of cut off or loop back around, update mode is "Strip Chart". A Legend informs users which plot corresponds to which measurement. [13]

Figure 2-9: Voltage Measurement

2.4

Waveform Generation

The MOSFET-Resistor Logic Inverter iLab is designed with a voltage ranging from -2.5 to

2.5 V. Since we only have a +5 volt supply, we generate a virtual ground at 2.5 V with a resistor divider. Within the lab, we refer to voltages relative to the virtual ground instead of actual earth ground. All of our measurements and inputs from the ELVIS board are relative to earth ground, so we must convert them by subtracting 2.5 from each measurement and the offset parameter. [18] The output waveform is controlled by the NI ELVISmx Function

Generator tool, with its parameters configured as shown in Figure 2.10.

34

Figure 2-10: Function Generator

2.5

Data Storage

To analyze the data and calculate the various time constants, students must be able to download their data into Excel or Matlab. Upon starting the lab, students are presented with a file dialog box to select which file the data will be saved to. When a student has clicked the Record Data button, the waveforms from the graph are turned into a string of "<Input Voltage>, <Output Voltage>, <Temperature>" written to a data socket or file selected. Students can choose to collect data for analysis once the system is stable.

To limit the size of the data file and to collect only useful data, a user must click the

"Record" button to start. The resulting data file is of file format .lvm, with three columns, time in milliseconds, Temperature in degrees Celsius, Output Voltage in Volts. [4, 13] The sampling rate of the analog inputs and of the light meter is not equal, with approximately

10 samples from the image per sample from the oscilloscope. Our preliminary data files

35

appeared with missing temperature measurements 9 out of every 10 lines. For a student to use the shown temperature data would require manual work to either only extract temperature measurements, or copy previous values into the blank cells. To handle this mismatch, Philip Bailey added a loop to copy each temperature measurement a number of times depending on the difference between sampling rate. [13]

2.6

Documentation

Beyond the original LabVIEW client described in the previous sections, we expanded it to be a standalone client including user instruction. It is necessary for the student to understand how the circuit is arranged, especially the location of the input and output in the circuit on the gate and drain of the transistor respectively. On the first panel in

Figure 2.11, we show the circuit diagram and a brief description. On the second tab, we

Figure 2-11: Introduction Panel

36

provide more detailed instructions regarding use of the lab as shown in Figure 2.12. Based on a screenshot of the third panel containing all the active lab components, we explain the function and how to use them. Students taking 6.002 may have never seen any real circuit parts, so it is important for us to show the sample full-color image labeling every component. The thermal image especially does not show the elements’ colors as expected, so even the resistor may be indistinguishable from any rectangular object. [6] The third tab

Figure 2-12: Documentation Panel contains the active lab components as shown in Figure 2.13. On the left is the colorized image from the IR camera. The two scrollbars along the bottom and left side allow us to choose the square that we will find the temperature of. On the right, on top we have the graph and legend of the 3 signals, Input, Output, and Temperature. We have two axes for the Voltage waveforms on one scale and Temperature on the other. On the bottom, we have the controls determining the shape of the Input Voltage: Amplitude, Frequency, DC

Offset, Type (Sine, Triangle, and Square), and Duty Cycle.

37

Figure 2-13: Active Lab Panel

2.7

Issues from Demo

In January, we demoed the complete lab to visitors from Berkeley. As the demo took place outside of our lab, it was infeasible to move the thermal camera, ELVIS board, and computer to the demonstration room. The visitors from Berkeley were able to understand the lab as presented and responded positively. However, when they asked how they could access the lab later, we were unsure that they could access the Remote Panel themselves outside the MIT network. In addition, LabVIEW is not a free software and relatively uncommon. Unless the visitors wished to purchase LabVIEW, they would not be able to operate the Remote Panel. [12, 14]

2.8

Conclusion

In an improvement from the Batched MOSFET-Resistor Logic Inverter iLab, the Switching

Circuit Energy Balance iLab eliminated the need for a student to set parameters and then wait for results. A student is able to try multiple sets of input waveforms quickly, and

38

receives instantaneous results. To show a student the live image stream from the thermal camera not only teaches them about power dissipation, but also shows the students that they interact with a real circuit. To publish this lab for student use however, it became necessary to address the issue of putting a LabVIEW VI online via the Remote Panel.

39

40

Chapter 3

ELSA Architecture

This chapter explores a new ELSA (Experimental Lab Server Architecture) system for the

Thermal lab. Visiting scholar Luciano Mendes developed ELSA as a new experimental architecture which can be used as an alternative to iLabs Shared Architecture. ELSA serves as an interface between the lab server hosting a lab and the client. It consists of four major components: the Operations Manager, Web Services, Remote Client, and Local

Experiment.

3.1

Motivation

The iLabs Shared Architecture has been used successfully for experiments since 2002. However, during our first demo, it became apparent to us of deficiencies of the current architecture for interactive labs. It is most convenient to build a lab in LabVIEW, which provides convenient methods to interface with the IR camera and ELVIS board. However, it is not feasible to ask users to access a LabView client, as most students will not have LabVIEW installed. Furthermore, the size of the Remote Front Panel to host on a web server may be a concern. [12] In its final form, the Thermal lab would be placed online, accessed by potentially hundreds of students. Since only one student can control the lab at a time without

41

conflicts, we would add scheduling as in the AM Modulation lab. However, as stated by

National Instruments in the license, there is still a limited number of clients available at any given time. It would be problematic if a student stayed connected past his/her scheduled session, and no other students could then access the lab. [12, 14] The previous version of this lab avoided the Remote Front Panel by using a client-side Java Applet to send requests to the Service Broker, which then called a DLL interface to compiled LabVIEW VIs. We initially considered building upon this approach, but the compiled VIs were built using a previous version of LabVIEW and were full of errors when opened. In addition, it is more efficient to build all the functionality of the lab in one VI, instead of scattering them about in multiple VIs, each corresponding to a call from the Service Broker. It was unknown how to have the Service Broker communicate to grab image information. While it could be possible to convert this lab to batched, it would involve sending not only the measurements, but also enough information to display multiple images across to the client, which we were unsure would be possible. [10] It is for these reasons that we sought to develop an architecture that can support an interactive lab with a lightweight client on the user-side.

3.2

Overview

Created by Luciano Mendes, the ELSA (Experiment Lab Server Architecture) system is an interface between the lab server hosting a lab and the client. ELSA-based experiments allow us to avoid the issues of Remote Panels while still allowing us full access to the tools of

LabVIEW. A lightweight client, such as a Java Applet, runs remotely to provide a graphical interface for the user to control the lab. The client relies on RESTful web services to send requests and acquire data from LabVIEW. The client’s RESTGet and RESTPost calls are handled by deployed LabVIEW VIs serving as web services. The web services parse the string request, and either send a string back or send an update to the Operations Manager through Network Shared Variables. [19] The Operations Manager, another LabVIEW VI,

42

serves as an intermediary between the experiment and client, communicating through global variables with the experiment and through web services with the client. The VI runs continually, logging requests, and passing relevant information into the Experiment VI through global variables. The experiment LabVIEW VI runs locally on a host machine, running the experiment using the ELVIS board, Thermal Camera, and any other connected hardware. [19]

Figure 3-1: ELSA Components and Communication Methods

3.3

Communication Across Web Services

For general use, the Lab Server and Client will be located on different computers. Communication must take place across the network. This section describes the major methods of communication across the components: REST Calls, Web Services, and Shared Variables.

43

Figure 3.1 shows all the elements of ELSA, and the method of communication between components.

3.3.1

REST Calls

Java Applets and other lightweight clients communicate with LabVIEW using REST (Representational state transfer) GET and POST calls. Calls consist of a string in the form: http://<IP Address>:<Port>/IWL/<WebServiceName>/<Message>. All deployed web services and their types can be seen on the NI Web Services Management page as shown in Figure 3.2. [19]

Figure 3-2: National Instruments Web Services Management

3.3.2

Deployed Web Services

Web services are implemented using LabVIEW VIs. The deployed LabVIEW VIs parse a string message from a REST call and either return a string to the client, or update parameters within LabVIEW. If the VI must update parameters, it will change the value of a Network Shared Variable. For example, the block diagram for IWLcontrols.vi in Figure

44

3.3 sends new controls into LabVIEW. First the VI extracts the token=<token >substring, and if the token string matches the shared variable "Token", then the remaining string is set as the variable "IW_controls". The VI also returns a string, either "ok" if the token matches, or "unauthorized" if incorrect. [19] Web Services are capable of only sending

Figure 3-3: IWLcontrols VI strings in response to REST calls. Output data from web services must be formatted into a comma separated string. Figure 3.4 shows the block diagram for IWLdata.vi, which returns a string if the token matches. [19] Table 3.1 shows the list of all IWL RESTful Web services, the format of their string arguments and responses, and functions.

3.3.3

Network Shared Variables

Web Services must be able to pass information to the host computer running the Operations

Manager and experiment. Network Shared Variables allow communication between different LabVIEW VIs. The Web Service VIs pass data to the Operations Manager through

45

Method

IWLstatus

IWLdata

IWLopMngr Msgs

Argument (String) Response

(String) token=<token> "Experiment started",

"Experiment token=<token> token=<token> stopped",

"unauthorized" or

Commaseparated string of data values or

"unauthorized"

Last message re-

IWLcontrols

IWLmgt

IWLauthToken

IWLstreaming userControls= <parameter>= Value>!

<command>, ken=<token> couponId=

<couponId> issuerGuid= tosuerGuid> passkey=<passkey>

& token=<token>

&

<isgarding experiment execution event or "unauthorized"

"ok" or "unauthorized"

"ok" or "unauthorized"

"authenticated" or "token failed"

Commaseparated string of image pixel values

Function

Informs if the experiment TopVI is running or not

Returns most recent data.

Returns "" or

(OpMngrMsg)SV and clears it.

Updates variable

IW_controls

Updates variable

IW_management

Updates variable

Token

Updates variable

IW_stream

Table 3.1: IWL RESTful Web Services

46

Figure 3-4: IWdata VI the string variables IW_controls, IW_data, IW_management, IW_status, IW_stream, and Token described in Table 3.2. [19]

3.3.4

Operations Manager

The central component of ELSA, the Operations Manager, provides communication between the Experiment VI and the Client. From commands sent through web services via

Network Shared Variables, the Operations Manager reads the variable’s value, and performs the requested action through a command to the Experiment VI. The Operations Manager operates as a State Machine. The list of states and their transition conditions are shown in Table 3.3. Figure 3.5 shows the state diagram. [19]

47

Variable

IW_controls

IW_data

Function

Sends new values for experiment variables

Sends newest data values

Format Associated

Web Service

String of pairs

<argument> =

<value>!

String of comma

IWLcontrols

IWLdata separated data values

"start" or "stop" IWLmgt IW_management Signals to start or stop lab

IW_status

IW_stream

Token

Stores current experiment status

Sends newest image data

Current

Passkey

Session

"experiment running"

"experiment or stopped"

String of comma separated pixel values

String

IWLstatus

IWLstream

All

Table 3.2: Network Shared Variables between Operations Manager and Web Services

Figure 3-5: Operations Manager State Diagram

3.3.5

Experiment Control

Messages sent to the Operations Manager passed on by Web Services from the Client are

Management Commands, Control Commands, or ISB requesting commands. Management

Commands include starting and stopping the experiment, changing the state of the Op-

48

State

WaitingCmd

Details

Neutral state: Waiting for authentication attempt

Transition conditions

On a successful authentication by a Client, switches to NewRedeemedTicket state; On command to exit, switches to StopOpManager

Switches to CheckRemainingTime (unconditionally)

NewRedeemedTicket

CheckRemainingTime Checks for experiment finish time; Updates Experiment Initial, Current and

Finish Times (UTC) and a

% Progress Bar

AddRecordToESS

Takes no relevant actions

(available for future code expansion)

Makes a service call to ESS and sends current experiment data

If experiment time is over, switches

ToESS; to AddRecord-

If experiment time is over, switches to EndOfSession;

If not, returns to CheckRemainingTime

Returns to CheckRemainingTime (unconditionally)

NewExpDataLogFile Signals to start new experiment data log file by setting

(StartNewFile?)GV to True

EndfOfSession Set a new random value to

Token

ClientCloseExperiment Makes a service call to ESS and orders the experiment to close

Switches to ClientCloseExperiment (unconditionally)

Goes back to WaitingCmd state

Table 3.3: Operations Manager States

49

erations Manager, and authenticating the client token. Control Commands update the input variables to the experiment. ISB requesting commands are authorization requests to the Service Broker. [19] To start a lab, the Operations Manager checks the state of the experiment within variable "IW Status". If the experiment is not running, the Operations

Manager starts an asynchronous call to launch the Experiment VI as shown in Figure 3.6.

The variable "STOP Experiment" is set to False to indicate to the experiment that it is not stopped. To stop the lab, if the experiment is running, the Operations Manager simply sets the "Stop Experiment" variable to True, which the Experiment VI uses as a signal to stop running. [19] The Operations Manager must also pass user commands to modify parameters

Figure 3-6: Operations Manager Launch of Experiment in a running experiment. The Network Shared Variable "IW data" is a string containing many pairs of "<argument>=<Value>!" pairs. The experiment VI reads controls from a

Cluster data type, so the string must be converted. The VI "GeneralCommandsParser" separates out the values, converts each string to the correct data type, and creates a cluster of the corresponding values as shown in Figure 3.7. [19] To send data to the client, the

Operations Manager constantly reads from global variable ExperimentOutputs at a rate of

1 kHz. ExperimentOutputs is a cluster of various data types depending on the experiment.

If the experiment is running, the Operations Manager converts a Cluster into a string using

50

Figure 3-7: Conversion of String to IW Data Cluster Variable the "Flatten to xml" tool. If it is not, it sends a cluster of 0s or empty strings. Image

Streaming is separate from waveform data in order to keep image streaming from slowing down data acquisition on the client side. To send even a small 320 x 256 image requires a string of over 81 thousand grayscale values. Image streaming involves much more data and will be much slower, so we process it on a separate thread. The variable IWL_stream is a string of comma separated values that the experiment writes, bypassing the Operations

Manager completely since copying a long string from one variable to another will be slow, and there is no extra processing required. [19]

3.3.6

Security

ELSA relies on the ISA Service Broker for authentication. While malicious attacks are unlikely, we wish for only one authorized user to send commands through the Operations

Manager at a time. However, ISA is SOAP-based, while LabView only uses RESTful services. To function as a Lab Server, the RESTful service calls from the Operations

Manager must be converted into SOAP calls. Luciano Mendes designed a web services project SOAPCallsRESTful that will translate between the two types. For local testing, the Operations Manager generates a token string that a user manually pastes into the

"token" field in the Client. The Java Applet Client then sends every REST call including

51

the acquired token. For each request, clients must send their REST calls ending with the substring "token=<token>" in order for the web service VIs to process the request. For production use, the user does not have access to the Operations Manager and the client automatically grabs the token string without user assistance. First, the Client is sent a coupon id and coupon passkey from the Service Broker. The Client application then submits the coupon information to the Operations Manager, and the Operations Manager redeems an ISA Ticket on the Service Broker. The Operations Manager creates a unique string "Token", stored in a Network Shared Variable, on each start of a client. The client instead automatically receives the token string upon launch and saves it for use in each

REST call. [19]

3.3.7

Components

The Operations Manager VI is divided into 5 tabs: Traffic, Session, Experiment, Log, and

OpM. Figure 3.8 shows the ’Traffic Tab’, which displays the commands in the current session. The current token or passkey is displayed at the top. The commands are divided into

Control, Management, and ISB Requesting commands as shown. The displays below each section show the number of commands in the queue waiting to be processed by the Operations Manager. [19] Figure 3.9 shows the "Session" Tab, which contains the information regarding the ticket from the Service Broker. Figure 3.10 shows the "Experiment Tab", containing information regarding the location of the experiment, time, and the status of any loops in the experiment that can be tracked. This may be used to monitor if one section in an experiment has failed. Figure 3.11 shows the Log Tab, a list of state changes and commands sent to the Operations Manager. The contents of the lab are read from files in the /ELSA/Logs/ folder. Figure 3.12 shows the OpM" tab, which contains information about the Operations Manager VI. Time and iteration numbers of loops within the Operations Manager are shown. Errors in the session are displayed in the ’error out’ terminals.

52

Figure 3-8: Operations Manager Traffic Tab

53

Figure 3-9: Operations Manager Session Tab

54

Figure 3-10: Operations Manager Experiment Tab

55

Figure 3-11: Operations Manager Log Tab

56

Figure 3-12: Operations Manager OpM Tab

57

3.4

Conclusion

The Experimental Lab Server Architecture (ELSA) enables us to build labs in LabVIEW and offers users a convenient Java Applet Client. Deployed LabVIEW-based Web Services allow the client to communicate with LabVIEW using REST calls and Shared Variables allow the Operations Manager to communicate with both the Web Services and local Experiment. In the next chapters, we describe the modifications necessary to adapt our

ISA-based experiment to ELSA.

58

Chapter 4

Thermal Lab in Experimental Lab

Server Architecture - Server Side

The Thermal Lab Experiment was adapted for the new Experimental Lab Server Architecture through integration with the ELSA VIs and development of a Java Applet Client.

Changes were made to the Thermal Lab VI to support communication under the ELSA architecture. In this chapter, we describe the modifications made to the ISA-based experiment on the server side for integration with ELSA.

4.1

Overview

As iLabs expands, future staff may be interested in using the ELSA system to design their own labs. ELSA is designed so the Operations Manager and supporting VIs are identical regardless of the experiment. Luciano Mendes designed the ELSA system to be capable of supporting any lab with only minimal changes. After a new experiment has been added to an ELSA project, the developer may copy over most of the ELSA files without changing them. An experiment integrated into ELSA must be controlled remotely. It is necessary that a user can start and stop the lab, change experiment variables, and access experimental

59

data through commands sent to the Operations Manager. LabVIEW allows communication between two separate running VIs through Global Variables and asynchronous calls.

The Thermal Lab is started through an asynchronous call, and subsequently uses Global

Variables to change parameters, output data, and stop the lab.

4.2

Experiment Configuration

ELSA requires experiment configuration files LabServerConfig.ini

and ExperimentConfig.ini

for each experiment (Examples attached in Appendix).

LabServerConfig.ini

describes the location of the Lab Server, Process Agent, Experiment Configuration File, etc.

ELSA serves as the Process Agent, a web service which sends authentication requests to the Service Broker. If authorized, the Service Broker returns a ISB coupon, which is a string the client uses to request access to access the experiment.

ExperimentConfig.ini

describes the Experiment location, computer IP Address, input variables, and output variables. Using these files, the Operations Manager parses out information specific to each experiment. Under this system, no manual changes need to be made to the Operations

Manager. [10, 19] Luciano Mendes developed a Setup VI to assist users with writing the

Figure 4-1: Operations Manager read of configuration files

Configuration Files. First, the current files are loaded into the Setup Tool so the user can check the current setup as shown in Figure 4.2. The third tab, Lab Server, displays the Lab

Server Configuration File for the user to edit as shown in Figure 4.3. The user may update the file through Lab Server->Write. The fourth tab, Process Agent, configures the Process

60

Agent and ISB Coupon configuration files for the Service Broker as shown in Figure 4.4.

The left section shows the Lab Server Process Agent information. The right section shows the ISB-Installed Domain Credentials used by the Lab Server to communicate with the

Service Broker. [19]

Figure 4-2: Setup Tool –Current Setup Tab

61

Figure 4-3: Setup Tool –Lab Server Tab

62

Figure 4-4: Setup Tool –Process Agent Tab

63

4.3

Cluster Setup

Input controls to the experiment are sent in by the Operations Manager using a cluster

"ExperimentControls", and output data is sent to the Operations Manager using cluster

"ExperimentOutputs". Each cluster consists of any number of variables of floats, strings, etc. The Controls and Output Data Clusters’ types and number of variables vary across experiments, so their type definition files much be changed each time a new lab is added.

For output, the Thermal Lab measures 3 attributes: input voltage, output voltage, and temperature, all numbers of the double type. [19] The Thermal Lab experiment has 8 controls, with their types and function shown in Table 4.1 below. While one can set up the cluster definitions manually, it is more developer-friendly to automate the process. Luciano

Mendes developed the Setup VI as a tool for convenience in adapting an ELSA project to a new experiment. The Experiment Tab of the Setup tool reads the ExperimentConfig.ini

file as shown in Figure 4.5. [19] A developer may select Artifacts-> Generate Artifacts to and modify the control and output cluster types to match the Types Array of the experiment shown. The resulting clusters are generated as shown in Figure 4.6. [19]

Control

Amplitude

Offset

Frequency

Type

Xpos

Ypos

Stream

Type

Double

Double

Double

Double

Double

Double

String

Function

Amplitude of Waveform (0-2 V)

Offset of Waveform (-2.5 - 2.5V)

Frequency of Waveform (>0)

Type of Waveform (Sine/Square/Triangle)

X coordinate of point in Image to measure temperature of (0-320)

Y coordinate of point in Image to measure temperature of (0-256)

Command for Streaming (currently unused)

Table 4.1: Experiment Controls

64

Figure 4-5: Setup Tool –Experiment Tab

65

Figure 4-6: Control and Output Cluster Type Definition

66

4.4

Remote Start

The ISA-based experiment started upon manually running the lab. Since a user no longer accesses the LabVIEW client, it is necessary to modify the VI to start upon a command from the Operations Manager instead. The Operations Manager launches the lab through an asynchronous call as shown in Figure 4.7, using the VI Full Path parameter given in the experiment configuration file. [4,19] On the experiment side, Luciano Mendes developed the

Figure 4-7: Asynchronous Call within Operations Manager block of code shown in Figure 4.8 to enable an experiment to start upon such calls. When the experiment is started, it becomes necessary to change IW_status, and reinitialize all the values to their default.

67

Figure 4-8: Asynchronous Launch within Experiment

4.5

Remote Stop of Experiment

The ISA-based lab halted all loops (Function Generator, Oscilloscope, Image Acquisition, etc) upon manual press of the "Stop" button. To synchronize the stop across all loops, a local variable "stop" signaled all loops running in the lab to break. Since a user no longer accesses the LabVIEW client using the ELSA system, it is necessary to modify the VI to stop upon a command from the operations manager instead. For the ELSA-based lab, we remove the stop button and create a Global Variable "STOP EXPERIMENT" replacing the local variable in every loop. On receiving the "STOP" management command, the Operations Manager sets the Global Variable "Stop Experiment" to true, and all experiment loops break. [19] When the experiment is stopped, it is necessary that the VI closes itself as well, using the "Invoke Node –Close Front Panel" tool on the VI reference. The code is shown in Figure 4.9. The Operations Manager needs for the lab to be closed to launch it again. In addition, we end all monitoring of the experiment, such as the Loops Alive array. [19]

68

Figure 4-9: Close Experiment upon Stop Command

4.6

Parameter Control

Parameters from the Controls cluster control the Function Generator and Temperature

Measurement. When operating an experiment through the ELSA system, inputs to the front panel are ignored, and instead Input Voltage parameters are determined by the Experiment Controls cluster. To prevent the user from entering values which will either crash the application, such as non-positive values of frequency, or those beyond the voltage range of the circuit (-2.5 –2.5V), experiment controls are screened before being sent to the Function Generator. Amplitude is limited to be within 0 to 2 V and Offset to 0 to 5 Volts.

There are only 3 types, so variable Type is limited between 0 and 2. If Frequency is negative, it is set to1 Hz. The modified input to the function generator is shown in Figure

4.10. [13, 19] Originally, a horizontal and vertical scrollbar moved the point in the image whose temperature was measured. In the ELSA system, the two scrollbars are removed,

69

Figure 4-10: Remote Function Generator and the coordinate of the point to measure in the image is set by the Control Cluster’s variables X-Position and Y-Position instead. Figure 4.11 shows the new setup for point selection.

70

Figure 4-11: Remote Temperature Measurement

4.7

Data Output

In the ISA-based experiment, data was directly displayed on a graph on the front panel of the client. For ELSA, it becomes necessary for the Experiment to periodically send the most recent data to the output data cluster Experiment Outputs. The variable Temperature is the most recently calculated temperature, while the voltages measured are stored in a cluster containing arrays of every value recorded. To extract the most recent voltage values, the data cluster is split into each voltage value, and then further split into the attributes, and then the most recent y value is extracted using the Index Array Tool. The 3 doubles are then bundled into the Experiment Outputs Cluster as shown in Figure 4.12.

71

Figure 4-12: Output Data from Experiment

4.8

Image Stream

To stream the image, the experiment must write the image into a string variable as shown in Figure 4.13. The pixel values are 320 x 256 grayscale values in the range of 0-255. The array of pixel values is then reshaped into a 1 dimensional array. The array is converted using the ArrayToSpreadsheetString function into a comma separated string of numbers, and entered into string variable IW_Stream.

Figure 4-13: Streaming within Experiment

72

4.9

Conclusion

The Experimental Lab Server Architecture was designed for convenient integration with any lab. A setup tool automatically modifies the type definitions for the input and output clusters to match that of the lab. Deployed Web Services remain identical across all labs.

From an ELSA system designed for another lab, the only changes on the server-side involve changing the type of the control and output clusters. In the next chapter, we describe the client-side development of ELSA.

73

74

Chapter 5

Experimental Lab Server Architecture -

Client Side

In ELSA, a lightweight Java Applet serves as the client for the user and interfaces with the

Operations Manager. The applet uses REST calls to the web service to send commands to start, end, update the lab, and request data from the web service. In this chapter, we describe client-Side development of the Thermal Lab in Experimental Lab Server Architecture.

5.1

Overview

The Java Applet Client, shown in Figure 5.1, contains all of displays and controls of the front panel. At the top of the applet, there is a toolbar with a "File" menu, to save a data file, and "Help" menu, to provide the user information with operation. The components of the applet are the graphs of voltage and temperature, the text box for entering the parameters of the input waveform, thermal image, sliders, and command buttons. Once the applet is initialized and started, the client waits for the user to enter a valid token for authenticated communication with the Operations Manager. Once authenticated, data acquisition for the

75

Figure 5-1: Java Applet voltage graphs occurs on one thread, and image acquisition of the thermal image occurs on a separate thread. The graphs and thermal image are constantly redrawn by a repaint() command. Action listeners are bound to command buttons, and send requests to the

76

management web service when pressed. The Update button and two sliders also have associated action change listeners sending updated parameters to the controls web service.

5.2

Applet Layout

As this Java Client will be used by real students in the future, it becomes essential for the layout to be organized with elements in predictable locations. Java Clients may use various layout managers to arrange elements. The applet will contain elements of various sizes and will contain multiple elements spanning rows and columns, so GridBagLayout was used. Using the JFrame and JElement classes for better control, the applet can specify coordinates and length within a grid, whereas the Frame and Element classes do not support coordinates. [11, 22] The Applet is a grid of 6 columns and 12 rows in which elements are placed. The top row contains 6 equally sized blank cells to serve as a reference for the following elements and force the cells to be the same size. Total grid width is 6, so for each row, element widths must sum to that value. For example, the graphs occupy the entire row, so weightx=6, while the 3 command buttons together occupy a row, so weightx = 2.

The canvas containing the thermal image must be aligned with a vertical and horizontal slider. Originally, sliders were placed in the cells to the left and bottom of the canvas, but the slider widths and heights were different from those of a normal cell. Instead, creating a smaller frame containing 2 x 2 cells within the main applet frame better aligns the image and toolbars.

5.3

Authentication

As described in Chapter 3, REST calls to Web Services must include the coupon passkey for authentication. For local testing, the passkey from the Operations Manager is provided to the user to enter into the "Token" field. The Client reads the value entered and includes

77

it as the token parameter in each REST call. [24] For remote deployment however, the

Operations Manager is not visible to the user, and therefore the user must be able to acquire the token in a different method. The Client is instead packaged into a signed jar and uploaded to iLabs. Upon launch, the Service Broker sends coupon information to the client. The Client’s Token field should be removed, and the passkey sent during every

REST call should be acquired using getParameter("passkey") calls. [3, 10]

5.4

Data Acquisition and Display

While the experiment is running, the Client must continually update the graphs and thermal image with the most recent data. The thermal lab continually calls Web Service IWdata, which returns a comma separated string of 3 numbers, and IWstreaming, which returns a string of all the grayscale value of every pixel in the 320 x 256 image. Image Streaming involves parsing a long string, which is time consuming. It is important to us that the graph is as smooth as possible, and therefore data acquisition should not wait for image display. The two processes are completely independent from each other, so they run on separate threads. This section describes the data acquisition and display for the graphs and thermal image.

5.4.1

Graphs

If the experiment is running, the Web Service IWdata sends the most current values for

Input Voltage, Output Voltage, and Temperature in order. Since Voltage and Temperature operate on different scales, they are plotted on separate graphs. This section describes the selection and adaptation of existing graph classes for the Applet.

78

5.4.1.1

Batched Lab Graph

The first version of the client used the old batched Java Client’s graph class. The Weblab’s

Graph class takes as input an X and Y axis. The Axis class can be set with a minimum and maximum, and data in the form of a BigDecimal Array. As soon as the experiment starts, data values are appended into a BigDecimal list. From testing, approximately 50 data points fit well on the graph. The experiment can last for minutes, generating far too many points to be displayed. Therefore, after over 50 points are plotted, only the most recent 50 values are entered into a separate array. The new data is entered into the X and Y axis, and the graphs are repainted. The batched lab was designed to graph once only, so speed of graphical display was not a factor. In the preliminary trial of the graph class, the graph plotted a varying sine wave as shown in Figure 5.2. The waveform is clearly not smooth enough. Since numbers must be first converted to BigDecimal, and the Y-Axis must be changed after every sample, there is a significant amount of time which elapses between data acquisition and display on the graph. [4] In addition, the Weblab graph package does not include axis drawn on the graph. The batched applet is designed to allow users to choose the scale, and draw the axis outside of the graph itself. As shown below, the xaxis and y-axis, and scale must be manually drawn. We considered solutions to increase sampling rate, such as only updating the graph once every 50 samples while collecting data without processing or display. However, the graph would no longer be realtime, and any update we make on parameter values would not be reflected for some period of time

5.4.1.2

Ptolemy Lab Graph

Another graph package, TEAL Ptolemy, was originally designed for a continuously updated applet more similar to ours. The Ptolemy graph is initialized in the init method, and points in the form of floats are constantly added to a Vector. Once over 50 data points have been recorded, every time a new point is added, the first data point is removed through a call to

79

Figure 5-2: Original Batched Lab Graph plot.erasePoint(0), making the graph a constant left-scrolling frame of the most recent data points. The reduced logic for processing data points improves performance. As shown in

Figure 5.3, the sine wave input is far smoother. A legend is also added to inform users which

Figure 5-3: Teal Package Plot waveform corresponds to input vs output voltage. The plot’s X-axis is constantly rescaled to the new values, while the Y-axis for voltage remains -2.5 to 2.5 Volts and temperature remains 20 - 70 degrees C.

80

5.4.2

Image Stream

To stream an image, the client continually acquires the most recent image from the thermal camera. Image values are accessible through the web service IW_Streaming. The client’s image thread continually calls the web service for the most recent image string.

Requests for data are in the form: http:// <IP Address>: <Port >/stream/IWLStreaming/token=<token >. The web service sends back a spreadsheet string of 819260 comma separated values. [19] The returned spreadsheet string is split into an array of values. Each array value is a grayscale value in the range of 0-255, and must be converted into a Color type. Values close to 0 should be blue and values close to 255 should be red. Using the formula shown below, we convert each pixel into a RGB array. [23] public int[] convert(int x) { int[] rgb = new int[3]; if (x < 0) { rgb[0] = 0; rgb[1] = 0; rgb[2] = 0;

} else if (x < 64) { rgb[0] = 0; rgb[1] = 0; rgb[2] = x * 4;

} else if (x < 128) { rgb[0] = 0; rgb[1] = (x - 64) * 4; rgb[2] = 255;

} else if (x < 192) { rgb[0] = 0;

81

} rgb[1] = 255; rgb[2] = (x - 128) * 4;

} else { rgb[0] = (x - 192) * 4; rgb[1] = (255 - x) * 4; rgb[2] = 0;

} return rgb;

The Applet draws the thermal image in the Applet on a Canvas class. The Client generates an Image object from an integer array, and every time repaint() is called, the Applet’s

Graphics class redraws the Image object on the canvas.

5.5

Communication Across Web Services

The Java Applet Client uses REST Post Calls to control the remote experiment. Each component’s state change (button press, scrollbar value change) is bound to an associated

Listener class, which sends a REST call to the associated web service. In this section, we describe the types of requests required in this lab and how they are implemented. [11]

5.5.1

Start and Stop of Lab

Start and Stop calls are sent to the web service IWL_management through REST calls.

The REST call required to launch the Lab is: http://<IP Address>: <Port> /IWL/I-

WLmgt/start, token=<passkey>, and the call to stop the lab is http://<IP Address>:

<Port> /IWL/IWLmgt/stop, token=<passkey>. Invalid calls (stopping the lab before it

82

is started, repeated start calls) are screened by the Operations Manager, so there is no need to handle them within the client.

5.5.2

Update Parameters

The input waveform characteristics and coordinate of the point are changed by the user.

After any value change, the updated parameters are sent to the web service IWL controls in the form of a rest call: rest.RestPost.restMethod("http://18.28.1.27: 8081 /IWL/IWLcontrols/ userControls=<Parameter>=<parameter>!, token=couponPasskey) Users control the input waveform to the Function Generator and location measured of the thermal image. This section describes the requests to update parameters of these components.

5.5.2.1

Function Generator

Users control all the applicable parameters of the Function Generator, Amplitude, Frequency, Offset, Type (Sine/Square/Triangle) and Duty Cycle (for square waves). Users enter values into the associated text fields, and click the Update button. The VI General-

CommandsParser requires that each field be filled in or else it would reset them to 0. In order for the input fields to match the parameters from the function generator, the applet prompts the user if every field is not filled in. In addition, each text field is set to the values of when the experiment launches, so students have a reference connecting the parameters to the input waveform displayed. [19]

5.5.2.2

Temperature Measurement

It becomes most reasonable from a user interface perspective to use scrollbars instead of text fields to select the point in the image instead of asking users to enter raw numbers.

Not only would a student not have a sense of the location of values, we also can constrain entered scrollbar numbers to the size of the image, not having to worry about errors when students enter out of bounds numbers. Similar to the design from LabView, a black 3x3

83

box shows the area which is being measured. While moving the scrollbar, a student would prefer that he/she could see the black rectangle work to provide instant feedback when selecting a specific region. A Value Change Listener is bound to both scrollbars, which repaints the black rectangle on the image to move with the scrollbar. [11]

5.6

Data Storage

Since the computer running the experiment is no longer accessible to the user, there must be a new interface to record data. Users who wish to perform analysis on collected data require a data file to download. Again, it is necessary for students to indicate the start and end of recording, so they may try out some parameters before collecting relevant data.

After a user selects "Record Data", a file prompt asks for the location to save the resulting data file, as shown in Figure 5.4. The applet saves a list of comma separated value strings in the form "Elapsed Time, Input Voltage, Output Voltage, Temperature". When the user selects "Stop Recording", the associated Action Listener writes to the specified text file all the collected data as shown in Figure 5.5.

84

Figure 5-4: File Prompt for Recording Data

85

Figure 5-5: Output Data File

86

5.7

Help Menu

To provide students with guidance and information on operating the applet similar to the final LabVIEW-based experiment, the help menu opens a window with documentation.

Unlike with the original batched lab, there was no space in the applet to display the circuit diagram. It is therefore essential to provide users with information on the circuit they are operating. The help window is shown in Figure 5.6.

Figure 5-6: Documentation Window

87

Client

Location

CECI/MIT network

CECI/MIT network

PUCPR

60Mbps

(download) network

Private

15Mbps

(download) network

Lab Server

Location

Same computer

CECI/MIT network

CECI/MIT network

CECI/MIT network

2.75

Experiment Data traffic

[MB] rate

[kB/s]

4.70

web service calls traffic

[MB]

Streaming rate

[kB/s] web service calls

10464 1321.73 2255.75 4244

2.23

0.64

0.66

3.81

1.09

1.12

8473

2418

2498

494.99

24.05

23.45

844.77

41.05

40.02

Table 5.1: Payload data transfer rates for 600s (normalized) test time.

1602

78

86

5.8

Results

The Thermal Lab would eventually be used in students worldwide. During development, the client and lab server has always been on the same computer. To examine if ELSA is capable of supporting adequate data transfer rates, we compared the data and image rates with the client located different distances away, moving to a separate computer within

MIT and then to different Brazilian networks. One Brazilian network, was located in the university Pontifical Catholic University of Parana (PUCPR), and the other was a nearby private home network, with varying network speeds. As shown in Table 5.1, there is a significant drop in data rate, but adequate for maintaining operation of the lab. The slower private network does not show significantly different data or stream transfer rates, leading us to believe that students from outside the US may access experiments from their own home networks as well as university networks. [19]

88

5.9

Conclusion

The Java Applet serves as a lightweight client capable of communicating with a lab built in Experimental Lab Server Architecture. User actions on the applet trigger REST calls to web services to send requests to start, stop, and modify the lab, as well as request waveform and image data. For user convenience, a toolbar with options for Help and Recording data is displayed at the top of the lab. From preliminary testing moving the client to Brazil, the

Experimental Lab Server Architecture supports remote operation outside of MIT.

89

90

Chapter 6

Conclusions and Future Work

In this thesis, we described the development of a new Switching Circuit Energy Balance Lab in a new online laboratory architecture. An original NMOS Resistor iLab taught students about MOSFET modes of operation and the operation of a MOSFET-resistor logic gate.

The addition of a thermal camera to the lab would add information about heat dissipation.

To include streaming from the thermal camera, the experiment was re-built into a Lab-

VIEW VI. However, previous iLabs Shared Architecture did not support interactive labs in a manner we desired. Luciano Mendes developed the Experimental Lab Server Architecture to support an experiment built in LabVIEW on the server side, and a lightweight Java

Client on the client side. The client sends requests for data and parameter updates through

REST calls to web services, which are then sent to the Operations Manager. The Operations Manager then records the request and formats them to send it to the client through shared variables. We used the new ELSA architecture to implement the new Thermal iLab.

ELSA’s Operations Manager and other processes were developed to be modular, so minimal modification and development was needed to adapt an experiment for ELSA. The only changes to the Operations Manager’s Setup files and Shared Variables can be made through an automated Setup Tool for developer convenience. The LabVIEW experiment itself must be modified to respond solely to remote commands for start, stop, and input parameter

91

changes. A corresponding Java Client for users is developed to match the front panel of the LabVIEW VI and includes all the buttons corresponding to controls, and graphs and canvases for displaying data. Testing ELSA included locating the Lab Server at MIT, and then locating the client on the same computer, on a different computer in the MIT network, and on a computer in Brazil. As expected, data transfer rates were significantly lower with a remote client, but still sufficient to support operation. Future work as this lab becomes available for class and worldwide use include more testing, improvements to data transfer rates, and development of lab exercises to guide students.

6.1

Future Work

6.1.1

Adaptation to Class Use

Before this lab is released for class use, it becomes necessary for us to start actual user testing on a small scale. No developer can truly predict all the actions of a user, nor the bugs that may arise due to unexpected actions. Student testers may have feedback regarding the documentation, layout, or other comments regarding aesthetic issues and user interface.

Since hundreds of students are expected to use this lab, it is important to determine if the program can handle a large volume of user requests. Any unanticipated issues may arise, such as the Operations Manager being unable to handle above a certain number of calls, the web services ignoring client requests after the client switches from one user to another, etc. Efforts should be made to run the web services for longer periods of time, mimicking the access by hundreds of users. Before this lab is released to the public, it is also important to fully integrate the lab with iLabs data storage and scheduling. iLabs data storage keeps experimental data for 30 days after a lab is run, in case a student misplaces a data file or suffers computer issues. Currently, the framework to limit the client to only one student at a time is missing. The iLabs scheduling system can be used by students to reserve a

92

period of time in the future, and then allows access only to the one user who is scheduled to use the client at that time. It would not be interesting for a student to see the voltage waveforms and image during the time the Function Generator is running the inputs from another student, or worse, if a student assumes that the response is due to his own inputs but actually showing data from another student. Lab Exercises should also be developed to further guide students’ learning during the thermal lab. Any data analysis for original

NMOS Amplifier Lab may remain the same, and new problems on calculating thermal time constant, total heat dissipated in a cycle, and etc. may be added.

6.1.2

Improved Display

Ideally, the experiment graphs should be conveyed to the user without loss of resolution and preserve the shape of the pulse response. Users should see that the output is roughly an inverted copy of the input pulse train, and the temperature graph follows the output waveform with exponential rise and decay. For square wave inputs, it is important for the client to display the RC exponential decay of the output voltage waveform. However, the current client’s graphs do not preserve the ELVIS measured waveforms to the degree of accuracy desired. For sine waves of frequency above 1 Hz, the graphs in the client are less smooth than those in the experiment. Triangle waves especially may not display the sharp peaks properly. To improve display, the data output rate of the client, response time of the web service, and processing time before display in the client should be measured. Based on these measurements, we can determine which process is limiting the display rate the most and attempt to improve it. An interactive lab has certain advantages, such as no queueing, and the ability to try many sets of parameters. A student is given more freedom to explore; to choose different parameters and instantly see the response. However, image streaming and data acquisition are continuous web service calls, and sampling rate may be increased if we were to send all the data, smoothly plot the data and display the image all at once.

If any other attempts to improve display rate fail, it may be recommended to adapt the

93

Thermal Lab into a batched form, and then have students evaluate both systems to decide which they prefer, and the pros and cons of each format. Previous testing has also been limited to clients located in either MIT or Brazil. If this lab will be used world-wide, the data transfer rates should be measured for other countries as well. If the transfer rates to other countries are too low to provide users with a useable lab, it may be necessary to provide an option of the batched lab to international users or those with slower internet.

6.1.3

Thermal Camera

While at this point iLabs has only one thermal camera, when this lab becomes available for class use, it may be recommended to buy a backup camera. In case the camera breaks, it would be not ideal to shut down the lab until a replacement arrives. In addition, there may be other circuits with interesting thermal characteristics to study. Once the circuit and locations of Analog Input and Analog Output are changed on the ELVIS board, the

LabVIEW VI itself with mostly remain the same, besides changing the documentation.

Sending the camera stream through LabVIEW, then web services, and then to the client requires a great deal of processing. If the camera stream can be accessed directly from the client, the stream should be smoother. This improvement may require further research and contact with FLIR, or the purchase of a new thermal camera.

94

Appendix A

Client Source Code

p a c k a g e c l i e n t ;

/ **

*

* @author mitadm

* / i m p o r t com . sun . t o o l s . x j c . r e a d e r . Const ; i m p o r t j a v a . a p p l e t . Applet ; i m p o r t j a v a . awt .

* ; i m p o r t j a v a . awt . G r a p h i c s ; i m p o r t j a v a . awt . e v e n t .

* ; i m p o r t j a v a . awt . image .

* ; i m p o r t j a v a . i o . B u f f e r e d R e a d e r ; i m p o r t j a v a . i o . B u f f e r e d W r i t e r ; i m p o r t j a v a . i o . F i l e ; i m p o r t j a v a . i o . F i l e W r i t e r ; i m p o r t j a v a . i o . I OE x ce pt i on ; i m p o r t j a v a . i o . InputStream ; i m p o r t j a v a . i o . InputStreamReader ; i m p o r t j a v a . i o . OutputStream ; i m p o r t j a v a . i o . OutputStreamWriter ; i m p o r t s t a t i c j a v a . l a n g . Thread . s l e e p ; i m p o r t j a v a . l a n g . r e f l e c t . Array ; i m p o r t j a v a . math . BigDecimal ; i m p o r t j a v a . math . B i g I n t e g e r ; i m p o r t j a v a . n e t . MalformedURLException ; i m p o r t j a v a . n e t .URL; i m p o r t j a v a . n e t . URLConnection ; i m p o r t j a v a . u t i l . A r r a y L i s t ; i m p o r t j a v a . u t i l . A r r a y s ;

95

i m p o r t j a v a . u t i l . C o l l e c t i o n s ; i m p o r t j a v a . u t i l . L i s t ; i m p o r t j a v a . u t i l . l o g g i n g . L e v e l ; i m p o r t j a v a . u t i l . l o g g i n g . L o g g e r ; i m p o r t j a v a x . i m a g e i o . ImageIO ; i m p o r t j a v a x . s w i n g . Im ageIcon ; i m p o r t j a v a x . s w i n g . JButton ; i m p o r t j a v a x . s w i n g . JComboBox ; i m p o r t j a v a x . s w i n g . J F i l e C h o o s e r ; i m p o r t j a v a x . s w i n g . JFrame ; i m p o r t j a v a x . s w i n g . J L a b e l ; i m p o r t j a v a x . s w i n g . JPanel ; i m p o r t j a v a x . s w i n g . J S c r o l l B a r ; i m p o r t j a v a x . s w i n g . J T e x t F i e l d ; i m p o r t r e s t . R e s t P o s t ; i m p o r t t e a l . p l o t . ptolemy . P l o t ; p u b l i c c l a s s C l i e n t e x t e n d s Applet im pl em en ts Runnable { b o o l e a n u s e P a r a m e t e r s = f a l s e ;

// r e a d t h e p a r a m e e t e r s from t h e a p p l e t l a u n c h i n t i = 0 ; l o n g s t a r t T i m e = System . c u r r e n t T i m e M i l l i s ( ) ;

//

// OpCoupon Data

S t r i n g strCouponID = n u l l ;

S t r i n g c o u p o n I s s u e r = n u l l ;

S t r i n g couponPasskey = n u l l ; s t a t i c f i n a l i n t im2 [ ] = new i n t [ 2 5 0 0 ] ; s t a t i c f i n a l i n t im3 [ ] = new i n t [ 2 5 0 0 ] ;

Thread dataThread ;

Thread imageThread ;

S t r i n g B u f f e r b u f f e r ; i n t r e s e t C o u n t e r = 0 ; i n t [ ] imageData = new i n t [ 8 1 9 2 0 ] ;

L i s t <Long> x v a l u e s = new A r r a y L i s t <Long >() ;

L i s t <S t r i n g > s a v e=new A r r a y L i s t <S t r i n g >() ;

F i l e s a v e f i l e ;

JFrame frame ;

JFrame h e l p f r a m e ;

J T e x t F i e l d t o k e n = new J T e x t F i e l d ( 1 0 ) ; p u b l i c v o l a t i l e b o o l e a n s a v i n g= f a l s e ;

J T e x t F i e l d a m p l i t u d e = new J T e x t F i e l d ( 4 ) ;

96

J T e x t F i e l d f r e q u e n c y = new J T e x t F i e l d ( 4 ) ;

J S c r o l l B a r x S c r o l l = new J S c r o l l B a r ( S c r o l l b a r .HORIZONTAL,

1 0 0 , 1 0 , 0 , 3 2 0 ) ;

J S c r o l l B a r y S c r o l l = new J S c r o l l B a r ( S c r o l l b a r . VERTICAL, 1 0 0 ,

0 , 0 , 2 5 6 ) ;

JButton s t a r t = new JButton ( "START" ) ;

JButton s t o p = new JButton ( "STOP" ) ;

JButton update = new JButton ( "UPDATE" ) ;

JButton e x i t = new JButton ( " E x i t " ) ;

J T e x t F i e l d o f f s e t = new J T e x t F i e l d ( 4 ) ;

J T e x t F i e l d d u t y C y c l e =new J T e x t F i e l d ( 4 ) ;

S t r i n g [ ] t y p e s = {" S i n e " , " T r i a n g l e " , " Square " } ;

JComboBox chooseOut = new JComboBox ( ) ;

ImageCanvas i c=new ImageCanvas ( ) ; b o o l e a n keepRunning = f a l s e ;

P l o t temp_plot = new P l o t ( ) ;

P l o t p l o t = new P l o t ( ) ;

MenuBar mb ; p r i v a t e Menu fm , hm ; p r i v a t e R e d i r e c t i n g M e n u I t e m rd , s r , hc ;

@SuppressWarnings ( " empty − s t a t e m e n t " ) p u b l i c v o i d s t a r t S a v e ( ) { s a v i n g=t r u e ;

} p u b l i c v o i d i n i t ( ) {

////// i f ( ! u s e P a r a m e t e r s ) { strCouponID = " 1 2 3 4 5 " ; c o u p o n I s s u e r = "moreDummy " ; couponPasskey = " f a k e P a s s k e y " ;

} e l s e {

// l o o k f o r coupon i n f o r m a t i o n p a s s e d from S e r v i c e

B r o k e r strCouponID = g e t P a r a m e t e r ( " couponId " ) ; c o u p o n I s s u e r = g e t P a r a m e t e r ( " i s s u e r " ) ; couponPasskey = g e t P a r a m e t e r ( " p a s s k e y " ) ; i f ( ( strCouponID != n u l l && ! strCouponID . e q u a l s ( " " )

&& ! strCouponID . e q u a l s ( " $ { op : couponId } " ) )

&& ( c o u p o n I s s u e r != n u l l && ! c o u p o n I s s u e r .

e q u a l s ( " " ) )

&& ( couponPasskey != n u l l && ! couponPasskey .

e q u a l s ( " " ) ) ) {

// t o k e n . s e t T e x t ( couponPasskey ) ;

97

// Send A u t h S t r i n g

//TODO: R e p l a c e w i t h not hard − coded IP i n f o

S t r i n g B u i l d e r b u f = new S t r i n g B u i l d e r ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / i w l /IWLauthToken/&couponId

=") ; b u f . append ( strCouponID ) ; b u f . append ("& i s s u e r G u i d =" + c o u p o n I s s u e r ) ; b u f . append ("& p a s s k e y=" + couponPasskey + "&") ;

S t r i n g r e s p = n u l l ;

System . out . p r i n t l n ( b u f . t o S t r i n g ( ) ) ; t r y { r e s p = R e s t P o s t . r e s t M e t h o d ( b u f . t o S t r i n g ( ) ) ;

System . out . p r i n t l n ( r e s p ) ;

} c a t c h ( IO Ex c ep t io n e ) {

// throw new RuntimeException ( " Post E r r o r : " , e ) ;

} i f ( ( r e s p . matches ( " a u t h e n t i c a t e d " ) ) ) { t o k e n . s e t T e x t ( couponPasskey ) ;

} e l s e {

// throw new RuntimeException ( " C l i e n t

A u t h e n t i c a t i o n F a i l e d ! " ) ;

}

} e l s e { throw new RuntimeException ( " M i s s i n g a u t h e n t i c a t i o n p a r a m e t e r s ! " ) ;

}

}

// t h i s . s e t S i z e ( 5 0 0 , 6 0 0 ) ; frame = new JFrame ( ) ; a m p l i t u d e . s e t T e x t ( " 0 " ) ; o f f s e t . s e t T e x t ( " 0 " ) ; d u t y C y c l e . s e t T e x t ( " 5 0 " ) ; f r e q u e n c y . s e t T e x t ( " 1 " ) ; frame . s e t S i z e ( 6 0 0 , 8 0 0 ) ; p l o t . s e t S i z e ( 6 0 0 , 2 0 0 ) ; temp_plot . s e t S i z e ( 6 0 0 , 2 0 0 ) ;

GridBagLayout g b l = new GridBagLayout ( ) ;

G r i d B a g C o n s t r a i n t s c = new G r i d B a g C o n s t r a i n t s ( ) ; frame . s e t L a y o u t ( g b l ) ;

98

frame . s e t R e s i z a b l e ( f a l s e ) ; mb = new MenuBar ( ) ; mb . add ( fm = new Menu( " F i l e " ) ) ; mb . add (hm = new Menu( " Help " ) ) ; mb . setHelpMenu (hm) ; fm . add ( rd = new R e d i r e c t i n g M e n u I t e m ( t h i s , " Record Data " ) ) ; fm . add ( s r = new R e d i r e c t i n g M e n u I t e m ( t h i s , " Stop R e c o r d i n g

" ) ) ; hm . add ( hc = new R e d i r e c t i n g M e n u I t e m ( t h i s , " Help " ) ) ; rd . a d d A c t i o n L i s t e n e r ( new S a v e L i s t e n e r ( ) ) ; s r . a d d A c t i o n L i s t e n e r ( new S t o p S a v e L i s t e n e r ( ) ) ; hc . a d d A c t i o n L i s t e n e r ( new H e l p L i s t e n e r ( ) ) ; frame . setMenuBar (mb) ;

// These 6 l a b e l s s e t up t h e columns t o be t h e same s i z e , s o t o t a l width i s 6

J L a b e l l a b 1 = new J L a b e l ( " " ) ;

J L a b e l l a b 2 = new J L a b e l ( " " ) ;

J L a b e l l a b 3 = new J L a b e l ( " " ) ;

J L a b e l l a b 4 = new J L a b e l ( " " ) ;

J L a b e l l a b 5 = new J L a b e l ( " " ) ;

J L a b e l l a b 6 = new J L a b e l ( " " ) ; c . g r i d w i d t h = 1 ; c . w e i g h t x = 1 ; c . g r i d x = 0 ; c . g r i d y = 0 ; g b l . s e t C o n s t r a i n t s ( l a b 1 , c ) ; frame . add ( l a b 1 ) ; c . g r i d x = 1 ; g b l . s e t C o n s t r a i n t s ( l a b 2 , c ) ; frame . add ( l a b 2 ) ; c . g r i d x = 2 ; g b l . s e t C o n s t r a i n t s ( l a b 3 , c ) ; frame . add ( l a b 3 ) ; c . g r i d x = 3 ; g b l . s e t C o n s t r a i n t s ( l a b 4 , c ) ; frame . add ( l a b 4 ) ; c . g r i d x = 4 ; g b l . s e t C o n s t r a i n t s ( l a b 5 , c ) ; frame . add ( l a b 5 ) ; c . g r i d x = 5 ;

99

g b l . s e t C o n s t r a i n t s ( l a b 6 , c ) ; frame . add ( l a b 6 ) ; frame . s e t T i t l e ( "MIT IR Lab " ) ;

// T i t l e

J L a b e l t i t l e = new J L a b e l ( "MIT IR Lab " ) ; t i t l e . s e t F o n t ( new Font ( " S e r i f " , Font .BOLD, 2 0 ) ) ; c . g r i d w i d t h = 6 ; c . g r i d x =0; c . g r i d y =1; c . g r i d h e i g h t =1; c . f i l l =G r i d B a g C o n s t r a i n t s . VERTICAL ; g b l . s e t C o n s t r a i n t s ( t i t l e , c ) ; frame . add ( t i t l e ) ;

//Add s u b t i t l e

J L a b e l s u b t i t l e=new J L a b e l ( " Powered by MIT iLab / PUCPR

ELSA" ) ; c . g r i d x = 0 ; c . g r i d y = 2 ; c . g r i d w i d t h = 6 ; s u b t i t l e . s e t F o n t ( new Font ( " S e r i f " , Font .BOLD, 1 1 ) ) ; g b l . s e t C o n s t r a i n t s ( s u b t i t l e , c ) ; frame . add ( s u b t i t l e ) ;

// V o l t a g e P l o t c . a n c h o r=G r i d B a g C o n s t r a i n t s .CENTER; c . g r i d x = 0 ; c . g r i d y = 3 ; g b l . s e t C o n s t r a i n t s ( p l o t , c ) ; frame . add ( p l o t ) ; c . g r i d w i d t h =6; c . g r i d y =4; c . g r i d x =0; g b l . s e t C o n s t r a i n t s ( temp_plot , c ) ; frame . add ( temp_plot ) ;

// Token L a b e l c . g r i d x = 0 ; c . g r i d y = 5 ;

J L a b e l t o k e n l a b e l = new J L a b e l ( " Token " ) ;

100

c . g r i d h e i g h t = 1 ; c . w e i g h t x = . 5 ; c . f i l l = G r i d B a g C o n s t r a i n t s .NONE; c . g r i d w i d t h = 1 ; g b l . s e t C o n s t r a i n t s ( t o k e n l a b e l , c ) ; frame . add ( t o k e n l a b e l ) ;

// Token F i e l d c . g r i d x = 1 ; c . g r i d y = 5 ; c . w e i g h t x = 1 . 0 ; c . g r i d w i d t h = 5 ; c . f i l l = G r i d B a g C o n s t r a i n t s .BOTH; g b l . s e t C o n s t r a i n t s ( token , c ) ; frame . add ( t o k e n ) ;

// S t a r t b u t t o n c = new G r i d B a g C o n s t r a i n t s ( ) ; c . g r i d x = 0 ; c . g r i d y = 6 ; c . f i l l = G r i d B a g C o n s t r a i n t s .BOTH; c . w e i g h t x = . 5 ; c . g r i d w i d t h = 2 ; g b l . s e t C o n s t r a i n t s ( s t a r t , c ) ; frame . add ( s t a r t ) ;

// Stop b u t t o n c . g r i d x = 2 ; c . g r i d y = 6 ; c . f i l l = G r i d B a g C o n s t r a i n t s .BOTH; c . w e i g h t x = 0 . 5 ; c . g r i d w i d t h = 2 ; g b l . s e t C o n s t r a i n t s ( s t o p , c ) ; frame . add ( s t o p ) ;

// Update Button c . g r i d x = 4 ; c . g r i d y = 6 ; c . w e i g h t x = . 5 ; c . g r i d w i d t h = 2 ;

// c . g r i d w i d t h = G r i d B a g C o n s t r a i n t s .REMAINDER; g b l . s e t C o n s t r a i n t s ( update , c ) ; frame . add ( update ) ;

101

L a b e l t y p e L a b e l = new L a b e l ( " Waveform t y p e " ) ; c . g r i d w i d t h = 1 ; c . g r i d x = 0 ; c . g r i d y = 7 ; g b l . s e t C o n s t r a i n t s ( t y p e L a b e l , c ) ; frame . add ( t y p e L a b e l ) ;

// Type S e l e c t f o r ( S t r i n g s : t y p e s ) { chooseOut . addItem ( s ) ;

} c . g r i d x = 1 ; c . g r i d y = 7 ; c . a n c h o r = G r i d B a g C o n s t r a i n t s . BASELINE ; c . g r i d w i d t h = G r i d B a g C o n s t r a i n t s .REMAINDER; c . f i l l = G r i d B a g C o n s t r a i n t s .BOTH; g b l . s e t C o n s t r a i n t s ( chooseOut , c ) ; frame . add ( chooseOut ) ;

// Amplitude L a b e l c . g r i d x = 0 ; c . g r i d y = 8 ; c . g r i d w i d t h = 1 ;

L a b e l ampLabel = new L a b e l ( " Amplitude (V) " ) ; g b l . s e t C o n s t r a i n t s ( ampLabel , c ) ; frame . add ( ampLabel ) ;

// Amplitude F i e l d c . g r i d x = 1 ; c . g r i d y = 8 ; c . g r i d w i d t h = G r i d B a g C o n s t r a i n t s .REMAINDER; g b l . s e t C o n s t r a i n t s ( a m p l i t u d e , c ) ; frame . add ( a m p l i t u d e ) ;

// Frequency l a b e l

L a b e l f r e q L a b e l = new L a b e l ( " Frequency ( Hz ) " ) ; c . g r i d w i d t h = 1 ; c . g r i d x = 0 ; c . g r i d y = 9 ; g b l . s e t C o n s t r a i n t s ( f r e q L a b e l , c ) ; frame . add ( f r e q L a b e l ) ;

// Frequency F i e l d c . g r i d w i d t h = G r i d B a g C o n s t r a i n t s .REMAINDER;

102

c . g r i d x = 1 ; c . g r i d y = 9 ; g b l . s e t C o n s t r a i n t s ( f r e q u e n c y , c ) ; frame . add ( f r e q u e n c y ) ;

// O f f s e t L a b e l c . g r i d x = 0 ; c . g r i d y = 1 0 ;

L a b e l o f f s e t L a b e l = new L a b e l ( " O f f s e t (V) " ) ; c . g r i d w i d t h = 1 ; g b l . s e t C o n s t r a i n t s ( o f f s e t L a b e l , c ) ; frame . add ( o f f s e t L a b e l ) ;

// O f f s e t F i e l d c . g r i d x = 1 ; c . g r i d y = 1 0 ; c . g r i d w i d t h = G r i d B a g C o n s t r a i n t s .REMAINDER; g b l . s e t C o n s t r a i n t s ( o f f s e t , c ) ; frame . add ( o f f s e t ) ;

// DutyCycle L a b e l c . g r i d x = 0 ; c . g r i d y = 1 1 ;

L a b e l d u t y L a b e l = new L a b e l ( " Duty C y c l e (%) " ) ; c . g r i d w i d t h = 1 ; g b l . s e t C o n s t r a i n t s ( dutyLabel , c ) ; frame . add ( d u t y L a b e l ) ;

// DutyCycle F i e l d c . g r i d x = 1 ; c . g r i d y = 1 1 ; c . g r i d w i d t h = G r i d B a g C o n s t r a i n t s .REMAINDER; g b l . s e t C o n s t r a i n t s ( dutyCycle , c ) ; frame . add ( d u t y C y c l e ) ;

//Add s p a c e b e f o r e p a n e l

J L a b e l b l a n k=new J L a b e l ( " " ) ; c . g r i d x =0; c . g r i d y =12; g b l . s e t C o n s t r a i n t s ( blank , c ) ; frame . add ( b l a n k ) ;

// I n s i d e p a n e l , add s c r o l l b a r s and image c a n v a s

JPanel p a n e l=new JPanel ( ) ;

103

p a n e l . s e t S i z e ( 5 0 0 , 1 0 0 ) ;

GridBagLayout g b l 2 = new GridBagLayout ( ) ; p a n e l . s e t V i s i b l e ( t r u e ) ; p a n e l . s e t L a y o u t ( g b l 2 ) ;

G r i d B a g C o n s t r a i n t s c2=new G r i d B a g C o n s t r a i n t s ( ) ;

// V e r t i c a l S c r o l l b a r c2 . g r i d x =0; c2 . g r i d y =0; c2 . g r i d w i d t h =1; c2 . a n c h o r=G r i d B a g C o n s t r a i n t s . EAST ; c2 . f i l l =G r i d B a g C o n s t r a i n t s . VERTICAL ; g b l 2 . addLayoutComponent ( y S c r o l l , c2 ) ; p a n e l . add ( y S c r o l l ) ;

// Image Canvas c2 . g r i d x =1; c2 . g r i d y =0; c2 . g r i d w i d t h =10; c2 . a n c h o r=G r i d B a g C o n s t r a i n t s .WEST; g b l 2 . addLayoutComponent ( i c , c2 ) ; p a n e l . add ( i c ) ;

// P l a c e h o l d e r

J L a b e l p l a c e h o l d e r 2 = new J L a b e l ( " " ) ; c2 . g r i d w i d t h =1; c2 . g r i d x =0; c2 . g r i d y =1; g b l 2 . addLayoutComponent ( p l a c e h o l d e r 2 , c2 ) ; p a n e l . add ( p l a c e h o l d e r 2 ) ;

// H o r i z o n t a l S c r o l l b a r c2 . a n c h o r=G r i d B a g C o n s t r a i n t s .WEST; c2 . g r i d w i d t h =10; c2 . g r i d x =1; c2 . g r i d y =1; c2 . f i l l =G r i d B a g C o n s t r a i n t s .HORIZONTAL; g b l 2 . addLayoutComponent ( x S c r o l l , c2 ) ; p a n e l . add ( x S c r o l l ) ; p a n e l . v a l i d a t e ( ) ; p a n e l . updateUI ( ) ; c . g r i d x = 0 ; c . g r i d y = 1 3 ; c . g r i d w i d t h=G r i d B a g C o n s t r a i n t s .REMAINDER;

104

g b l . addLayoutComponent ( p a n e l , c ) ; frame . add ( p a n e l ) ;

// e x t r a s p a c e

J L a b e l s p a c e=new J L a b e l ( " " ) ; c . g r i d x = 0 ; c . g r i d y = 1 4 ; g b l . s e t C o n s t r a i n t s ( s p a c e , c ) ; frame . add ( s p a c e ) ;

// E x i t c . g r i d w i d t h = G r i d B a g C o n s t r a i n t s .REMAINDER; c . g r i d x = 0 ; c . g r i d y = 1 5 ; g b l . s e t C o n s t r a i n t s ( e x i t , c ) ; frame . add ( e x i t ) ; s t a r t . a d d A c t i o n L i s t e n e r ( new S t a r t L i s t e n e r ( ) ) ; s t o p . a d d A c t i o n L i s t e n e r ( new S t o p L i s t e n e r ( ) ) ; update . a d d A c t i o n L i s t e n e r ( new U p d a t e L i s t e n e r ( ) ) ; e x i t . a d d A c t i o n L i s t e n e r ( new E x i t L i s t e n e r ( ) ) ; x S c r o l l . a d d A d j u s t m e n t L i s t e n e r ( new s c r o l l L i s t e n e r ( ) ) ; y S c r o l l . a d d A d j u s t m e n t L i s t e n e r ( new s c r o l l L i s t e n e r ( ) ) ; frame . pack ( ) ; frame . s e t V i s i b l e ( t r u e ) ;

// S e t up p l o t s p l o t . s e t M a r k s S t y l e ( " p o i n t s " ) ; p l o t . addLegend ( 1 , " I n p u t " ) ; p l o t . addLegend ( 2 , " Output " ) ; p l o t . s e t X L a b e l ( " Time ( ms ) " ) ; p l o t . s e t Y L a b e l ( " V o l t a g e (V) " ) ; temp_plot . s e t M a r k s S t y l e ( " p o i n t s " ) ; temp_plot . addLegend ( 1 , "Temp" ) ; temp_plot . s e t X L a b e l ( " Time ( ms ) " ) ; temp_plot . s e t Y L a b e l ( " Temperature (C) " ) ; p l o t . setYRange ( − 2 . 5 , 2 . 5 ) ;

// temp_plot . setYRange ( 2 0 , 6 0 ) ;

// temp_plot . s e t X P e r s i s t e n c e ( 5 0 ) ; p l o t . s e t X P e r s i s t e n c e ( 6 0 0 ) ;

105

g b l . l a y o u t C o n t a i n e r ( frame ) ; h e l p f r a m e=new JFrame ( ) ; h e l p f r a m e . s e t T i t l e ( " Help " ) ;

J L a b e l i m a g e l a b e l = new J L a b e l ( new ImageIc on ( g e t C l a s s ( ) .

g e t R e s o u r c e ( " h e l p f r a m e . png " ) ) ) ; h e l p f r a m e . getContentPane ( ) . add ( i m a g e l a b e l ) ; h e l p f r a m e . s e t S i z e ( 6 0 0 , 5 0 0 ) ; h e l p f r a m e . pack ( ) ; h e l p f r a m e . s e t V i s i b l e ( f a l s e ) ;

} p u b l i c v o i d s t a r t ( ) { i f ( dataThread == n u l l ) { dataThread = new Thread ( t h i s ) ; dataThread . s t a r t ( ) ;

// run ( ) ;

} i f ( imageThread==n u l l ) { imageThread=new imageThread ( t h i s ) ; imageThread . s t a r t ( ) ;

}

} p u b l i c v o i d s t o p ( ) { dataThread = n u l l ;

} p u b l i c v o i d d e s t r o y ( ) {

} p u b l i c v o i d run ( ) { w h i l e ( dataThread != n u l l ) { i f ( ! u s e P a r a m e t e r s && ! t o k e n . g e t T e x t ( ) .

isEmpty ( ) ) { couponPasskey = t o k e n . g e t T e x t ( ) ;

} p a r s e ( ) ;

106

/ * t r y {

// Get d a t a p a r s e ( ) ;

// Check coupon d a t a i f V a l i d − c r e a t e t o k e n

// URL o r a c l e = new URL( " h t t p : / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / s t r e a m / IWLstreaming / t o k e n="+ couponPasskey ) ;

// Get Stream

S t r i n g r e s p = r e s t . RestGet . RestMethod ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / s t r e a m / IWLstreaming / t o k e n="

+ couponPasskey ) ; i f ( r e s p != n u l l && r e s p . c o n t a i n s ( " , " ) ) { t r y {

S t r i n g [ ] p o i n t s = n u l l ;

S t r i n g [ ] v a l u e = n u l l ;

S t r i n g [ ] d a t a = r e s p . s p l i t ("< Value >") ;

} i f ( d a t a . l e n g t h > 1 ) { v a l u e = d a t a [ 1 ] . s p l i t ("</ Value >") ;

} i f ( v a l u e != n u l l && v a l u e . l e n g t h > 1 ) { p o i n t s = v a l u e [ 0 ] . s p l i t ( " , " ) ;

// S p l i t s t r e a m r e s p o n s e i n t o p i x e l v a l u e s i f ( p o i n t s . l e n g t h == 8 1 9 2 0 ) {

// System . out . p r i n t l n ( p o i n t s . l e n g t h ) a r r a y imageData [ i ] = new C o l o r ( a r r [ 0 ] , a r r [ 1 ] , a r r [ 2 ] ) . getRGB ( ) ;

}

} e l s e {

// Image i s b l a n k o t h e r w i s e

A r r a y s . f i l l ( imageData , 0 ) ;

}

} c a t c h ( E x c e p t i o n e ) {

System . out . p r i n t l n ( " e r r o r i n r e a d image " )

;

System . out . p r i n t l n ( r e s p ) ;

}

; f o r ( i n t i = 0 ; i < 8 1 9 2 0 ; i ++) {

S t r i n g p = p o i n t s [ i ] ; i n t y = I n t e g e r . v a l u e O f ( p ) ; i n t [ ] a r r = c o n v e r t ( y ) ;

// P l a c e RGB v a l u e s i n t o image

107

}

} c a t c h ( MalformedURLException ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

} c a t c h ( IO E xc ep t io n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

} r e p a i n t ( ) ;

* /

}

// } // end keepRunning

} p u b l i c v o i d p a r s e ( ) { t r y {

// System . out . p r i n t l n ( " oh come on " ) ;

// Get d a t a s t r i n g

S t r i n g s = getData ( ) . r e p l a c e A l l ("&" , " " ) ; i f ( s . c o n t a i n s ( " T e m p e r a t u r e l t " ) ) {

S t r i n g temp = s . s p l i t ( " T e m p e r a t u r e l t " ) [ 1 ] . s p l i t ( "

V a l g t ; " ) [ 1 ] . s p l i t ( " l t " ) [ 0 ] ;

S t r i n g i n p = s . s p l i t ( " I n p u t V l t " ) [ 1 ] . s p l i t ( " V a l g t

; " ) [ 1 ] . s p l i t ( " l t " ) [ 0 ] ;

S t r i n g out = s . s p l i t ( " OutputVlt " ) [ 1 ] . s p l i t ( " V a l g t

; " ) [ 1 ] . s p l i t ( " l t " ) [ 0 ] ;

//

// System . out . p r i n t l n ( i n p + " " + out + " " + temp

) ; l o n g currTime = System . c u r r e n t T i m e M i l l i s ( ) ;

System . out . p r i n t l n ( s a v i n g ) ;

// i f ( s a v i n g ) {

System . out . p r i n t l n ( " s a v i n g " ) ; s a v e . add ( ( currTime − s t a r t T i m e ) +","+ i n p +","+ out

//

+","+temp ) ;

}

BigDecimal t = new BigDecimal ( ( currTime − s t a r t T i m e ) / 1 0 0 0 ) ; x v a l u e s . add ( currTime − s t a r t T i m e ) ;

// I f t h e v a l u e s c o n t a i n E , u s u a l l y t h e y a r e 1 e − 15 o r so , s o s i m p l i f y t o 0 ;

108

i f ( i n p . c o n t a i n s ( "E" ) ) { p l o t . addPoint ( 1 , currTime − s t a r t T i m e , 0 , t r u e ) ;

} e l s e { p l o t . addPoint ( 1 , currTime − s t a r t T i m e , Double

. v a l u e O f ( i n p ) , t r u e ) ;

} i f ( out . c o n t a i n s ( "E" ) ) { p l o t . addPoint ( 2 , currTime − s t a r t T i m e , 0 , t r u e ) ;

} e l s e { p l o t . addPoint ( 2 , currTime − s t a r t T i m e , Double

. v a l u e O f ( out ) , t r u e ) ;

}

} e l s e { temp_plot . addPoint ( 1 , currTime − s t a r t T i m e ,

Double . v a l u e O f ( temp ) , t r u e ) ;

} i f ( temp . c o n t a i n s ( "E" ) ) { temp_plot . addPoint ( 1 , currTime − s t a r t T i m e ,

0 , t r u e ) ;

// Keep o n l y 50 p o i n t s t o k e p t t h e waveforms from b e i n g c o m p r e s s e d i f ( r e s e t C o u n t e r > 1 0 0 ) { p l o t . e r a s e P o i n t ( 1 , 0 ) ; p l o t . e r a s e P o i n t ( 2 , 0 ) ;

// p l o t . setYRange ( 0 , 5 ) ; x v a l u e s . remove ( 0 ) ; temp_plot . e r a s e P o i n t ( 1 , 0 ) ; ; d o u b l e min=C o l l e c t i o n s . min ( x v a l u e s ) ; d o u b l e max=C o l l e c t i o n s . max ( x v a l u e s ) ; temp_plot . setXRange ( min , max) ; p l o t . setXRange ( min , max) ;

} r e s e t C o u n t e r ++;

}

} c a t c h ( IO Ex c ep t io n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g ( L e v e l .

SEVERE, n u l l , ex ) ;

}

109

}

/ * r e p a i n t ( ) ; t r y {

Thread . s l e e p ( 1 0 0 0 ) ;

} c a t c h ( I n t e r r u p t e d E x c e p t i o n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g ( L e v e l .

SEVERE, n u l l , ex ) ;

} * /

/ **

* c o n v e r t t a k e s a g r a y s c a l e v a l u e (0 − 255) and r e t u r n s a RGB v a l u e

* @param x

* @return

* / p u b l i c i n t [ ] c o n v e r t ( i n t x ) { i n t [ ] rgb = new i n t [ 3 ] ; i f ( x < 0 ) { rgb [ 0 ] = 0 ; rgb [ 1 ] = 0 ; rgb [ 2 ] = 0 ;

} e l s e i f ( x < 6 4 ) { rgb [ 0 ] = 0 ; rgb [ 1 ] = 0 ; rgb [ 2 ] = x * 4 ;

} e l s e i f ( x < 1 2 8 ) { rgb [ 0 ] = 0 ; rgb [ 1 ] = ( x − 6 4 ) * 4 ; rgb [ 2 ] = 2 5 5 ;

} e l s e i f ( x < 1 9 2 ) { rgb [ 0 ] = 0 ; rgb [ 1 ] = 2 5 5 ; rgb [ 2 ] = ( x − 1 2 8 ) * 4 ;

} e l s e { rgb [ 0 ] = ( x − 1 9 2 ) * 4 ; rgb [ 1 ] = ( 2 5 5 − x ) * 4 ; rgb [ 2 ] = 0 ;

} r e t u r n rgb ;

} p u b l i c v o i d p a i n t ( G r a p h i c s g ) {

//Draw a R e c t a n g l e around t h e a p p l e t ’ s d i s p l a y a r e a .

g . drawRect ( 0 , 0 ,

110

getWidth ( ) − 1 , g e t H e i g h t ( ) − 1 ) ;

//Draw imageData p i x e l v a l u e s on image Canvas

Image p i c = c r e a t e I m a g e ( new MemoryImageSource ( 3 2 0 , 2 5 6 , imageData , 0 , 3 2 0 ) ) ; i c . g e t G r a p h i c s ( ) . drawImage ( p i c , 0 , 0 , 3 2 0 , 2 5 6 , i c ) ;

//Draw r e c t a n g l e o f h o t s p o t i n t xpos = x S c r o l l . g e t V a l u e ( ) ; i n t ypos = y S c r o l l . g e t V a l u e ( ) ; i c . g e t G r a p h i c s ( ) . drawRect ( xpos − 3 , ypos − 3 , 9 , 9 ) ; p l o t . r e p a i n t ( ) ; temp_plot . r e p a i n t ( ) ;

} p u b l i c S t r i n g getData ( ) t h r o w s IO E xc e pt i on {

// C a l l web s e r v i c e f o r d a t a

// System . out . p r i n t l n ( " getData " ) ;

S t r i n g r e s p = r e s t . R e s t P o s t . r e s t M e t h o d ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / IWL/IWLdata/ t o k e n=" + couponPasskey

) ; r e t u r n r e s p ;

} c l a s s S t a r t L i s t e n e r i mp le me nt s A c t i o n L i s t e n e r { p u b l i c v o i d a c t i o n P e r f o r m e d ( A ct i on E ve n t e v e n t ) {

//On s t a r t , c a l l web s e r v i c e f o r l a b s t a r t t r y {

S t r i n g r e s p = r e s t . R e s t P o s t . r e s t M e t h o d ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / IWL/IWLmgt/ s t a r t , t o k e n=" + couponPasskey ) ;

// s t a r t ( ) ;

//

System . out . p r i n t l n ( r e s p ) ; addItem ( r e s p ) ;

} c a t c h ( IO Ex c ep t io n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

}

}

}

111

c l a s s S t o p L i s t e n e r i mp le me nt s A c t i o n L i s t e n e r { p u b l i c v o i d a c t i o n P e r f o r m e d ( A ct i on E ve n t e v e n t ) { t r y {

// Stop l a b , and s t o p g a t h e r i n g d a t a dataThread=n u l l ;

S t r i n g r e s p = r e s t . R e s t P o s t . r e s t M e t h o d ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / IWL/IWLmgt/ s t o p , t o k e n=" + couponPasskey ) ;

} c a t c h ( IO E xc ep t io n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

}

}

} c l a s s U p d a t e L i s t e n e r i mp le me nt s A c t i o n L i s t e n e r { p u b l i c v o i d a c t i o n P e r f o r m e d ( A ct i on E ve n t e v e n t ) {

// Get c u r r e n t v a l u e s o f v a r i o u s f i e l d s , send t o web s e r v i c e d o u b l e amp = Double . v a l u e O f ( a m p l i t u d e . g e t T e x t ( ) ) ; d o u b l e f r e q = Double . v a l u e O f ( f r e q u e n c y . g e t T e x t ( ) ) ; d o u b l e o f f = Double . v a l u e O f ( o f f s e t . g e t T e x t ( ) ) + 2 . 5 ; i n t t y p e = chooseOut . g e t S e l e c t e d I n d e x ( ) ; i n t xpos = x S c r o l l . g e t V a l u e ( ) ; i n t ypos = y S c r o l l . g e t V a l u e ( ) ;

S t r i n g t = t o k e n . g e t T e x t ( ) ; d o u b l e duty=Double . v a l u e O f ( d u t y C y c l e . g e t T e x t ( ) ) ; t r y {

S t r i n g r e s p = r e s t . R e s t P o s t . r e s t M e t h o d ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / IWL/ I W L c o n t r o l s / u s e r C o n t r o l s=Amplitude=" + amp + " ! Freq=" + f r e q + " ! O f f s e t =" + o f f + " ! Type=" + t y p e+ " !

Xpos=" + xpos + " ! Ypos=" + ypos + " ! DutyCycle

="+ duty+ " ! , t o k e n=" + couponPasskey ) ;

} c a t c h ( IO E xc ep t io n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

}

}

} c l a s s s c r o l l L i s t e n e r im pl em en ts A d j u s t m e n t L i s t e n e r {

112

p u b l i c v o i d adjustmentValueChanged ( AdjustmentEvent e ) {

//When s c r o l l i n g , s end updated v a l u e s t o web s e r v i c e d o u b l e amp = Double . v a l u e O f ( a m p l i t u d e . g e t T e x t ( ) ) ; d o u b l e f r e q = Double . v a l u e O f ( f r e q u e n c y . g e t T e x t ( ) ) ; d o u b l e o f f = Double . v a l u e O f ( o f f s e t . g e t T e x t ( ) ) + 2 . 5 ; i n t t y p e = chooseOut . g e t S e l e c t e d I n d e x ( ) ; i n t xpos = x S c r o l l . g e t V a l u e ( ) ; i n t ypos = y S c r o l l . g e t V a l u e ( ) ; d o u b l e duty=Double . v a l u e O f ( d u t y C y c l e . g e t T e x t ( ) ) ;

S t r i n g t = t o k e n . g e t T e x t ( ) ; t r y {

S t r i n g r e s p = r e s t . R e s t P o s t . r e s t M e t h o d ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / IWL/ I W L c o n t r o l s / u s e r C o n t r o l s=Amplitude=" + amp + " ! Freq=" + f r e q + " ! O f f s e t =" + o f f + " ! Type=" + t y p e+ " !

Xpos=" + xpos + " ! Ypos=" + ypos + " ! DutyCycle

="+ duty+ " ! , t o k e n=" + couponPasskey ) ;

} c a t c h ( IO Ex c ep t io n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

}

}

}

// c l a s s S a v e L i s t e n e r i mp le me nt s A c t i o n L i s t e n e r { p u b l i c s a v e L i s t e n e r ( p a r e n t p ) { p u b l i c v o i d a c t i o n P e r f o r m e d ( A ct i on E ve n t e v e n t ) { f i n a l J F i l e C h o o s e r f c = new J F i l e C h o o s e r ( ) ; i n t r e t u r n V a l = f c . showOpenDialog ( frame ) ; i f ( r e t u r n V a l == J F i l e C h o o s e r .APPROVE_OPTION) { s a v e f i l e = f c . g e t S e l e c t e d F i l e ( ) ;

System . out . p r i n t l n ( " s a v e " ) ; s t a r t S a v e ( ) ; s a v i n g=t r u e ;

}

}

} c l a s s S t o p S a v e L i s t e n e r im pl em en ts A c t i o n L i s t e n e r {

// p u b l i c s a v e L i s t e n e r ( p a r e n t p ) { p u b l i c v o i d a c t i o n P e r f o r m e d ( A ct i on E ve n t e v e n t ) {

113

System . out . p r i n t l n ( " s t o p " ) ; i f ( s a v e f i l e != n u l l ) { t r y {

B u f f e r e d W r i t e r bw=new B u f f e r e d W r i t e r ( new

F i l e W r i t e r ( s a v e f i l e ) ) ; bw . w r i t e ( " Thermal Lab d a t a \ r \n " ) ; bw . w r i t e ( " Time , I n p u t V o l t a g e , Output V o l t a g e

, Temperature \ r \n " ) ; s a v i n g=f a l s e ; f o r ( S t r i n g s : s a v e ) { bw . w r i t e ( s +"\ r \n " ) ;

} bw . f l u s h ( ) ; bw . c l o s e ( ) ;

} c a t c h ( IO Ex c ep t io n ex ) {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

}

}

}

} c l a s s H e l p L i s t e n e r im pl em en ts A c t i o n L i s t e n e r { p u b l i c v o i d a c t i o n P e r f o r m e d ( A ct i on E ve n t e v e n t ) {

System . out . p r i n t l n ( " h e l p " ) ; h e l p f r a m e . s e t V i s i b l e ( t r u e ) ;

}

} c l a s s E x i t L i s t e n e r im pl em en ts A c t i o n L i s t e n e r {

// Stop l a b , t h e n e x i t p u b l i c v o i d a c t i o n P e r f o r m e d ( A ct i on E ve n t e v e n t ) { s t o p ( ) ; t r y {

S t r i n g r e s p = r e s t . R e s t P o s t . r e s t M e t h o d ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / IWL/IWLmgt/ s t o p , t o k e n=" + couponPasskey ) ;

} c a t c h ( IO Ex c ep t io n ex ) {

} t r y {

L o g g e r . g e t L o g g e r ( C l i e n t . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ; frame . s e t V i s i b l e ( f a l s e ) ;

114

keepRunning = f a l s e ; frame . d i s p o s e ( ) ;

} c a t c h ( E x c e p t i o n e ) {

System . out . p r i n t l n ( e . g e t M e s s a g e ( ) ) ;

}

}

} c l a s s imageThread e x t e n d s Thread {

C l i e n t a ; // Thread n e e d s t o know t h e a p p l e t . . .

// C o n s t r u c t o r s i m p l y s t o r e s t h e a p p l e t t o p a i n t . . .

p u b l i c imageThread ( C l i e n t a ) { t h i s . a = a ;

}

// Run t h e t h r e a d . L i n e s e v e r y w h e r e !

p u b l i c v o i d run ( ) { w h i l e ( a . dataThread != n u l l ) {

// System . out . p r i n t l n ( " r u n n i n g " ) ; t r y {

S t r i n g r e s p = r e s t . RestGet . RestMethod ( " h t t p

: / / 1 8 . 2 8 . 1 . 2 7 : 8 0 8 1 / s t r e a m / IWLstreaming / t o k e n=" + a

. couponPasskey ) ; i f ( r e s p != n u l l && r e s p . c o n t a i n s ( " , " ) ) { t r y {

S t r i n g [ ] p o i n t s = n u l l ;

S t r i n g [ ] v a l u e = n u l l ;

S t r i n g [ ] d a t a = r e s p . s p l i t ("< Value >") ;

} i f ( d a t a . l e n g t h > 1 ) { v a l u e = d a t a [ 1 ] . s p l i t ("</ Value >") ;

} i f ( v a l u e != n u l l && v a l u e . l e n g t h > 1 ) { p o i n t s = v a l u e [ 0 ] . s p l i t ( " , " ) ;

// S p l i t s t r e a m r e s p o n s e i n t o p i x e l v a l u e s i f ( p o i n t s . l e n g t h == 8 1 9 2 0 ) {

// System . out . p r i n t l n ( p o i n t s . l e n g t h ) ; f o r ( i n t i = 0 ; i < 8 1 9 2 0 ; i ++) {

S t r i n g p = p o i n t s [ i ] ; i n t y = I n t e g e r . v a l u e O f ( p ) ; i n t [ ] a r r = c o n v e r t ( y ) ;

// P l a c e RGB v a l u e s i n t o image a r r a y a . imageData [ i ] = new C o l o r ( a r r [ 0 ] , a r r [ 1 ] , a r r [ 2 ] ) . getRGB ( ) ;

115

}

}

}

}

}

}

} e l s e {

// Image i s b l a n k o t h e r w i s e

A r r a y s . f i l l ( a . imageData , 0 ) ;

}

} c a t c h ( E x c e p t i o n e ) {

System . out . p r i n t l n ( " e r r o r i n r e a d image " ) ;

System . out . p r i n t l n ( r e s p ) ;

}

// S l e e p some . . .

t r y { s l e e p ( 1 0 0 ) ;

} c a t c h ( I n t e r r u p t e d E x c e p t i o n e ) { }

} } c a t c h ( I O Ex c ep t io n ex ) {

L o g g e r . g e t L o g g e r ( imageThread . c l a s s . getName ( ) ) . l o g (

L e v e l . SEVERE, n u l l , ex ) ;

116

Appendix B

Lab Server Config File

[ L a b S e r v e r ]

LabServerBasePath = "C: \ \ U s e r s \\ mitadm \\ Documents \\ELSA" p a s s k e y = "/C/ U s e r s /mitadm/ Documents /ELSA/1 _Experiments /

I R e x p L e t i t i a / f i l e s / IRLabExperimentConfig . i n i "

UTCtimeZoneInHours = " − 5" t e m p F i l e s D a y s O f L i f e t i m e = "60"

I n i t i a l P a s s k e y = "IWLL"

L a b S e r v e r P r o c e s s A g e n t = "E34 − 300LL"

DomainCredentials_ISB_ProcessAgent = ""

DomainCredentials_ISB_InCoupon = ""

DomainCredentials_ISB_OutCoupon = ""

[ ISAasmxPages ]

S e r v i c e B r o k e r A s m x = " h t t p : / / i l a b s d e v . mit . edu / i l a b S e r v i c e B r o k e r / i l a b S e r v i c e B r o k e r . asmx"

ExpStorageServiceAsmx = " h t t p : / / i l a b s d e v . mit . edu /

E x p e r i m e n t S t o r a g e / E x p e r i m e n t S t o r a g e . asmx"

[ Experiment ] e x p e r i m e n t C o n f i g F i l e = "C: \ \ U s e r s \\ mitadm \\ Documents \\ELSA\\1

_Experiments \\ I R e x p L e t i t i a \\ f i l e s \\ IRLabExperimentConfig . i n i "

117

118

Appendix C

Experiment Config File

[ E x p e r i m e n t I n s t a l l I n f o ] expName = "IRLab Experiment " basePath = "C: \ U s e r s \mitadm\ Documents \ELSA\1 _Experiments \

I R e x p L e t i t i a \ f i l e s "

T o p V I f u l l P a t h = "C: \ U s e r s \mitadm\ Documents \ELSA\1 _Experiments \

I R e x p L e t i t i a \ f i l e s \ IRlab_soap . v i " computerIP = " 1 8 . 2 8 . 1 . 2 7 " t e m p F i l e s D a y s O f L i f e t i m e = 10

[ E x p e r i m e n t V a r i a b l e s ] expCommands = " Amplitude , O f f s e t , DutyCycle , Freq , Type , Xpos , Ypos ,

Stream " numberOfCommands = 8 expOutputs = " InputV , OutputV , Temperature " numberOfOutputs = 3 expOption = " Use S i m u l a t e d P l a n t "

119

120

Bibliography

[1] del Alamo cited for creating iLabs as recipient of 2012 EDS Education Award.

MIT

EECS Announcements , January 2013.

[2] A. Agarwal and J. Lang.

Foundations of Analog and Digital Electronic Circuits . The

Morgan Kaufmann Series in Computer Architecture and Design. Morgan Kaufmann,

San Francisco, California, first edition.

[3] P. Bailey. The iLabs Shared Architecture and the Future of Web-based Laboratory

Experiments., September 2014.

[4] B. Cukalovic. MIT Integrated Microelectronics Device Experimentation and Simulation iLab. Master’s thesis, Massachusetts Institute of Technology, 2006.

[5] D-Link. HTML for Embedding Camera Feed in Web Page, September 2014.

[6] J. del Alamo. iLabs: Laboratories Without Frontiers. Aug 2013.

[7] FLIR Systems. FLIR ThermoVision LabVIEW Toolkit, December 2013.

[8] FLIR Systems. FLIR Tools for PC and Mac, September 2013.

[9] S. Gikandi. ELVIS iLab: A Flexible Platform for Online Laboratory Experiments in

Electrical Engineering. Master’s thesis, Massachusetts Institute of Technology, 2006.

[10] J.D. Hardison. The Microelectronics Weblab 6.0 –An Implementation Using Web

Services and the iLab Shared Architecture.

Exploring Innovation in Education and

Research , 2005.

[11] C. Horstmann and G. Cornell.

Core Java 2 . The Sun Microsystems Press Java Series.

Prentice Hall, 5 edition, Dec 2000.

[12] National Instruments. How Many Clients Can View or Control a Remote Front Panel with my LabVIEW License?, May 2013.

[13] National Instruments. Introduction to NI LabVIEW., October 2013.

[14] National Instruments. Remote Panels in LabVIEW – Distributed Application Development, February 2013.

[15] National Instruments. Troubleshooting GigE Vision Cameras, May 2013.

121

[16] National Instruments. NI ELVIS, November 2014.

[17] J. Gagnon. RSTP Streaming, October 2013.

[18] Massachusetts Institute of Technology. 6.01 Design Lab, 2008.

[19] L. Mendes. ELSA –Experiment Lab Server Architecture.

[20] National Instruments. Acquiring from GigE Vision Cameras with Vision Acquisition

Software - Part II, July 2013.

[21] National Instruments. Unable to load camera’s XML file, 2014.

[22] Oracle. A Visual Guide to Layout Managers, 2015.

[23] Stack Overflow. How do I create a pseudo-color image in C++, October 2010.

[24] A. Rodgriguez. RESTful Web Services: The Basics, November 2008.

122