NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems creating callback VI

Solved!
Go to solution

Hi,

 

I stumbled over some strange behavior....

I tried to register a TestStand ActiveX callbacks, but I'm facing multiple problems:

 

Callback.png

 

 

My first attempt for assigning the callback VI was the right-click "Create Callback VI" which brings then up a template VI which in my case reports the following errors:

 

error.png

 

Albeit, both typedefs are considered ok (at least) for all the rest of this application....

So I manually deleted the "broken" controls and replaced them with the typedef'ed one and wired them up to the connector block.

 

The problem comes up at runtime: the Register for callback node returns Error 97: LabVIEW:  A null or previously deleted refnum was passed in as an input.

 

What am I doing wrong?

 

Cheers

Oli

 

0 Kudos
Message 1 of 8
(5,607 Views)

Oli,

 

can you please boil this down to a single VI UI and the typedef-ed event showing this?

If my understanding is correct, the issue is that the template for the callback VI does not create a compatible User Parameter control.....

 

thanks,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(5,606 Views)

Hi Norbert,

 

thanks for the quick reply. Please find attached some scrrenshots:

 

Typedef for UserEvent

 

DynEvent.png

 

Typedef for UserEvent data

 

DynEventData.png

 

Frontpanel of automatically created callback VI

 

CallbackVI_Broken.png

 

Frontpanel of modified callback VI (Error97)

 

CallbackVI.png

 

The typedefs reside within the same lvlib as the caller. The callback VIs are reentrant. They are also marked private within the library, changing the access scope to public did not change the behaviour.

 

Do you think http://forums.ni.com/t5/LabVIEW/Register-Event-Callback-problem-with-Linkam-ActiveX-controls/td-p/15... could be related?

 

BTW using LV2012SP1 ans TS 2012SP1

 

Cheers

Oli

0 Kudos
Message 3 of 8
(5,604 Views)

Oli,

 

looking at the screenshots, i am not sure what is going on here.

One important remark on "Frontpanel of automatically created callback VI":

As the notifier reference is grayed out, LV shows you that this type definition is modified. Is it possible, that you have the type definition of either UserEvent or UserEvent data (or both) open in background?

Is this type also used in LV code you use as LV modules in sequences?

 

Regarding your last screenshot, you state that this is running into error 97. This is during runtime?

Error 97 states: LabVIEW:  A null or previously deleted refnum was passed in as an input.

Are you sure that the notifier is correctly "obtained" in the code execution before passing the reference to the callback VI? Essentially, do you call "Obtain Notifier" and pass the reference to your cluster before unbundling that cluster in order to register the callback VI?

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 8
(5,596 Views)

Norbert,

 

regarding the automatically created callback VI:

- neither of the typedefs are open in the background (closed the project and even restarted LV to make sure)

- right-clicking the "broken" control, the Open Typedef option is even grayed out!

 

regarding the manually modified callback VI:

- Error 97 is returned form the Register fo callback node when executed

 

I just tried to redo the callback VI from scratch:

1.) Right-click --> Create Callback VI.

CallbackVI_Broken.png

 

2.) Save the File. Open Type Def. option is not available on the control, only Disconnect from TypeDef

3.) Right-Click on the control Replace->Select a control and reference and replace with typedef'd control, the VI is not broken anymore.

4.) Save the VI

 

When trying to register this VI for callback, Error 97 pops up Smiley Frustrated

 

Am I doing sth obviously wrong?

 

 

 

 

0 Kudos
Message 5 of 8
(5,591 Views)
Solution
Accepted by topic author Oli_Wachno

Oli,

 

can you attach the UI VI and the controls here (as they are in the project, meaning: in the lvlib)?

Without lvlib, i had no success in a very short attempt to reproduce the issue from scratch.....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 8
(5,588 Views)

Norbert,

 

I'll try to strip the project down to contain only the affected lvlibs and send you a copy via mail.

 

Thanks a lot!

0 Kudos
Message 7 of 8
(5,583 Views)

Problem solved: Norbert found out, that the TS Application Manager Reference I used for the Register for Callbacks node was not properly initialized, so that's where the Error 97 comes from.

Seems I was too busy keeping the amount of open references as small as possible Smiley Wink

 

The typedef-issue remains, but the manual replacement workaround is only a minor nuisance at the moment.

0 Kudos
Message 8 of 8
(5,578 Views)