02-03-2017 07:11 AM
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.
02-03-2017 08:32 AM
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.
02-03-2017 08:33 AM
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
02-03-2017 09:02 AM - edited 02-03-2017 09:04 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
02-03-2017 09:11 AM
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?
02-03-2017 09:14 AM
Yes this is a different version and I just now finished the aligments.
02-03-2017 09:17 AM
Okay. That's good.
Please attach your latest VI that shows the event structure you are having issues with.
02-03-2017 10:11 AM - edited 02-03-2017 10:16 AM
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.
02-03-2017 10:30 AM
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.
02-03-2017 01:54 PM
Thanks I did that and more. I'm loving the Event Structure.