LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to create event driven timer

Are you talking about the shift register?  Right click on the while loop and select "Add Shift Register".
 
Array icon as "U32"??  Drop empty array constant on diagram.  Drop a numeric constant on the diagram.  Right click numeric constant and set Representation to U32.  Drag the numeric constant into the array constant.
0 Kudos
Message 41 of 56
(2,504 Views)
I've got my program to work fine but it gives me the time between every two intervals. How can i add these up and get one total time in another indicator? Also, how can i input an equation to measure viscocity from the data i got?
0 Kudos
Message 42 of 56
(2,478 Views)

I don't understand why in the middle wire, you are dividing the entire array by a given value every iteration.  It seems that the calculation should be performed on a given interval, not the entire array.

Second, try using build array instead of insert into array.

Third, don't use the STOP function, you don't need it.  The VI will stop once the loop is done anyway.

If you want a total time, them sum up the individual times and carry them through a shift register.  If that isn't what you want, then I'm not sure what you are asking.

0 Kudos
Message 43 of 56
(2,471 Views)
I agree with Ravens that there are quite a few constructs that are very weird.
  • Why do you use the elapsed time express VI with a timeout of zero and reset it at each call???
  • Why do you keep the same data in three different shift registers? All you need is one shift register and then calculate the derived data from it for the other indicators.
  • "Built array" is more natural than "insert into array".
  • It is dangerous to allow changing the number of sensors during the run and check with "equal". What if the operator lowers the value below the current count? The VI would never again stop!
  • There is a hard upper limit to the size of the data array. For efficiency it would help to initialize the shift register with the full size array (# of sensors!) containing all NaN and then replace the times in order.

What is the formula for the viscosity?

 

0 Kudos
Message 44 of 56
(2,458 Views)
The thing is I need various values to be displayed. One of them is the time it takes the sphere to go from one sensor to another which I already have set up. In seperate indicators I need the total time, average velocity, average viscocity , vicocity per interval and velocity per interval. The first three would be single values while the last two would be arrays. The reason that for one of the arrays I'm dividing by a constant is that that is the distance between two sensors so this way i get velocities per iterval in my array.

" Why do you keep the same data in three different shift registers? All you need is one shift register and then calculate the derived data from it for the other indicators"
"
It is dangerous to allow changing the number of sensors during the run and check with "equal". What if the operator lowers the value below the current count? The VI would never again stop!"
"There is a hard upper limit to the size of the data array. For efficiency it would help to initialize the shift register with the full size array (# of sensors!) containing all NaN and then replace the times in order."
All these suggestions sound great but the problem is that I don't know how to do any of these.... I took the six hour course but I'm still pretty lost with labview.. it's only been a few months

Finally for the viscocity equation, i still have to figure that out. I just wanted to know if there is a way to connect a box with a anequation so that for evey value I'm getting i get the voscocity. I will be working at the lab tomorrow so I will change my array so they are built instead of data being inserted into them. I'll also kill that STOP functions... seems to annoy alot of ppl.. srrry bout that.  I will upload VI. Thanks so much


0 Kudos
Message 45 of 56
(2,437 Views)
Hi guys... I am very new to Labview. I am actually a physicist and now iam trying to make a program in labview for the past few days for performing break junctions. I just want to  make a small timer that counts seconds (from 1,2,3...) and i want the timer to count until 3 seconds. can some one help me how to make it? thakn you
              Saranyan
0 Kudos
Message 46 of 56
(2,269 Views)

You probably should have started a new thread for this.

It is not really clear what you want. What else should it do during these three seconds?

The simplest solution would be a FOR loop with N=4, containing a 1000ms wait, and an indicator connected to [i]. Try it! 😄

0 Kudos
Message 47 of 56
(2,247 Views)
Hi..Sorry for not starting a new thread.. The truth is I cant find how to do it. Thnx for the previous msg. Actually I have a condition of true or false and I have made a case structure. Initially  the false loop will be executed and once the condition is reached, the 'true' loop will execute. What I want is, I need this 'true' loop to execute only for 3 seconds. After this 3 seconds, I want the false loop to start executing again.
Can some one help pls?
    thank you
         Saranyan
0 Kudos
Message 48 of 56
(2,220 Views)

Instead of having two different loops (one in each case), use a single outer loop and place the case structure inside it.

Here's a quick draft of one possible solution (LV 8.0). See if it makes sense.

 

0 Kudos
Message 49 of 56
(2,212 Views)
Hello I am having a similar setup for pressure sensors. Thing is that i want an user interface driven event structure which writes data to my file whenever i push a button of some sort and stops again when i tell it in a similar manner. I am attaching my vi. Please suggest appropriate modifications. Thanks in advance
0 Kudos
Message 50 of 56
(2,084 Views)