Starting a procedure from the a Windows batch file
joerg.kunze
I want to start an Igor instance automatically from a Windows batch file and have it execute a certain procedure in order to load, process and save some data. I want to run the windows batch file over night when we all are asleep, so Igor has to do its Job without human interaction. The question is how to start an Igor proc.
I have tried to start Igor and have it load a procedure like
Igor.exe /I ExampleProcedure.ipf
that works, but it doesn't start a specific proc in the ipf file. Let's look for something else...
I have tried to start Igor, have it load a procedure and execute a procedure like
Igor.exe /I ExampleProcedure.ipf /X "MyProc()"
that also loads the ipf, but doesn't start the proc, because Igor can only take one argument when using /X.
I have tried it like this
Igor.exe /I /X "#include"ExampleProcedure.ipf";MyProc()"
but that doesn't work, because the #include is not a valid command line instruction.
In addition, I could not find an instruction to load an ipf or a pxp file, so I can pass it along in the /X command followed by the proc call.
Any ideas?
Thanks in advance,
Joerg.
Would it be a problem if the procedure is present? It should be fine as long the is no code executed automatically on load.
See:
displayhelptopic "igor procedures folder"
October 26, 2012 at 04:41 am - Permalink
October 26, 2012 at 06:28 am - Permalink
Then, after the #include statements, put in a call to a function that is defined in your main procedure window. Igor will execute code in an experiment's main procedure window that is not contained within a function, macro, etc. when the experiment is loaded.
For example:
ProcessData()
Function ProcessData()
....
End
There is a help topic somewhere that mentions this feature of Igor but I can't find it at the moment.
You probably have read this already but in case you haven't you should read:
October 26, 2012 at 06:51 am - Permalink
The solution is: Write a Windows batch containing the following two commands
Step1: Open the procedure
"C:\Program Files (x86)\Wavemetrics\Igor Pro Folder\Igor.exe" /I ExampleProcedure.ipf
Step2: Execute the procedure
"C:\Program Files (x86)\Wavemetrics\Igor Pro Folder\Igor.exe" /X "MyProc()"
That is all. Works perfect.
October 7, 2016 at 11:13 pm - Permalink