pszczepan Posted August 31, 2018 Report Share Posted August 31, 2018 Hi, I did some code and it works partially, but I don't know where is a mistake. I atttached my api. The problem is on screen 2 with variables green and pink. Variable MI5 should shows elapsed time of timer #0, #1, #9 depends on MB1,MB2, MB3 (net 27) - it works correct On the same scrren pink value is connected to variable MI8. Variable MI8 should shows elapsed time of timer #2, #3, #10 and depends on MB11,MB12, MB13 (net 28) If only one Mi5 or MI8 change values everything is correct, but when both are working displayed values are strange. If you can test it please check it and write where is a problem. Uni_ostatnie.U90 Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted September 1, 2018 MVP 2023 Report Share Posted September 1, 2018 Thanks for posting your code. Your program is full of the newbie error of putting multiple logical statements per network. When you download, each net is submitted to the STL compiler and sometimes what is actually sent to the PLC is not what you intended. Break your code into one logical statement per net - there is no limit on how many nets you can have. If you right-click on the side of the net and select STL Quick View you can see the compiled statement list. Everywhere you see a "!" it's a new logical statement. Your net 27 has three. This is not good programming form in UnitronicsLand. I have separated your nets 27 and 28 to show what I mean. I don't have a unit handy to test it so you'll have to let us know if it worked properly. Go back through your program and break the rest of it up as I have shown. Joe T. Uni_ostatnie JT.U90 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