Jump to content

elapsed timer and data writing at intervals


Recommended Posts

Hello ppl, need some help!! please see attached if this is not clear

( 0)----8hrs--------(8)-------8hrs-------(16)--------8hrs------(24)--------upto 14 days

30secs-----------30secs---------------30sec----------------30sec-----------of data @ each 8hr interval

every 8hrs i need to able to write up 30secs of data to spreadsheet and continue the operation until the end of expt (14 days), also optionally i should be able to write some 45 sec of data between the 8hrs gap without interrupting the original interval setup

I was trying with 2 elapsed time vis, one countsdown 8hrs ,when elapses it should trigger another 30 sec timer which will enable those 30s of of writing and stop.again when 8hrs elapses it should write 30 seconds.( it should not stop, it should reset again and wait for the 8hr timer to set it) but i am very much stuck with these timers, another types or ideas welcome

any help would be much appreciated

thanks,

free mason

Link to comment

Hello ppl, need some help!! please see attached if this is not clear

( 0)----8hrs--------(8)-------8hrs-------(16)--------8hrs------(24)--------upto 14 days

30secs-----------30secs---------------30sec----------------30sec-----------of data @ each 8hr interval

every 8hrs i need to able to write up 30secs of data to spreadsheet and continue the operation until the end of expt (14 days), also optionally i should be able to write some 45 sec of data between the 8hrs gap without interrupting the original interval setup

I was trying with 2 elapsed time vis, one countsdown 8hrs ,when elapses it should trigger another 30 sec timer which will enable those 30s of of writing and stop.again when 8hrs elapses it should write 30 seconds.( it should not stop, it should reset again and wait for the 8hr timer to set it) but i am very much stuck with these timers, another types or ideas welcome

any help would be much appreciated

thanks,

free mason

Link to comment

QUOTE (freemason @ Jan 14 2009, 10:38 PM)

Let me take this opportunity to introduce you to the http://jkisoft.com/state-machine/' rel='nofollow' target="_blank">JKI State Machine. It's worth your while to learn.

I've attached something for you to start with. If you like it, take the time to watch the videos on JKI's site, read whatever you can find on the forum and post back here if you have any trouble filling it out for your application. If you don't like it ( :o ), post your code here and we'll see what we can do to help you.

</jim>

Link to comment

QUOTE (freemason @ Jan 14 2009, 10:38 PM)

Let me take this opportunity to introduce you to the http://jkisoft.com/state-machine/' rel='nofollow' target="_blank">JKI State Machine. It's worth your while to learn.

I've attached something for you to start with. If you like it, take the time to watch the videos on JKI's site, read whatever you can find on the forum and post back here if you have any trouble filling it out for your application. If you don't like it ( :o ), post your code here and we'll see what we can do to help you.

</jim>

Link to comment

Thanks for the reply, i will need more time to learn jki state machine, but for now its kind of urgent so, im attaching my vi , please help!!

I am using 2 elapsed time vis

ideas:

1) I can use a case structure but the 8hrs timer gives out a boolean only when elapsed

and instantly changes to false, if some how i can make that boolean to be true for 30 secs and do my operation

and change back to false while the 8hrs timer resets at its time

2) I can use the get start time of hrs timer and add 30 sec to it and give it to 30 sec timer's "set start time " and

do my operation within that 30 secs and wait for 8hrs again

but, i am unable to do any of these may be because both are in the same while loop or something, even if put a

while loop around the 30 sec timer and stop the loop when time up, its not working, it still resets,

i need something that can start a while loop (programatically) not when we press the run button,

3) if we make the 30 sec timer a subvi and put in a case structure and contol its running/run button...

4) if you can give me in a standard state machine i guess i can understand, but im thinking if the 8hrs elapsed it will wait for the 30 sec thing to happen and then start 8hrs again, but i need to run that 8 hrs,8hrs,8hrs silently in the background and do 30 sec thing simultaneously, not wait for 30 secs

any help would be much appreciated???

thanks

Link to comment

Thanks for the reply, i will need more time to learn jki state machine, but for now its kind of urgent so, im attaching my vi , please help!!

I am using 2 elapsed time vis

ideas:

1) I can use a case structure but the 8hrs timer gives out a boolean only when elapsed

and instantly changes to false, if some how i can make that boolean to be true for 30 secs and do my operation

and change back to false while the 8hrs timer resets at its time

2) I can use the get start time of hrs timer and add 30 sec to it and give it to 30 sec timer's "set start time " and

do my operation within that 30 secs and wait for 8hrs again

but, i am unable to do any of these may be because both are in the same while loop or something, even if put a

