LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

run once inside timed loop

Solved!
Go to solution

icemaker wrote:
Looks like the first call will work for me.

 

If you use First Call, and the error happens, it sends an email. Assuming you don't shut down the software, someone fixes the error condition. Then error happens again. No email.
Richard






0 Kudos
Message 11 of 17
(1,168 Views)
I could live with that as the solution but would obviously prefer the shift register method. Can anyone elaborate on that or provide an example.
0 Kudos
Message 12 of 17
(1,166 Views)

Hi

 

Something like this maybe:

 

Email on error.png

 

This VI should have the same function as yours, but only send one email per error. I say "should" because I can't test it properly without a mailserver. There are most certainly a couple of bugs in there, but I hope the main idea comes across. What is missing right now is a way to reset the alarms. As it is now when an alarm has triggered it will remain triggered until you restart the VI. Hope this helps you in the right direction

 

Best Regards

 

David

Message Edited by Davidek on 10-05-2009 07:35 AM
0 Kudos
Message 13 of 17
(1,140 Views)

I tested that snippet and it seems to function partly. It only alarms on the 4th set point change. I am trying to figure it out as it is a much much neater way of wiring up my program.

 

I also have just started testing the program on my actual system and have noticed a problem with my programming. The voltage is not always on they intermittantly kick on whenver the machine I am monitring requestes heat. When it kicks on the voltage steps up from 0 to 6, so as I have it programmed now it warns when its on the way up to the specified voltage. What I need to do is take only the peak and compare it to my set point and ignore when it is 0. Sounds confusing but that is about the easiest way to explain it. 

 

Thanks to all for the help so far.

0 Kudos
Message 14 of 17
(1,124 Views)

Hi again

 

Had some time to do some tests. I'd forgotten a shift registrar on the for loop. I also replaced the e-mail with a popup (be carefull not the get caught in popup-lock) and the DAQ Assistant with a manual input so you can run test easier. Here's a snippet:

 

Email on error v2.png

 

If I understand your intent correctly you just wnat to compare the peak value to the setpoint? As you are reading the values one at a time you would have to save them (maybe in a shiftregister) so you can compare the current and previous values and find the peak. Or you could read more values at a time and use some built in functions

0 Kudos
Message 15 of 17
(1,109 Views)
Davidek- What kind of built in functions would be useful for finding peak value?
0 Kudos
Message 16 of 17
(1,089 Views)

Hi

 

That depends on a few things. At the moment you are reading one sample on demand so you get only a singel sample per iteration. One way to go would be to use the Peak Detector PtByPt VI, which takes single values. It is included in LV Full and above. You could also use the Collector Express VI to build an array for you as the samples are coming in. Then you can use the Amplitudes and Levels Express VI or the Peak Detector VI to find the peaks.

 

Another way would be to read more samples per iteration and then use the Peak detector or Amplitudes Express directly, but that may not be preactical for you. Will require more rewriting of your VI. Have a look at the different options and see what you think suits you.

 

Best Regards

 

David

0 Kudos
Message 17 of 17
(1,069 Views)