Host Engineering Forum
General Category => Do-more CPUs and Do-more Designer Software => Topic started by: Controls Guy on May 26, 2018, 02:41:20 PM
-
I love that delta contact to death. Use it all the time, plus impress my friends who program other brands that don't have it.
Once in a while, I want to detect changes in a numerical register only in a single direction, so you might create delta/increase and delta/decrease contacts. It'd be like leading and trailing edge contacts on a bit. What you have to do now in ladder is slightly cumbersome (remember the previous value and compare each scan). Not sure if users in general would find value in this.
-
The rising/falling edge equivalent of delta. Wouldn't be hard.
-
How does delta work on a float, even the current bidirectional one? Look for any change in the exponent or past some threshold in mantissa?
-
How does delta work on a float, even the current bidirectional one? Look for any change in the exponent or past some threshold in mantissa?
Simple integer compare of the raw bits. A directional version would require int/float awareness, but it isn't hard. The hardest part would be the 27 things that have to happen in DmD.
-
Well, the inc/dec thing isn't a huge deal. Nice to have, whenever it floats to the top of the list.
As a separate idea, though, you might think about upgrading the float implementation of delta. Any change in exponent, or a significant change in mantissa*, or a sign change with a mantissa above a certain threshold. Could that be done entirely in DM firmware without changing DMD? I guess the issue is that the compare still has to know it's looking at a float to invoke those rules.
*This implicitly makes the threshold relative to the magnitude so a larger number has to change more to kick the delta, plus still allowing an integer comparison rather than having to convert to a float and apply a comparison rule.
-
It would be controller only, but we are very reluctant to change behavior in an instruction that isn't explicitly broken.
-
Good point. There may be people out there depending on it the way it is.
-
Maybe throw up a poll, and see what percentage would prefer which way.
-
I say leave it alone. I do not want it changed. Because then I would have to modify my programs.
Now if you want to add a new contact then that's all right.