Jump to content

Labview to Excel


Recommended Posts

Posted

Hello,

I am designing a threshold detector with 10 inputs.

When the threshold is reached (and passed) there will be two data values.

1. The time it takes for each input to pass the threshold limit

2. The time starting from the threshold passing till the STOP button is pressed.

3. The total duration from the start of running till the STOP button is pressed.

The I want to export to Excel these times and make a column for each of the 10 inputs.

Also I need the vi to write to excel after the stop button is pressed.

How can I do all these?

Posted

If the requirement is not to specifically make a *.xls file, but rather just a file that Excel can read, the easiest way to do this is to make a Comma Separated Variable (*.csv) file from your data. Then you don't have to fool around with ActiveX or .Net or anything like that.

So, for example, your time file would end up looking something like

timeToThreshold1, timeToStop1, duration1

timeToThreshold2, timeToStop2, duration2

timeToThreshold3, timeToStop3, duration3

...

  • Like 1
Posted

If the requirement is not to specifically make a *.xls file, but rather just a file that Excel can read, the easiest way to do this is to make a Comma Separated Variable (*.csv) file from your data. Then you don't have to fool around with ActiveX or .Net or anything like that.

So, for example, your time file would end up looking something like

timeToThreshold1, timeToStop1, duration1

timeToThreshold2, timeToStop2, duration2

timeToThreshold3, timeToStop3, duration3

...

Thank you for the prompt reply!

How do I make the vi to write to excel after the stop button is pressed, ie after all the data is collected? It keeps asking me to save the data at the beginning.

Posted
You just have to place the write to excel fonction after your loop...

What Roderic says.

And if you use *.csv, you can use "Write to Text File" function in the File I/O Palette.

Posted

How can I write each waveform/array to a different column in excel?

wave1, wave2, wave3

w1pt1,w2pt1,w3pt1

w1pt2,w2pt2,w3pt2

w1pt3,w2pt3,w3pt3

w1pt4,w2pt4,w3pt4

etc...

Posted

How do I implement it to labview?

I think we've gotten to the point where you need to post some code of how you've tried to implement the suggestions Roderic and I have already made, and what's working and what's not working.

Posted

I think we've gotten to the point where you need to post some code of how you've tried to implement the suggestions Roderic and I have already made, and what's working and what's not working.

I made it work (see Attached Picture)

Where you talking about another way?

Is there another way to make this, perhaps more simple?

Posted

Where you talking about another way?

Is there another way to make this, perhaps more simple?

There are a whole bunch of comments I could make, but first of all, what is this project for?? Work? School??

Posted (edited)

Indeed, there's different ways to do this. and I dont think this is the simpler way, but if it works then...

You seem to use an indicator as a control for the file path... or maybe I dont have the whole picture.

Your design is a bit weird to me.

Edited by Roderic
Posted

Your design is a bit weird to me.

The code almost looks deliberately wrong, which makes me wonder if it's a school assignment??? If so, while we're all glad to help people out here, we really shouldn't be doing your homework for you.

Posted (edited)

The code almost looks deliberately wrong, which makes me wonder if it's a school assignment??? If so, while we're all glad to help people out here, we really shouldn't be doing your homework for you.

Its work!

What you see is a patch work from different other vi/examples etc, and no it is not "deliberately wrong"!

Indeed, there's different ways to do this. and I dont think this is the simpler way, but if it works then...

You seem to use an indicator as a control for the file path... or maybe I dont have the whole picture.

Your design is a bit weird to me.

It is an indicator, the file path is generated via a path/tag code. I chopped it off as I thought it might be confusing

Edited by Ano Ano

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.