Autosave/ User Interface issue
Hello,
I am new to coding, and I am working on developing a code for research purposes and am currently running into two issues.
I am attempting to autosave my data to a file on my computer every x amount of points taken while my function is running in case of a crash, but every time I try, it either stops collecting data and opens a window for me to manually save the data to the folder or doesn't save at all.
I am also trying to create a User interface so that others in my group can use the code, but don't actually have to touch the code and click compile for it to work. I am using IgorPro version 9, have the XOP tool kit downloaded, and am using a VDT2 to connect my dual channel pH/Ion Meter.
Does anyone have any advice on how to do either of these things? Anything would be appreciated.
Thanks!
Without actually seeing your code, the usual reason for putting up a dialog for saving a file is that the path to the file isn't completely specified. If you use the Open command initially to create the file and it puts up a dialog for the user to decide where it goes and what it's named, the command will create a variable called `S_fileName` that contains the full path and file name. You can use that when you write to the file so that it doesn't put up a dialog.
For you instrument interface, you shouldn't need the XOP toolkit. That's only required if you want to write custom code in C or C++.
December 5, 2025 at 09:18 am - Permalink
> I am attempting to autosave my data to a file on my computer every x amount of points taken while my function is running ...
Is the function running in a background thread? Otherwise, the processing to save a wave will interrupt the function steps. As John notes, the Open operation has flags to prevent showing a dialog box.
> I am new to coding ... I am also trying to create a User interface so that others in my group can use the code
Some suggestions. Your user's group may be anxious to have your package today. But they will be far less forgiving when you would promptly deliver a cluttered interface panel that runs broken (incorrect) code. First, create code such that works entirely by calling functions from the command line. Use modular development steps, for example, create a function to capture_data(...) using the VDT2 protocols. Create a function *entirely within Igor Pro* to analyze_waves(...) as well as a function to display_results(...). When your code appears to work as expected, start the steps to build a control panel to drive the (three separate) operations. Build one part of the panel at a time. First, build the portion that triggers the function to capture data. Then, build the portions that analyze the waves and display the results. For the latter steps (analysis and display), you may find existing packages on this site that are pre-built to do exactly what you want and even more.
December 5, 2025 at 11:13 am - Permalink