Hi guys,
Fairly new to RxLogix/PLCs here. I am currently working on a project where I have a FIFO buffer that I have populated (lets say, up to 6 values). I also have a register (number_of_elements, we shall call it) that stores a number (say, 1-6).
The value of the latter register determines how many of the elements in the buffer to add.
I figure, since I know the base address of the buffer, and have a register to use to calculate the offsets, I can calculate the sum of the first X values in the buffer. However, my problem comes with the fact that the number of ADDs I need to do will change depending on the value in the number_of_elements.
Thoughts? I have some ideas on how to do it but, per usual, they are pretty hack-ish.
Fairly new to RxLogix/PLCs here. I am currently working on a project where I have a FIFO buffer that I have populated (lets say, up to 6 values). I also have a register (number_of_elements, we shall call it) that stores a number (say, 1-6).
The value of the latter register determines how many of the elements in the buffer to add.
I figure, since I know the base address of the buffer, and have a register to use to calculate the offsets, I can calculate the sum of the first X values in the buffer. However, my problem comes with the fact that the number of ADDs I need to do will change depending on the value in the number_of_elements.
Thoughts? I have some ideas on how to do it but, per usual, they are pretty hack-ish.