gunnaraherman

MrPLC Member
  • Content count

    23
  • Joined

  • Last visited

Posts posted by gunnaraherman


  1. 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.


  2. 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. 

     


  3. 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. 


  4. 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. 


  5. 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.


  6. 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.


  7. 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. 

     

     

     


  8. 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. 


  9. Hello,

    I am looking for a way to use the OpenFileDialog in VB to be able to select a recipe file to import. I read this forum:

    and thought that maybe I could access the OpenFileDialog function from the code, but System.Windows.Forms namespace is unavailable. 

    Is there any other way to access the dialog box to let the user select a file?

    I am using Sysmac Studio with an NA5 series HMI.

    Thank you for your help.


  10. Hello,

    I am looking for a way to programatically select a recipe. Any time that a recipe is change or saved, the recipe viewer object always resets its view and selects the first recipe. This will lead to possibly writing the wrong recipe to the controller, as well as frustrate the user if they have to scroll through a hundred items to find the recipe again.

    I looked at the VB functions, but the only one I could find that was close was the .SelectedRecipe, which is a read only.

    I am using Sysmac Studio v1.1.7, and an NA5 HMI.

    Any help would be appreciated.


  11. Hello,

    I am using an NJ301 PLC with an NA series HMI. I am communicating to the PLC via FINS protocol using the DotNet FINS UDP application by Jay Anthony found under the downloads section.

    I am finding that when I write a string to an address, the bytes order are reversed. For example,  I am writing the string 'Test' to variable 'FINS_String', which is a String data type at memory address D20. My FINS command is the following:

    010282001400000254657374

    0102: Write

    82: Data Memory

    001400: Address 20

    0002: Write 2 words

    54: T

    65: e

    73: s

    74: t

    The value that appears on the HMI and in the watch window is 'eTts'. If I write 65547473 (eTts) as my command, it appears correctly as 'Test' on my HMI.

    I debugged the application and I see that the byte array is being sent in the correct order, so I'm not sure what the matter is. I can't imagine that to pass a string through FINS protocol the hex values need to be switched every time. 

    Any help would be appreciated. Thank you for your time.

     

     


  12. 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.