LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

values in a shift register are not functional outside the loop

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!

0 Kudos
Message 1 of 4
(2,328 Views)

I did not follow that at all.  Can you show us some code so we what you have?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 4
(2,317 Views)

 

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!

 

 

0 Kudos
Message 3 of 4
(2,312 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(2,300 Views)