LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview timed loop: how to use period terminal to control sampling rate?

Hello, I am using timed loop in scan mode and want to control the sampling rate with it as shown in the following vi.

23248i3595EE332BFC9237

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!!

0 Kudos
Message 1 of 4
(4,573 Views)

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.

0 Kudos
Message 2 of 4
(4,557 Views)

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!!

Message 3 of 4
(4,540 Views)

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.

0 Kudos
Message 4 of 4
(4,530 Views)