Lab 14
Data Acquisition

In this exercise you will use your serial communication expertise to create LabVIEW™ VIs that will be used to collect digital data in Lab 15.

I.    Create a Nanoammeter VI

Use serialcom.vi to create a VI that will read and display the status of your nanoammeter’s digital data lines (DB8-DB1) and the corresponding current (in nanoamperes) using your digital calibration parameters from Lab 10. Display the op-amp output with its corresponding ADC value and the Blue Earth digital controller response. A control should be available to set the serial port number. See Figure 1 and Figure 2


Figure 1. Front Panel Example (Nanoammeter VI)



Figure 2. Blue Earth Digital Controller Commands

II.    Add Accouterments

Create an icon and wire the controls and indicators to a connector pane. See Figure 3.


Figure 3. Example Icon and Connector Pane

III.    Test Your Nanoammeter VI

Test your nanoammeter by setting each of the eight data lines. Open serialcom.vi. Run the VI using the following commands to generate a simulated input current of 304 nA:

  1. Bit179=0\r

  2. Bit178=1\r

  3. Bit149=0\r

  4. Bit148=0\r

  5. Bit147=1\r

  6. Bit146=1\r

  7. Bit145=0\r

  8. Bit144=0\r

Open and run your nanoammeter VI. Examine each indicator. See Figure 4.


Figure 4. Nanoammeter Test

Notice that the op-amp output does not correspond to the simulated current of 304 nA. Why?  Save your nanoammeter VI in the CEsoftware folder (as Read Nanoammeter.vi).

IV.    Create a Data Collection VI

Create a data collection VI that will read a current from your nanoammeter and the corresponding voltage. Save the current and the voltage in a spreadsheet file.

Add 4 digital indicators to the front panel to display the Current (nA), the Voltage, the ADC reading and the Op-Amp output of your nanoammeter. Add a digital control to set the Serial Port and a Boolean switch to select a voltage scale factor of 1 or 1000. Position its Boolean Text over the switch to display the scale factor. Add a Boolean button to Enter the current and the voltage and a Boolean button to Quit data collection and save the data in a spreadsheet file. See Figure 5.


Figure 5. Data Collection VI Front Panel

The VI diagram will require a Sequence Structure with 3 Frames. Frame 0 should contain access the Enter and Quit buttons. The current should be read in Frame 1 using your nanoammeter VI. The corresponding voltage from an external device should be read in Frame 2 using the VI you created in Lab 13.

The VI should remain in Frame 0 until the Enter button is clicked. When the Quit button is clicked the VI should write the voltage and current data to a spreadsheet file (using the VI you created in Exercise 13 of GTutorial) and halt execution. See Figure 6.


Figure 6. Data Collection VI Diagram

V.    Test Your Data Collection VI

Open and run your data collection VI. Click the Enter button several times to collect several identical readings. See Figure 7.


Figure 7. Test (Data Collection VI)

Click the Quit button. Enter a name and a location for the spreadsheet file at the prompt. Open the spreadsheet file in a suitable application to verify that the data was recorded correctly. Save your data collection VI in the CEsoftware folder (as: Collect Digital Data.vi).

If you do not see the readings shown in Figure 7 use serialcom.vi to reset the 8 data lines using the procedure outlined in Section II.

VI.    Finish Up

In preparation for Lab 15, open serialcom.vi and click the simulation switch to its OFF position. From LabVIEW’s menu bar make the current values default. Save serialcom.vi. This will enable RS-232 data communication using LabVIEW serial VIs. See Figure 8.


Figure 8. RS-232 Data Communication

Quit LabVIEW™ and save the changes you made to your VIs.

VII.    Homework Assignment

Update your lab notebook to include this exercise and questions raised in class.

Complete your VIs. They will be needed for data collection in Lab 15.

Read the next laboratory exercise.