LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a shared variable to store 2D Picture data?

Solved!
Go to solution
I'd like to store 2D picture data as a shared variable, but there's no data-type to do so! How can I do it?
0 Kudos
Message 1 of 5
(3,852 Views)
Solution
Accepted by topic author jamespherman
You will need to use the Picture to Pixmap VI to get a cluster of image data which you use with a shared variable. Have a look at the other VIs in the Picture Functions palette on the block diagram.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 5
(3,842 Views)

Adnan --

 

Thanks! I figured something like that would work, but I was trying to avoid using the extra conversion step, in my application (generating stimuli to evoke human eye movements which I then measure and experimentally study the parameters of) I need to redefine the stimuli constantly, and the conversion was going to be a little annoying.

 

I'm surprised that there's no way to directly create a shared variable with the picture data type, however. Fortunately, Eric Shaffer (an applications engineer) that I was phoned up, pointed out that one can create a Global Variable of the Picture type. I understand that global variables aren't as robust as the shared kind, but I'm comfortable enough with the uses of Globals that this solution is preferable.

 

Thanks again!

 

-- jph

0 Kudos
Message 3 of 5
(3,836 Views)

I wasn't aware that you were using the variable on the same computer. Since you mentioned shared variable, I mistakenly assumed that you were going to use it over the network. There is no implementation difference between a single process shared variable and a global variable with one of the exceptions being what you have just seen with regards to the datatype. Also, a lot of people tend to use a single process shared variable since it's much easier to switch to a network published shared variable (all you have to do is to change the drop down option).

 

I would recommend getting into the habit of using a functional global variable (type of action engine), instead of using a global variable, since that helps in avoiding race conditions which could become relevant for you in the future, if not now:

Using Local and Global Variables Carefully

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 4 of 5
(3,830 Views)

James,

 

Your icon shows up as a red X because you have it posted on a 3rd party webserver that is not accessible.

 

Upload your icon to your image gallery, then go into your profile and have the icon image point to the image gallery file location.

0 Kudos
Message 5 of 5
(3,820 Views)