# Lab bench
## Problem Statement (Finish description)

Existing Lab Hardware and Software Problem .. don't connect to each other
Today software and hardware from one vendor dominates educational institutions. Students are trained through labs to use this equipment. But there are drawbacks:
no community of users on the internet
constantly being updated requiring constant purchase/constant obsolescence
no easy interconnect with other vendors
never will be seen again because industry doesn't use it
can not put on resume to get summer jobs
How is LabView sold to an Educational Institution?
To convince educational institutions to change, the goal is to:
show solutions that embrace emerging technology .. new
solutions that maintain the ... old
use test equipment in a remote lab .. borrowed
connect emerging open source hardware ... blue
If implemented poorly, LabView is compared to a procedural language such as Java, C, etc. In reality LabView is teaching the world how to program parallel CPU's ... and computers computers. It's only competitor is MathWork's Simulink.
Connect everything
LabView is used to run the Large Hadron Collider. It is used by Space X for mission control .. coordinating activity all over the earth. launch rockets It essentially creates an operating system on top of all computers and lab equipment.
It can collect data and respond by activating output devices. It potentially could connect every piece of lab equipment in a school or company automating all repetitive scientific/engineering processes. It also provides a common, easy to learn, graphical mechanism to do all this.
Our Kids are learning it
LabView is found in everything from children's toys (Lego NXT mindstorm), High School First Robotics Competitions to PC based electrical engineering test equipment (Digilent).
The point is that are kids are learning this software indirectly. Industry wants direct experience with the product. :

## Conceive

What we have works .. but not really
Most institutions are full of equipment that comes with it's own drivers, it's own programming environment and it's own "family" of add on products. The term for this is "stove pipe or silo". The goal is to find examples of things that can not be done with independent technologies. Example silos or stove pipes include:
Vernier hardware and software
Xbox kinect and controllers
Arduino and its IDE
AR drone and cell phone flight controllers
Leap Motion and it's driving software
Lab View is a Real Time Operating System
The goal is to break up these silo's by connecting them through common software to each other. For example connect an arudino to a veriner logic gate. Connect a Leap Motion to DR drone.
LabView is an operating system that evolved out of the real-time world. Real time operating systems were used to collect data from experiments without dropping any data. Today they coordinate many computers through high speed networks so that data is not lost.
LabView runs on PC's to coordinate devices hooked up through a network. When the speed is not fast enough, the PC's themselves can be replaced with specialized hardware and the networks can be upgraded to Gigabit Ethernet.
LabView is software from a company called National Instruments
LabView connects input to output devices and collects data from computers.
In the past this software required dedicated computers
The programs are called VI's (Virtual Instruments)
VI stands for virtual instrument. It is a dataflow programming language that has it's roots in a 1960 paper called a "Block diagram Computer" and is very similar to VHDL which is taught in FPGA class. Most software allows just one execution path through it's code. This type of programming allows things to happen in parallel.
The result of a VI is something that looks like a flight simulator or oscilloscope simulator .. a screen with lots of virtual knobs and guages that help control, collect data and visualize results .. a virtual customized instrument panel. :

## Design

What can be done with LabView, that can't be done now?
The goal is to use existing equipment within an institution that is lying around unused and connect it all with LabView. This is similar to how Wordperfect began to connect all printers (1990-1995) before Microsoft moved printer drivers into the operating system and sold Word to everyone.
List of things to connect
This is the potential hardware to connect
Microphone in Laptop, use Lab View to start application when fingers are snapped
Arduino Motor shield, use Lab View to control motors
MIDI shield, use Lab View to play songs
LED array, use Lab View to blink lights
Kinect, use Lab View to interpret what the Kinect sees
Leap Motion, use Labview to interpret what the Leap Motion sees
DR Drone, use Lab View to control quad copter
Agilent MSO, collect data from it
iRobot, use Lab View to control it's motion
Digilent FPGA, Digilent Analog Discovery, Digilent Electronics Explorer
The Kinect could be used to control a quad copter through LabVIEW :

## Implement

