gunnaraherman

Enumerations in Recipes

8 posts in this topic

Hello,

 

Is there a way to limit the input of an ingredient value, possibly by use of an Enum? 

For example, I have an ingredient called Press_Speed. I want the values to be either Normal, Slow_1x, Slow_2x, or Slow_3x. On the PLC these values are interpreted as numbers. Can I limit the input to the String representation of the Enum?

 

I'm using the NA series HMI with Sysmac Studio. 

Share this post


Link to post
Share on other sites

You can set min a max value for each ingredients in recipice when you add ingredients. For example min 0 and max 100. Than you are not able to set value which is out of range.

Share this post


Link to post
Share on other sites

That has more to do with data validation which is different. 

In the same way that a Boolean data type will give you the option of a different keypad with the options True and False buttons, I'm looking for a way to allow users to select the Enumerated values, with the ability to enter its String representation on the keypad (Normal, Slow etc), not its numerical value (1,2, etc).

Digging into this, it appears there's no way to accomplish this. 

 

Share this post


Link to post
Share on other sites

 

2 hours ago, gunnaraherman said:

Digging into this, it appears there's no way to accomplish this. 

You can do this, perhaps not with the canned recipe tool, but by building your own recipe handling code. I typically build my own recipe code anyway as it is much more flexible.

Share this post


Link to post
Share on other sites

Up until now, the canned recipe control has worked well for me, although now that my needs have changed, I may need something a little more versatile. Do you have an example of a custom built, more flexible recipe editor?

Share this post


Link to post
Share on other sites

Just use a button to turn on a momentary bit and select the numbers in the PLC. When the bit is on use it to show which speed is selected on the screen. To change numbers in the PLC use a number box and put a password on it. Or you could use a string into a DM area in the PLC - they enter the words - push a button and use a table compare function or something in the PLC to determine what has been typed in - match - turn a bit on.

Share this post


Link to post
Share on other sites

Here is an example of some simple recipe code, of course this can be much more elegant than this:

Recipe Sample.smc2

Share this post


Link to post
Share on other sites

Apologies for the late response. I was traveling. 

 

Thanks for the example. I'll need to update Sysmac Studio first to view it, but I'm sure it'll shed light on this issue and future issues. 

 

In the meantime, I was able to create an ingredient that was uneditable and not visible within the recipe viewer object, and map the variable to a group of radio buttons. The only thing extra I needed to do was call the VB function to set the recipe ingredient before I saved the recipe. 

 

Thanks for everyone's help.

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