05-31-2015 05:33 PM
Hello All!
I am a Labview newbe and I need help with image control. I have a set of two images- one static png and one animated gif. I want to use these two images as an activity indicator in a picture box or other control. I can send one or the other to the picture box programmatically in the function block screen but I do not understand how to set the image control conditionally for condition "A" and condition "B". The code below is for two separate picture boxes. My goal is to select one image to show in a single box depending on conditions "A" or "B". The two conditions are "not running" and "running". Can this be accomplished with boolean logic? I also hope to use such a control in the future for multiple conditions to help illustrate to the user a specific hardware item to pay attention to. I am using LV 2014 on a Windows 7 box. The built VI will be used on Windows 7 and XP.
-cmengineer
05-31-2015 06:50 PM
Bob Schor
06-01-2015 10:57 AM
Hi cmengineer,
It sounds like you may be talking about a case structure. Take a look at this link and see if it will work for your project. If not, can you please explain your end goal in more detail?
06-01-2015 01:04 PM
Hi CMEngineer,
There are many ways to select the path you'd like. You can drag a path constant into an array constant to create an array of paths, then index out the one you want. You can also use selectors or case structures.
06-06-2015 09:05 PM
Sorry, Bob. I really am "that new". I will post the vi.
06-06-2015 09:27 PM
Hey, we were all Newbies at one time! And you are trying to do some interesting things with LabVIEW -- we're here to encourage you.
Bob Schor
06-06-2015 09:38 PM
Thank you Briana. Yes, I did try the case structure shortly after posting the question. I am sure that this is the correct method. What was odd is that I did not seem to get the effect of changing the image as a result of the bool flag I used. It may be that a GIF cannot be used in this fashion with a PNG . If this is the case (no pun intended) how can I utilize static png images and animated gifs to indicate activity? When I try to run the vi, I do get error 6 regarding the File I/O error at this section of the code.
I am attempting to recreate a program which I created in VB.net some time ago.
06-06-2015 09:58 PM
All,
Attached is the vi. I did not attach the the other associated files. I do not know if I should package them in a zip file. The forum has a limit of three files per post.
-cmengineer
06-07-2015 10:04 AM
@cmengineer wrote:
All,
Attached is the vi. I did not attach the the other associated files. I do not know if I should package them in a zip file. The forum has a limit of three files per post.
-cmengineer
Yep, bundling them into a ZIP file is how you do it.
Some questions and comments:
Bob Schor
06-07-2015 09:00 PM
Happy Sunday Evening All!
I have included all files in the zip file. I changed the image for one state to a jpeg and changed the control to a jpeg control. This works to demonstrate the state change but my goal is to use the gif which is shown as decoration in the middle of the vi front panel as the running state indicator.
Now that I have tested it, I think I need to work on the file write operation as well. Instead of getting my four points of data in a row, I get one or another. Always fun!
-cmengineer