09-06-2010 11:03 AM
Hello, I am using timed loop in scan mode and want to control the sampling rate with it as shown in the following vi.
I used a constant 100000 to connect to the peroid terminal. However the loop did not work as expected. It only excuted once after I clicked run and then keep displayed the same values on the front panel. Those valuse should keep changing actually. Could anybody tell me why is this happening and how can I fix the problem? Thank you very much!!
09-06-2010 04:45 PM
How do you know the loop only ran once? A dt of 100,000 means it is a period of 100 seconds, which is a pretty long time to wait for a change to occur.
What target are you running on? You have the timer set for 1 MHz, but that clock does not exist on a Windows PC, only a 1 kHz clock.
Are you sure the values in your shared variables are changing?
Why are you combining the shared variables into an array to go right back to indexing the array to get 6 scalar indicators?
If you want to change the loop period (which is that say you want to do), you need to use the dt terminal that is on the block of nodes to the inside of the righthand side of the while loop.
09-07-2010 04:32 AM
Thank you for your replying. I am running the vi on the controller of compactRIO which has the clock of 1MHz. Could I ask that why does 100,000 means 100 seconds? What I though before was that 100,000 indicates 0.1 second because the unit of the clock is us.
Thank you very much!!
09-07-2010 08:06 AM
Because I didn't know you were using a cRIO that had a 1 MHz clock base, so I figured you were using a Windows PC with a 1 kHz clock base.