LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure

I am trying to add an event to an event structure. I want the event to occur when a counter reacher a certain value which will be inputed by the user. I want the event to occur when these two values are equal. How do I configure the event structure for such a case? -P
0 Kudos
Message 1 of 10
(3,021 Views)

You need to use 'Create User Event' and their corresponding functions, whenever you will get your desired condition. you can refer few examples from NI code example.

0 Kudos
Message 2 of 10
(3,016 Views)

Since you need to poll the counter anyway, just do repetitive comparisons and a simple case structure where a non-empty case activates when the condition is met. No events needed.

Message 3 of 10
(3,012 Views)

You can configure an event case to handle value change events for multiple controls.

 

 

multiple events.png

 

Edit: The code capture tool removed the text from the event selector. That should look like this:

 

selector.PNG

=====================
LabVIEW 2012


0 Kudos
Message 4 of 10
(3,004 Views)

A counter is typically not a control.

0 Kudos
Message 5 of 10
(2,999 Views)

Right. For some reason I missed that and only saw the "input by the user" part.

=====================
LabVIEW 2012


0 Kudos
Message 6 of 10
(2,994 Views)

Checkout Value(Signaling) property node.

Some useful help here and here..

0 Kudos
Message 7 of 10
(2,987 Views)

There is at least one gotcha with the Value(Signaling) property node. Remember that this is not a ValueChanged(Signaling) property. If the control is set to 5 and you write a 5 to it will still cause the event to fire. I realize this will not happen with a counter if it is incremented each time through the loop. Something to be aware of.

=====================
LabVIEW 2012


0 Kudos
Message 8 of 10
(2,978 Views)

SteveChandler wrote:

Edit: The code capture tool removed the text from the event selector. That should look like this:



Not so fast my friend.  It is the Native LV Snippet creator which mangles your event structure (amongst many other things).  Under the hood it uses the 'Create SubVI' method which can lead to many, many headaches.  Having developed the Copy/Paste alternative which is now part of the Code Capture Tool I can tell you unequivocally that the CCT would not do that.

 

Here is the LV version and my homebrew version of a simple event structure.

 

original.png  original2.png

 

Notice that I even backsaved to 8.2 for the heck of it.  You can not drag it directly in 8.2, but there are ways of using it still.  Just trying to show the underutilization of snippet possibilities.

 

I tried, distinctly in vain, to get the situation improved.  Stick to the CCT.

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Treat-Code-Snippets-as-quot-Copy-and-Paste-quot-instea... 

Message 9 of 10
(2,967 Views)

Thanks. I am going to install the CCT right now. It has been on my todo list for a while. I usually create snippets to post and also attach a backsaved VI so older versions can open it. Just getting rid of that step makes the CCT worth it but I know there are a lot of other things that the CCT gives you.

 

Bubye Edit/Create VI Snippet from Selection. It was fun but I am moving on. This was my final native snippet and from now on you will only see me with the newer and sexier CCT.

=====================
LabVIEW 2012


Message 10 of 10
(2,961 Views)