LabView Basics 2 - Writing data to an excel file

Jason Street
9 Oct 201913:02

Summary

TLDRThis video tutorial demonstrates how to log temperature data from a DAC module into an Excel file. It covers the process of creating a shift register for tracking iterations, setting up data arrays for date, time, and temperature, and ensuring data is correctly recorded every second. Viewers learn about troubleshooting common issues, such as data format conversions and managing Excel's cell limitations. The tutorial emphasizes practical steps to effectively collect and store experimental data, making it an invaluable resource for anyone looking to automate data logging in their experiments.

Takeaways

  • 🔧 Using a DAC module, you can accurately measure temperature for data logging.
  • 📊 Data can be logged into an Excel file to keep track of experimental results.
  • 🔄 Implement a shift register to increment iteration counts automatically with each loop.
  • ⏰ Ensure your time logging includes seconds for accurate data tracking.
  • 📝 Build an array to combine various parameters such as date, time, temperature, and iteration count.
  • 🔗 Convert numerical data to strings to ensure proper formatting before logging to Excel.
  • 🗂️ Excel has a maximum cell count limitation; be mindful of this when logging large datasets.
  • 📂 Change the file name once a certain iteration count is reached to prevent data loss.
  • 🛠️ Use boolean conditions to control when to change the file name during data logging.
  • 📈 This logging technique facilitates better organization and analysis of experimental data over time.

Q & A

  • What is the purpose of the DAC module mentioned in the transcript?

    -The DAC module is used to measure temperature in the experiment, providing data that can be logged for analysis.

  • How can data be recorded into an Excel file according to the script?

    -Data can be recorded into an Excel file by using a string constant connected to the 1D data and building an array of the data points, such as date, time, iteration, and temperature.

  • What is a shift register, and how is it utilized in the experiment?

    -A shift register is used to store and increment a value each time the loop runs. In this case, it tracks the iteration count of the data being logged.

  • Why is it important to convert numeric data to strings in this process?

    -Converting numeric data to strings is necessary for properly building arrays of data that will be recorded in the Excel file, as Excel requires data in string format for certain operations.

  • What issue did the speaker encounter with the Excel file output?

    -The speaker initially faced a problem where not all data points were recorded in the Excel file, as it only captured the last data entry rather than stacking all the numbers.

  • How did the speaker resolve the issue with the Excel file output?

    -The speaker resolved the output issue by ensuring that all data points were pinned to the file and correcting the configuration to allow all entries to be recorded.

  • What modification was made to include seconds in the time recording?

    -To include seconds in the time recording, a constant was created to set the condition to true, allowing the recording of seconds in the output.

  • What limitation of Excel is mentioned regarding data recording?

    -The script notes that Excel has a maximum cell count limitation, meaning that after a certain amount of data is logged, a new file name should be generated to continue recording data.

  • What does the speaker use to increment the iteration count?

    -The speaker uses a numeric increment operation, specifically adding one to the iteration count each time the loop runs.

  • What steps did the speaker take to ensure the temperature was correctly recorded?

    -The speaker warmed up the thermocouple and monitored the temperature reading, verifying that the data was logged properly after initiating the recording process.

Outlines

00:00

📊 Logging Data from a DAC Module

In this section, the speaker discusses the process of logging temperature data obtained from a DAC (Digital-to-Analog Converter) module into an Excel file. They outline steps for creating a string constant and connecting it to 1D data while emphasizing the need for adjustments to make the system work effectively. A shift register is introduced to track iterations in data logging, with the speaker demonstrating how to increment the count with each loop iteration. The need for an array to hold date, time, and temperature data is highlighted, along with a conversion step to ensure numerical data is formatted as strings for logging. The speaker encounters some issues with file saving but resolves them, ultimately confirming that the data is being recorded correctly.

05:00

📈 Ensuring Accurate Time and Temperature Logging

Continuing from the previous part, the speaker focuses on refining the logging process by building an array for date and temperature data, ensuring that the system captures time accurately, including seconds. They identify and resolve issues related to time stream settings and Boolean conditions that affect the logging of seconds. The speaker successfully demonstrates the system in action, confirming that iterations, temperature, and time are being recorded accurately every second. However, they note Excel's limitations in handling large datasets, suggesting strategies for changing file names once a certain cell count is reached to manage data effectively.

Mindmap

Keywords

💡DAC module

A DAC (Digital-to-Analog Converter) module converts digital signals into analog signals. In the context of the video, it is used to record temperature data from an experiment, facilitating the transition from digital measurements to a format suitable for real-world applications. The discussion on obtaining temperature from the DAC module highlights the importance of accurate data conversion in experiments.

