January 1, 2021

#49 - Rockwell PLC array to stack data

In this post we will create a simple routine that will stack data in an Array. The main instructions used were LEQ  for comparison , a CTU counter that increases the storage index and is reset with RES, and MOV to move the data according to the index. 

To reset the stacked data, there are some options, such as copying the zero value with the COP instruction, or CPS that guarantees the copy regardless of whether the execution of the PLC scan was completed during the copy process, or also with the FLL file fill instruction. In this case we prefer the last option that is ideal for working with arrays, specifying the index of the first element and the size of the array.



Nota: A destinação da instrução MOV é o índice do array CounterArray[CounterStacker.ACC]. 

No comments:

Post a Comment