Independent Module: How to insert different Procedure Files

Dear All,

I try to write an Independent Module which consist of different procedure files which include each other. Everytime I try to compilate I get the following error massage: "Name already exist as a function". I think due to the fact that different procedure files include each other, Igor see the same function many times but I don't know how to avoid this.
Do you have any suggestions?

Thanks a lot in advance,


P.S. Is it try that the Nidaq MX Tools are not threadsafe? I cannot find this information anymore
An example experiment with the associated procedures files are probably necessary to help you.

There aren't enough details in your description of the problem.

Try sending the experiment and procedures to support@wavemetrics.com.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
As I understand your problem, you have perhaps one of two problems

* Perhaps your modules call other modules recursively. In other words, do you have this ...

// mainprocedure
#include "myprocedure1"
...
// procedure1
#include "mainprocedure"


* Perhaps your function names are not properly "protected". See this link for information. http://www.igorexchange.com/node/1688

In general, you are better to avoid Independent Modules until you really understand their caveats.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
LausX actually found a flaw in Igor's compiling of independent modules.

The flaw is (which will be fixed in Igor 6.34) that Igor was not recognizing that an #include of a procedure file that was already open and already contained #pragma IndependentModule=someIM did not need to be adopted into the experiment again, and thus two copies of the same procedure were loaded (one opened directly, the other erroneously adopted and another #pragma IndependentModule=someIM statement inserted into the adopted procedure.

For example, put these two procedure files into User Procedures, and drag them into/onto Igor to open them directly:

A.ipf

#pragma rtGlobals=3
#pragma IndependentModule=myIM

#include "B"
Function FunctionInA()
End



B.ipf

#pragma rtGlobals=3
#pragma IndependentModule=myIM

#include "A"
Function FunctionInB()
End


Click Compile and Igor will complain about duplicate FunctionInA or FunctionInB.
Execute SetIgorOption IndependentModuleDev=1 and click the Windows->Procedures menu and see that two A.ipf and two B.ipf procedures are listed, both with [myIM] suffixes.

While this example has "recursive" includes, the flaw wasn't related to that; recursive includes are normal and usually are no problem at all; this was an independent module #include flaw only.

--Jim Prouty
Software Engineer, WaveMetrics, Inc.
Thanks both for your replay,

I already wrote to JimProuty that I could solve this problem by changing the name of the Independent Module to one without "-" in it.
I also viewed the source code of the Igor example "Slow Data Acq" under File->Recent Examples->Programming and also in this they opend the procedure files into each other:

Procedure 1 (Userinterface)

#pragma IndependentModule=SlowDataAcq

Procedure 2 (Main)

#pragma IndependentModule=SlowDataAcq
#include "SDA Main"
#include "SDA Aquisition"

Procedure 3 (Aquisition)

#pragma IndependentModule=SlowDataAcq
#include "SDA Main"


Without any problems....
JimProuty wrote:
LausX actually found a flaw in Igor's compiling of independent modules....


Oh! I don't think I realized that you could have two different procedure files in the same IM this way.

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
Quote:
P.S. Is it try that the Nidaq MX Tools are not threadsafe? I cannot find this information anymore

That is true- NIDAQ Tools MX is not threadsafe. It is definitely on my list for a future revision. It is a fairly big job and right now all my energy is devoted to trying to get Igor 7 ready.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com