LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a problem using COM

I have a problem with my project, it apears that it is not closing down correctly.

I am using Labview Express 7.0

The first vi obtains a connection to an Automation interface.

The interface has the capability to enable or disable event firing for seven different events, the second vi - InletKernel_RequestAllEvents.vi
takes the reference to the interface and then enables event firing for all of the events.

The third vi - InletKernel_NotifierSetup.vi sets up some notifiers - firstly a notifier containing a cluster made up of

1) A reference to the AI
2) The name of the fired event
3) The filename and path of a user defined vi

The fourth vi - InletKernel_RegisterAllEvents2.vi - registers each of the seven e
vents and associates a callback function to be called when
an event is fired. It is the responsibility of each of the callback vi's to explicitly set the name of the event and the path of the user defined vi, it then performs the send notification.

The fifth vi - TestEventHandler4.vi waits upon the notification sent by the call back vi's and uses a case structure to handle the event types.

I have been using the Dynamically Monitor VI's.vi which is provided with LV7.0 to monitor which vi's are in memory, if I run my program and then
close it down / stop it, all vi's close and disappear from the list except the callback vi's
( remember that for the Dynamically Monitor VI's.vi program to display the vi's they must have their front panel open )

I can only think that I am not closing/releasing my connections to notifiers/Automation Interfaces correctly, but I have tried many things but to no avail.

Can anybody help ???

Best regards

Stephen
0 Kudos
Message 1 of 7
(3,168 Views)
Hi Stephen,
As you mention in your question the problem you are experiencing is usually caused by not closing a reference correctly. I have been looking at your code for this application and I have a couple of questions I'd like to ask you about it which will help me research your problem further. Firstly you mention that you have 5 vi's but you have only posted 3, please could you post the remaining 2 vi's. I also do not have the ActiveX server object that you are using, "InletKernelInterfaceLib" which is a .dll or .exe file. Could you also post a 'walk-through' of your code as well so I can understand better what is going on there. On a different note have you tried running the vi's without the ActiveX server? Did it work then? have you tried splittin
g the code to determine where the problem may lie?
I look forward to hearing from you,
Best Regards,

Chris Mead
National Instruments (UK)
0 Kudos
Message 2 of 7
(3,168 Views)
Hi Chris
Thank you for your response, i was begining to think that nobdy could help !

I have developed things further and did find a document on the NI web site discussing closing references...

I have made some progress I feel but the problem has not been fixed.

The vi's mentioned all have sub vi's so I have zipped them ALL up and attached the zip file.

I have also attached a description of the program as requested...

Best Regards

Stephen
Download All
0 Kudos
Message 3 of 7
(3,168 Views)
Hi Chris

As promised I have done some further investigation.

If I remove the vi that registers all the events and associates the callback vi's with an event then the app closes down ok.

It looks as though the callback vi's themselves are not closing down.
0 Kudos
Message 4 of 7
(3,168 Views)
Hi Stephen,
Thank ypu for the extra files and information. I've been investigating your code further
and I understand from your comments that the problem lies in the 'InletKernel_RegisterAllEvents2.vi', is this correct?
However I still need the .dll, executable or control which supplies 'InletKernelInterfaceLib.IInletSystem2' to continue my investigations as I do not have that on my installation and it appears to be part of you application. With that file I can follow the callbacks events through and hopefully find where the problem lies.
Best Regards,

Chris M
Applications Engineer
National Instruments (UK)
0 Kudos
Message 5 of 7
(3,168 Views)
Hi Chris

Unfortunately I could not send you a .dll, I wish it was that simple, the cmponent is made up of many dll's and is dependant upon many others to run. I looked at the possibility of removing some of the dependancies but it could take weeks of development time with no guarantee at the end.

Some better news for you though, I took some of your advice and having decided that the problem lay with my call back vi's I went away and started a new projet and ripped out all of the required code from the sub vi's and pasted it all into a blank vi. Bit by bit - but couldn't get it to fail !

I then rebuilt my call back vi's bit by bit - but couldn't get them to fail ! weird !

For some strange reason it appears that I constructed
my callback vi's wrongly , the first time I did a copy anjd past and rename once I had completed the first one.

The second approach involved registering the event, connecting the data type the i/p and then creating the callback vi...

Anyway everything works fine now, so thanks for your help, it would have been nicer to have a conclusive answer to the problem but cest la vie !

Cheers

Steve
0 Kudos
Message 6 of 7
(3,168 Views)
Hi Steve,
Thank you for your email. I'm very glad to hear that your code is now working as it should but as you say it is a little strange that we cant pin down exactly what was wrong and why your new work has corrected it. I would with a little time and that DLL possibly be able to find out why this was but as you say there's no guarantee about that for a lot of work.
Anyway I'm glad that all is now well and good luck with the rest of your project.
Best Regards,
Chris M

Applications Engineer
National Instruments (UK)
0 Kudos
Message 7 of 7
(3,168 Views)