Signal Edges
Provider specific ↗
Provider-specific feature.
All providers are free to implement it with custom behavior and name or simply avoid it.
To access this feature, you need to use the internal
field of a Provider
instance.
Both Rising & Falling edges are supported.
Rising edge
ts
import {Provider} from "#source";
import {Ob, Fb, InstanceDb} from "#pou";
import {Bool} from "#primitives";
import {Instance} from "#complex";
import {Compare, Call} from "#basics";
const MyFb = new Fb({
interface: {
static: {
r_trig_instance: new Instance(Provider.internal.R_TRIG, {}),
clk: new Bool(),
output: new Bool(),
}
},
body() {
return [
new Call(this.static.r_trig_instance, {
input: {
CLK: this.static.clk
},
output: {
Q: this.static.output
}
})
]
}
})
Falling edge
ts
import {Provider} from "#source";
import {Ob, Fb, InstanceDb} from "#pou";
import {Bool} from "#primitives";
import {Instance} from "#complex";
import {Compare, Call} from "#basics";
const MyFb = new Fb({
interface: {
static: {
f_trig_instance: new Instance(Provider.internal.F_TRIG, {}),
clk: new Bool(),
output: new Bool(),
}
},
body() {
return [
new Call(this.static.f_trig_instance, {
input: {
CLK: this.static.clk
},
output: {
Q: this.static.output
}
})
]
}
})