1
Technical support / Method for causing events at counter PV intervals
« on: April 17, 2018, 02:44:12 PM »
I'm looking for a method to trigger a math equation at intervals of a HSCPV[n] as it accumulates.
For instance, as the counter accumulates 100 counts, solve the math equation, then after another 100 counts solve it again, continue to do this after each 100 counts until the HSCPV[n] is reset from a separate part of the program. The counter does not stop at any point so the equation trigger needs to happen 'on the fly'.
One method I thought might work would be to use an IF statement. IF HSCPV[n]/100=1 THEN (equation here) ENDIF. The 1 could be incremented at each TRUE occurrence of the if statement. But even if the custom function rung clock is set fast at 0.01s it still seems to miss the IF instruction.
I'm sure there's a better way...
For instance, as the counter accumulates 100 counts, solve the math equation, then after another 100 counts solve it again, continue to do this after each 100 counts until the HSCPV[n] is reset from a separate part of the program. The counter does not stop at any point so the equation trigger needs to happen 'on the fly'.
One method I thought might work would be to use an IF statement. IF HSCPV[n]/100=1 THEN (equation here) ENDIF. The 1 could be incremented at each TRUE occurrence of the if statement. But even if the custom function rung clock is set fast at 0.01s it still seems to miss the IF instruction.
I'm sure there's a better way...