05-28-2006 05:53 PM
05-28-2006 10:32 PM - edited 05-28-2006 10:32 PM
Hi, Philip!
Let me see if I got it right: You simply want to keep this spreadsheet data in memory in order to manipulate it somehow while the program runs and then write it to a new spreadsheet file later on? My screen resolution is very poor and your files filled something like 10 screens when I opened them so I gave up getting the overview.
If I'm right in my assumption there are many -and quite simple- ways to do this depending on what kind of data your spreadsheet file contains and to what extent you want to manipulate it. What about a simple array or cluster of arrays? If you put them in a sub-VI it has the nice quality that even if you have multiple instances of it on your block diagram (configured to read or write) they all reference to the same array in memory. They can also be adapted to fit virtually any specification (what kind of data to save: 1D, 2D....,) Once you're ready to write to your new spreadsheet file you simply dump the contents into it.
The principle is used in any standard buffer, and LV has a couple of example codes (search for "buffers"), but these are actually much more complicated than what I'm thinking of. I've attached a "suggestion VI" made in LV7.1 that stores an array of strings and a 2D array of doubles which are replaced each time you write to the VI. This might not solve your problem, but perhaps it will point you in the right direction.
Regards, Einar
Message Edited by einarsto on 05-28-2006 10:39 PM
Message Edited by einarsto on 05-28-2006 10:40 PM
05-29-2006 05:58 PM
Thanks alot for the reply!! My main area of confusion is the DAQ parts of the program, If you look at those data read/write files you'll see what I'm talking about. This is a project someone else started and I've kind of been brought in to finish. If you could, take a look at "data_write.vi" within that first big .llb file, maybe you can shed some light on this mess. Thanks again!
Philip
05-29-2006 07:33 PM
05-30-2006 04:51 PM
05-30-2006 08:25 PM
05-31-2006 03:05 PM
05-31-2006 03:43 PM
06-01-2006 03:41 PM
Anyone have some insight on the topic, I'm getting really pressed for time trying to get this part workin. Thanks everyone!
Philip
06-01-2006 04:42 PM
Philip,
Unfortunately for such a specific topic there isn't going to be a complete
example that does everything that you need it to. However, I believe that
if you check the resources that I gave in my previous post you will be able to
do everything that you need with example code modules. For example, if
the spreadsheet file is saved as a tab delimited text file you can use the Read
from Spreadsheet function to read that information into LabVIEW. This
will output an array of strings, which you will need to convert from a hexadecimal
string to a number and then to a Boolean array, which the Hexadecimal String to
Number and Number to Boolean Array functions will accomplish. Once you
have Boolean Arrays you can write those arrays using the DAQmx examples.
Write Digital Line or Port should do the job. Once you have done this you
can reverse the entire process and read the information from the proto board,
convert that into numbers and then compare the previous and updated values to
determine if you need to rewrite the file.
I would be glad to help out more if you had specific questions about errors or
problems you are having when implementing your application.
Andy F.