Datalogging in LabVIEW: Timed datalogging

A simple way to log data in LabView involves specifying a time interval between each measurement and the time interval over which the recording takes place.

For example, we could measure the sound level for 5 minutes, with an interval of 5 seconds between each measurement.

To set this up, first select the Log Data command from NXT Robotics > NXT I/O > Log Data:

NXIO_menu

Insert this command, and select Log Sound from the drop-down menu:

LOGdrop_down

Notice that the icon has a red background. That means we store the data in the red data set. But we also have a green and blue data sets available. They are located in the submenu complete > logging. They look like this:redgreenbluedatalogSo what do we mean with a red, green or blue data set? Well, when we log the data in this way the data is stored as a file on the NXT brick. If we use the red dataset the datas are saved in a file called RedData.dat, the green data set is saved in a file called GreenData.dat and the blue dataset, not surprisingly BlueData.dat. In addition, we need to configure our logging. We do this with the modifier parameters. We moves the mouse pointer over the lower left corner, right click and choose create constant. Now it looks like this:

datalogging settingsThe values given here are default values. ย We should have a measurement every 5 seconds for 5 minutes, that will be 300s (5min = 300s). We select the text tool and change the values

datalogocnfigured1

We must also choose the port where the sound sensor is connected. We hover up in the middle, right click and choose create constant:

datalogging configured

That’s it. We can now press run and run the program. During the datalogging, the data will be plotted on the NXT screen as shown below:

datagraph_1

We also get the latest measurement of the screen. In this case, the equal to 100, but it is important to be aware that this is not given in decibels, but decibels given as percentages.

The following two tabs change content below.
Svein-Tore Narvestad

Svein-Tore Narvestad

I have used LEGO Mindstorms as a teacher since 1999, and have used it widely. For example, to measure noise in kindergartens, to have the students create lemonade blenders using small pumps connected to the NXT, and in process control with industrial equipment: pneumatics, industrial sensors, etc.