LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

images for picture box

I have to create a system configuration control for our machines.
 
What we are going to have are a lot of images (about 50 or so) that will be displayed as the operator selects different sub-systems to configure.
 
We started with a tabbed index, used "drag-n-drop" to put a different image on each tab of the front panel, then used the block diagram to switch from one tab to the next. So, in our block diagram, there is an enumeration wired to a Tab Control property-node for *each* change to the tabbed index.
 
Here is the problem: When we add new tabs to the tabbed index control (future features, etc.), the Tab Control enum changes, and the wire from the Tab Control enum to the Tab Control property node breaks.
 
Fixing these broken wires is tedious.
 
We can drag-n-drop the images directly onto the block diagram, and this would be an acceptable solution if we could find out how to get the images on the block diagram to load into a picture control.
 
Most of the images have to be sized to fit, so we don't want to have them dynamically linked to a folder. It would be best if we could place all of our images onto either the front panel or the block diagram, then load those into a picture box (or something similar) whenever the image is needed. But, for images dropped on the block diagram, there are no wires to connect them with a picture box.
 
Any thoughts? Suggestions?
 
Attached file is saved in 8.2 format.

\
Angus Cattle from Pool Ranch and Steel Repairs via Joe's Welding.
0 Kudos
Message 1 of 8
(4,030 Views)
I would suggest creating a typedef'd enumeration. This is a control (.CTL file) that consists of an enumeration and it's Status set to typedef

When you drop instances of this typdef on your block diagram OR fron panel, it is LINKED to the CTL. Any changes made the the CTL will AUTOMATICALLY update the instances on your fornt panel and block diagram.

When you add an item to your typdef'd enum, your Tab Control and your case statements will likely break, but you can usually use Add Page or Add Case and move forward. Your existing enums in the other cases should update.

LabVIEW wiki: Type Definition
LabVIEW wiki: Enum: Potential Uses






Message Edited by Phillip Brooks on 01-02-2008 12:28 PM
Message 2 of 8
(4,018 Views)

I changed the vi you created to customize the tab control and turn it into a type def.  Now when you update the control, all the constants will update with it. 

 

Tom

Download All
Message 3 of 8
(4,011 Views)

Forgive if i missunderstood, but, wouldn't it be easier putting the constant number ( ex: "0"(zero) in the property "Value" of the table or its local variable) of the page instead of the enum constant?

That way, the only problem is when you try to load a page number that doens't exists.

0 Kudos
Message 4 of 8
(3,998 Views)

Mr. Bau,

I tried doing that at first, but LV would not let me wire a constant because Values was expecting an enumeration.


\
Angus Cattle from Pool Ranch and Steel Repairs via Joe's Welding.
0 Kudos
Message 5 of 8
(3,974 Views)
Strange, I use constants to select pages always because of that problem.
Maybe we're talking about different errors.
I've attached a VI that illustrates the problem I've experienced. 
Download All
0 Kudos
Message 6 of 8
(3,952 Views)

Hi Yves,

The enum wire breaking is a good thing. It lets you know you should think aout the pages and how they are numbered.

But an better option is to use typedef'd enums (as mentioned earlier).

The big issue arises when you re-arrange tab pages. If you use the numeric contstants, your approach will still run but the pages dispalyed could be wrong.

If you define typedef'd enum, and use it in your diagrams instead of the numerics, you only have to edit the typedef once and all occunces get updated. I used to find it frustrating that I would have go back and change a lot of contstants (and find them!) before I learned to used typedef'd enums.

Try it, you'll like it. Smiley Wink

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 8
(3,943 Views)
Hi Ben,
Sorry, I didn't know your name before, I'm used to going for the easiest way, so i simply add a page after the last one, in that way the number always increases, because i never rearrenge the pages, since in most of my applications the order didn't matter.
It's my first time with the typedef's, and i agree that will make it easier for big projects that uses a lot of subvi's, because the data is changed in every one of them.
Thanks a lot =D
 
Yves Rios Bau
0 Kudos
Message 8 of 8
(3,936 Views)