After the above happens with the #math channels un-checked and formula turned red if I run the script again, which runs the definitions in the script snippet again, TestController does not re-enable the turned off #math channels. They still have a red indication in the Source Formula column. If I just click inside the Source Formula and hit return manually they work. Why doesn't the script #math re-defining them fix and re-enable them?
The general assumption is that you need to edit the math to fix the error.
I understand the points. But, I would think that executing a #math command to define a math channel would count as editing the math. For example, I would expect the below sequence to work but it doesn't.
1. Start TestController fresh with no #math channels defined and no device connected.
2. Execute script to define one #math channel. For example:
#math RDSineOff - FormulaNU 0 getMatch(deviceRead("AKD1G","FB1.REGRDSineOffset?"),"[-.0-9]+")
3. Click the Current_values tab and see only 0 for the #math channel values.
4. Click the Math tab and see that the Math channel formula is red (because no device is connected.)
5. Click the Load devices tab, select device, click reconnect.
6. Run the script to define the #math channel again.
7. Click Math tab and see it is still red.
8. Click inside formula, make no changes, and hit return. Now the red on the formula is gone.
9. Click Current_values and see values come back.
TestController in the above sequence makes perfect sense to me except at step 6. I would have thought that step 6 would count as editing the #math channel and would clear the red. It does not. You have to manually enter the formula make no changes in step 8 to get it to work again.