Ian Melville
2008-08-07 12:10:07 UTC
The story so far...
I am using the Active X features to create an event callback structure in combination with a queue to achieve an event driven structure. The initial registration is performed in a Sub VI using a Automation Open dialogue and after completion the reference is stored in a variable created at the top level VI (not a global). Afterwards each time I try to reconnect to the interface of the COM object (normally for communication purposes via a CAN Bus) even though I pass the original stored reference into the Automation Open dialogue, a new instance is created of the COM Object. Consequently, multiple instances of the COM Object are created resulting in loss of synchronisation between the COM object and the LabView Program. As a result when the Lab View program is terminated the a fatal exception error occurs crashing the program.
So my questions are:
1. How can I ensure that the same reference is used (either directly or via the Automation Open dialogue after creation and that no additional Instances of the COM Object are created?
2. Is it possible to create the initial instance of the COM Object in a SubVI (limited scope) and store the reference created in a variable created in the Top Level VI that has been passed into the SubVI or is the reference always destroyed on leaving the Sub VI?
3. What effect does the Close Reference dialogue have on the referenced instance of the COM Object and when should it be used?
I have been trying to solve with this problem for a week with the Active X experts without success so I hope someone can help.
Many thanks in advance.
Ian Melville
I am using the Active X features to create an event callback structure in combination with a queue to achieve an event driven structure. The initial registration is performed in a Sub VI using a Automation Open dialogue and after completion the reference is stored in a variable created at the top level VI (not a global). Afterwards each time I try to reconnect to the interface of the COM object (normally for communication purposes via a CAN Bus) even though I pass the original stored reference into the Automation Open dialogue, a new instance is created of the COM Object. Consequently, multiple instances of the COM Object are created resulting in loss of synchronisation between the COM object and the LabView Program. As a result when the Lab View program is terminated the a fatal exception error occurs crashing the program.
So my questions are:
1. How can I ensure that the same reference is used (either directly or via the Automation Open dialogue after creation and that no additional Instances of the COM Object are created?
2. Is it possible to create the initial instance of the COM Object in a SubVI (limited scope) and store the reference created in a variable created in the Top Level VI that has been passed into the SubVI or is the reference always destroyed on leaving the Sub VI?
3. What effect does the Close Reference dialogue have on the referenced instance of the COM Object and when should it be used?
I have been trying to solve with this problem for a week with the Active X experts without success so I hope someone can help.
Many thanks in advance.
Ian Melville