example useing JS_DEADTIME

example useing JS_DEADTIME

I am trying to do a simple analog simulation for a PID loop. I want the output to lag
the input in a first order lag response. I wrote the following code in a UDFB when call the FB from a main program it did not react as I expected. Do I need to use JS_LEADLAG instead?
Any example program would be helpful.

IN2REAL = ANY_TO_INT(WY_IN);
JS_DEADTIME(IN2REAL,5,T#5s);
WX_OUT = ANY_TO_INT(JS_DEADTIME.OUT);

This is a migrated post! Originally posted on 27.02.2015 by user bsneddon. Please be aware that information can be outdated.