LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: Register Event Callback

Hi,

The Register Event Callback doesn't seem to work anymore, when a native
LabVIEW control is wired, no matter what event is choosen.

I know that the Register Event Callback isn't ment to do this, but it is
very conveinient in some cases.

Also, you can wire everything like expected, but when you run the code,
LabVIEW crashes when the event is triggered.

Tested this in LabVIEW 8.2.1.

Regards,

Wiebe.


0 Kudos
Message 1 of 10
(6,281 Views)
Can you provide us with an example that reproduces this behavior? What version of LabVIEW do you have?
 
Regards,
 
Juan Galindo
Applications Engineering
Juan Galindo
Applications Engineer
National Instruments
0 Kudos
Message 2 of 10
(6,203 Views)
Posting examples is a bit time consuming for me (since I can't attach VI's
anymore in Outlook, and LV8.2.1 is on another PC), but I'll see what I can
do later on.

I'm using LabVIEW 8.2.1 (did mention that in the original thread). it used
to work in 7.1.

Reproducing it is very simple:

Put a Register Event Callback node on the diagram (in the ActiveX palette).
Wire a control reference to it.
Select an event.
Right click the Register Event Callback node, and select "Create Callback
VI".
Run the VI, and LabVIEW will crash when the event triggers.


Why this was usefull might need some clearification. Let's say you make a
key filter. So, if you press "q", the computer beeps (or does something
usefull). With the Register Event Callback node, you can attach this
behaviour to any number of controls. The greatest benifit over an event
structure in a reentrant sub vi that handles the filtering (besides it's
simplicity), is that the callback vi stops when the main VI stops. With any
other construction, you need to go though great length to stop the filtering
vi. Hope that is clear.

Regards,

Wiebe.


0 Kudos
Message 3 of 10
(6,181 Views)
Juan, were you able to reproduce this from Wiebe's steps?  Please post back with the results of your test and CAR number if you could reproduce.

thanks-
Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 4 of 10
(6,077 Views)

Hello Wiebe,

I created some VIs to reproduce the behavior you described but LabVIEW 8.2.1 did not crash. The VIs I have created ran correctly. Here is the following code I have created using Register Event Callback nodes.

National Instruments recommends using the Event Structure for handling LabVIEW user interface events. However, you can use a VI as a callback VI to handle events from front panel controls when the controls generate the registered events. The callback VI should run properly when an event occurs.

Please let me know if you have problems loading the Vis attached.

Regards,

Juan Galindo
Applications Engineering

Juan Galindo
Applications Engineer
National Instruments
Download All
0 Kudos
Message 5 of 10
(6,054 Views)
Hi,

Thanks for looking into this. You've got me puzzled for a while. For a few
minutes, I couldn't reproduce it myself.

The crash happens for the event I needed: Key Down?.

I know I can use the event structure, but the event structure has a few
downside. Like I explained earlier.

Regards,

Wiebe.


0 Kudos
Message 6 of 10
(6,015 Views)
Or basically any event that has a ? behind it.

They all crash.

Regards,

Wiebe.


0 Kudos
Message 7 of 10
(6,010 Views)
Hello Wiebe,
 
I tried a couple of events with question mark (?) and they did not crash. Please run the following vi and tells me if it runs correctly in your PC.
 
Regards,
 
Juan Galindo
Juan Galindo
Applications Engineer
National Instruments
Download All
0 Kudos
Message 8 of 10
(5,969 Views)
The code crashes when the event is triggered. In "Event Callback VI.vi", the
event can never be triggered, because the vi stops immediately.

Put a Wait of 800000 ms in the diagram, so the Vi doesn't stop ( a while
loop is fine too). Then tigger the event by selecting it, and pressing a
key.

Hope that does the trick.

Regards,

Wiebe.


0 Kudos
Message 9 of 10
(5,935 Views)
I was able to reproduce the issue for the Mouse Down? and Key Down? events.  This was reported to R&D (# 4FD9MKK4) for further investigation.  Thanks for the feedback!
Regards,

James R.
National Instruments
0 Kudos
Message 10 of 10
(5,909 Views)