LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Email Error Messages

I am trying to send an email message to myself when an error has occurred while the program is running.  The code is pretty complex and I have just taken on this project with limited labview background.  I have taken two attempts at putting code in to send an email when an error has occurred.  In both cases I get an email to send me the error message but it will not send it until I click the "STOP ME FIRST" button then the "Then Exit Program" button.  The error will then pop up and after I click it to exit the error the email sent button lights up and I receive an error email.  I am looking to not have to click the two buttons and exit out of the error message in order for me to receive emails when I am not at the program so that I know something has gone wrong.  Can anyone help me out with this?  I have attached the two attempted codes.

 

Thanks

Download All
0 Kudos
Message 1 of 4
(2,755 Views)

The code is way too complex.  You have case structures and other structures buried 8 layers deep in you upper part of your code.  And there is a heavy use of local variables that I suspect is leading to a race condition.  Some things like your last e-mail structure will never work like you expect.  You read a local variable of e-mail sent and that determines which case of the case structure to execute.  The case structure won't execute until the main portion of your code is done due to the data dependency of the error wire.  But that local variable is going to be read at the very beginning of your program because nothing else depends on it.

 

What is the difference between the two VI's you posted?

 

Why do you preview a queue element before dequeuing it?

 

I think you need to revisit your whole architecture, the deeply embedded structurs makes it impossible to debug what is going on.  That is going to prevent anyone from looking at your code any further.  You should probably be looking at a state machine architecture.

Message 2 of 4
(2,742 Views)
The first vi was an attempt to put the error handling email loop at the end of the huge loop.  The second vi, I tried to fix the problem with the email being sent after I exit the program so I inserted email sending loops for errors in two parts of the huge loop where the program has error loops.  The both do the same thing but I think the second version is a better way of doing it.  I am thinking that if I somehow can get the loop under the huge loop to exit and the wait loop in the bottom left of the program to exit then it will work.  Maybe have those in no error/error loops as well?  Sorry it is hard to explain where I am talking about since it is such a large program.  I am going to run the code today and highlight the block diagram to see if I can see where the code is getting stuck.
0 Kudos
Message 3 of 4
(2,727 Views)
It will be hard for us to help you given the size and structure of these VIs. I would take Ravens Fan's advice on restructuring your VI. If you have any specific questions on programming in LabVIEW, I would be glad to help.
Vivek Nath
National Instruments
Applications Engineer
Machine Vision
0 Kudos
Message 4 of 4
(2,695 Views)