Lab 4: Data Acquisition from a Function Generator

Setup

I began by forking 2012-Physics-308L-Lab-4 from stevekochscience at GitHub.com and then I cloned the repository to the desktop computer.

 

I then acquired the necessary hardware needed for measurements shown below.

USB-1208LS USB-based Analog and Digital I/O Module (Board Serial #163)

 

BK Precision 4017A 10MHz Sweep/Function Generator

 

Tektronix P2220 Voltage Probe

Final Setup

 

From here I needed to make sure the board was working and then determine the board number. To do this I located the program Instacal by first going to the start menu and then to the folder “measurement computing”. It gave me the board serial number as 163. Then I performed the Analog Test to determine that the board was indeed functional. As shown below it displayed the desired square wave when connected to the proper channels.

 

 

Program

Both the following programs were created while referencing the programs downloaded from Dr. Koch’s Lab 4 repository on GitHub. I also received additional help from Dr. Koch with the fine tuning of the program, especially on the latter of the two.

 

Point-by-Point VI

The goal of the first VI was create a program that would acquire one data point at a time from the function generator and then graph the output wave of the data.

The following are displays of the front panel and block diagram of this VI.

 

 Front Panel

 

Block Diagram

The above VI was fairly simple to create. Below are some screen shots of different frequency settings for the function generator. As can be see after about 5 Hz it gets increasingly more difficult to distinguish the waves from one another. This is due to the slow rate at which the data is sent from the measurement module to the computer across the USB cable. While reading over Paul’s notebook I learned that the actually frequency that it should be able to read is about 25 Hz. This can be determined from the Nyquist criterion f(sample)/2.

 

5 Hz

10 Hz

 

1062 Hz

 

Buffered VI

The second VI we created was meant to sample at much higher rate through the use of buffering. While creating the VI I ran into some difficulties acquiring data. This was determined to be the result of some wiring errors. I connected the range toggle hooked up to the rate input on AlnScFg.Vi and the opposite as well. Once this was corrected the VI performed as desired. Below are the screen shots for both the front panel and block diagram, as well as readings at different frequencies for the function generator. It is clear that this VI is much more capable at acquiring data at hire frequencies than the VI that sampled point by point.

 

 Front Panel

 

Block Diagram

4 Hz

 

551 Hz

1043 Hz