08-11-2006 10:17 AM
08-12-2006 01:27 AM
Hi kmoorthy,
Nice work - it was a pleasure going over this code - wiring left-to-right, little wasted space and great comments. ![]()
I don't think the code would have done what you wanted, though: it looks like "equal" was intended to search for duplicates, but it would produce a cell-for-cell comparison between arrays (comparing the first elements of both arrays, then comparing the second element of both arrays, etc) the long-and-short of it is, there could never be a false comparison.
There was quite a bit of file IO. Here's a VI that keeps an array of Device ID's and only writes a record if the ID is unique - no need to read-back all the data! There's still room for improvement though. If I knew how you wanted the file formatted, I'd have used the low-level File VIs to open a reference once, and just use a Write File on each iteration of the loop.
Hope it helps!
08-12-2006 08:06 AM
Some general advice: It's always better to avoid doing something, rather than doing it and then undoing it.
Can you hold all the data in memory at one time? If you can, then search for duplicates IN MEMORY, and avoid putting duplicates IN MEMORY as they come in. Write the current data out periodically, if needed.
If you can't hold all the data, can you hold all the DEVICE IDs? If you can, then just search your internal list for a duplicate device ID and avoid writing the data if it's a dupe.
HTH,
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-14-2006 09:29 AM
Hi tbd:
Thanks for the VI. It works fine. I appreciate your help.