Str8jCkt

MrPLC Member
  • Content count

    24
  • Joined

  • Last visited

Community Reputation

6 Neutral

About Str8jCkt

  • Rank
    Sparky

Profile Information

  • Country United States
  1. RecSearch unreliable.

    @SKA AB  If you place the StackPush in line with the EndofOperation of the RecSearch does the problem seem to improve?   Take a stab at what may be going on... I am wondering if on Rung 1, when Lap1_OperationComplete goes TRUE, RecSearch on Rung 0 is no longer being executed (EN is off) so maybe Lap1_FoundBoard will go FALSE. I do not think that output is a "Retained" status and goes FALSE when it is no longer executing. This could possibly cause Rung 1 to execute the StackPush multiple times as long as Lap1_Processing bit is still high. Also will depend on conditions you are using to reset Lap1_OperationComplete  
  2. @DonNH Use the Omron help for any functions, they can be very informative. Select the function and F1 to go to the help. FOR loops do execute the entire loop within a single PLC scan so like @chelton said it is probably not the correct solution for what you are wanting to do. Without really seeing how you are doing you commands, if you are wanting to check a condition every second then maybe you can just use the Get1sClk instruction.     Would look something like this.  This assumes the Start_enabled bit is latched on the entire time after you execute your function. on a Failed state you would probably reset your function execute and then issue the command again if it has been turned off.          
  3. Not sure why the website is being goofy, I can't even open threads now but I was able to see your response on your wall here. Thank you for the help that was exactly what I was looking for. 

  4. First Scan bit

    @taxidelt Not sure what is up with website but i am unable to upload screenshots.   Menu > Help > System Defined Variable Reference It should open a pdf file with a list all system variables. There are two options depending on your need P_First_RunMode P_First_Run
  5. @AlphaPapa here is the file i had reated. The idea is to turn on the PLC ftp server. Then have the PLC ask itself what files are on the server directory (SD Card).   R&D - ReadSDFileList.smc2
  6. @DonNH Threw something on one of my current PLCs real quick that might work for you. I made them all internal variables, but you could make your upper and lower limits global and editable from a Maintenace menu or something.     Sadly, Omron does not have very good general "In Range' functions so i usually write some of my own with this exact logic. For your case, would need to use TIME_OF_DAY variable but to make other range check functions just change the variable types as needed and create any InRange function to suit your need.      
  7. @ollyhutsby  First thing is to check the status and make sure the Ready is on before executing the command to move.   If Ready is not on before executing, then it will never move no matter if you command a move or not.     Also just checking if you already have the Power Instruction in your logic. Make sure that the status from it is good. And then if you have the Reset Instruction to be able to clear any conditions of the drive.
  8. NA5 HMI Popup

    @BE, bit of a long response but wanted to give you some things i learned by experience. There may be others in this Forum with far more experience than me but hope this helps. Here is the method i use to create HeartBeat from the PLC to the HMI so HMI can run conditions based on the HeartBeat. I noticed in my previous post that my comment on HeartBeat variable was (HeartBeat - 10ms). Sadly the comment is from my early development and with much testing i found a 10ms HeartBeat to HMI is not practical. The reason for that is Sysmac variable setup on the NAs only allows a minimum update rate of 100ms. Since that is the case lately i have set my PLC Heartbeat to toggle 100ms low and 100ms high (actually 95/105) as the attached code demonstrates.   You can then use the HeartBeat in Events to perform a number of actions - update variables, run a subroutine, etc.     From experience be careful how often you are calling subroutines via this method. If you are calling too many to "run in the background" or repeating one before it has finished it is possible your HMI will start to feel sluggish and unresponsive - have been there many times. As you stated, if your VB code is heavy, it can take a lot of HMI resources. The longer i have used Sysmac the more i have limited the amount of code I have the HMI running and handle as much as possible in the PLC.  A couple other points i will make is you will notice in the post to @kckku i have my HMI page info Event running as an interval instead of via HeartBeat. I used to use HeartBeat a long time ago to catch HMI connection state but got away from it for interval instead. In that case i found it best not to check AsyncExecution but when i use a HeartBeat to run code i usually check the AsyncExecution.   Rather than HeartBeat to run your Subroutine on set intervals you can just use two variables between HMI and PLC. One that PLC sets to call an Event to run the Subroutine and then one that returns complete at the end of the subroutine to tell PLC it is finished.  PLC can then detect the complete variable, reset it and call to run again if needed. IT is important to note depending on how much you are doing in the VB code; the complete response may come thru before the refresh rate of the variables the code may be changing. I have found it is best to add sufficient delay in the PLC even after the complete signal to ensure all variables have truly been updated. Not sure of your application but here is an example of how i have a machine self-changing product configs during run using Omron HMI RecipeViewer. HMI does not need to be on the page with the viewer for this changeover code to work. This demonstrates not using a HeartBeat but two variables, Change and Complete that PLC will command HMI to run code and then receive a response.      
  9. NA5 HMI Popup

    System popups not really. Your created popup pages, not directly but you can create a means of knowing what page is currently active using an Event in the HMI. In all my projects i create an HMI structure in my PLC that i pass certain information from the HMI. Along with other variables this structure contains variables for passing _HMI_CurrentPage (Page Name as a String) as well as _HMI_CurrentPageIndex (Page Number) These values are updated even when a popup is active. IF A POPUP PAGE YOU CREATED. Then your PLC will know either by page name or number that your popup is active.   Attached example of how to add the event and what variables it pulls from each page property. Also attached partial snip of part of the HMI structure I create in the PLC  
  10. Looks like you are trying to use RecSearch. This is beneficial when you have an array of structures and you want to search within one of the structures of your array. That is what Member In[0].m is referring to.  Since you are doing a search within a single dimensional array you could try just use ArySearch. ArySearch works if you do not have various "member" in your array.
  11. Timer logic

    That is the behavior of  TON  function. IT only increments as long as the input is TRUE. the timer resets when the input goes FALSE. If you really want to keep the timer method you have then you could just SET the First output and use TP Conv2_timer  off logic to RESET it.        
  12. Timer logic

    Your TP timer Conv2_timer will cut off right at 4sec, turning off the control to the TON On_timer_conv2 . Not sure if the scan time will catch the input on long enough to pulse the output from the TON that sets the TP timer_conv2.  Could you try something simple like this so your TP and TON are running simultaneously and the TP timer_conv2 will not set until  O_C2in_run  is actaully off? 
  13. Lipton, A few years back I was right where you are trying to get Beckhoff Safety EP modules to work with Omron. I ended up trying to get EtherCAT FSoE safety modules from several different vendors to work with Omron with no luck. Closest i could get was some that would actually load the ESi and allow me to put the device on the EtherCAT network but they would not show up in the NX-SL Safety PLC. Would only allow me to use them as standard inputs or outputs in the Main PLC. One option is to pass the I/O from the Remote modules into the Safety controller via Exposed variables and then use them in the Safety program. But then they are just working as standard safety Inputs and you paying extra for the EP safety module when you could just buy the standard I/O version of the EP modules. as @photovoltaic said, if you want third party remote I/O modules to work directly in the Omron Safety controller you would need to use CIP safety modules with the NX-SL5 safety PLC or drop in an ECC module with Omron Safety modules.
  14. Calling a sub

    You are correct, there is no event on the RecipeViewer when something is selected or change. These would be nice features to have added. I have used Omron Recipes and RecipeViewer on most of the projects i build lately. Typically i only have one template and several Recipes that are selected manually. But i have had a few machines which required multiple templates with RecipeViewers on different pages. I have used Barcode scanners that would determine the product and load the appropriate Recipes by calling global subroutines. When need manual selection/load i add a button to "load" the selected recipe/template - sounds similar to what you ended up with your DataDisaplay solution. It is nice sometimes to go to the RecipeViewer and select different recipes to compare the ingredient values without actually loading each time you select one to view.   For auto loading you can create a global subroutine. Depending on if you already know your needed recipe (in case i mentioned above with Barcode scanner) then you can pipe in the recipe name or you can request the selected recipe from the RecipeViewer. The Page and RecipeViewer object names can be static or dynamic depending on your need as well. Code would be end up being something like this...   Public Const RecipePageName As String = "Setup" Public Const RecipeObjName As String = "RecipeViewer0" ' --------------------------------------------------------- ' Load Selected Recipe ' --------------------------------------------------------- Public Sub Load_Selected_Recipe     Dim SelTemplate As String      Dim SelRecipe As String      SelTemplate = GetSelectedRecipeTemplate(RecipePageName, RecipeObjName)      SelRecipe = GetSelectedRecipe(RecipePageName, RecipeObjName)  ' ---- If Loading Selected Recipe of the Viewer     SelRecipe = Barcode.ProductName                                                         ' ---- If Loading Recipe Called by PLC     WriteRecipeToController(SelTemplate, SelRecipe) End Sub      
  15. Calling a sub

    Artz, So i am a little unclear of the ultimate goal you are trying to achieve, Simply put, it sounds like you want to select a recipe and then "load" the ingredient values from that recipe into other variables for display. Is this correct? One question i have is why are you trying to run a global sub on a one second interval for this? Is your selected recipe changing frequently? That would mean you are coding the recipe selection to change or someone is on the recipe page selecting or changing variables frequently. If selected recipe is not changing frequently then why not just have a onetime event to "load" the recipe ingredients after a new one has been selected? It seems excessive to constantly be reading/writing data when a new recipe has not been selected/changed. There are a couple ways you could tackle this. You could have the Sub routine that loads the recipe at the page level OR at the global level. You just need to decide what event you want to use to trigger the subroutine. If code is changing the data then use that code to trigger the "load". If someone is making the changes then they are already on the needed page and have one of their actions trigger the event to load. I would not try to split the handling of this between both places (global and page) unless the page is calling the global routine. It may be possible, but I have not had any luck calling a page subroutine from the global level.