Please enable JavaScript to view this site.

DAQFactory User's Guide

Navigation: 10 PID Loops

10.4 PID Event

Scroll Prev Top Next More

You can optionally provide sequence code that is executed every time the PID loop calculates its setting.  The following Privates are updated each time as well and available for use within the event:

effectI     - calculated I for PID

effectD    - calculated D for PID

effectP     - calculated P for PID

  - the normal output is the sum of these three parameters

calcedSP   - actual SP value (result of SP expression)

calcedPV  - actual PV value (result of PV expression)

You can optionally return an output value to use in place of the normal output value for this loop iteration.  If you do so, the output range parameters of the PID are ignored.  If you need to limit your outputs while using the event you'll need to do so in the event.  For example:

 

Private out = (effectP + effectI + effectD) + 2.5

if (out > 5)

  out = 5

endif

if (out < 0)

  out = 0

endif

DAC0 = out