💡Excel file

An Excel file is a spreadsheet format widely used for data storage and analysis. The video emphasizes writing data to an Excel file as a method for logging experimental results. By exporting data such as temperature and timestamps to an Excel file, researchers can systematically record and analyze their findings over time.

💡shift register

A shift register is a storage device that allows data to be shifted in and out, often used for storing sequential data. In the video, a shift register is employed to keep track of iterations in the experiment, effectively incrementing each time a loop runs. This concept is vital for ensuring that each data point corresponds to a unique iteration, aiding in data organization.

💡iteration

An iteration refers to a single cycle of a loop in programming or experimental procedures. The video discusses using iterations to track how many times a process has occurred, which is crucial for understanding the flow of data over time. By monitoring iterations, researchers can correlate their temperature readings with specific data points.

💡numeric increment

A numeric increment involves increasing a number by a specified value, commonly by one in loop structures. The script describes using a numeric increment to add one to the iteration count for each loop cycle, illustrating a fundamental programming concept that ensures data logging is orderly and systematic. This technique is essential for capturing time-based changes in the experiment.

💡array

An array is a data structure that can store multiple values in a single variable. In the video, arrays are used to consolidate different types of data, such as date, time, and temperature readings. This aggregation allows for efficient data management and retrieval when saving to an Excel file, illustrating the importance of arrays in data handling.

💡string constant

A string constant is a fixed sequence of characters that represents text in programming. The video discusses connecting string constants to data points for labeling in the Excel file, which helps make the data more readable. Using string constants ensures that labels remain consistent, providing clarity in the recorded data.

💡time stream

A time stream is a sequence of time-based data points collected during an experiment. The video illustrates the necessity of recording not just date but also precise time (including seconds) for each data point, which enhances the accuracy of temporal analysis. This aspect is crucial in experiments where precise timing is necessary for data interpretation.

💡boolean values

Boolean values represent truth values in programming, commonly 'true' or 'false'. In the context of the video, boolean values are used to control whether specific features (like recording seconds) are enabled or disabled. This binary decision-making is fundamental in programming logic, affecting how data is processed and recorded.

💡file management

File management refers to the way in which files are organized, stored, and retrieved in a computing environment. The video touches on the necessity of managing output files, especially as data grows, to avoid exceeding limitations of Excel. Effective file management ensures that data logging is sustainable and that researchers can analyze long-term data without loss.

Highlights

The process starts with reading temperature data from a DAC module.

The speaker outlines methods to log temperature data into an Excel file.

Using a string constant allows for the connection of data to be logged.

A shift register is introduced to keep track of data points being logged.

The iteration count is incremented by one each time the loop runs.

The need for a user-defined output location for the data file is discussed.

An indicator is used to visually confirm that the iteration count is working.

An array is built for storing date, time, and temperature data.

The importance of converting numerical data to string format for logging is emphasized.

Arrays for both temperature and time are constructed to accommodate changing values.

A specific naming convention for the output file is established.

The limitations of Excel regarding maximum cell count are acknowledged.

A boolean condition is used to manage the inclusion of seconds in the time logging.

The system demonstrates an ability to log temperature changes effectively.

File names can be dynamically changed once a certain number of iterations are reached.

A hands-on demonstration shows the temperature sensor's response to heat.

Transcripts

play00:00

okay so let's say you've done that and

play00:03

got a certain temperature off of your

play00:08

DAC module and now you want to maybe do

play00:14

a log you want to try to keep up with

play00:16

what's being recorded in your your

play00:24

experiment

play00:47

so we've got our right to excel file and

play00:49

there's a couple ways you can do this

play00:51

but I'm going to try to do this one of

play00:52

the easier ways quickest ways you

play00:54

right-click choose a string constant

play00:57

connect it to the 1d data it's not gonna

play01:02

work as is once in a race or a

play01:03

right-click here it changed to array now

play01:06

we can add in our different look

play01:09

controls into it

play01:11

we can add in our different labels here

play01:13

and so what I'm going to label these is

play01:18

that show up on our excel file so he'll

play01:19

we're looking at so what do date/time -

play01:26

we'll start with the iteration okay so

play01:28

we'll start with the iteration that we

play01:31

want to know basically what data point

play01:36

we're logging here so we're going to put

play01:37

we're going to use what's called a shift

play01:40

register so we're going to come to right

play01:43

side of this hit add shift register put

play01:46

a constant zero outside of it then we're

play01:51

going to add one find a numeric

play01:57

increment plus one so every time is loop

