Host Engineering Forum

General Category => General Discussion => Topic started by: Bolt on March 24, 2020, 03:34:52 PM

Title: One Shot an Output
Post by: Bolt 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!
Title: Re: One Shot an Output
Post by: franji1 on March 24, 2020, 05:04:32 PM
I'm seeing the same thing with just a simple TIMEDOUT.   Hmmm...
Title: Re: One Shot an Output
Post by: BobO on March 24, 2020, 05:26:06 PM
Minimum time is limited to a WORD...65535ms.
Title: Re: One Shot an Output
Post by: Bolt 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!
Title: Re: One Shot an Output
Post by: BobO on March 25, 2020, 07:24:37 PM
It uses the low 16 bits.
Title: Re: One Shot an Output
Post by: Bolt on March 25, 2020, 08:23:00 PM
Simple enough.  Replaced the TIMEDOUT logic rungs with some OFFDTMR logic.  Thanks!