LabVIEW normally keeps controls around between runs. This allows you to see the output from one run when you return to edit mode. It also lets you change the value in edit mode and have it be the initial value when you run the VI again. By default, LabVIEW handles ActiveX controls this way, too. However, this is very different from the typical ActiveX model and causes problems with some ActiveX controls.
The ActiveX container "owns" the reference to the control, meaning that it is responsible for creating and releasing it. The control may actually stay around (hidden) until the VI is closed and LabVIEW sees fit to remove it from memory. Attempting to release the control yourself by closing the refnum could cause nasty things to happen.
When the "Advanced >> Design Mode" option is checked on the ActiveX Container, LabVIEW manages the control in the customary ActiveX way. There are distinct "design" and "run" modes for the control. Each time you run the VI, the design-mode control is destroyed and a new one is created in run-mode in its place. When the VI stops, the run-mode control is destroyed and a new design-mode control is created. In a built application there is no design-mode control; the run-mode control is created when the VI starts and released when it stops.
You want the latter behavior for your control, so you want to turn on the "Advanced >> Design Mode" option.
George Erwin-Grotsky
LabVIEW R&D
National Instruments
Message Edited by Gorg on 05-05-2005 06:27 PM
George Erwin-Grotsky
National Instruments
LabVIEW Research & Development