Search the Community

Showing results for tags 'subroutines'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 4 results

  1. Hello All, I am using GxWroks 2 software is there a way to create a Routines and the under itself create several Subroutines Like studio5000 and Omron. Please See the Image Attached  can we do Similar thing in GX works Searched for 2 hours on the inetrnet and found nothing. HELP
  2. Subroutine bug across POUs

    Hello, I have a subroutine error that I cannot figure out. I had about a 45k step ladder project with about 50 subroutines running great. I decided to add another subroutine and I get this error (attached.) Error H33E7 which means there is some structural ordering issue. I have had this before and it was always that I forgot my RET or I deleted a RET on accident after a subroutine definition. No prob, easy fix. However, that is not the case with this issue I am having. After cutting code out of my project until the error went away, it came down to specifically this: (see simple code attached) This is a test project separate from my main project to replicate the issue. Notice in the Navigation panel that I have two POU's under main program. POU2 shown in the picture is M0 controlling a call for P1. FEND, then P1 is defined as a simple INC Z0 and then RET. This is the exact 'structure' in my working subroutine ladders but with much more complex operations; where, I define 50 or so subs P1-100 thereabouts, and call them throughout my other POU's, and each sub is 25-100 rungs. This code you see does not error until I added POU1. Meaning, building and simulating POU2 by itself will work. Adding POU1 is a simple SM401 (always off) controlling INC Z1. Its just a dead line to make POU1 a thing when compiled. Then I get the error. No matter what is in POU1, the error will exist. This basically means I cant have any other POU's without a structural error when using subroutines. In diagnostics while simulating (and on the FX5UC PLC unit I have, I tested if it wasnt just simulation), I can jump to the error line. It will always point to the first line of POU1. This is important to note: in my full program with the 50 subs, when the error occurs, it will pick one of my 7 POUs and say error at the first line of it. If I unregistered that POU that is marked, the error will simply jump to another POU, and so on until it was reduced to basically the sample code I showed in the attached. The error went away when it was 1 POU.   But in my working project (before implementing this sub that caused all this issue) all these subs work and there are several POUs. I spent a 2days on this so I am just g oing to copy paste this code I intended to sub many times just to move forward, but I want o understand what is the hangup. The test project was me just trying to write a sub again and apparently I cannot anymore. Thoughts? I appreciate it, thanks.        
  3. Hi, In my HMI project I use a subroutine triggered by a button. All it does is check if certain variables are triggered and if the condition is met I use the showpage function to call a popup page.  Because of the update interval between PLC and HMI to 100msec the condition inside the subroutine is not always met although the PLC has completed the job behind the scene. Is there a way to implement a "wait until strategy" instead of the straight "IF...END_IF" I am using now ?  
  4. I am pretty new to Automation Direct. This is my first project programming in Direct Soft 6. Is there a way to make subroutines?