ScottRyan Posted August 7, 2017 Report Share Posted August 7, 2017 I am having an error that when I add a call subroutine in my main ladder the program does not load on the PLC. It is giving a Status: Idle on the black and white startup screen and stays on the screen. When I take the Call subroutine out. The main ladder and HMI shows on the PLC. Has anyone had a problem like this before? I have Updated the OS, Loaded a blank program and then downloaded my new program, but its still not working. Thanks Scott Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted August 7, 2017 MVP 2022 Report Share Posted August 7, 2017 I recommend posting your program here, but the only thing I can think of off the top of my head is that the subroutine is causing a Watchdog Timer error. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted August 8, 2017 MVP 2022 Report Share Posted August 8, 2017 Hi Scott, perhaps there isn't a return in your sub? cheers, Aus Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted August 8, 2017 MVP 2022 Report Share Posted August 8, 2017 I'm also assuming that compile is being/has been done ok, which in theory checks for any anomalies. It would normally do this anyway during a download. If you can't post the entire program, perhaps just the sub and pictures of the calls? Also, have you done a total reset when online? Connection/Communication & OS/2nd Tab/Initialize & Reset. Very occasionally I have odd things happen after a download that shouldn't need this, but the reset has cured the issues. cheers, Aus Quote Link to comment Share on other sites More sharing options...
ScottRyan Posted August 15, 2017 Author Report Share Posted August 15, 2017 I'm sorry for not replying. I usually get an email letting me know someone responded. I did not receive any this time. If you anyone is still out there..:\ I tried compile and it had no errors. I also tried initialize & reset to no avail. I could not post my program because it was too big even when compressed. I have messed with it and found that in my main routine I was calling sub 1, sub 2, ret. In Sub 1 I was calling sub 2, ret. In Sub 2 I was calling sub 1, ret. I removed the calls in sub 1 and sub 2 but left RET. It now works. I am guessing this put it into a continuous loop and then error..? Any insights would be great. Thanks for the help. Scott Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted August 15, 2017 MVP 2022 Report Share Posted August 15, 2017 2 hours ago, ScottRyan said: in my main routine I was calling sub 1, sub 2, ret. In Sub 1 I was calling sub 2, ret. In Sub 2 I was calling sub 1, ret. I removed the calls in sub 1 and sub 2 but left RET. It now works. I am guessing this put it into a continuous loop and then error..? Any insights would be great. Why were you doing this? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted August 22, 2017 MVP 2022 Report Share Posted August 22, 2017 It was definitely looping if you were calling sub 1 from sub 2. The watchdog was timing out. It's best to call all subroutines from the Main in a simple program. Joe T. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.