LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure Freezes Vi After Capturing The First Event

My Event structure catches the first instance of my button press but then it freezes my Vi.  The reason is because of the while loop but I need the while loop to constantly read from a serial port and send data to a serial port. The vi included is stripped down to be just a while loop that does nothing.  I have also tryed putting the event structure in the while loop, but the same thing is happening.
 
Any ideas?
 
Thanks,

Cason Clagg
SwRI
LabView 7.1, Windows XP
0 Kudos
Message 1 of 8
(5,354 Views)
you forgot to attach your code.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 8
(5,347 Views)
Right you are.

Cason Clagg
SwRI
LabView 7.1, Windows XP
0 Kudos
Message 3 of 8
(5,341 Views)
Try wiring a value to the timeout of the event structure.  Even if it's just 10 ms, it might be the thing that's causing your program to 'freeze'

Just looked at your vi.

Put the event structure in a while loop.  Then do above.

Also, include a timout event.

Message Edited by Novatron on 07-22-2005 03:22 PM

Message Edited by Novatron on 07-22-2005 03:26 PM

0 Kudos
Message 4 of 8
(5,342 Views)

Also, put the button inside the event structure where it is acted upon, from LV help (suggest you read the entire events section of help):

When you trigger an event on a Boolean control configured with a latching mechanical action, the Boolean control does not reset to its default value until the block diagram reads the terminal on the Boolean control. You must read the terminal inside the event case for the mechanical action to work correctly. As a reminder, a note appears in the Edit Events dialog box when you configure a Value Change event on a latched Boolean control.

Refer to the Handling a Latched Stop Boolean Control in an Event Structure caveat for information about how to handle a latched Boolean control.

When you trigger an event on a Boolean control configured with a latching mechanical action, the Boolean control does not reset to its default value until the block diagram reads the terminal on the Boolean control. You must read the terminal inside the event case for the mechanical action to work correctly. As a reminder, a note appears in the Edit Events dialog box when you configure a Value Change event on a latched Boolean control.

Refer to the Handling a Latched Stop Boolean Control in an Event Structure caveat for information about how to handle a latched Boolean control.

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 5 of 8
(5,331 Views)
This should do what you need--or at least get you pointed in the right direction. The only tricky thing about the serial stuff going in the tiomeout case is to remember that in this situation the outer loop is you process loop. By that I mean if (for example) you are waiting for a response, the outer loop will be the one iterating while you are waiting. Do NOT put another loop inside the timeout case for any reason. You do not need it.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 8
(5,322 Views)

Setting the timeout to 350 ms worked for me! Thank you very much, now I can actually have it quit out of my programs instantly! 

0 Kudos
Message 7 of 8
(2,737 Views)

This is a 15+ year old thread and 350ms is not instant. I suspect there are better solutions for your problems.

Message 8 of 8
(2,731 Views)