int32 input
bool32.rising trigger
int32 output
int ntrig;
int latch;
if ((inlet_trig > 0) && !ntrig) {
latch = inlet_in;
ntrig = 1;
outlet_out = -666;
}
if (!(inlet_trig > 0)) {
ntrig = 0;
outlet_out = latch;
}
if ((!(inlet_trig > 0)) && !ntrig)
outlet_out = inlet_in;