News:

  • October 01, 2026, 04:53:54 AM

Login with username, password and session length

Author Topic: Timer instruction  (Read 15222 times)

eman5oh

  • Sr. Member
  • ****
  • Posts: 59
Timer instruction
« on: January 28, 2019, 01:52:00 PM »
Not sure if this is an issue or not, but I found by accident that you can end up with a negative value in the timer instruction if you point the timer value to a D address that you have stored an IP address in using the INIT instruction. I have attached an image of an example.
« Last Edit: January 28, 2019, 01:55:38 PM by eman5oh »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3847
    • Host Engineering
Re: Timer instruction
« Reply #1 on: January 28, 2019, 02:32:48 PM »
It's definitely an issue at runtime.  There's nothing stopping the program from using a variable preset, then setting that variable equal to something invalid (e.g. INIT or MOVE or MATH or whatever).

Designer can validate a constant preset to make sure it is positive before downloading it to the PLC.  But if it's a variable, that means it's a runtime decision, which means that the program or HMI determines that value.

If you are using an HMI to enter a variable preset, and the HMI allows you to enter a negative value for a timer, that's not good.  Make sure the HMI only allows valid entries for a specific value.  Most HMI's support some kind of range validation on a specific field/tag.

If you mis-use a register for your Timer Preset (e.g. it's an IP Address), even if the value was valid, your timer won't work correctly (e.g. 10.0.0.1 is a valid Timer Preset, but I doubt that's what you want your Timer timing to).

eman5oh

  • Sr. Member
  • ****
  • Posts: 59
Re: Timer instruction
« Reply #2 on: January 28, 2019, 02:38:57 PM »
Definitely figured it out pretty quickly when the timer did not behave as expected.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Timer instruction
« Reply #3 on: January 29, 2019, 09:08:55 AM »
I guess you could use it for controlling a modified DeLorean .  ;)

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Timer instruction
« Reply #4 on: January 29, 2019, 11:34:48 AM »
I guess you could use it for controlling a modified DeLorean .  ;)

Not helpful without 1.12GW. Power cell tech still needs some work.
"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: Timer instruction
« Reply #5 on: January 30, 2019, 02:08:55 PM »
I guess you could use it for controlling a modified DeLorean .  ;)

Not helpful without 1.12GW. Power cell tech still needs some work.

Mechman makes a 370A alternator...we'd only need to hook up...carries the one...272,523 of them to produce enough current. We could go to a 16V system and we'd only need 204,392 of them!
« Last Edit: January 30, 2019, 02:10:38 PM by Evilbeard »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Timer instruction
« Reply #6 on: January 30, 2019, 03:07:13 PM »
I guess you could use it for controlling a modified DeLorean .  ;)

Not helpful without 1.12GW. Power cell tech still needs some work.

Mechman makes a 370A alternator...we'd only need to hook up...carries the one...272,523 of them to produce enough current. We could go to a 16V system and we'd only need 204,392 of them!

Perfect. Now we just need something to spin those bad boys...
"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

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Timer instruction
« Reply #7 on: February 06, 2019, 12:10:05 PM »
What, you mean alternators don't just spontaneously produce energy??  Hmmm....this is going to make me rethink using hydrogen as a fuel.....
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

ADC Product Engineer

  • Hero Member
  • *****
  • Posts: 270
Re: Timer instruction
« Reply #8 on: February 06, 2019, 12:55:05 PM »
What, you mean alternators don't just spontaneously produce energy??  Hmmm....this is going to make me rethink using hydrogen as a fuel.....

You need to wind them cross-wise along the vertices and add a prenumbulator before the fizzle drain.  Don't forget that they must spin anti-counterclockwise during the startup whipple sequence.  Adding hydrogen will only increase the flambeant factor which might result in the discharge of the hydraulic ceiling nozzelator.

You don't really need a retroencabulator although it might help.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Timer instruction
« Reply #9 on: February 06, 2019, 01:23:23 PM »
A retroencabulator is *always* a good idea.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.