06-20-2018 03:58 PM
Hello, I am using LabVIEW with a MyRio and would like to know how can I store three previous values using shift registers? I already managed to store two previous values, but when adding a third register we get NaN at the ouput of our PID equation. Below are the VI front panel and block diagram.
Thanks for your time,
06-20-2018 04:21 PM - edited 06-20-2018 04:22 PM
Do you mean storing three different variables for the next iteration or the last three values of the same variable? The former you already know how to do and if you are getting NaN you probably have a logic error somewhere. The latter you can simply change the shift register on the left hand side to specify storing additional previous iteration values (look at the "stacked" description here http://www.ni.com/getting-started/labview-basics/shift-registers) all of which you can use in your current iteration (eg. x(n-1), x(n-2), x(n-3) etc.).
06-20-2018 10:23 PM
We don't debug pictures of a truncated diagram with wires flowing in all directions, some even hidden behind structures. So, as a first step, clean up the diagram and attach the VI here. (I bet that once your diagram is a bit more orderly, the bug will be easily visible.)