JW0807 Posted December 13, 2023 Report Share Posted December 13, 2023 Bit of a newbie to visilogic and PLCs in general, and am having an issue with store functions not working. Could someone point out my mistake? Link to comment Share on other sites More sharing options...
MVP 2023 kratmel Posted December 13, 2023 MVP 2023 Report Share Posted December 13, 2023 Moved... to appropriate forum section Standard problems: -- MB47 and MB50 are not activated according to the program; -- the piece of code you wrote lies in a routine that is never called anywhere; --there is another place in the program where variables MI97 and MI116 are overwritten with another value or initialized. If possible put your code here otherwise it's hard to tell where the problem lies. P.S. What plc are you using and how do you test your code? Link to comment Share on other sites More sharing options...
MVP 2023 Ausman Posted December 13, 2023 MVP 2023 Report Share Posted December 13, 2023 and as well.... -- Split this into 2 rungs, -- Ensure that MB50 & 47 (and perhaps any other MBs that also dictate parameters) cannot be called at the same time...only one of them (all). Re the "routine that is never called anywhere" noted by Kratmel, read this: Point 11 in here: https://forum.unitronics.com/topic/6229-ongoing-24-topics-almost-worth-pinning/ cheers, Aus Link to comment Share on other sites More sharing options...
JW0807 Posted December 14, 2023 Author Report Share Posted December 14, 2023 Fixed the issue. I had created a new subroutine just for that code, and I guess the program never called on that subroutine, so I moved it into the main subroutine and now it works fine. For future reference, how do you call up a subroutine? (I should probably read the help section 😁) 1 Link to comment Share on other sites More sharing options...
Cara Bereck Levy Posted December 18, 2023 Report Share Posted December 18, 2023 On 12/14/2023 at 4:33 AM, JW0807 said: Fixed the issue. I had created a new subroutine just for that code, and I guess the program never called on that subroutine, so I moved it into the main subroutine and now it works fine. For future reference, how do you call up a subroutine? (I should probably read the help section 😁) Yes 🙂 Link to comment Share on other sites More sharing options...
sgull Posted December 18, 2023 Report Share Posted December 18, 2023 Hi JW0807 The example above show how to call subroutines when certain conditions are met. The best way is to call subroutines without any condition. Just connect the call subroutine block directly to the left rail without any condition. This way the subroutine is always called. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now