01-18-2013 08:13 AM
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
Solved! Go to Solution.
01-18-2013 08:28 AM
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.
01-18-2013 08:47 AM - last edited on 01-18-2013 12:09 PM by MaryH
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!
01-18-2013 09:40 AM
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.
01-18-2013 09:53 AM
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?
01-18-2013 09:56 AM
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.
01-18-2013 10:13 AM - edited 01-18-2013 10:26 AM
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!