LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging data from multiple signals into one excel file

Are you clicking the Stop button, or just Stop 2? Your Stop button, which will finish the DAQ loop, is way off to the left of the front panel. Once you push that you should be prompted to select a file to save to. It saved data when I tried your VI.

 

One thing: It looks like you are creating two analog input tasks for the same device. Are you receiving a Resource Reserved error? Typically you can only have one Analog Input task running per device. You will likely want to combine them into a single task that reads both channels. Then you can use the Multiple Channels > Multiple Samples option on the DAQmx Read to read both channels at the same time.

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
Message 11 of 16
(1,533 Views)

@Will_S. wrote:

Are you clicking the Stop button, or just Stop 2? Your Stop button, which will finish the DAQ loop, is way off to the left of the front panel. Once you push that you should be prompted to select a file to save to. It saved data when I tried your VI.

 

One thing: It looks like you are creating two analog input tasks for the same device. Are you receiving a Resource Reserved error? Typically you can only have one Analog Input task running per device. You will likely want to combine them into a single task that reads both channels. Then you can use the Multiple Channels > Multiple Samples option on the DAQmx Read to read both channels at the same time.


Thank you, Will. I just ran the VI and clicked Stop and it did ask me to write in the filename and there was a spreadsheet which was created. I also wasn't aware that I could only run one analog input task per device. I have been getting that error and wasn't sure why it was occurring either, but I thought that it just had something to do with my file saving error. If I create one task to read all of the channels, then how do I go about splitting up the signals to record them each in their own column on the excel spreadsheet?

0 Kudos
Message 12 of 16
(1,523 Views)

@Will_S. wrote:

Are you clicking the Stop button, or just Stop 2? Your Stop button, which will finish the DAQ loop, is way off to the left of the front panel. Once you push that you should be prompted to select a file to save to. It saved data when I tried your VI.

 

One thing: It looks like you are creating two analog input tasks for the same device. Are you receiving a Resource Reserved error? Typically you can only have one Analog Input task running per device. You will likely want to combine them into a single task that reads both channels. Then you can use the Multiple Channels > Multiple Samples option on the DAQmx Read to read both channels at the same time.


Thank you, Will. I just ran the VI and clicked Stop and it did ask me to write in the filename and there was a spreadsheet which was created. I also wasn't aware that I could only run one analog input task per device. I have been getting that error and wasn't sure why it was occurring either, but I thought that it just had something to do with my file saving error. If I create one task to read all of the channels, then how do I go about splitting up the signals to record them each in their own column on the excel spreadsheet?

0 Kudos
Message 13 of 16
(1,523 Views)
You don't split up a thing. If you are getting a 2D array, the write will automatically create a multi-line text file with the separator of your choice and Excel will place the data in columns.
0 Kudos
Message 14 of 16
(1,510 Views)

@Will_S. wrote:

If you want to use real timestamps instead of simple index numbers, you can use the Get Date/Time in Seconds VI to get the time and date at the beginning of the acquisition. Then use the Y and dt components of the waveform to build out the timestamps themselves for each signal.

 

waveform timestamps.png

 

 

Also, keep in mind that all of your While Loops in the Warning Lights loop have no timing in them. So they are going to use 100% of your CPU. I would put a Wait Until Next ms Multiple function in each of those loops to give your other processes time to execute.

 

 

 

 

 

 


What is the pink icon connected to the waveform node in the top "build waveform" function?

0 Kudos
Message 15 of 16
(1,498 Views)

It's just a waveform cluster constant. You don't really need it, I just like to have it for completion.

 

But the image I posted is a VI Snippet. Right-click it, save it to your desktop and then drag the file onto your block diagram. It will create the block diagram for you and you can use Context Help to see what everything is. (Assuming youre using LabVIEW 2013 or later)

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
0 Kudos
Message 16 of 16
(1,456 Views)