Action22 Posted September 18, 2021 Report Share Posted September 18, 2021 Hello, The following net is giving me a 1012 - Illegal Net error I've narrowed it down to the MB 38 NO contact, as when I remove it from the rung I do not get the error. Something is flying over my head and I don't get why have that bit is parallel would be causing an illegal net error. Any tips would be greatly appreciated Here is the STL view. 31.vlp Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted September 18, 2021 MVP 2022 Report Share Posted September 18, 2021 You need to break that network into four separate networks. Each one should have a separate and complete logical statement. It's good that you know how to use STL view, and it is showing you that you're over-working the compiler with all the LBs (virtual Local Bits) it has to create to try to accommodate you. There's no memory cost for more networks. Joe T. Quote Link to comment Share on other sites More sharing options...
Action22 Posted September 18, 2021 Author Report Share Posted September 18, 2021 Thanks for the feedback! Unfortunately i don't really understand what exactly is going on with the STl veiw(trying to figure it out though!) but I''l keep that in mid to break up my net Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted September 18, 2021 MVP 2022 Report Share Posted September 18, 2021 Every time you see a "!" in STL the compiler is starting it's own logical statement. It's kind of like assembly language and it takes liberties and re-arranges your rung. It can only make one decision at a time and writes results to the temporary memory. For example, look at the first few lines- ! MB 6 / MB 38 = LB 0 Translation- Look at MB 6 OR MB 38 and store the temporary result in LB 0. ! TD 4 = LB 1 Store TD 4 in LB 1. You can see here that it's looking at TD 4 before it's even called !N MB 35 & LB 0 = TD 4 Look at NOT MB 35 AND my LB 0; if true run TD 4 And so on. The more lines you have in STL View with "LB" in them, the more the compiler is performing somersaults to get your code to work. It's mission is to get it all in. Other brands of PLCs force you to finish a rung and number each one. Unitronics does not have that limitation but it can get you in trouble. When you create a new network, the slate is wiped clean and the result much more resembles what you were thinking. Compare the STL views after you break it up an you'll see what I mean. Joe T. 2 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted September 18, 2021 MVP 2022 Report Share Posted September 18, 2021 13 hours ago, Action22 said: The following net is giving me a 1012 - Illegal Net error Think about what ladder logic is all about. It's a high level language where each ladder rung is intended to encompass a single line of code. It's not just a blank slate with some random lines drawn. Separate lines of code belong in separate ladder rungs. You tried to put 4 lines of code in a single ladder rung. Sometimes you can get away with it, but it's fraught with risk and is very poor form. 1 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.