A couple of options:
1. You can Increase your Array size to 51 and set element 50 to always be 0. That will allow the 49th element to be counted if true before the FSC is Done. If you add a XIO Done Bit in front of the ADD instruction it will not count the last element because Found and Done will happen on the same scan cycle. By the same token if you don't add a XIO Done Bit and the last Array element is true, the ADD will increment every scan cycle if the FSC instruction is still enabled.
2. If you don't want to increase your array size, you can one shot the FSC and add a holding circuit using XIC FSC.EN and XIO FSC.DN. This will allow you to just use the FSC.FD in the ADD Rung and count the last element if true.
Glad you got working. Good luck with your project!
1. You can Increase your Array size to 51 and set element 50 to always be 0. That will allow the 49th element to be counted if true before the FSC is Done. If you add a XIO Done Bit in front of the ADD instruction it will not count the last element because Found and Done will happen on the same scan cycle. By the same token if you don't add a XIO Done Bit and the last Array element is true, the ADD will increment every scan cycle if the FSC instruction is still enabled.
2. If you don't want to increase your array size, you can one shot the FSC and add a holding circuit using XIC FSC.EN and XIO FSC.DN. This will allow you to just use the FSC.FD in the ADD Rung and count the last element if true.
Glad you got working. Good luck with your project!
Last edited: