LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Help for DeclareThreadSafeScalarVar

Solved!
Go to solution

I am having issues using DeclareThreadSafeScalarView. In my header file I have the following:

DeclareThreadSafeScalarVar (int, RunUserInterface);

I have two different source files with procedures I would like to refrence the variable 'RunUserInterface'. In one file where my

thread is created, I first make a call to 'InitializeRunUserInterface()' and 'SetRunUserInterface(0)' in one procedure, and in

another procedure in that file I call 'GetRunUserInterface()'. In the second source file I have the call 'SetRunUserInterface(1)'.

Both files compile ok, but when the linking of the executable in CVI takes place, I receive link errors saying there are instances

of 'Undefined symbol' for each one of the calls made. I have looked through the CVI Help screens and do not see what I

may be doing incorrectly. Can anyone answer why I may be having these link errors?

0 Kudos
Message 1 of 4
(3,484 Views)

RunUserInterface is a function in your program. You cannot have a variable with the same name as a function.

 

Are you really trying to manipulate a variable or are you trying to do something else treating RunUserInterface as a thread safe variable?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 4
(3,481 Views)

RunUserInterface is the variable name in my DeclareThreadSafeScalarVar declaration in my header file. I don't have a function

with this name. My intent is to have a thread safe variable to manipulate from two different source files.

0 Kudos
Message 3 of 4
(3,479 Views)
Solution
Accepted by topic author ciao_bullet

I just happen to google and find another forum on the DeclareThreadSafeScalarVar usage and stumbled on my problem. The NI

manuals did not state the usage of this with the DefineThreadSafeScalarVar statement. I made an assumption that if I did one

then I was covered. I did not realize that the two statements need to be used together. The declare statement in the include file

and the define statement in the source file where the InitializeVar is used. I place the define in my source and built my executable

without any link errors. Thanks for your earlier response.

0 Kudos
Message 4 of 4
(3,474 Views)