News:

  • August 15, 2026, 01:32:48 AM

Login with username, password and session length

Author Topic: I do not understand intended behavior  (Read 15981 times)

oliviagreene

  • Newbie
  • *
  • Posts: 1
I do not understand intended behavior
« on: September 19, 2019, 04:17:12 AM »
Previous content edited due to site terms violation. 
« Last Edit: September 24, 2019, 12:59:39 PM by Matt »

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: I do not understand intended behavior
« Reply #1 on: September 19, 2019, 10:24:00 AM »
All rings in a block have to be delineated from the previous with some form of a STR instruction, except the first.  That's how DMD knows where the rungs break, and I bet that's what's confusing the paste operation.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: I do not understand intended behavior
« Reply #2 on: September 19, 2019, 10:30:27 AM »
It should be smart, and query whether you want the ST1 $On contact prepended to the output logic (or figure it out intelligently).

Should be easy to figure out when to do that.  I'm surprised this hasn't been caught sooner.


Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: I do not understand intended behavior
« Reply #3 on: September 19, 2019, 10:34:07 AM »
Or just fix the whole problem and just handle the $ST1s transparently and don't even show them.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: I do not understand intended behavior
« Reply #4 on: September 19, 2019, 10:44:13 AM »
Or just fix the whole problem and just handle the $ST1s transparently and don't even show them.

That's a different issue.  The issue is that $ST1 NO contact is NOT in the clipboard, but needs to be there (sometimes) when you paste it.

What you're talking about is whenever the $ST1 NO contact IS there, whether to draw it or not.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: I do not understand intended behavior
« Reply #5 on: September 19, 2019, 10:46:04 AM »
Or are you saying ALWAYS put an $ST1 on ALL rungs that are tied to the power rail (but then not draw them).  That could be done instead.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: I do not understand intended behavior
« Reply #6 on: September 19, 2019, 11:33:12 AM »
If you are going to do that , make it an option. I don't want to find on a new DMD version that my programs mysteriously grow in size.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: I do not understand intended behavior
« Reply #7 on: September 19, 2019, 12:19:49 PM »
If you are going to do that , make it an option. I don't want to find on a new DMD version that my programs mysteriously grow in size.

Agreed.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: I do not understand intended behavior
« Reply #8 on: September 19, 2019, 12:40:28 PM »
Or are you saying ALWAYS put an $ST1 on ALL rungs that are tied to the power rail (but then not draw them).  That could be done instead.

Yes, this is what I meant.  It's something that has meaning for the parser, but not for the programmer.  If you show it on the screen, you're just burning visual bandwidth with no actual information transmitted.

I actually thought this was already in the task hopper.
« Last Edit: September 19, 2019, 12:45:44 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: I do not understand intended behavior
« Reply #9 on: September 19, 2019, 12:44:03 PM »
If you are going to do that , make it an option. I don't want to find on a new DMD version that my programs mysteriously grow in size.

How is it [significantly] more space?  Almost every rung has to start with a STR now.  They don't have to add them on rungs that already have one, so the only place it adds an instruction would be the places you can get away without one now, like the first rung in a routine or following a left-rail box like FOR, NEXT, YIELD, etc.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: I do not understand intended behavior
« Reply #10 on: September 19, 2019, 12:49:52 PM »
For programs that are large, and if they use Stage programming, the implied ST1 contact may be quite prolific.  Many stages are just a few rungs long, many of them where the first rung is an OUT, a SET, or a TMR.

I have no idea how I will implement this.  It may just be best to do what I was originally planning if I was going to have to make the implied ST1 contact feature optional.  It would be easier to just make the paste be "smart".  You get the same net result (plus faster/less code).

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: I do not understand intended behavior
« Reply #11 on: September 19, 2019, 01:07:50 PM »
You get the same net result (plus faster/less code).

Except for this part:  "It's something that has meaning for the parser, but not for the programmer.  If you show it on the screen, you're just burning visual bandwidth with no actual information transmitted."

I've despised that thing forever.  Losing it (and fixing AND above a JOIN) would be a boon.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: I do not understand intended behavior
« Reply #12 on: September 19, 2019, 01:21:12 PM »
I see your point.  Like I said, I have no idea how I would implement it (both the compiler side and the drawing side would need to support it).  It's a hack on both sides, regardless, especially with making it an option.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: I do not understand intended behavior
« Reply #13 on: September 19, 2019, 02:19:31 PM »
I see your point.  Like I said, I have no idea how I would implement it (both the compiler side and the drawing side would need to support it).  It's a hack on both sides, regardless, especially with making it an option.

Yeah, it's always the logically simple things that end up being a bear to implement.  OTOH, think of the brazilians of PLC programmer hours you'll save not having to enter or look at it!   ;)
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

OrionHE

  • Sr. Member
  • ****
  • Posts: 90
Re: I do not understand intended behavior
« Reply #14 on: September 24, 2019, 12:38:15 PM »
I feel like I'm seeing a different OP than the one everyone is responding to.