LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait Until Next ms Multiple.vi explanation

 

AnalogKid2DigitalMan

 

is there a way i can view this code in LabVIEW 8.0 ? I am not able to see the code .. 

0 Kudos
Message 11 of 25
(2,202 Views)

altenbach, 

 

Great examples!!! 

 

I am using an older code that place a “wait until next ms multiple.vi” in a time loop.

From the feedback I am getting on the forum, I think I should use CONSUMER AND PRODUCER ARCHITECTURE TO GATHER THE data. BUT for me to get more time for the project I would have to explain why the current codes need to be changed.

 

The only thing that change in this code when I run it at a smaller distance( angles smaller than .72) and bigger distance (angles greater than .72 ) are the timing for the “wait until next ms multiple.vi.”  Inside the time loop I measure the time it take for the wait until ms to finish.

 

I had run the code when the angle was smaller than .72 and printed out the Boolean status for each iteration. And when it was bigger than .72. if interested I have attached the file. There is no different. The different is only with the timing!!!

 

 

0 Kudos
Message 12 of 25
(2,203 Views)

sorry for the multiple post. 

 

when i am measuring smaller distance i have to increase the "wait until next ms miltiple.vi" to 300 -400 ms for it to work correctly. 

 

Does this mean i am not sample at the 5ms time period that i set the time loop to? 

 

 

again thanks for all the helps!! 

0 Kudos
Message 13 of 25
(2,194 Views)

I have not looked at your code. Timed Loop will execute every 5ms if thats the setting.

 

If Wait_Until_Next_Multiple is inside the Timed Loop, it waits till clock reaches 300ms then 600 then 900 then 1200... so on so forth for execution. Maybe you data is not acquired till 300ms has elapsed.... the longest delay limits the acquistion right?

 

There are very good explanations of the Wait differences posted, good luck.

0 Kudos
Message 14 of 25
(2,185 Views)

Could you please reduce your VI to a small version that only contains the timing code and relevant inputs. Currently it's like wading through a swamp in the dark trying to figure out what you are doing. I am also on a laptop, so scrolling that over-sized diagram is very tedious.

 

You also did not include important subVIs, such as remove zeroes from array.

 

Anyway, a 100ms "wait until next ms multiple" inside a 10ms timed loop screams problems, because, as I said, the first wait is somewhat random, depending on the arrival at the job site. Since each "arrival" is dictated (1) by the loop timing and (2) whatever needs to execute before the case can be scheduled (e.g. the digital U8 read below it) , the wait in the false case will be different for each iteration.

0 Kudos
Message 15 of 25
(2,183 Views)

sorry about that. 

0 Kudos
Message 16 of 25
(2,168 Views)

in the crk_angle to steps.vi the egb need to be set to 500 

0 Kudos
Message 17 of 25
(2,160 Views)

Where is "measure time.vi"?

0 Kudos
Message 18 of 25
(2,158 Views)
0 Kudos
Message 19 of 25
(2,151 Views)

I have trapped into a problem in my code. My requirement is to have a sudden action on button press. Whenever user presses stop button the program has to stop running at the same instant. 

 

The problem here is that I am having 4 LEDs changing their state consistantly for every 3s. Suppose if I press stop button, the program is waiting for 3s as I put a wait(ms) function to wait for 3s and then stops. But how can I make it stop in an instant when I press button. It is purely because of Wait ms function. 

 

So my direct question is "Is there any other way for waiting in the code(Not using waitms), so that sudden response should happen for the user actions over UI?..

 

 

 

 

 

 

 

I am attaching sample VI where I have same scenorio. In this VI, I dont want to wait after pressing stop button.

Can anyone suggest me any other way of causing delay without using delayms function?..

0 Kudos
Message 20 of 25
(1,815 Views)