Install the software
Download LabVIEW software from National Instruments
Create NI account and confirm in email
Get six month trial serial number
Download LabVIEW software
Activate six month trial
Learn the software
LabVIEW YouTube videos 0-10 recommended for general understanding
Trouble with The first tutorial?
How is he switching between front panel and block diagram?
Deleting unwanted items from block diagram and front panel; Video explanation
Play with Examples
Examples are found in the VIPM or VI Package Manager. It maintains a list of the example names which can be downloaded. If VIPM can not connect with the VI server, then go to Options->VI Server->Machine Access, add localhost to the list and just below it in Exported VIs, add * to that list.
XBOX Kinect
Connect LabVIEW to XBOX Kinect
Attach older version of Kinect to computer USB port
Check if computer is 32 or 64 bit
Download Kinect device driver software (SDK) (KinectSDK-v1.0-beta2-x86.msi for 32 bit,KinectSDK-v1.0-beta2-x64.msi for 64 bit)
Should now be able to open up sample games like the skeletal viewer and shape game
Now download the LabVIEW specific software for Kinect . This includes the VI Package Manager (VIPM) and the Kinect Toolkit
Turning off and on Arduino Uno onboard LED
Connect LabVIEW to Arduino UNO
Install Arduino environment
Search for and install the Arduino toolkit from the VI Package Manager
Follow steps in this video
May encounter error 5002.
Success
Flying AR drone
xbox controller was hooked to VI also
AR Drone
AR Drone Toolkit from LabVIEW website
video showing it work with LeapMotion & Kinect
Master's Thesis .. need to read
LabVIEW Hackerspace monitor this .. something useful may show up
The drone's VI revealed more features than cell phone control apps originally used to control flight
Hooked Xbox controller to lab view and controlled flight with it
Overview of VI's
Causing VI to launch notepad or calc on another computer
VI's can be used to connect programs. System Exec is a VI that can launch programs.NI's databases can be used to search for VI'S. VI's are created by connecting icons of other VI's. VI'S "Simple TCP" and "TCP Named Service" are good example VI's. Send continuously to work.
Here is how the above VI's were connected:
Block Diagram of Receiver Program
Block Diagram of Sender Program, Version 1
Block Diagram of Sender Program, Version 2
Opening Notepad and Other Programs
Notepad
LabVIEW System Exec VI
Copy VI program
Use for loop to open just one file, make boolean incidator true so file opens after program is run
Error message for trying to load a program with LabVIEW
Successful running of Notepad with LabVIEW
Other programs
Use same program as notepad
Type in "calc.exe" to open calculator
Connecting Laptop Microphone
"Snd Read Waveform.vi"
"Acquire Sound" function
Making a soundwave graph
Reading Data from Microsoft Kinect
Kinect for Windows has to be downloaded
Video of using depth capture and color video
https://www.youtube.com/watch?v=F-ipHd5g0Cw Video] of Vi Hiearchy and How to Clean them Up
Video of hooking up to VI
Microsoft has changed Kinect models. It is difficult to tell them apart. So far this is the test .. look at the ball joint:
The Kinect with the black tilt function does not work properly in LabVIEW
The Kinect with the mirrored tilt function works properly in LabVIEW
Counting Fingers with Leap Motion
Leap Motion looks at your fingers in the air. The VI software reveals more about what the Leap Motion controller is capable of than any of the corporate demos.
sample LeapMotion block diagram
Using "Unbundle by Name" was able to extract just one of the possibilities.
Video using LeapMotion to turn on a control panel button]
Failure to connect Lego Mindstorms NTX robots
Lego's forces purchase of their licensed version of LabView own program
Mathworks Simulink can.
LabView can not because Lego is preventing this.
The problem is not the company NI or the LabView community. The problem is Lego making their brick proprietary.
One brick has a problem with lines appearing on the display
People have fixed the problem.
Some tools may need to be purchased.
Lego service websites replacement for non-functioning parts.
iRobot Connection Status
The robot has as a USB port on it and it has a removable command module that also has a usb port on it. It has to infared walls that the robot will avoid and a charge it can locate, drive up, park and recharge itself.
Can get both USB cables to create a functioning device in the windows device driver window. But these were generic USB devices.
Next step is to download the Command Module software which was found in iRobot support. A Video overview of the LabView VI was made. :

## Demo

Presentation
Non-Engineers Oriented Presentation

## Next Steps

* Connect Lab View to Arduino Motor shield, use Lab View to control motors
* Connect Lab View to MIDI shield, use Lab View to play songs
* Connect Lab View to LED array, use Lab View to blink lights
* Connect Lab View to Agilent MSO, collect data from it
* Connect Lab View to iRobot, use Lab View to control it's motion
* Connect Lab View to Digilent FPGA, Digilent Analog Discovery, Digilent Electronics Explorer
* Use Kinnect and VI to do something similar to one of these videos:
** Virtual Watershed Table
** Augmented Reality Sandbox
** Virtual Dam Failure
** UC Davis web site
** Possible software starting point