Saving waves to do analysis

So I have code that does this:
Macro GetWave(file,timestamp)
    String file
    Variable timestamp
   
    LoadDataset("Path",file,"data");
    LoadDataset("Path",file,"reference")
        \\Do other stuff
End

I have labview creating an h5 file and then sending the command "GetWave"file,timestamp)". In the h5 file, I save the data wave as "data" and the other as reference. This runs constantly, so data and reference are constantly being overwritten, and I am unsure of how I could create a wave that would store every set and then keep saving (they all have the same timestamp, which is just the x scaling) so that I could do some statistics on many waves.
How often do you get a new file?

Sounds like you need some sort of locking mechanism. It would work something like:
1) Labview: Check for lock file. If none, save new data file
2) Labview: Create lock file.
3) Igor sees lock file, loads data set.
4) Igor deletes the lock file.
5) go back to 1)

Maybe our WaitForFileProcs.ipf would be of help for implementing this. Add this to your procedure file:

#include <WaitForFileProcs.ipf>


Be aware that any sort of locking mechanism like this has a tendency to get out of sync, leaving a lock file in place. Crashes, premature abort of a procedure, etc., might have that effect.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thanks for the reply. We get a new file every ~30 seconds when we are running.

I will look into that. I may just need to adjust the naming of the files and waves to include an index and then load those. I just do not want a new window to appear 400 times (I display the waves and their fft at some point) per day.
Once per 30 seconds isn't very fast, so a lock file (or something like that) should work adequately.

It just occurred to me that you might be able to use Labview to invoke an Igor user procedure to process your files:

DisplayHelpTopic "Igor Command Line"

This confusingly-named help topic refers to invoking Igor itself via an OS command, not to Igor's command line at the bottom of the History window. You can use the /X flag described there to invoke your file-processing command. It would be an unusual computation that took more than 30 seconds to complete.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com