02-10-2009 06:24 AM
I have a VI that creates colum headdings and then updates the rows with data every second, if i open the file while the VI is running all my data is there but if i stop the VI then open the file only my colum headdings are there.
I assume it isnt finalising or saving the file when the program stops but i can't figure it out.
Any ideas - i have attached a picture...
Solved! Go to Solution.
02-10-2009 09:22 AM
Excuse me for saying so, but that is one of the ugliest block diagrams I have seen in a while.
I suspect your problem is because you have nothing wired in the false case and the shift registers are getting cleared when the case is false. I don't know why you are using the shift registers (and using them badly) anyway. In the true case, it looks like all you need to do is have a single Build Array function, pass it all of the numerics, and pass the 1D array output to the Write to Spreadsheet 1D input.
02-10-2009 09:44 AM
Thank's for the reply (i think ) i tried passing my numbers into a 1D array then passing that to the 1D write to spreadsheed function. but no matter what i did with the loops it allways filled the spread sheet with copys of the first values that went into the array. It was as if the array simply stored the first values then wrote them to file every second instead of updating the array every second.
All i want to do is have a row of values that update every second and are added to a new row on a spread sheet every second.
Cheers, Zac
02-10-2009 10:42 AM
02-10-2009 11:19 AM
The front pannel controls are linked to connectors on the VI so they are controled by a master VI. (i know i should use references instead of actual controls but i wated to be able to change them manually in the VI to help with debugging untill i get the file write working properly.)
I have attached the SubVI, but i have made changes to it since i posted the picture. Thanks Zac
02-10-2009 11:33 AM
I wish I had known you were using this as a subVI because now your problem makes sense. You have a basic misunderstanding of LabVIEW and dataflow. Because you used controls and not references, the controls in the subVI are only updated when your main VI calls this subVI. The values remain the same until the subVI is stopped and called again by the main.
It would make more sense to have your subVI just do the write of data - no loop or anything else. Have the 1 second loop in your main as well as a single instance of creating the header.
02-10-2009 11:44 AM
Ahh, that explains it.
I will change them to references.
I avoided putiting the loop in my main program as it is quite large on the diagram. But i can put it there if thats where it should be.
Thanks for your help ,Zac
02-10-2009 11:48 AM