News:

  • August 14, 2026, 03:35:05 AM

Login with username, password and session length

Author Topic: One Shot an Output  (Read 10943 times)

Bolt

  • Hero Member
  • *****
  • Posts: 598
One Shot an Output
« on: March 24, 2020, 03:34:52 PM »
I have a program that I've been using for a few years.  While it may not be the cleanest way of doing it, I think it always worked "correctly".

Recently, I've had to change the runtime to be (90,000 milliseconds) longer than a 16 bit integer could handle, so I rewrote it with a 32 bit integer.

Watching it on a trend view, it only seems to run for 25 seconds.

Logic attached.  It's "triggered" in a Program, and executed in BottomOfScan

What am I missing here?

What is a cleaner way of accomplishing my goal?  I want it to run for a precise amount of milliseconds, have a manual/prime function (MC807), and a Kill in case of an Abort.

Thanks!

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3843
    • Host Engineering
Re: One Shot an Output
« Reply #1 on: March 24, 2020, 05:04:32 PM »
I'm seeing the same thing with just a simple TIMEDOUT.   Hmmm...

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: One Shot an Output
« Reply #2 on: March 24, 2020, 05:26:06 PM »
Minimum time is limited to a WORD...65535ms.
"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

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: One Shot an Output
« Reply #3 on: March 25, 2020, 07:10:57 PM »
Minimum time is limited to a WORD...65535ms.

Well would you lookey there, it says that right in the Help file...

So what does it do in this situation when a larger number is presented?  90000 ms - 65535 = 24465, which is about the 25 seconds I was capturing on the Trend View?

Or for simpler math, if it was 66535 it would only have run for 1 second?  Can you explain the logic behind that math?

Thanks!

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: One Shot an Output
« Reply #4 on: March 25, 2020, 07:24:37 PM »
It uses the low 16 bits.
"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

Bolt

  • Hero Member
  • *****
  • Posts: 598
Re: One Shot an Output
« Reply #5 on: March 25, 2020, 08:23:00 PM »
Simple enough.  Replaced the TIMEDOUT logic rungs with some OFFDTMR logic.  Thanks!