LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TIme Loop not running according to the define time

Dear All,

          I want to run the loop at exact 50 ms, and for that I am using timed loop, and specifying the time 50 ms and from that loop I am stamping the data into the excel file, but the datas are either not at exact 50 ms nor at the perfect specific interval.

          Can anybody tell me what could be the method which gives me specific delay in the loop i want?

Thanks in Advance,
Nishant
0 Kudos
Message 1 of 16
(7,204 Views)

Hi Nishanth,

Unless your 'writing/stamping data  to excel file' operation is taking a longer than 50 m Sec and different execution times in each iteration, the timed loop should work fine.

Just post your code and probably we could suggest better

Regards,

Dev

 

0 Kudos
Message 2 of 16
(7,201 Views)
Hiiii, Dev
 
          You are right that uptil and until stamp to excel exceeds 50 ms it should work OK, but u ll shock to know that it is giving less than 50 ms time, and that is of 46-47 ms, i m sending you one excel file with my code, and i really forgot to post the code in the last post, but it is still good if you can suggest me something.
 
           Check both of the file and i think you can suggest me something.
 
Thanks,
Nishant
Download All
0 Kudos
Message 3 of 16
(7,199 Views)
 I did a small check to determine if each iteration is taking 50 milli Sec and i got the result that each iteration is indeed taking 50 milli sec!
 
I also stream-lined the process flow in your application as shown in attached vi, but still ended up getting 4 max of 4 milli Sec difference
 
The culprit for this behaviour seems to be your Format Date/Time String function.

Message Edited by devchander on 10-12-2006 04:04 AM

0 Kudos
Message 4 of 16
(7,192 Views)
I did a small check to determine if each iteration is taking 50 milli Sec and i got the result that each iteration is indeed taking 50 milli sec!
 
I also stream-lined the process flow in your application as shown in attached vi, but still ended up getting 4 max of 4 milli Sec difference
 
The culprit for this behaviour seems to be your Format Date/Time String function.

Message Edited by devchander on 10-12-2006 04:04 AM

0 Kudos
Message 5 of 16
(7,192 Views)
Hiiii,
 
              Thanks for the such a real analysis, in your vi i have made some changes to see the data into the array, so that i have got some data as like i ve shown in the .jpg file below, though i cannot acheive the logic exactly you want to apply that diff of two readings give me exact delay time, but still from the data in the array you can see that its a difference of exacly 50 ms for the loop, but still there is a problem in the excel file, but i dont think it could be a problem because of Date/time format function, but if you are saying it could be.
 
            Anyways can you suggest me any other method, where i can get the exact delay in the excel file? or is it possible to stamp manually at exact 50 ms in an excel file? though its a cheating but we have to do it anyways.
 
Thanks,
Nishant
Download All
0 Kudos
Message 6 of 16
(7,184 Views)

though its a cheating but we have to do it anyways.

 
Smiley Very Happy
 
Yes I agree
 
I used to do manually generate timestamp( depending on sampling rate) whenever I do a Data acquisition.
I could trust the DAQ card's timing sequence that much!
 
I am not aware of any other better method to achieve this.
 
Wait, let's hear from others Smiley Happy
0 Kudos
Message 7 of 16
(7,173 Views)

Dear Dev,

             Great work, but can you tell me how you are doing cheaing (Joking Smiley Wink), i mean how you are doing the manual stamping? so that i also can do it in my application. please help me....Smiley Very Happy

Thanks,

Nishant

0 Kudos
Message 8 of 16
(7,168 Views)
Just use the timing built into the loop. It will be accurate unless the loop is delayed (this is probably desired). 🙂
 
 

Message Edited by altenbach on 10-12-2006 10:08 AM

Download All
Message 9 of 16
(7,152 Views)
Hiii, Altenbach,

                  I like the concept, but as i told main delay is in the time stamping, so will it be solved, cos what Dev has done gave me exact delay timing in VI, but main concern was Excel file, why i am asking this is that i am not in the office and at home, so pls check it if you can, if this can solve the problem for the Excel file also, then it would be a well n good option for me, but thanks anyways for the help, and i hope that this will work fine.

Thanks,
Nishant
0 Kudos
Message 10 of 16
(7,133 Views)