LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event structure triggering without an event having occured

I am using a cluster array to manage a set of records.

The problem is as follows:

1. A record (cluster) is shown on the front panel

2. The cluster is filled with one record.

3 Key focus and text selection are applied to the "label" field.

4. The user is now free to type into any elements of the record.

5. While editing occurs, an event structure waits for an event to occur. (The events are typically pushbuttons or mouse up)

6. Once the event occurs, the record is stored into the array, and other necessary processing is carried out.

The problem that I have been having is that the event structure sometimes triggers without an event having occured. Just simply typing into the cluster can ca
use the triggering of an event, even though typing is not an event in the structure.

This problem seems to happen most frequently when the "label" field is typed into. The "label" field is assigned key focus and text selection, and typing over the stored value sometimes causes a loss of focus, and sometimes a falsely triggered event.

It seems to only happen some of the time, and fairly infrequently.
0 Kudos
Message 1 of 7
(3,128 Views)
What event cases do you have?
What event case gets executed (other than the event you want to handle)?
Do you have a timeout event?
Is you event structure in a loop?
0 Kudos
Message 2 of 7
(3,128 Views)
I have three pushbutton cases, one tree value change, and one pushbutton up a cluster.

they all seem vulnerable to triggering.

I do not have a timeout.

Yes, my event structure is in a loop.
0 Kudos
Message 3 of 7
(3,128 Views)
I made a mistake in my response. I meant to say one mouse button up, not push button up
0 Kudos
Message 4 of 7
(3,128 Views)
What specific events are you trapping? Value Change? Mouse Up? Can you post your VI?
I've never seen an event case being triggered without its associated event occuring.
Is it possible that the operator is inadvertantly giving focus to another control by pressing the tab key? To test this, you could temporarily take out of the tab order the controls whose event cases are being triggered. On your front panel, right-click on the control, goto to Advanced >> Key navigation >> Skip this control when tabbing.
You could also experiment with the specific events chosen to see if that makes you more immune to your unwanted events problem.
0 Kudos
Message 5 of 7
(3,128 Views)
The program does the following:

1. It uses a global array to store records, and a tree structure filled with"labels" representing individual records.

2. The user can click on a label in the tree structure and the program will then bring up the corresponding record.

3. The record being displayed may be edited, while the event structure waits for an event to occur.

4. The events are:
a. tree value change(this causes the selected
record to be placed in the cluster on the front
panel.)
b. pushbutton for delete record
c. pushbutton for insert record
d. mouse up inside the cluster on front panel
(This causes the current record to be stored)

The problem seems to revolve around u
sing key focus and text selection.

When the record is placed in the cluster on the front panel, the "Label" field in the record receives key focus and text selection. This is where the error occurs. It only occurs about one in seven tries. When the error occurs, the first three letters may be typed in without a problem, then as the fourth key is typed, it seems to either lose focus and or trigger an event.
0 Kudos
Message 6 of 7
(3,128 Views)
What event is triggered when you don't want it to be?
What are your "pushbutton" events (4.b, 4.c in your previous comment)? Mouse down, mouse up, value change, etc.?
Are your pushbuttons part of the record cluster or are they independent controls?
Do your pushbuttons or any other controls have any short-cut key assignments?
When the error occurs, is it always on the fourth key?
Does it matter what the fourth key is?
Do you have any keypress events in your event structure?
Can you post your code?
0 Kudos
Message 7 of 7
(3,128 Views)