01-10-2014 02:21 AM
Hi,
I stumbled over some strange behavior....
I tried to register a TestStand ActiveX callbacks, but I'm facing multiple problems:
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:
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
Solved! Go to Solution.
01-10-2014 02:29 AM
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
01-10-2014 02:48 AM
Hi Norbert,
thanks for the quick reply. Please find attached some scrrenshots:
Typedef for UserEvent
Typedef for UserEvent data
Frontpanel of automatically created callback VI
Frontpanel of modified callback VI (Error97)
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
01-10-2014 04:59 AM
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
01-10-2014 06:23 AM
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.
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
Am I doing sth obviously wrong?
01-10-2014 06:43 AM
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
01-10-2014 07:18 AM
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!
01-10-2014 08:13 AM
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
The typedef-issue remains, but the manual replacement workaround is only a minor nuisance at the moment.