Jump to content

How can i take a temperature measurement every 5 seconds


xShadowDanx

Recommended Posts

  • 2 weeks later...

I ask about the question in the earlier post is a vi that takes a fixed period of temperature measurement ..

How can i actually take the measurement accordingly to the period adjustment? For eg. I create 1 more control which is the period(seconds)..and then i want to save the measurement accordingly to how many seconds i want and then it will automatically save. Can it work if i do that?

Link to comment

QUOTE (xShadowDanx @ May 7 2009, 10:56 PM)

How can i actually take the measurement accordingly to the period adjustment? For eg. I create 1 more control which is the period(seconds)..and then i want to save the measurement accordingly to how many seconds i want and then it will automatically save. Can it work if i do that?

You can wire a control that contains the milliseconds to delay to the Wait primitive. You could also have a control that has seconds (which more operators understand) and then multiply by 1000 to get milliseconds.

Tim

Link to comment
  • 2 weeks later...

QUOTE (xShadowDanx @ May 12 2009, 09:39 AM)

I haven't looked at your VI, I don't have Labview on here. However, using a wait doesn't seem like a good way to do this. If you want to stop your program and you press stop, you may have to wait up to 5 seconds for your program to end. Why not use a elapsed timer.vi and wire the time has elapsed booleanto a case structure. Inside the true case put all your data taking proceedures.

QUOTE (Tim_S @ May 8 2009, 01:46 PM)

You can wire a control that contains the milliseconds to delay to the Wait primitive. You could also have a control that has seconds (which more operators understand) and then multiply by 1000 to get milliseconds.

Tim

I got your code open. I have attached a simple example of how you can take data every 5 seconds. I would say though that there is some bad code in yours. Why do you have error, wired to a not, wired to continue while true? Why not just wire the error status to a stop if true? Rube Goldberg code. Also, how are you stopping your program? Does it just run until there is an error? You should wire a stop control and the error to an OR then wire that result to the stop sign of the while loop. It looks like you are using the abort on the front panel to stop which is a no-no. Anyways, here you go using an xy graph. Little messy but you should get the idea. You can change the 5 constant to a control to change how often the data is taken. If you want to write to a file you would also put that in the true case.

Link to comment

QUOTE (for(imstuck) @ May 21 2009, 07:07 PM)

Why do you have error, wired to a not, wired to continue while true?

Just a little bit of trivia, way back in the dark ages, like before LabVIEW had the "Undo" feature, this is the only way "while loops" worked. I wonder if this example has some old heritage to it?

-Pete Liiva

Link to comment

QUOTE (peteski @ May 22 2009, 02:38 PM)

Just a little bit of trivia, way back in the dark ages, like before LabVIEW had the "Undo" feature, this is the only way "while loops" worked. I wonder if this example has some old heritage to it?

-Pete Liiva

Haha, the funny thing is I posted this on the NI forums as an example of rube goldberg and got the same response! How could i have known, im only 22 :( lol.

Link to comment

QUOTE (for(imstuck) @ May 22 2009, 11:08 AM)

Haha, the funny thing is I posted this on the NI forums as an example of rube goldberg and got the same response! How could i have known, im only 22 :( lol.

No worries! Dang... I was 25 when I first started to use LabVIEW, so in one way of looking at it you have a head start on me!

;)

-Pete Liiva

Link to comment

QUOTE (peteski @ May 22 2009, 04:15 PM)

No worries! Dang... I was 25 when I first started to use LabVIEW, so in one way of looking at it you have a head start on me!

;)

-Pete Liiva

However, back to the most important point...setting a wait for next ms multiple to 5000 ms is not a good way to control how often you take data, as it will cause you a considerable wait time when trying to stop the program :). I learned this the hard way in the first program i did when i wanted to take data every 120 seconds lol

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.