gunnaraherman

MrPLC Member
  • Content count

    23
  • Joined

  • Last visited

Community Reputation

1 Neutral

About gunnaraherman

  • Rank
    Sparky

Profile Information

  • Country United States
  1. I found this video to be helpful when I was working through recipes.  https://www.youtube.com/watch?v=8gqnYP5AOps   
  2. Enumerations in Recipes

    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.
  3. Enumerations in Recipes

    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?
  4. Enumerations in Recipes

    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.   
  5. Enumerations in Recipes

    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. 
  6. Programatically Select Recipe

    I don't think so. I opened a new project and added an HMI with a recipe viewer object and it worked in simulation mode. I've attached the project so you can see yourself.  Make sure the DataDisplay type is set to String, not Numeric.    Hope this helps. test.smc2
  7. Programatically Select Recipe

    If you're using the DownloadRecipe subroutine, place the variable assignment in there. So it should look like  Public Sub DownloadRecipe WriteRecipeToController(RecipeViewer0.SelectedTemplate, RecipeViewer0.SelectedRecipe) NJ1_HMI_Loaded_Program = RecipeViewer0.SelectedRecipe End Sub It would then seem like you don't need the WriteSelectedRecipe subroutine.  As far as creating a new recipe, I would start a new topic to keep subjects and comments organized. 
  8. Programatically Select Recipe

    This line assigns the selected recipe to a global string variable: NJ1_HMI_Loaded_Program = rcpMold.SelectedRecipe In your case it should be: <your_global_string_variable> = RecipeViewer0.SelectedRecipe  
  9. Programatically Select Recipe

    The DownloadRecipe appears to be fine. I tested it in Simulation mode and it worked for me. I've attached an image of the value in the watch window. For your DataDisplay, just make sure that the variable is entered as the expression (attached image).
  10. Programatically Select Recipe

    For now you can remove the Try Catch statement and the Global_Sub references. I was using those as well as the Global_Sub routines to communicate success or errors. If you simply have this inside your subroutine, it should work: Dim rcpSelectedTemplate As String = GetSelectedRecipeTemplate([name_of_page], [name_of_recipeviewer_object]) Dim rcpSelectedRcp As String = GetSelectedRecipe([name_of_page], [name_of_recipeviewer_object]) WriteRecipeToController(rcpSelectedTemplate, rcpSelectedRcp) NJ1_HMI_Loaded_Program = rcpSelectedRcp Where NJ1_HMI_Loaded Program is a global string variable.  Use the Watch window or a data display to view the value of the Loaded Program variable.
  11. Programatically Select Recipe

    You should be able to get this value even in Simulation mode. I tested it myself and was able to get it. In the above code, these two lines get the selected recipe template and selected recipe, make sure the parameters are correct. Dim rcpSelectedTemplate As String = GetSelectedRecipeTemplate("Main", "rcpMold") Dim rcpSelectedRcp As String = GetSelectedRecipe("Main", "rcpMold") "Main" is the page name, and "rcpMold" is the name of the recipe viewer object. I find that looking up the function in Help -> Instruction Help is very helpful in answering any questions about it.
  12. Programatically Select Recipe

    I have this VB code which fires every time I write a new recipe: Sub WriteSelectedRecipe() Try Dim rcpSelectedTemplate As String = GetSelectedRecipeTemplate("Main", "rcpMold") Dim rcpSelectedRcp As String = GetSelectedRecipe("Main", "rcpMold") WriteRecipeToController(rcpSelectedTemplate, rcpSelectedRcp) NJ1_HMI_Loaded_Program = rcpSelectedRcp 'Selected reciped gets set here Global_Sub.ShowSuccessPage("Program '" & rcpSelectedRcp & "' has been written.") Catch ex As Exception Global_sub.ShowErrorPage(ex.message) End Try End Sub I created a variable named  NJ1_HMI_Loaded_Program which is set in the above code. You can then use a Data Display control and set the Expression as NJ1_HMI_Loaded_Program. Hope this helps.       
  13. Programatically Select Recipe

    Could you explain this more? Specifically how to set it as fixed parameters in my scripts. You said the .SelectedItem is for the recipe viewer, which is where I would like to programmatically select the recipe. However, I do understand that the method is read only, and not used for setting.  In my mind, what I think I need to do is before each action that resets the selected recipe is store the recipe in a variable. Then at the end of the Sub, do something like 'rcpViewer.selectedRecipe = varRecipe' - just not a read only method.  Thanks for the help. 
  14. Dialog File Browsing

    Apologies for the delayed response.   I can share what I have once it's finalized, but can't take any credit for it. The original IAG that I downloaded is here listed as  Memory File Manager SD / USB / FTP Filemanager V2 https://www.support-omron.fr/Prog_HMI.php I just stripped out the right side listbox and dropdown and minor other differences.     
  15. Dialog File Browsing

    After reading through this post I was able to find a File Manager IAG that I was able to use.  The site has a lot of helpful examples that I think will prove useful in the future.