LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Store three previous values using shift registers.

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,

0 Kudos
Message 1 of 3
(2,545 Views)

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.).

0 Kudos
Message 2 of 3
(2,532 Views)

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.)

0 Kudos
Message 3 of 3
(2,490 Views)