Code Comments
Programming Forum and web based access to our favorite programming groups.Hi guys! Right another problem for you all! (suprise suprise) I am writing to an "export waveform to spreadsheet.vi" with some success.... However I have a couple of problems: 1) I am writing to it inside a while loop, it correctly puts in all the data for the first iteration, however on the second and subsequent iterations it creates the new file but doesn't put any data in it! Any ideas? 2) To speed things up in the data capture loop I am not immediately writing to a graph output, what I wanted to do is once all the data has been written to that file is to reopen it and plot this in a a graph so the user can tel l if an event occured in th e previous iteration! However the read "waveform from spreadsheet" doesn't s eem to read the data? Thanks Jon Quench Velocity mod.vi: http://forums.ni.com/attachments/ni/170/313007/1/Quench Velocity mod.vi
Post Follow-up to this messageHey Jon, I have had a brief look at your code, and I think I have solved your saving issue. Please find the attached VI. It will require a bit of tinkering at yo ur end, to fully integrate the new VI into your project, but hopefully it wi ll solve your problems. You are obviously well versed in LabView, so you will be able to follow the code with ease. I have added a couple of comments to the block diagram, so h opefully that will help further. One of the major changes is - rather than loading the data froma file you ha ve just created, the program will display the data just before it is saved. This simplifies the code greatly. Other changes include - The DAQmx channel i s only stopped and started once. - The number of sampl es to read per iteration is now defined at the DAQmxRead function. It no lon ger requires a loop of its own. By varying the number of samples to read, an d the sampling rate, you ca n define how long the program aquires data before saving it. - You no longer requi re loop timing. Infact, in the current set up, loop timing would eventually result in a buffer overspill. I hope this has been of some use to you, and I look forward to hearing how y ou get on. Best wishes Rich :robotvery-happy: Ps. The attached VI is written in LV8.5. Dont hesitate to let me know if you are using an older version of LabView. 650728 export to spreadsheet.vi: http://forums.ni.com/attachments/ni/170/313391/1/650728 export to spreadshee t.vi
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.