play02:02

runs it's going to add one so as an

play02:05

example let's just put in indicator here

play02:09

to make sure it's working like it's

play02:11

supposed to so every time this loop runs

play02:13

over one second this indicator call that

play02:18

iteration should go up by one every

play02:23

second let's see oh it wants me to

play02:27

figure out where I want to say this file

play02:28

to which I haven't told it where to go

play02:31

yet so I'm just going to save it to the

play02:34

C Drive let the output okay then we'll

play02:41

call it test okay

play03:02

so this isn't working

play03:14

this figure out why

play03:45

and this should probably would be on the

play03:47

outside of our loop

play04:11

so doesn't keep asking us for file fetch

play04:16

every time let's try this again alright

play04:24

so now it's just gonna keep running and

play04:26

this iteration should go up good alright

play04:27

so we got our title of earth man

play04:37

alright Federation is going up so now we

play04:41

need to build an array for our date and

play04:43

our time and for our we also need to add

play04:48

another one of these for our temperature

play04:56

we're actually recording which is here

play05:00

okay so we've got four different things

play05:08

we're looking at here alright so we need

play05:10

to build an array of our date and our

play05:12

temperature because our date may change

play05:18

you let this run for a long time your

play05:19

date may change so we need our time a

play05:24

time Rayleigh long building array

play05:40

pull the Ray over time

play05:46

all right so we've got an array coming

play05:51

out of here here and then our data here

play05:56

so what we're going to do is we're going

play05:58

to combine this temperature data with

play06:02

our at the bottom and our iteration but

play06:26

this needs to be a number to a string

play06:38

let's do that

play06:46

we got put in our conversion signal

play06:51

manipulation from number there we go so

play07:03

it's a string now this is a string and

play07:06

this is a string so we got to build

play07:09

array

play07:27

there we go so now we can build the

play07:35

array that we want

play08:00

and we'll put that into our data file so

play08:07

let's see if this works I'll start we're

play08:15

going to give it a name just one XLS

play08:21

running my fingers on the thermocouple

play08:26

try to warm it up it should be warming

play08:34

right now all right I'm gonna hit the

play08:35

stop button you'll see it appeared in my

play08:49

these other ones on the 19th generation

play09:09

32-bit notice how it didn't record all

play09:12

the way down through

play09:21

so that recorded a very last one but it

play09:28

did not stack the numbers that we wanted

play09:42

let's figure out one of that happen

play10:03

we don't want it to we already we do

play10:09

want it to a pin to the file I want this

play10:13

one too as well so that looks like that

play10:19

is our problem all right let's go back

play10:21

and test it again should start all over

play10:23

again we're gonna call it the test -

play10:28

accel x s I think that's right I can't

play10:32

remember the new Linux OS all right so

play10:37

let's let it go throw a couple

play10:38

iterations will use my fingers start

play10:39

warm up the thermocouple just a second

play10:49

stop

play10:51

so should now be here okay good deal and

play10:59

we can see we had didn't like it for a

play11:09

full minute so we got our date we've got

play11:12

our time iteration is counting upwards

play11:15

this means just going through iterations

play11:17

but we've got our minutes we don't have

play11:20

seconds so let's figure out why we don't

play11:22

have seconds it's because our time

play11:25

stream here we do one seconds and it's

play11:28

again the same issue of having to tell

play11:32

it true or false here so we're going to

play11:35

create a constant it's naturally it's uh

play11:38

yeah naturally false but we want to be

play11:41

true because we do want seconds so we'll

play11:43

try this again test three X and less

play11:52

okay all right again we'll let it run up

play11:56

and then I'm gonna push my fingers you

play11:58

own the thermocouple tip and let it run

play12:01

up and hopefully it should be showing a

play12:06

increase in the temperature stop

play12:11

let's see if that worked test three does

play12:18

it show seconds yes it does and notice

play12:21

our timing is working every one second

play12:30

so we have seconds we have our iteration

play12:33

we have our temperature so now it's

play12:34

recording now Excel does have a

play12:38

limitation where you know eventually it

play12:42

will run out of the ability there's a

play12:46

maximum cell count and so what you can

play12:49

potentially do is once you get to a

play12:52

certain amount change the file name and

play12:54

you can do that with one of those

play12:55

boolean numbers where your iteration

play12:58

gets a certain amount you change your

play13:00

file name

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
Data LoggingTemperature MonitoringExcel AutomationDAC ModuleExperimentationEngineering TutorialData AnalysisInstrumentationReal-Time DataLab Equipment
Benötigen Sie eine Zusammenfassung auf Englisch?