Lakee911
Member
I have a whole bunch of analog inputs that I need to scale to process values. Using JMP and LBL can I use indirect addressing to cycle through all inputs? This would save lots of rungs of logic.
Essentially I'll create two nested for loops to cycle between all input cards and each point and just read in the scale values from a table of registers. Any problem here?
I would need to use something like this for the SCP:
Assuming that the rest of the code was written properly, would this work?
For each value of N7:50 (which corresponds to the slot), I would cycle through 0 - 8 on N7:51 (which corresponds to the point). Each iteration would increment N7:52 and N7:53 by two and then throw the output into register N7:54 in file N14.
How would I limit the times it goes through the loop so my watchdog timer doesn't time out and fault the processor?
Essentially I'll create two nested for loops to cycle between all input cards and each point and just read in the scale values from a table of registers. Any problem here?
I would need to use something like this for the SCP:
Code:
Input: I:[N7:50].[N7:51]
Input Min: 4000
Input Max: 20000
Scaled Min: N13:[N7:52]
Scaled Max: N13:[N7:53]
Output: N14:[N7:54]
Assuming that the rest of the code was written properly, would this work?
For each value of N7:50 (which corresponds to the slot), I would cycle through 0 - 8 on N7:51 (which corresponds to the point). Each iteration would increment N7:52 and N7:53 by two and then throw the output into register N7:54 in file N14.
How would I limit the times it goes through the loop so my watchdog timer doesn't time out and fault the processor?
Last edited: