gunnaraherman

NA5 - Dynamically Change Image From Recipe

11 posts in this topic

Hello,

I'm pretty new to Sysmac Studio and have a question regarding displaying an image on the HMI.

We have a machine that uses molds to create parts. For each mold, there is a recipe storing information pertinent to it. I would like to be able to store either a ResourceID or an image path as an ingredient, and load an image upon recipe change. Using a subroutine, I was hoping to do it like this:

imgDrawing.ResourceID = GetRecipeIngredientValue("rcpMold", "SelectedRecipe", "ResourceID")

But I am unable to access the ResourceID of the Image. 

Is there anyway to be able to dynamically change an image upon recipe change, based off of an ingredient? Any help would be appreciated. 

Share this post


Link to post
Share on other sites

Not that I know of.  Dynamic images does not seem to be possible at the moment.

Share this post


Link to post
Share on other sites

Thank you for the reply. Do you know if there is any other way to display an image based off a recipe? The only other idea that I had was to add all the images to the screen and change the visibility based off the current ingredient, but this seemed a bit cumbersome. 

Share this post


Link to post
Share on other sites

There is no way I am aware of to change the image being displayed in an image object live.  Perhaps someone knows more than me about the scripting language and there is something there, but there is absolutely nothing I know short of the visibility you mentioned.

Share this post


Link to post
Share on other sites

Which screen? It is probably possible to do it the same way I do it with NS screens and the CJ2M - let me know - I can perhaps provide a sample.

Share this post


Link to post
Share on other sites

Apologies, I should have posted that first. I am using an NA5-9W001S screen with a NJ301-1200 PLC. 

Share this post


Link to post
Share on other sites

Cannot help - have never used one - my main screen is the NS.

Share this post


Link to post
Share on other sites

Hello,

currently NA5 doesn't support such function. If you try to access ImageBox property by VB, you won't find Image property there.

 

One way you can trick this is to make lots of ImageBox inside the same page, stacked together. Then you can play with it's IsVisible property based on the recipe used.

Although by this method I don't know how big the memory consumption will be

Share this post


Link to post
Share on other sites

With the NS you store images in the screen, attach to bits and do the work in the PLC.

Share this post


Link to post
Share on other sites
Just now, BobB said:

With the NS you store images in the screen, attach to bits and do the work in the PLC.

You mean the Indirect Addressing function right?

Try using NA sometimes... it is so uncomfortable :D

Share this post


Link to post
Share on other sites

You can use "DataLamp" to do that.

  1. Create a DataLamp object;
  2. Change design to Image and select your default image in "DefaultImageFile";
  3. Create many "ColorRanges" and choose "ImageFile" for each color range;
  4. Add "Expression" to choose the right recipe;
  5. Choose recipe using "DropDown" Object;
  6. Done!

 

2 people like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now