Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 09/16/2021 in Posts

  1. 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 points
  2. 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 point
  3. The only reason I caught it so fast it that I've done it myself a few times. Only other advice most of the forum guru's would give is to break up the three lines in rung 1 into individual nets. I'm sure it works fine as coded but in some cases line stacking in a single rung (net) can give unexpected results. Something to do with the compiler, not sure... I'm loosely re quoting others. Glad you got it working to your satisfaction.
    1 point
  4. No! Either place both sets of conditions in the same ladder rung leading to the coil, or create two intermediate coils, one with each set of conditions, and use those intermediate coils in parallel to activate the original coil.
    1 point
  5. Hell Y.INDS. It does seem that when leading spaces are present in the string, the function will not convert (unlike leading zeros). Try to remove the leading spaces first.
    1 point
×
×
  • Create New...