03-28-2021 08:25 AM
Dear, I have a project in labview, with which I send an email when an alarm situation occurs.
For this I am using an Rpi 4 and the SMTP protocol.
So far I have been able to send the mail correctly when the alarm situation occurs.
The problem occurs when the Vi is in an alarm situation, then it sends the email constantly, saturating the mailbox.
To send the emails I am using the SMTP protocol within a case structure. In the attached image you can see the condition for case 2 to be executed (the idea of using the iteration icon I have obtained from a video made by NI Mexico), but with this condition I have not managed to send the email a once.
I hope you understand what I want to do and that you can have a solution for this.
Total thanks
Solved! Go to Solution.
03-28-2021 08:48 AM
The issue has nothing to do with sending the email. The email is working as every time your case 2 is triggered an email is sent.
If you only want 1 email to be sent you need to use a flag to indicate you sent the email and clear the flag when a new alarm is sent.
I am not sure what you are using the digitals for on the bottom of your image so I can't suggest exactly how to take care of this.
03-28-2021 09:23 AM
Thanks David for the prompt reply.
Regarding the digital ones and particularly in case 2, they are being used so that when a situation occurs in the physical environment, case 2 also occurs, nothing more than that.
Regarding the use of flag, sorry for the ignorance, but I don't know what you mean. Please, will you have an example or tutorial that I can refer to.
Thanks
03-28-2021 10:01 AM - edited 03-28-2021 10:25 AM
I can put together a quick VI but I am not in front of my development system at the moment.
By flag I just mean a boolean variable. Set the boolean to False when you initialize your condition you are monitoring for the email notification. When the condition for the email occur if the variable is False send the email and set the variable to True. This way next time the condition occurs it will not send the email as the variable is not False. In this situation an email will only be sent once after initializing the condition you are monitoring for.
Please let me know if you still need an example based on this explanation.
03-28-2021 10:14 AM
Ok David.
I will try to do it on my own.
If I can't, I'll ask you for an example.
Thanks a lot
03-29-2021 08:36 AM
03-29-2021 10:07 AM