Jump to content
Sign in to follow this  
KirinFrost

How to send an email automatically when warning light triggers

Recommended Posts

Hello,

 

I am making a basic programme for fall detection for the elderly. Right now, face detection is employed to identify a face, and should it fall below a certain level which can be adjusted, a warning light triggers. Using the smtp email example in labview, i have gotten the thing to send an email.

 

However, what i want is an automated sending of email when the warning light triggers and when it has been lighted up for say a min or something like that. Here is how my programme looks like so far:

 

post-54361-0-97902700-1452585967.png

 

The specific section of the email part in question:

post-54361-0-99646500-1452586353.png

 

 

Any ideas?

Edited by KirinFrost

Share this post


Link to post
Share on other sites

My suggestion is to refactor your code so no one VI takes up more than one screen.  Or if it does it scrolls in only one direction.  Oh and I'd also run your code through the VI analyzer to get an idea of what things can be improved, like wires going backwards, objects on top of each other, measuring code complexity and finding recommendations for compartmentalizing the code into subVIs, etc.

 

But to your specific question I'd say the simple solution is to used the Elapsed Timer express VI and configure it to tell you if some amount of time has gone by, and your condition has been true this whole time, resetting it if the condition is no longer true.  There is an input to the express VI for this.

Share this post


Link to post
Share on other sites

But to your specific question I'd say the simple solution is to used the Elapsed Timer express VI and configure it to tell you if some amount of time has gone by, and your condition has been true this whole time, resetting it if the condition is no longer true.  There is an input to the express VI for this.

 

I have no idea how to do that lol. Do you want me to take multiple screenshots of my programme so that you can see them in detail?

Share this post


Link to post
Share on other sites

Posting code on the forums can be done in several ways.  Taking screenshots of open windows is not one of them, pictures cannot be debugged or executed.  The comparison is you wouldn't take screenshots of notepad and post them on C++ forums.  Most people use snippets for small single VIs, which embeds the code in the PNG picture.

 

http://www.ni.com/tutorial/9330/en/

 

Other ways are zipping the project and all code dependencies outside of standard libraries shipped with LabVIEW, then posting that zip.

 

Drop down the Elapsed Time express VI (timing palette or search the palette), open the Context Help (CTRL+H) then hover over the function.  It will describe how to use it and what it can be used to do.  Then you could write a simple test VI that demonstrates how it works.  Hopefully once you use it, looking at the inputs and outputs, the usage will be clear.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

You mentioned taking multiple screenshots to see it in detail and so I wanted to describe how to share code.  But at the same time I wanted to give you the information on how to find the information yourself.

Share this post


Link to post
Share on other sites

I'm agree  with hooovahh, you need to follow some training on Labview. think about state machine. it might help you to refactor your code.

Your timer could be in a global functional (sub vi with a while loop that stop imediately and a shift register) so it can be called everywhere in your code and wont stp any process.

Share this post


Link to post
Share on other sites

Hello,

 

I am making a basic programme for fall detection for the elderly. Right now, face detection is employed to identify a face, and should it fall below a certain level which can be adjusted, a warning light triggers. Using the smtp email example in labview, i have gotten the thing to send an email.

 

However, what i want is an automated sending of email when the warning light triggers and when it has been lighted up for say a min or something like that. Here is how my programme looks like so far:

 

attachicon.giface conditions" that Event Driven programming allows and the highly probable "hang" due to not triggering an event and stalling your main loop..

 

I would suggest, instead, you just use a normal case structure instead of an event case, and wire the warning light to it and add a bit of logic to prevent it firing over and over again.

Edited by ShaunR

Share this post


Link to post
Share on other sites

Anyway the thing works now except for one small problem. Thanks all.

I noticed that the boxes created to show the facial features (eye,nose and lips) of the person keeps blinking. It seems to be telling me it cant detect it constantly all the time. Since the programme is meant to send an email when a feature is below a certain level after a certain period of time, because of the fact that it keeps blinking, it cant last long enough for the email to be sent.

Any ideas?

Share this post


Link to post
Share on other sites

When a control or indicator is blinking it's usualy because you are refreshing the value of it.

State macine and if you can learn about producer consumer it might help....

Share this post


Link to post
Share on other sites

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.

Sign in to follow this  

×
×
  • Create New...

Important Information

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