ijustdunnoaname
Member
I'm trying to think of a logical way to clamp a group of 32 analog inputs so that if they ever go out of range, the program will clamp them at either the min or max value. This will be in RSLogix5000
For example, if the counts drop below the minimum of 3277 counts, the program will convert it back to 3277.
Likewise, if the counts ever exceed 16384, the program will convert it back to 16384.
I haven't had much exposure to AB, but in Modicon I would make a R->T #0032 words in length and have the enable rung tied directly to the power rail. Every scan of logic would increment the pointer. For every value moved to the table, I would then use a sub block to compare it to the minimum value and overwrite as needed. I would then do the same for the max. Lastly, I would use a T->R to inject that value into an empty 40xx register using the same method for increasing the pointer. This was a quick and effective way to clamp the entire project's analog ins.
For example, if the counts drop below the minimum of 3277 counts, the program will convert it back to 3277.
Likewise, if the counts ever exceed 16384, the program will convert it back to 16384.
I haven't had much exposure to AB, but in Modicon I would make a R->T #0032 words in length and have the enable rung tied directly to the power rail. Every scan of logic would increment the pointer. For every value moved to the table, I would then use a sub block to compare it to the minimum value and overwrite as needed. I would then do the same for the max. Lastly, I would use a T->R to inject that value into an empty 40xx register using the same method for increasing the pointer. This was a quick and effective way to clamp the entire project's analog ins.
Last edited: