LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure crash VI

I seem to be missing something with event structures. When I add one to my working VI, nothing else works. I've tried different locations, inside and outside of my case statement. I can get my VI to work without it but I would prefer to use it.

0 Kudos
Message 1 of 10
(3,934 Views)

What do  you mean by it crashing your VI?  A crash of a VI is pretty severe.  But in your description, you just say that adding it then "nothing else works".

 

Also, the VI you attached does not have an event structure in it, so it is impossible to comment on why your VI is not working as expected when you put it in there.

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

I do not have 2016 so it is wild guess time for me!

 

Two guesses

 

1) the Event structure is not in a loop so it only works on the first click and never is allowed to run again.

 

And/Or

 

2) You lef teh event configured with the default setting of "lock front panel ..."

 

Done guessing.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 10
(3,893 Views)

It seems you didn't read the comment I placed in my timeout of the event structure I added.  Here is the other thread for context.

 

http://forums.ni.com/t5/LabVIEW/Tie-Scrollbars-together/m-p/3578146#M1001771

 

And the comment from the block diagram.

 

Timeout likely isn't needed but based on your design youy may want it since it isn't very event oriented and you may need to go poll the other controls you have.  You may want to consider moving to a more event driven application.

You'll notice that in my code I have a timeout of 100ms which means if no events are triggered in 100ms it runs that case.  If that isn't there or timeout is -1 it will wait forever for an event.  This means your loop won't execute (think data flow and you can use the highlight execution to see it).  

 

This also isn't a crash, the code is doing exactly what you asked it to, it just isn't doing what you intened it would do.

Message 4 of 10
(3,884 Views)

I'm curious why the attached VI doesn't reflect the improvements made to align the elements in the arrays like it was requested later in Re: Alignment of array of buttons with array of text on front panel .

 

Are you sure you gave us the latest code and not some old version?

0 Kudos
Message 5 of 10
(3,878 Views)

Yes this is a different version and I just now finished the aligments.

0 Kudos
Message 6 of 10
(3,875 Views)

Okay.  That's good.

 

Please attach your latest VI that shows the event structure you are having issues with.

0 Kudos
Message 7 of 10
(3,870 Views)

I don't get it. I just added the event the way I had it yesterday to show you and it worked!!! I now understand the timeout of the event structure. I had it set to 100 yesterday and it still didn't work. I'm sure I missed something.

Here's the latest.

0 Kudos
Message 8 of 10
(3,859 Views)

Glad it's working now.  Something must have been different about yesterday.  Who knows what it was.

 

One thing you could do is create a "Load Data": Value Change event and move the terminal and the code from inside your case structure into that event case.

Message 9 of 10
(3,845 Views)

Thanks I did that and more. I'm loving the Event Structure.

0 Kudos
Message 10 of 10
(3,820 Views)