grover1
Member
Greetings,
I am writing some code for a 5/05 project, but I do not have a 5/05 to play with to answer my own question meself. Can the FFL be truly used as a stack? I have a process with 15 or so states and approximately 15 or so events that cause the process to change states. I thought it would be neat to track state changes by storing them in a FIFO stack. The stack would serve only as a state history file, meaning if I ever had process problems, a check of the FIFO would show the last 20 or so states. Since I can't play with a real SLC, I'm not confident of my understanding.
I plan to keep the "SOURCE"(N7:2), "FIFO"(N35:0)and CONTROL"(R6:0) addresses constant and set the "LENGTH" to 20 elements. Each time a process state change occurs, another rung would update N7:2 with the new state value and toggle the FIFO rung false-to-true. What I am not sure about is whether the newest value is always loaded into the same FIFO address or if it is loaded into the next sequential FIFO address. I hope it is the former, meaning N35:0 is always the newest state and N35:19 is always the oldest state.
The HELP file states that "POSITION" is the next available location where the instruction loads data into the stack and that is what I am confused about. It makes it sound as if the latter was true, meaning I would have to know the current FIFO position in order to determine which N35 location has the newest state. I can see advantages to both, but prefer the former.
Any clarification would be appreciated.
Grover
I am writing some code for a 5/05 project, but I do not have a 5/05 to play with to answer my own question meself. Can the FFL be truly used as a stack? I have a process with 15 or so states and approximately 15 or so events that cause the process to change states. I thought it would be neat to track state changes by storing them in a FIFO stack. The stack would serve only as a state history file, meaning if I ever had process problems, a check of the FIFO would show the last 20 or so states. Since I can't play with a real SLC, I'm not confident of my understanding.
I plan to keep the "SOURCE"(N7:2), "FIFO"(N35:0)and CONTROL"(R6:0) addresses constant and set the "LENGTH" to 20 elements. Each time a process state change occurs, another rung would update N7:2 with the new state value and toggle the FIFO rung false-to-true. What I am not sure about is whether the newest value is always loaded into the same FIFO address or if it is loaded into the next sequential FIFO address. I hope it is the former, meaning N35:0 is always the newest state and N35:19 is always the oldest state.
The HELP file states that "POSITION" is the next available location where the instruction loads data into the stack and that is what I am confused about. It makes it sound as if the latter was true, meaning I would have to know the current FIFO position in order to determine which N35 location has the newest state. I can see advantages to both, but prefer the former.
Any clarification would be appreciated.
Grover