Jump to content

How do I debug Callback VI's?


Recommended Posts

I'm trying to figure out why the breakpoint isn't being hit when the callback VI executes. In the meantime, I found a potential workaround (that requires access to scripting). You can put a BDWin.Open property in the callback VI to cause its diagram to open on the first call of the callback. On any subsequent calls, you can probe wires and the probes will return the wire values. This method won't work if you are only interested in debugging the first call of the callback VI.

I'll post here when I find out more about why the breakpoint doesn't work.

-D

Link to comment

QUOTE(Dean Mills @ Oct 15 2007, 04:25 PM)

I am trying to remember, but I think you can turn off the reentrancy, turn on debuging, open the diagram and fake it. I have very vague memories of debugging a callback VI like this. Not using a breakpoint but just opening it, its diagram and using probes.

Dean

Dean's right. Don't forget to return settings to normal after your done debugging. Sometimes not having reentrancy on can screw up some events. I also use the attached tool to record event occurrences as they happen to a file.

Link to comment

After I did some investigating, it seems like a breakpoint in a callback VI *should* be fired whenever debugging is turned on and reentrancy is turned off on the callback VI. Unfortunately, this isn't happening. I've filed a CAR (4EH9RQF2) on this issue. For now, I see three possible workarounds: (1) use the BDWin.Open property to open the callback VI diagram and probe wires on non-initial runs, (2) stick file I/O in the diagram of the callback VI to write debugging info to disk when it executes, and (3) the callback execution recorder utility posted earlier.

-D

Link to comment

I prefer not to process any callback in the callback VI itself. What I do is to fire events of any callback into a single queue, by which queue element is a cluster of an enum [state or callback name] and a variant [hold the data]. An existing centralized queue state machine will than process all events of all callbacks. Make the enum "state" as type def for easy and fast adding of new states.

Wolfram

Link to comment
  • 3 months later...

QUOTE(Darren @ Oct 15 2007, 02:13 PM)

I'm trying to figure out why the breakpoint isn't being hit when the callback VI executes. In the meantime, I found a potential workaround (that requires access to scripting). You can put a BDWin.Open property in the callback VI to cause its diagram to open on the first call of the callback. On any subsequent calls, you can probe wires and the probes will return the wire values. This method won't work if you are only interested in debugging the first call of the callback VI.

I'll post here when I find out more about why the breakpoint doesn't work.

-D

Could you please tell me where I can find the BDWin property node? I am currently working on the callback VI with ActiveX, and I have no clue how it works.

Thank you so much,

Thang Nguyen

Link to comment

QUOTE(Michael_Aivaliotis @ Oct 15 2007, 02:23 PM)

Using the Register Event Callback node.

I feel your pain, Mike...

I had a strange bug that I assumed was a race condition. The value would get set without being triggered.. I fixed something else, unrelated, and it worked fine. There was a discussion about this on the NI forum. But I must admit that I'm still a novice with these Callback Events.. :(

Link to comment

QUOTE(Thang Nguyen @ Jan 30 2008, 10:04 AM)

Could you please tell me where I can find the BDWin property node?

As I mentioned in my previous post, this property requires access to VI Scripting. Search around on the LAVA forums for more information on VI Scripting.

-D

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.