From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make an Image global?

Solved!
Go to solution

Hi

I am trying to access an Image acquired using NIIMaqdx from a different .c module within the same program. Basically, I have written the live image acquisition in a separate .c file and I need to be able to get snap shots from the main source file. I guess the question is how to make the NIIMAQ "Image" variable global.

 

Thanks in advance!

 

Nabs

0 Kudos
Message 1 of 3
(2,496 Views)
Solution
Accepted by topic author nabs_nu

Hi nabs_nu,

To my knowledge, accessing an Image from a different .c module would be the same as with any other variable in your code. You can either pass the image to a function in the other module as a function parameter, or you could make the variable an "extern" variable. The following Stack Overflow page has a good discussion of extern variables and what their use cases are.
http://stackoverflow.com/questions/1433204/how-do-i-use-extern-to-share-variables-between-source-fil...

Charlie J.
National Instruments
0 Kudos
Message 2 of 3
(2,437 Views)

Thank you Charlie! This helps a lot! 

0 Kudos
Message 3 of 3
(2,399 Views)