LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can TDMS objects be EXTERN?

I'm trying to place a TDMS channel handle pointer in a header file and use it for functions in a few different c source files, but keep getting "Invalid  channel handle." types of errors. Can TDMS objects be used in this manner?

My code works fine when the channel handle declaration is contained in one source file, but crashes when I try to break it out.

Header File Declaration:

 

extern TDMSChannelHandle * tdmsChannelHandle;

 

Source File Definition:

 

TDMSChannelHandle * tdmsChannelHandle = 0;

 

0 Kudos
Message 1 of 2
(1,002 Views)

Your post contains not enough information. The fact that you declare it as extern should not change the operation. That you initialize it to 0 without assigning a valid handle by opening successfully a TDMs file could be not the problem?

And as soon as you try to access that handle from multiple source code modules you have to make sure of course to assign a valid handle somewhere before you try to use it elsewhere!

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(938 Views)