LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execute an event structure when alarm condition occurs

Solved!
Go to solution

Hello,

I want to turn on ALARM LED when an alarm condition occurs. The alarm LED is turned on when tank reaches above or below the specified levels and an visual pop up is displayed on the FP ,that pop up should get displayed only once the condition occurs. The Alarm LED should auto shutoff when tank is filled within range. 
1. Is there any better way to execute case structure 1 & 2? ( I mean the logic created using feed backs , the count goes on incrementing when no alarm condition occurs and might be a problem later)

2. How can i use event structure to execute the alarm conditions? coz i have to do this for multiple tanks? (What I understood is event structure works on FP activity.. how can I implement it here?)


Please suggest.
Attaching the vi for your reference.

Thank You.

0 Kudos
Message 1 of 8
(1,143 Views)

Hello,

 

if you set the control value with property node Value(signaling), it triggers event same as if you would change control value on front panel.

0 Kudos
Message 2 of 8
(1,119 Views)

Please ignore the above answer, it is completely irrelevant here.

 

I do recommend to start with the basic tutorials, because most of your code makes absolutely no sense.

 

  • Why are you conditions (all small integers!) orange instead of blue???
  • Why do you have these "select" nodes with the same value connected to both inputs???
  • Why does your loop spins millions of times per second?
  • Why is your "alarm" terminal not connected to anything? (properly done, no local variables are needed.
  • Why do you have loops inside loops instead of a proper state machine?
  • No, you don't need an event structure because your spinning the loop at regular intervals anyway to read the controls (or the analog input once you connect to a real system)
  • A popup is typically a bad idea because it interferes with dataflow unless you program around it. Why not just display a certain status string on the front panel?
  • Why not just have a string indicator where you append lines instead of a listbox?
  • Where is the "buzzer" you mention in the VI name?
  • etc.

 

Maybe you can make a list of all requirements so we can help you sort this out.

 

  • What are the various states of the program, how do you interact and  and what should the user see?
0 Kudos
Message 3 of 8
(1,095 Views)
Solution
Accepted by topic author Nectar_techabhi

See if this can give you some ideas. Modify as needed. Please ask if anything is not clear.

 

 

altenbach_0-1647897809001.png

 

altenbach_1-1647897880172.png

 

0 Kudos
Message 4 of 8
(1,084 Views)

I can't load your current code to see what you are doing now as my LabVIEW version isn't up to date.

 

In general you should listen to Altenbach.  He knows what's up.

 

However, to answer your second question (which might be irrelevant if you use his example code), then the answer could be "user events".  Check this "how to" page to see an example of how they work:

 

https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/creating_user_events/

 

 

0 Kudos
Message 5 of 8
(1,071 Views)

Thank you for your reply. I will surely go through the basic tutorials. If possible can you pls attach a link for the same

 

  • Why are you conditions (all small integers!) orange instead of blue??? Re: OK that was my mistake will change accordingly.
  • Why do you have these "select" nodes with the same value connected to both inputs??? Re: I was really stuck in finding a way to get that case structure to be executed once and thought would have better soln so put up on forum. Thanks will take care.
  • Why does your loop spins millions of times per second? Re: Ok will take care
  • Why is your "alarm" terminal not connected to anything? (properly done, no local variables are needed. Re: Ok
  • Why do you have loops inside loops instead of a proper state machine? Re: OK ..I will go through state machine tutorials
  • No, you don't need an event structure because your spinning the loop at regular intervals anyway to read the controls (or the analog input once you connect to a real system) Re: Actually I have to do it for 16 tanks simultaneously to read current capacity and show respective status. So instead of repeating the same code for every tank thought using event structure would help.
  • A popup is typically a bad idea because it interferes with dataflow unless you program around it. Re : Can you suggest a way using pop up without affecting the dataflow.
  • Why not just display a certain status string on the front panel? Re: Ok Accepted
  • Why not just have a string indicator where you append lines instead of a listbox? Re: Ok Accepted
    Where is the "buzzer" you mention in the VI name? Re: I am using an Ethernet to DO module to turn on Buzzer. So instead just indicated with an ALARM LED


  • What are the various states of the program, how do you interact and  and what should the user see?
  • Re: I want to design a GUI for real time tank monitoring system for 16 tanks
    Parameters to be shown on FP:
    1. Current Capacity (Using AI to Ethernet module to read current capacity)
    2. Visual Alarm indication (Status of the last tank with high or low alarm on screen) and a log of tanks with alarms with latest on the top. And a pop up as soon as an alarm is generated (High/Low)
    3.Audio Alarm that can be acknowledged using a button on FP and auto shutoff when with range.
    Configurable parameters for 16 tanks that can get updated in runtime
    1. Max capacity
    2. High and Low alarm values
    So thought event structure would be better for executing alarms

    Will Sate machine help here?

    Thank you.

0 Kudos
Message 6 of 8
(1,046 Views)

An event structure is NOT for repeating code! What gave you that idea???

 

Have you looked at my example?

0 Kudos
Message 7 of 8
(1,024 Views)

Have you looked at my example?

Yes and thank you it helped me improve my code to great extent.


0 Kudos
Message 8 of 8
(991 Views)