adccommunitymod (AutomationDirect) asked a question.

AND above JOIN in DL

Created Date: March 22,2006

Created By: franji1

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Originally posted by chris.zeman: I shouldn't have said scan time doubled; I realized just now it was quite that much of a difference, but it was enough of a difference to affect the performance of the DL-06 in my application. I no longer have the program I used for it before. I scrapped the design and the program. I'm trying to figure out if perhaps there was another factor that could have affected the results, but I'm at a loss. Doesn't the program size get larger with every instruction added, or am I misunderstanding something here and way off-base. I apologize if that's the case. My program consisted of a series of instructions (we'll say X0-X7 as an example), that would be part of a rung that branched into 2 levels, with different logic on each. Other rungs, duplicates of the one I described above only with different contacts, were in the program as well. The program gets quite large when you can't AND above a JOIN. If the program size is only a DirectSoft and human concept, then perhaps I'm looking at the problem all wrong. I do know that the DL-06 missed many pulses from the sensors. If I removed the logic for half the sensors, it was 100% accurate. I tried 2 DL-06's. An A-B 1100 had no trouble whatsoever. You 're 100% correct - it's the point that the number of RUNGs does not affect the scan time - its the number of ADDRESSES. Basically each instruction and each extra parameter take one word of memory. If you did this 1 2 3 -] This is technically 1 rung, but it takes up at least 11 words. (look at the bottom status bar of DirectSOFT to see the current size/max program size IN WORDS, to the left of the CPU type, e.g. 00047/15872). So, yes, the program size in words (not rungs) affects PLC scan. In DL PLCs and DirectSOFT, the same logic above would be programmed using MLS/MLR as: 1 -] The MLS and MLR each take a word, adding 2 words. But these instructions (or those similar) are there for other PLC systems - you just don't see them (like ANDSTR and ORSTR in DL - they 're there but you do not see them) However, if you are ANDing contact 1 with every rung, then I can see how your program is growing. Best bet is to use MLS/MLR instructions instead of duplicating and ANDing the "enabling " logic.


  • adccommunitymod (AutomationDirect)

    Created Date: March 22,2006

    Created by: chris.zeman

    Okay, franj1. I think we 're on the same page now. http://forum1.automationdirect.com/board/smile.gif

    Let me see if I got this right, because I believe I tried the MLS and MLR before and certain instructions (timers, maybe?) did not work with it. It's entirely possible (likely), however, that I had something programmed wrong.

    - - - --- - --(Y0)-

    |

    -- - --(Y1)-

    |

    -- - -(Y2)-

    would become

    - - - -------------(MLS)-

    | |

    | -- - --(Y0)-

    | |

    | -- - --(Y1)-

    | |

    | -- - -(Y2)-

    ----------------------------(MLR)-

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: March 23,2006

    Created by: elevmike

    Chris, That would actually be like so:

    |- - - -------------(MLS)-

    |

    |-- - ----------------(Y0)-

    |

    |-- - ----------------(Y1)-

    |

    |-- - ---------------(Y2)-

    |

    |---------------------------(MLR)

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: March 23,2006

    Created by: franji1

    Thanks elevmike!

    Chris, regarding timers and counters - I am NOT sure of how they work within MLS/MLR blocks - you will have to test it out or someone out there may know.

    Note, also that MLS/MLRs can be NESTED, so if you wanted to use nested AND ABOVE JOINs, you can do that by incrementing the K value per level, e.g.

    {logic}

    {logic} MLS K1

    {logic}

    {logic}

    {logic} MLS K2

    {logic}

    {logic}

    MLR K1 // reset back to desired level - here it's K1

    {logic}

    MLR K0 // MLR K0 is power rail

    {logic}

    {logic}

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 29,2006

    Created by: Bent

    I'm new to DSoft and have read the posts here with interest. I 've been reading posts regarding syntax since I'm in the process of learning the specifics of the DSoft way.

    This business of And above a Join doesn't quite make sense to me. What's the difference between:

    |-]

    From what I can tell from the user's guide, the first structure is legal, but the second is not.

    So, if I haven't missed anything, I can do And above a Join for the cost of a NOP instruction? Or I can do the MLS thing?

    If so, then in terms of instruction memory, a previous post indicated that there would still be the MLS/MLR instruction taking up two words regardless of how the structure was implemented, so would the first method then also add a word for the NOP?

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 29,2006

    Created by: Bent

    Sorry, the formatting got messed up in those ladders.

    I'll try again with the two ladders as follows:

    |-]

  • adccommunitymod (AutomationDirect)

    Created Date: June 29,2006

    Created by: marksji

    Bent, I just tried entering the code you have first and DS won't allow it. I get this error when I try to complie:

    Compiler Error: ORing two complex output elements which aren't AND's or JOIN's.

  • adccommunitymod (AutomationDirect)

    Created Date: June 29,2006

    Created by: AZRoger

    Concerning scan time: I have used both blocks and stages to speed up scan time. Both of these take words of memory -- which I am guessing are compiled into conditional branch instructions (conditional GOTOs? I can't say JMP because that doesn't actually go around anything!) to skip around all the rungs in inactive stages or the blocks. Do MLS and MLR operate the same way but without having a "permanent " status bit (CR or S) assigned?

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 29,2006

    Created by: franji1

    AZRoger, I do not belive MLS/MLR actually skip the logic, so it does not help scan time http://forum1.automationdirect.com/board/frown.gif

    Bent, as marksji explained, that construct is illegal. The only contact logic you can append following an output instruction is the AND construct:

    -]1 3

    The rung above generates

    STR 1

    OUT 2

    AND 3

    OUT 4

    and can become quite complex

    -]1 3 4 6 7

    That complex rung generates

    STR 1

    OUT 2

    AND 3

    AND 4

    OUT 5

    STR 6

    OR 7

    ANDSTR

    OUT 8

    The STR6/OR7/ANDSTR is technically an "AND " construct following the OUT 5, so it is valid.

    However, doing the "AND ABOVE JOIN " cannot be DRAWN, but logically it can be generated using the MLS/MLR instructions.

    -]1 2 4 6

    cannot be simply generated using STR, AND, OR, ANDSTR, ORSTR with output instructions. The boolean stack must be manipulated using the MLS and MLR instructions:

    -]1 2 4 6

    DirectSOFT will indent the logic between the MLS and MLR (and between FOR and NEXT instructions) to signify a logical grouping. Although "AND ABOVE JOIN " is not supported from a ladder editing construct, it is supported programatically.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: June 30,2006

    Created by: bcarlton

    Referring to page 5-182 in the DL06 manual and MLS/MLR instructions. it says "the logic ... will function ". Does that mean that the logic is skipped or that it is executed with the side rail set to TRUE if the MLS is true else with FALSE if the MLS is false? In the diagram, if X0 was OFF and X1 was ON would C0 be ON, OFF or undetermined?

  • adccommunitymod (AutomationDirect)

    Created Date: June 30,2006

    Created by: franji1

    Originally posted by bcarlton:

    Referring to page 5-182 in the DL06 manual and MLS/MLR instructions. it says "the logic ... will function ". Does that mean that the logic is skipped or that it is executed with the side rail set to TRUE if the MLS is true else with FALSE if the MLS is false? In the diagram, if X0 was OFF and X1 was ON would C0 be ON, OFF or undetermined?

    Master Line Set (MLS) determines the power applied to the power rail of all subsequent rungs up to the corresponding MLR. Hence affects the actual power state of the outputs.

    In the example in the manual given your input states, C0 would be OFF.

    Remember, this is equivalent to

    X0 X1 C0

    -]

    Expand Post
10 of 19