while loop around the 30 sec timer and stop the loop when time up, its not working, it still resets,

i need something that can start a while loop (programatically) not when we press the run button,

3) if we make the 30 sec timer a subvi and put in a case structure and contol its running/run button...

4) if you can give me in a standard state machine i guess i can understand, but im thinking if the 8hrs elapsed it will wait for the 30 sec thing to happen and then start 8hrs again, but i need to run that 8 hrs,8hrs,8hrs silently in the background and do 30 sec thing simultaneously, not wait for 30 secs

any help would be much appreciated???

thanks

Link to comment

QUOTE (freemason @ Jan 15 2009, 09:19 PM)

Thanks for the reply, i will need more time to learn jki state machine, but for now its kind of urgent so, im attaching my vi , please help!!

I am using 2 elapsed time vis

ideas:

1) I can use a case structure but the 8hrs timer gives out a boolean only when elapsed

and instantly changes to false, if some how i can make that boolean to be true for 30 secs and do my operation

and change back to false while the 8hrs timer resets at its time

2) I can use the get start time of hrs timer and add 30 sec to it and give it to 30 sec timer's "set start time " and

do my operation within that 30 secs and wait for 8hrs again

but, i am unable to do any of these may be because both are in the same while loop or something, even if put a

while loop around the 30 sec timer and stop the loop when time up, its not working, it still resets,

i need something that can start a while loop (programatically) not when we press the run button,

3) if we make the 30 sec timer a subvi and put in a case structure and contol its running/run button...

4) if you can give me in a standard state machine i guess i can understand, but im thinking if the 8hrs elapsed it will wait for the 30 sec thing to happen and then start 8hrs again, but i need to run that 8 hrs,8hrs,8hrs silently in the background and do 30 sec thing simultaneously, not wait for 30 secs

any help would be much appreciated???

thanks

http://lavag.org/old_files/monthly_01_2009/post-5713-1232101435.jpg' target="_blank">post-5713-1232101435.jpg?width=400

Something like this, maybe :) I guess it could be made simpler and better than this but this seem to work.

Link to comment

QUOTE (freemason @ Jan 15 2009, 09:19 PM)

Thanks for the reply, i will need more time to learn jki state machine, but for now its kind of urgent so, im attaching my vi , please help!!

I am using 2 elapsed time vis

ideas:

1) I can use a case structure but the 8hrs timer gives out a boolean only when elapsed

and instantly changes to false, if some how i can make that boolean to be true for 30 secs and do my operation

and change back to false while the 8hrs timer resets at its time

2) I can use the get start time of hrs timer and add 30 sec to it and give it to 30 sec timer's "set start time " and

do my operation within that 30 secs and wait for 8hrs again

but, i am unable to do any of these may be because both are in the same while loop or something, even if put a

while loop around the 30 sec timer and stop the loop when time up, its not working, it still resets,

i need something that can start a while loop (programatically) not when we press the run button,

3) if we make the 30 sec timer a subvi and put in a case structure and contol its running/run button...

4) if you can give me in a standard state machine i guess i can understand, but im thinking if the 8hrs elapsed it will wait for the 30 sec thing to happen and then start 8hrs again, but i need to run that 8 hrs,8hrs,8hrs silently in the background and do 30 sec thing simultaneously, not wait for 30 secs

any help would be much appreciated???

thanks

http://lavag.org/old_files/monthly_01_2009/post-5713-1232101435.jpg' target="_blank">post-5713-1232101435.jpg?width=400

Something like this, maybe :) I guess it could be made simpler and better than this but this seem to work.

Link to comment

Here's your code, slightly modified. You were so close!

  • I added a delay (to stop hogging the CPU)
  • I added a Case Structure and a Shift Register (to control when the 30 second timer operates)
  • I deleted your wire between Get Start Time and Set Start Time
  • I changed the Boolean control to a constant to Auto Reset the first timer
  • I added a First Call to the test so you'd get your measurement at T=0

You'll also need to multiply your "at every" control by 3600 to get the first timer to run for hours instead of seconds.

Jim

Link to comment

Here's your code, slightly modified. You were so close!

  • I added a delay (to stop hogging the CPU)
  • I added a Case Structure and a Shift Register (to control when the 30 second timer operates)
  • I deleted your wire between Get Start Time and Set Start Time
  • I changed the Boolean control to a constant to Auto Reset the first timer
  • I added a First Call to the test so you'd get your measurement at T=0

You'll also need to multiply your "at every" control by 3600 to get the first timer to run for hours instead of seconds.

Jim

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.