Problem Transferring Structures between Procedures

I have two procedure files within the same experiment ....

// PROCEDURE FRAC
#pragma rtGlobals=1     // Use modern global access method.

Static Structure MyStruct
    variable tc
endstructure

Function ChangeStructure(ms)
    STRUCT MyStruct &ms
   
    ms.tc = 1
    return 0
end


// PROCEDURE FRIC
#pragma rtGlobals=1     // Use modern global access method.

Static Structure MyStruct
    variable tc
endstructure

Function SendStructure()

    STRUCT MyStruct ms
    ms.tc = 0
    ChangeStructure(ms)
    return 0
end


Trying to compile these gives an error message for Fric:SendStructure ... reference variable is of a different type. When SendStructure() and ChangeStructure(ms) are within the same procedure, I get no compile error.

What am I missing?

Igor 6.1.0.7 under Windows Vista.
This is just a guess, but you're defining the structure in both of your procedure files. Even though the actual definition is the same, perhaps when Igor compiles the two files it stores the two structure types separately, such that your call to ChangeStructure() from SendStructure() would use a different representation of the structure than what is defined in the procedure file FRAC.
aclight wrote:
This is just a guess, but you're defining the structure in both of your procedure files. ...


Oh! Duh! Not only that, but the Structure definition must not be static. The proper set up is ...

// PROCEDURE FRIC
#pragma rtGlobals=1     // Use modern global access method.

Structure MyStruct
    variable tc
endstructure

Function SendStructure()
 
    STRUCT MyStruct ms
    ms.tc = 0
    ChangeStructure(ms)
    return 0
end


and

// PROCEDURE FRAC
#pragma rtGlobals=1     // Use modern global access method.
 
Function ChangeStructure(ms)
    STRUCT MyStruct &ms
 
    ms.tc = 1
    return 0
end


Thanks!

--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH