News:

  • October 14, 2025, 04:17:23 AM

Login with username, password and session length

Author Topic: OFFDTMR unexpected behavior  (Read 5447 times)

mhw

  • Hero Member
  • *****
  • Posts: 250
OFFDTMR unexpected behavior
« on: September 25, 2017, 07:07:44 AM »
I used a OFFDTMR for the first time the other day. If the off delay time is set to 0 the output will never be true.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: OFFDTMR unexpected behavior
« Reply #1 on: September 25, 2017, 09:39:54 AM »
I used a OFFDTMR for the first time the other day. If the off delay time is set to 0 the output will never be true.

True, but if your off delay time is 0, why do you need an off delay timer to start with?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: OFFDTMR unexpected behavior
« Reply #2 on: September 25, 2017, 10:01:33 AM »
Mixed emotions about that. I can perhaps see the merit in it turning on for one scan, but then the time wouldn't actually be zero. I would considering it to be working as designed though.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

mhw

  • Hero Member
  • *****
  • Posts: 250
Re: OFFDTMR unexpected behavior
« Reply #3 on: September 25, 2017, 10:25:32 AM »
Quote
True, but if your off delay time is 0, why do you need an off delay timer to start with?
The customer wanted a variable to delay the off. Sometimes that variable will be 0.
Quote
Mixed emotions about that. I can perhaps see the merit in it turning on for one scan, but then the time wouldn't actually be zero.
The logic diagram shows the output being true when the input leg is true.

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: OFFDTMR unexpected behavior
« Reply #4 on: September 25, 2017, 11:21:04 AM »
Mixed emotions about that. I can perhaps see the merit in it turning on for one scan, but then the time wouldn't actually be zero. I would considering it to be working as designed though.

I can see what he's saying. If you put the off delay to 0, the output never goes active. It should toggle on/off with the input. It's just always false. The .done bit is always on, so the Output is always off.



In order to make it operate like it "should", you have to use logic like this:

« Last Edit: September 25, 2017, 11:27:14 AM by Evilbeard »

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: OFFDTMR unexpected behavior
« Reply #5 on: September 25, 2017, 11:29:30 AM »
Hmmmm. I have several of these in the field right now...
I need to dig through some code to see what is going to happen if someone changes the settings to zero.
I would expect the output to always be true when the input leg is true, regardless of the time setting.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: OFFDTMR unexpected behavior
« Reply #6 on: September 25, 2017, 11:36:00 AM »
Hmmmm. I have several of these in the field right now...
I need to dig through some code to see what is going to happen if someone changes the settings to zero.
I would expect the output to always be true when the input leg is true, regardless of the time setting.

That's what I expected to see. Here's what X0 driving timer T0 (set to output Y0) does with an off delay set at 0.

« Last Edit: September 25, 2017, 11:37:36 AM by Evilbeard »

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3601
  • Darth Ladder
Re: OFFDTMR unexpected behavior
« Reply #7 on: September 25, 2017, 12:45:03 PM »
I used a OFFDTMR for the first time the other day. If the off delay time is set to 0 the output will never be true.

I've used like 5 off delay timers in 3 decades or so of doing this stuff.  The rules on off delays vary from brand to brand. So the first solution to come to mind is invariably writing the rung logic inverted (or adding a NOT contact inline) and using a normal on delay timer.  NOW it occurs to me that I need to check and make sure TMR's work correctly with a zero setpoint.

UPDATE: TMR (on-delay) works just fine with a zero setpoint, so there's at least a short term workaround.
« Last Edit: September 25, 2017, 12:58:00 PM by Controls Guy »
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

plcnut

  • Hero Member
  • *****
  • Posts: 813
    • premiersi.com
Re: OFFDTMR unexpected behavior
« Reply #8 on: September 25, 2017, 01:46:48 PM »
I have always used normal timers for everything, but several months ago I started doing some programming for some systems where the OFFDTMR was the perfect fit. It made for cleaner code, so I went with it. I now have several systems that are spread out nearly coast to coast that are running these timers. I doubt that anyone will be in there messing with the values, but if they do, it will have consequences that I did not account for. At least it will not hurt anybody or any equipment...

@BobO Is this the expected behavior for the OFFDTMR?
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: OFFDTMR unexpected behavior
« Reply #9 on: October 01, 2017, 07:35:33 AM »
I have always used normal timers for everything, but several months ago I started doing some programming for some systems where the OFFDTMR was the perfect fit. It made for cleaner code, so I went with it. I now have several systems that are spread out nearly coast to coast that are running these timers. I doubt that anyone will be in there messing with the values, but if they do, it will have consequences that I did not account for. At least it will not hurt anybody or any equipment...

@BobO Is this the expected behavior for the OFFDTMR?

I think we broke BobO with this one. He can't believe all the things we break. It's why we can't have nice things.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: OFFDTMR unexpected behavior
« Reply #10 on: October 01, 2017, 09:09:35 AM »
I have always used normal timers for everything, but several months ago I started doing some programming for some systems where the OFFDTMR was the perfect fit. It made for cleaner code, so I went with it. I now have several systems that are spread out nearly coast to coast that are running these timers. I doubt that anyone will be in there messing with the values, but if they do, it will have consequences that I did not account for. At least it will not hurt anybody or any equipment...

@BobO Is this the expected behavior for the OFFDTMR?

I think we broke BobO with this one. He can't believe all the things we break. It's why we can't have nice things.

Nah. Just very busy.

Timers are really very simple code. This is just a quirky situation where two conditions overlap. I could easily be convinced that it *should* be changed...but we are very reluctant to change things that might break stuff in the field.

@Franj1 - You recently did the timing diagrams. Do you have any thoughts about this?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Evilbeard

  • Hero Member
  • *****
  • Posts: 160
Re: OFFDTMR unexpected behavior
« Reply #11 on: October 01, 2017, 12:04:03 PM »
I have always used normal timers for everything, but several months ago I started doing some programming for some systems where the OFFDTMR was the perfect fit. It made for cleaner code, so I went with it. I now have several systems that are spread out nearly coast to coast that are running these timers. I doubt that anyone will be in there messing with the values, but if they do, it will have consequences that I did not account for. At least it will not hurt anybody or any equipment...

@BobO Is this the expected behavior for the OFFDTMR?

I think we broke BobO with this one. He can't believe all the things we break. It's why we can't have nice things.

Nah. Just very busy.

Timers are really very simple code. This is just a quirky situation where two conditions overlap. I could easily be convinced that it *should* be changed...but we are very reluctant to change things that might break stuff in the field.

@Franj1 - You recently did the timing diagrams. Do you have any thoughts about this?

Yeah, my assumption was that the code looks for the .done bit and then toggles the output off, but since .done is always on, the output never actually comes on.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6126
  • Yes Pinky, Do-more will control the world!
Re: OFFDTMR unexpected behavior
« Reply #12 on: October 01, 2017, 12:12:30 PM »

Yeah, my assumption was that the code looks for the .done bit and then toggles the output off, but since .done is always on, the output never actually comes on.


Essentially, yes.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO