LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create files and compare data

I have an aplication that can recive data (an integer and string), it stores it in a datafile and adds the date and time.  However, I need that everytime a new set of data cames, it ctompares it with the rest of the data stored in the same file.  If it the integer (key)  is repeated, it should be stored in a different file if not, it should be stored there.  
 
I been able to read and write data files in different vi, but I can't makean  application that does everything at the same time.  I will appreaciate any suggestions.   I'm new with LabView and there is a lot I dont know yet. 
 
Thank you!!!!
 
 
 
0 Kudos
Message 1 of 4
(2,767 Views)
Hi,
 
It looks like you have everything working in separate VIs but you are facing trouble incorporating everything into one VI. In that case, you can use a  feature of LabVIEW called subVIs that lets you carete modular code. Here is some more information on creating subVIs.
 
If there is another aspect of your code that you need help with, please let us know and we would be happy to help you out.
 
Regards,
Ankita
 
 
0 Kudos
Message 2 of 4
(2,745 Views)

Thanks for your suggestion.  However, the main problem is not how to read and write together but how to compare the data.  I started by writing and reading vi becuase I wanted to insolate every part of my program, be sure it works and then build on top of it.   The complete application should do something like:

--Open two files, one for new data, one for repeted data

-- User enters data -> a key as integer and some string

-- compare the new key with ALL the keys already stored in the file.

      -- if the file is empty or no key is found in the file, write the data in the file for new data

     -- If the key is repeted, write the data in the file for repeted data

-- Keep doing this until the user stops the application.

What I really need is to be able to compare the recent entered data to what was entered before.  I chose to save data in a datalog because it seemed the best solution and because I also needed to store the date and time.  However, if there is any other way to store the data and compare it, please let me know.  I tried arrays and clusters by themselves but it wasnt easy.  Datalogs worked fine storing data but now comparing is too hard because I dont know how to read the file, record by record while comparing it to the new data I just got.

I hope this is a little bit clearer!

0 Kudos
Message 3 of 4
(2,739 Views)

I think I finally got what I needed it.  This is the vi.  If anybody has suggestions on how to make it better or more efficient, please let me know. I think it is very slow but I dont know if this is normal or I can make it better.

Thanks!

 

 

0 Kudos
Message 4 of 4
(2,729 Views)