LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Combining data and table display

Hi,

 

I am new to LabVIEW and have been given a project where I must collect 1 voltage reading, from a pyranometer, and several thermocouple readings. I am having trouble combining the two different data types.

 

Ideally, I would like in Excel a time, voltage and temperature column but I cannot output the data to one file where the data is collected a the same intervals.

 

I've tried combining the DAQ 1 and 2's outputs together into the 'Export Waveform To Spreadsheet File.vi' but this brings up an erro.

 

Can voltage and temperature data be combined like this? How can I do it? 

 

Thanks, 

Euan

0 Kudos
Message 1 of 12
(3,635 Views)

Waveform data type is array of data supplied with additional values: start time, time increment. You cannot save two arrays of data (temperature and voltage) in the same array. So, you need to use two shift registers (by the way, I would write it without shift registers but let’s stick to your design).

 

Saving two arrays in one file is not a difficult task. But solution depends on desired file format.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 2 of 12
(3,625 Views)

Thanks for the quick reply.

 

Do you mean something more like I have attached? 

 

If there is a far easier way to save two arrays in the one file can you point me in the correct direction please? 

 

The desired file is an excel file with time, voltage and temperature as the column headings.

 

Thanks

0 Kudos
Message 3 of 12
(3,591 Views)

Hi Euan,

 

I am having trouble combining the two different data types.

Which trouble? Error messages? Error numbers?

The problem with your information/images is: we cannot debug them using LabVIEW.

When you want help for your VI you should attach the VI…

And you should provide information about the DAQ hardware used for this setup!

 

Ideally, I would like in Excel a time, voltage and temperature column but I cannot output the data to one file where the data is collected a the same intervals.

What about using an array of waveforms?

What about using TDMS files for saving the data, maybe even in two different groups (voltage vs. temperatures)?

 

I've tried combining the DAQ 1 and 2's outputs together into the 'Export Waveform To Spreadsheet File.vi' but this brings up an erro.

Again: what have you tried? Where are you stuck? Which error did you get?

 

Can voltage and temperature data be combined like this?

Yes.

 

How can I do it? 

- array of waveforms…

- TDMS…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(3,588 Views)

Sorry to say, Euan11, but you do the same error again combining two different types of data in one array (waveform). Please pay attention to function of each node in your program.

I think one question would be appropriate. Do you want to create a “quick and dirty” solution or learn how to program in a good way? Both answers are ok, there are many engineers who use LabVIEW only for small fixes without any need to do more.

Quick and dirty fix:

Replace last “Append Waveforms” with “Build Array” and supply meaningful file path to “Write To Measurement File”.

If you want to know why this is a “dirty” solution, ask.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 5 of 12
(3,582 Views)

That works, thanks. Why is this a "dirty" solution?

0 Kudos
Message 6 of 12
(3,578 Views)

Hi Euan,

 

it's at least a quick solution: simply create an array of waveforms for saving the data.

 

It's "dirty" because you may run into memory problems before you have a chance to save your data: in the loop you build (possibly) large waveforms consuming (possibly) a lot of memory and after the loop you try to build an even bigger array from your two large waveforms…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 12
(3,574 Views)

Data are collected then saved. Longer data collection requires larger memory.

 

Even if memory is not an issue (f.ex. frequency of data collection is low) any interruption would result in disappearing of whole data.

 

Express VI-s (big blue VI-s) are great for quick fixes but not for creation of readable/maintainable/extendable code. Avoid them in larger programs (with few exceptions).

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 8 of 12
(3,572 Views)

Thank you for all of your help thus far. I am very much going for the quick fix.

 

My next question, I've got my two arrays now outputting their data but there is an issue with the timestamp. It counts 1, 2, 3... for each data collected. I'd rather have the time here than a count. I know I could process the data, knowing the start time, frequency of collection etc but this is laborious. How can I add a timestamp? 

 

Thank you,

Euan

0 Kudos
Message 9 of 12
(3,560 Views)

Hi Euan,

 

it's your fault you are losing the timestamp!

 

You convert your DDT data (which contain a timestamp!) to a simple array of sample: those arrays don't contain timestamp information! Then you create a 2D array and convert it back to DDT, but now without timestamp information…

 

As has been said several times before: use an array of waveforms!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(3,557 Views)