trigger

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

trigger

jhearon


Getting myself confused about trigger opcode.  Don't understand why ktr goes
to '0.0'?  I thought as long as ksig was = 2, trigger is supposed to inform
and set ktr as '1'.  Does ksig have to go below,
and beyond 1 to start trigger?  I'm looking for a way to keep ktr on 1 to
work with schedkwhen for event opcode.  thanks.

instr1
ksig init 2
kcnt init 1
if (kcnt < 10) then
ktr trigger ksig, 1, 0
ktm times
printks "time = %f seconds, trigger = %f, ksig = %f\\n", 0, ktm, ktr, ksig
kcnt = kcnt + 1
endif


--
Send bugs reports to this list.
To unsubscribe, send email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: trigger

Andres Cabrera-3
Hi James,
Looking at the documentation for trigger there are 3 modes:
kmode = 0 - (down-up) ktrig outputs a 1 when current value of ksig is
higher than kthreshold, while old value of ksig was equal to or lower
than kthreshold.
kmode = 1 - (up-down) ktrig outputs a 1 when current value of ksig is
lower than kthreshold while old value of ksig was equal or higher than
kthreshold.
kmode = 2 - (both) ktrig outputs a 1 in both the two previous cases.

So you actually only get a one when the threshold is crossed, not when
the signal is over (or below) the threshold.

Cheers,
Andres

On Wed, 2005-07-13 at 08:30, James Hearon wrote:

> Getting myself confused about trigger opcode.  Don't understand why ktr goes
> to '0.0'?  I thought as long as ksig was = 2, trigger is supposed to inform
> and set ktr as '1'.  Does ksig have to go below,
> and beyond 1 to start trigger?  I'm looking for a way to keep ktr on 1 to
> work with schedkwhen for event opcode.  thanks.
>
> instr1
> ksig init 2
> kcnt init 1
> if (kcnt < 10) then
> ktr trigger ksig, 1, 0
> ktm times
> printks "time = %f seconds, trigger = %f, ksig = %f\\n", 0, ktm, ktr, ksig
> kcnt = kcnt + 1
> endif
>

--
Send bugs reports to this list.
To unsubscribe, send email to [hidden email]