LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing waveforms to spreadsheet using write to spreadsheet vi

Solved!
Go to solution

Hi,

 

Having problems with writing 2 waveforms from the myDAQ to a spreadsheet. Using the 'write to spreadsheet vi.' isn't working as it saves to the file but when we open the file to look at the results, there is no data. I have got a print screen of the vi used, unfortunately an attachment of the file can not be posted. Can anybody see the problem and any solutions?

 

http://i50.tinypic.com/2isil8w.jpg

 

Thanks

0 Kudos
Message 1 of 7
(2,333 Views)

There is no obvious issue.  Highlight execution or use data probes to ensure you actually have data.  This may be your root issue.

 

As a side note, you have almost done all the work the write to spreadsheet string does.  I would recommend going all the way and replacing the write to spreadsheet with direct calls to the file I/O primitives.  You will need to add separators between your fields.  Open the write to spreadsheet string to get what you need to do.  I would recommend you not use anything not on the palettes, and there are some subVIs in that code which qualify.  Or, don't convert to strings, use the DBLs and let the write to spreadsheet format it.

 

You also do not need to index out the waveforms in your first loop to scale them.  You can do that on the array of waveforms directly.

 

What error do you get when you try to post your code?  You should be able to do it.

0 Kudos
Message 2 of 7
(2,325 Views)

Ok I've managed to atach the vi to this message. Not really sure about how to go about using your method, we're novices, sorry!

0 Kudos
Message 3 of 7
(2,310 Views)
Solution
Accepted by topic author Rickhall

You need to do a little basic troubleshooting. Right click on the wires going into the for loop and select 'Probe'. After running the VI, view the probe contents and see if there is any data there. I had to put a delay in the acquisition loop or specify a sample count to consistently get data.

0 Kudos
Message 4 of 7
(2,299 Views)

Using the probe and running the programme with highlight execution gives us data consistently, but the the programme is run normally is does not. At which point should the delay be added?

 

0 Kudos
Message 5 of 7
(2,295 Views)

Put it in the acquisition loop. As I said, you can skip the delay and request a fixed number of samples. I don't know where you got this code but I think the examples that come with LabVIEW use a fixed sample count.

0 Kudos
Message 6 of 7
(2,291 Views)

Ah I see, I've added that now. It seems to be worked quite consistently, maybe with an error in the time but that isn't as major of a problem.

 

Thanks for the help!

0 Kudos
Message 7 of 7
(2,285 Views)