Announcement

Collapse
No announcement yet.

Do-more designer question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • Do-more designer question

    I am using Do-more designer 2.5.1, (so maybe a newer version allows it?), I don't understand why the below would not be allowed? Its not overly complicated logic. When I try to accept I get the following compiler error [Error] Lane_1_Fill_Seq#16:01:01 Compiler Error: Trying to AND above a JOIN

    Click image for larger version

Name:	Domore.PNG
Views:	165
Size:	32.6 KB
ID:	126270

    Also is there a setting somewhere to make the software allow you to copy a rung without having to accept it first? This gets a bit annoying when writing a program where you are copying existing rungs and modifying them. Like in this instance, I could make a copy of this rung and split it into 2 rungs. The top line would be on its own, the bottom half I would just have to put the same compare instruction in on the left. But because it won't accept due to the error, I can't copy it.

    When looking at this from a point of efficiency, what would be processed quicker, the rung as I have it shown above or 2 separate rungs?


  • #2
    Without going into all the details, yes, you have to split it up into 2 rungs, one driving the OUT MC41, and one driving the TMR/MOVE.

    Also, Copy/Paste only works on whole rungs or individual instructions, not sub-regions of a rung.
    There are 10 kinds of people in this world, those who know binary, and those who do not.

    Comment



    • #3
      Originally posted by franji1 View Post
      Without going into all the details, yes, you have to split it up into 2 rungs, one driving the OUT MC41, and one driving the TMR/MOVE.

      Also, Copy/Paste only works on whole rungs or individual instructions, not sub-regions of a rung.
      franji1 BobO
      I have wondered for quite some time, what are the specific reasons why Do-More cannot do such a line but Productivity can? Is it differences in the main CPU and how instructions are handled by it? Or something in the way ladder code is compiled to boolean? Or just a forced way of making the person writing a program to make code more legible?

      I know DirectSoft cant do complicated lines, but I figured that upgrading to Do-More would let me do things like the line above. I have often run into compile errors when coding on Do-More so I got in the habit of compiling to test after almost every line I write. Yet Productivity can do something crazy like this:

      Click image for larger version

Name:	image_4391.png
Views:	115
Size:	41.7 KB
ID:	126302
      https://forum.automationdirect.com/f...6302&type=full

      Comment



      • #4
        It's a limitation in the stack-based Boolean logic implementation. We actually have the instructions in Do-more to implement it, but the work to DmD was more than wanted to tackle at the time. We are gonna take a look at it again though.

        Comment



        • #5
          It has to do with how programming languages are designed. Designer (and DirectSOFT) utilize a standard stack-based architecture, similar to how most programming languages resolve simple expressions (think handheld programmers):

          1. V0 = V1 + V2
          similar to
          2. Y0 = X0 && X1

          1. resolves to
          LD V1
          LD V2
          ADD
          OUTW V0

          2. resolves to
          STR X0
          AND X1
          OUT Y0

          or in Ladder Logic:
          Click image for larger version

Name:	MidlineOut3.png
Views:	83
Size:	2.9 KB
ID:	126307

          Designer can even do

          3. Y1 = (Y0 = (X0 && X1) && X2
          STR X0
          AND X1
          OUT Y0
          AND X2
          OUT Y1

          or in Ladder Logic:
          Click image for larger version

Name:	MidlineOut1.png
Views:	88
Size:	5.2 KB
ID:	126306

          But the since it utilizes a standard "stack based" language, the code generation for a rung like the following does not resolve easily:
          Click image for larger version

Name:	MidlineOut2.png
Views:	83
Size:	5.2 KB
ID:	126308

          If we tried to write it using in-fix mathematics (think Algebra)

          Y0 = (Y1 = X0 && X2) && X1 ? ? ?

          You can't. But just because it does not resolve to a single in-fix algebraic expression, that does NOT mean that it can't be done in a stack-based assembly language.

          We can enhance the push down stack to do something like the following by adding 2 new Boolean stack operators DUP and POP (Duplicate Top Of Stack and Pop the Stack):
          STR X0
          DUP
          AND X1
          OUT Y0
          POP
          AND X2
          OUT Y1

          The Code Generator and Reverse Generator need to support this concept. That is the goal.
          There are 10 kinds of people in this world, those who know binary, and those who do not.

          Comment

          Working...
          X