06-13-2014 07:30 AM
Hi All,
My VI works fine but when I automate my SP input to the PID by using a shift register that is placed inside a while loop the controls on my VI do not respond. I place my shift register outside, but same issue. The only thing that work is when I put all my controls inside the shift register. The issue though is that I need my SP value to the PID needs tochange every 1 minute but I don't want my timing for the other units to be 1 min. Is there a way to make a shift register outside my while loop (which contains all my controls)? Do you have to make the variable coming our of the shift register to be a global variable so that it is recogized out the shift register's structure? How do you implement this?
Thanks!
06-13-2014 07:54 AM
I did not follow that at all. Can you show us some code so we what you have?
06-13-2014 08:07 AM
Here is the code. What I want to happen is that my SP input to the PID would change by 1%/min. So I decided to create a shift register to do it but the controls then are not working.
Thanks!
06-13-2014 08:24 AM
What you want to do is only change your set point once so much time has passed. Use the Elapsed Time express VI and set it to 1 minute. When the minute passes, increment your set point. That set point will still be stored in teh shift register.
Some other notes on your code:
1. You will likely want to set your loop rate to something faster than 10 seconds.
2. Move the initialization of the output DAQmx tasks to before your loop and move the clearing of the task to after your loop. This way you aren't constantly creating and closing the task. Once it is initialized, you can write to it as much as you want inside of the loop.