f



Each time I use the Active X Automation Open feature a new Instance is created even if one already exists?

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 
 
0
x9561 (148440)
8/7/2008 12:10:07 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

8 Replies
461 Views

Similar Articles

[PageSpeed] 21

Hi Ian Melville,
you can check if the connected reference is valid. Use a case structure with true/false case. If the reference is valid use the reference, if not create a new one.
 
Hope it helps.Mike
0
x9561 (148440)
8/7/2008 12:40:05 PM
Hi Mike 
Thanks for the quick reply. This is where I am a bit puzzled about the operation of the Automation Open dialogue. According to the help infomation when left in its default state the dialogue will first try and connect to an existing valid reference before creating a new reference/instance. This does not appear to work, at least not how I interperate the available information about how it should work. In any case what would you consider an appropriate test of whether a reference is valid (appart from a non-null value)? 
Regards
 
Ian
0
x9561 (148440)
8/7/2008 12:40:10 PM
Hi Ian,
you can use a shift register to store your refnum and check it with "not a refnum". See the attached picture.
Hope it helps.Mike


Automation_Open.PNG:
http://forums.ni.com/attachments/ni/170/347483/1/Automation_Open.PNG
0
x9561 (148440)
8/7/2008 12:40:11 PM
> 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?

Use Open Automation only once.

> 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?

Make an action engine. E.g. a while loop with a case. The while loop has a
shift register which holds the reference. The TRUE case does an open
automation, the false case simply passes the previous value.

> 3. What effect does the Close Reference dialogue have on the referenced
instance of the COM Object and when should it be used?

If you mean Close Reference function, it closes the reference, and releases
the object. You use it for each reference you've opened, once you're done
with it.

Regards,

Wiebe.


0
8/7/2008 1:30:31 PM
Hi Wiebe.
Thanks for the input and the solutions when a reference is lost. What I'm still trying to understand is the reason/mechanism that causes the reference to be lost in the first place?  Is the storing of a reference in a cluster via a local variable for future use not allowed? The reason I ask is that the Program is nested structure with SubVi's within SubVi's which does not easily lend itself to the Action Engine structure that yourself and Mike suggested.
Regards
Ian
 
0
x9561 (148440)
8/7/2008 2:40:10 PM
Originally you mentioned:

>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.

I think you need to tell us more about this. Most important question: how do
you notice that a new instance is created?

Normally, an external reference (.com or .net) should stay open untill
explicitelly closed. Now there might be an optimalisation bug or something,
but it's hard to tell without seeing any code.

Regards,

Wiebe.


0
8/8/2008 2:52:18 PM
Hi Wiebe
I have the ability to debug the COM Object using .NET Visual Studio and can see that every time the interface is accessed the process to create a new instance is performed. During recent discussions it has become apparent that the because I have created the original instance/refnum in a SubVi when the SubVi is exited the instance resources are released thus causing the refnum to be no longer valid. As the COM Object needs a reference to the original instance to shutdown the event handling properly I need to ensure the original refnum/instance is not released until the end of the LabView program shutdown. Would a AE/FG actually help under these circumstances?
Best Regards
 
Ian Melville
0
x9561 (148440)
8/11/2008 9:40:12 AM
> I have the ability to debug the COM Object using .NET Visual Studio and
can see that every time the interface is accessed the process to create a
new instance is performed. During recent discussions it has become apparent
that the because I have created the original instance/refnum in a SubVi when
the SubVi is exited the instance resources are released thus causing the
refnum to be no longer valid. As the COM Object needs a reference to
the original instance to shutdown the event handling properly I need to
ensure the original refnum/instance is not released until the end of the
LabView program shutdown. Would a AE/FG actually help under these
circumstances?

Why don't you give it a try? An AE/FG that buffers the reference woudn't
take much longer then 5 minutes to make. I can't do it for you, I don't have
..NET Visual Studion to debug the AX behaviour. That is a nice feature
though!

Regards,

Wiebe.


0
8/11/2008 11:00:08 AM
Reply:

Similar Artilces:

creating a new DICOM file from existing one using DCMTK
Hi all, I am trying to create a new DICOM file from an existing DICOM file. So, the= scenario is that I have a DICOM file and I do some image processing on it = and produce a transformed/processed file and I would like to save it using = the original file as a template.=20 The only things that change are=20 1: The pixel data 2: The rescale and offset tags. Does anyone know how I can achieve this with DCMTK? I looked at various exa= mples but most of them show how to save a JPG or BMP image into a new DICOM= file. On Monday, October 27, 2014 7:28:29 PM UTC+1, Luca Pamparan...

Re: [tao-users] _this creates a new reference even thoughtheobject is activated already
Hi Jan, >> I was able to reproduce the problem again, where a call to _this() acquires >> memory which is not released. I am sure that this is probably an issue of my >> program rather than a bug in TAO. In order to track memory leaks, I have >> dump memory leaks at the end of my program execution. One of the memory >> leaks is when calling _this, I have attached call_stack_1.txt which contains >> the call stack of the call to "new" that is not released. >> Also a lot of memory is not released, which is acquired during the call to >> ORB_init (see call_stack_2 for the call stack). The odd thing is, that in a >> smaller example, where I initialize and shutdown the ORB exactly the same. >> This memory is released. Also all memory from _this calls is released. I >> create and shutdown my servant as follows: >> >> creation: >> NameDictionary_impl * nameDic_i = new NameDictionary_impl(); >> NameDictionary_var nameDic = nameDic_i->this(); >> >> shutdown: >> PortableServer::ObjectId_var obj_id = >> data->rootPoa->servant_to_id(nameDic_i); >> data->rootPoa->deactivate_object(obj_id.in()); >> nameDic_i->_remove_ref(); >> >> By calling nameDic_i->_remove_ref(), the NameDictionary_impl object is >> released. >> >> Do you have any clues, why this memory might not be releas...

Script to create new Sun One Directory Server 5.x instance? #2
Hi, There is a perl script available from Sun that will create a new instance of a directory server 4.*. It's called create_instance.pl Sun states that "This tool is not compatible with Directory Server 5.x." Does anyone have or know where I can get a script or other tool that will provide the same functionality for Directory Server 5.x? Thanks Bill ...

Re: [tao-bugs] _this creates a new reference even though the object is activated already
Hi Milan, Thanks for using the PRF. >> TAO VERSION: 1.4.7 >> ACE VERSION: 5.4.7 >> >> HOST MACHINE and OPERATING SYSTEM: >> Debian Linux x86 >> >> COMPILER NAME AND VERSION (AND PATCHLEVEL): >> g++-2.95.4 >> >> THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform- >> specific file, simply state which one]: >> config-linux.h >> >> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you >> use a link to a platform-specific file, simply state which one >> (unless this isn't used in this case, e.g., with Microsoft Visual >> C++)]: >> platform_linux.GNU >> >> CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features >> (used by MPC when you generate your own makefiles): >> unmodified >> >> AREA/CLASS/EXAMPLE AFFECTED: >> _this() function >> >> DOES THE PROBLEM AFFECT: >> EXECUTION? YES >> >> SYNOPSIS: >> _this function invoked on servant creates a fresh reference to the >> object event though the object had been activated before. >> >> DESCRIPTION: >> Scenario: >> 1. I have PERSISTENT/USER_ID/NO_IMPLICIT_ACTIVATION POA >> 2. I activate the object within this POA with my object id ...

Re: [tao-users] _this creates a new reference even though the object is activated already
Hi, since I have noticed as well, that each time you call _this() memory is allocated which is not released. I have tried to override _default_POA() in my servant class and I am returning the root POA reference. It works until I am trying to shutdown the orb. An access violation exception is thrown in object_adapter.cpp line 702: in method TAO_Object_Adapter::close (int wait_for_completion ACE_ENV_ARG_DECL) when the line CORBA::release(root) is executed. I am using ACE Version 5.4.6 and TAO Version 1.4.6 on a Windows XP SP2 computer. In my application I am using a thread pool for the ORB and one POA - the root POA. Thanks for your help. Regards, Jan --------------------------------------------------------------------�- Dipl.-Inform. Jan Ohlenburg Fraunhofer Institut fuer Angewandte Informationstechnik FIT Forschungsgruppe Collaborative Virtual and Augmented Environments Schloss Birlinghoven D - 53754 Sankt Augustin, Germany Telefon: +49-2241-14-2724 Telefax: +49-2241-14-2084 e-mail: mailto:jan.ohlenburg@fit.fraunhofer.de > -----Urspr�ngliche Nachricht----- > Von: owner-tao-users@cse.wustl.edu > [mailto:owner-tao-users@cse.wustl.edu] Im Auftrag von Jonathan Biggar > Gesendet: Samstag, 8. Oktober 2005 03:06 > An: Milan Cvetkovic > Cc: TAO users; tao-bugs@cs.wustl.edu > Betreff: Re: [tao-users] _this creates a new reference even > though the object is activated already > > Milan Cvetkovic wrote: ...

Why Doesn't Labview Place New Indicators I create near existing ones on the block diagram?
When I create a new indicator from the block diagram side Labview usually places them way off in space on the front panel instead of near my other existing stuff. I then have to go find them and drag them back to where I can see them using labview's slow border autoscrolling. This is extremely annoying. I would think that after all the revisions of labview with all the intellegent app engineers NI has that something this simple would have been fixed a while ago. Is there a setting I don't know about or something? Doesn't everyone else have the same annoying problem? Help. If you click on the indicator and hold shift-direction key you will scroll five pixels at a time instead of one.&nbsp; That's the best I can offer. you're not the only one.. :( &nbsp; See this link where we discuss "cosmetic" improvements for future version of Labview: <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;thread.id=327752" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;thread.id=327752</a> &nbsp; I bring up the subject here: <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;view=by_date_ascending&amp;message.id=327914#M327914" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;view=by_date_ascending&amp;message.id=327914#M327914</a> &nbsp; Having a block diagram that spans over more than o...

Labview 6.0 x LabView 7.0 list of enhancements or new features
Hi, Have u a 1 page document with the main enhancements or new features, that we can base our decision to upgrade (or not) to version 7.0 ? LV 7 FAQS: http://www.ni.com/support/labview/lv7faq.htm ...

how to use Active X in LabVIEW
i m trying to acquiring the images from the ethernet camera. for this i want to use the ActiveX control. but i donot know how to use this Active X with Image Acqusition. Hi ddsdds, has your camera an ActiveX support? If yes, then use the "Automation Open" function, create a constant for "ActiveX Refnum" and select your type. Use invoke and property nodes to work with it. Don�t forget to close the reference if you are ready. Mike <a href="http://zone.ni.com/devzone/cda/tut/p/id/2983" target="_blank">ActiveX and LabVIEW</a> ...

using ACTIVE X in labview
Hi all &nbsp; Please see attach file ,, this is Active X&nbsp; which called TPDFILTER.OCX . ? this suppose to recognize if usb&nbsp; device connected if yes letter E : rise &nbsp; How can I use this active X in labview This is the command in this ocx &nbsp; System.String GetDriveLetterByHW_ID ( System.String strInput ) &nbsp; please i need this very urgent &nbsp; thansk &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TPDFilter.zip: http://forums.ni.com/attachments/ni/170/289374/1/TPDFilter.zip ...

Using same GUI window to open new ones
I wrote a .fig file's name into button's callback funtion. When I click a b= utton, a new GUI is opening and it's being 2 windows , when I click another= button, another GUI is opening , and it's being 3 windows on the screen. B= ut I don't want multiple windows on the screen. I want to use one main wind= ow and open my GUIs' on that main window. How can I do that.(By the way I'm= creating my GUIs'with GUIDE not with code) Thanks in advance. ...

How do I read multiple channels at one time using labview...
How do I read multiple channels at one time using labview with the Fluke Hydra Data Bucket 2620a using serial port? I need to take a reading of 15 channels about once a second. I can read one value at a time using the monitor function on the read values.vi driver, but this takes forever to read all the channels. ...

Has anybody had an example of mapping using an active x in labview?
Thank you in advance. Can you please provide a bit more information on what exactly you are trying to do? Thanks! ...

Concept required for creating new projects out of existing one
Dear all, Since I am a beginner in ProE I may ask some foolish questions, please bear with me. I have made a simple assy and the drawings of the assy as well as the parts. For a similar assy i need to copy the assy with drawings and same parts with minor changes. To be more specific, I need to create new product with new names for the assy/parts/drawings by duplicating the existing without redesigning it from scratch also the drawings. I have tried it by adding the config option rename_drawings_with_object < both> & all the concerned parts/drawings in the session a...

RE: Creating new table with same structure as existing one
How about altering the table to fragment it, putting the yyyymm rows into a separate fragment, and then detaching that fragment into the new table? The effectiveness of this approach probably depends on how big the original table is. HTH, Paul Mosser -----Original Message----- From: Nebojsa Sevo [mailto:DELETE_mips@zg.tel.hr] Sent: Tuesday, October 14, 2003 2:59 AM To: informix-list@iiug.org Subject: Creating new table with same structure as existing one I need to create "archive" table that will have the same structure as "production" one. When I run my program it have to create table named "pronop_yyyymm" ( yyyymm is argument to my program representing date in format year(4)month(2)) if it doesn't exist. I will write rows from table "pronop" that are in given month/year to "pronop_yyyymm" and delete them from "pronop" (I know that DELETE is very slow but I don't have alternative). What I want is not to change program (or part of program where I create "pronop_yyyymm") when structure of table "pronop" is changed. I am using I4GL. I have an idea to do it with "dbschema" and some scripting. Is there any other way? nebojsa ------------------------------------ Remove spam block (DELETE_) to reply sending to informix-list ...

Create menu for instruction on how to use database when opened for the first time
I have an access database application that is used to calculate landed costs for foreign goods imported into vartious countries. I am trying to determine an approach so that a user will be prompted through a form the first time they open the database to read through instructions for how to use the application. Then once they have read through the instructions, they can select a check box so that access will not open that form at open. Any advice to how to approach this would be appreciated. If you want a simple do/don't display the help setting, open Northwind.mdb (comes with access) ...

Creating an instance when the argument is already an instance.
I am learning python -:) I am creating a new class: package (to analyse the packages database in some linux distros). I have created a class package such that package("string") give me an instance of package if string is a correct representation of a package. I would like that if pack is already an instance of package then package(pack) just return pack. This is exactly the behaviour of many of the built-in types. For example: [code] [oesser@pcolivier ~]$ python2 Python 2.7.3 (default, Apr 24 2012, 00:06:13) [GCC 4.7.0 20120414 (prerelease)] on linux2 Type "he...

How to update a existing tag file without creating a new one?
Hello there: I use ctags+vim to read source code. After I've done some modification to the source code, for example, add some comments, remove some code, the original tag should be updated. How can I just "append" the modification to the original tag file? It really takes me a lot of time to rebuild another tag file( 33M tag file for linux kernel 2.4 ;-) ). And if I want to map this update feature to some key in vim, for example, F5, how should I write the script? Thanks a lot! ...

Use New for multiple rept. instances conflicts w/ ControlSource on open
Hi all, This is actually not an issue of mine, but one a friend of mine told me about that I was able to confirm. Let's say you want a highly customizable report, so you want to be able to do things like specify the ControlSource properties of TextBox controls on the report when it is run. The only time this works is in the Open event handler, but that works great. So, no problem, right? Now, say the report is called rptFoo, and you want to open multiple instances of the report for preview, so now, instead of using DoCmd.OpenReport, you use something like Set mrptKeepOpen1 = New Repor...

opening new window in one window using Tkinter -- Help please
Hi,... I meant to write an application where there is a button in a window and when you click on the button, it will open a new window, but I want the first window to close, replaced by the second window. I open a login window and start the mainloop, when the user click on the login button, the __call__ function of VerifyProcessor is executed and it will call the new window which is the file manager window The thing is,.. I don't know how to exit the first mainloop and then display the second window...I even tried calling the mainloop again but a weird thing happens. I really need help bec...

Times where one would use new style classes vs classic classes
Hi all, I'm really new to Python and I've been reading up some texts on older versions of Python (2.2 to be specific). The text briefly mentioned new style and classic classes. I'd really like to know in the current context of Python 2.5, besides in the cases of multi-inheritance, where would I use new style classes? Is it a norm to use more new style classes even if I don't have multi-inheritance in the industry, open source projects, etc today? If this isn't the right place to ask these questions, could some one point me somewhere more appropriate? Thanks a lot. >...

Any one use xml in a tcl\tk application to create new UI?
What I want is: In an application written in tcl\tk, I want to source or excute severl different xml files, so that I can create different window from these xml files. And infomation needs to be passed from tk application and will be passed back to it from the new created window. That is, new created window will be integrated into tk application just like it's a top window written in tk. pheobe wrote: > What I want is: > In an application written in tcl\tk, I want to source or excute severl > different xml files, so that I can create different window from these > xml files. And infomation needs to be passed from tk application and > will be passed back to it from the new created window. That is, new > created window will be integrated into tk application just like it's a > top window written in tk. It would be straight forward to do -- but why? Do you have some XML "UI" description from somewhere that you need to implement? -- +--------------------------------+---------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+ On Aug 22, 9:47 am, "Gerald W. Lester" <Gerald.Les...@cox.net> wrote: > pheobe wrote: > > What I want is: > > In an application written in tcl\tk, I want to source or excut...

Is it possible to create a single csv file one row at a time using
Hi! I'm running an algorithm that outputs a list of numbers each time it runs. I need to collect this data so I can analyze it in Mathematica, but I have to run my algorithm about 14 million times. So far I've been creating tables with 100,000 rows (one for each run of the algorithm) and then exporting them to csv files. My question is: can I create a csv file one row at a time? Is there a way to use Export (or something else) so that the file isn't overwritten each time I run my algorithm, but instead builds a single csv file row by row? It's less taxing on my...

Trouble creating new style based on existing one and applying to paragraphs
I have an outline-based document, using "Heading 1" through "Heading 3". I'm trying to change all the "Heading 3" paragraphs in one particular "Heading 2" section so they use a different style, just changing the numbering style from "1." to "AR-1." (this is a requirements document). I first created the "Requirement Heading" style based on "Heading 3". I successfully applied the style to the first paragraph. Then, I tried applying the style to the second paragraph, but it didn't quite work. Inste...

OraInventory- Installer asks for new inventory location while one already exist.
Hi all, I just installed OEM Grid Control using the new database option. every thing looks good. OMS, database and agents all are up arn running and every thing seems like a good installation. When i try to upgrade it 10.2.0.3 installer does not recognize the OraInventory and asks for the new location for the inventory location, which essentially means I can not upgrade as it does no show me any installed products. Interestingly when i used Opatch to apply a patch it found the OraInventory and Opatch was successful. What am i missing? what could be the potential reason and any solution? thanks for athe help. On Mar 24, 4:46=A0pm, Faraz <sarfarazla...@gmail.com> wrote: > Hi all, > I just installed OEM Grid Control using the new database option. every > thing looks good. OMS, database and agents all are up arn running and > every thing seems like a good installation. > =A0When i try to upgrade it 10.2.0.3 installer does not recognize the > OraInventory and asks for the new location for the inventory location, > which essentially means I can not upgrade as it does no show me any > installed products. > =A0Interestingly when i used Opatch to apply a patch it found the > OraInventory and Opatch was successful. > What am i missing? what could be the potential reason and any > solution? > thanks for athe help. Did you correctly run root.sh? Niall On Mar 24, 4:24=A0pm, Niall Litchfield <niall.litchfi...@gmail.com> wrote: > ...

Web resources about - Each time I use the Active X Automation Open feature a new Instance is created even if one already exists? - comp.lang.labview

Automation - Wikipedia, the free encyclopedia
For a hierarchical presentation of automation topics, see Outline of automation . For other uses, see Automation (disambiguation) . Automation ...

Automation World - Covering the field of industrial automation
AutomationWorld.com delivers content for the Automation Buying team, which includes Information Technology and Networking; Operations and Engineering; ...

Facebook Ads API Partner AdStage: Campaign Automation, $6.25M Series A Funding
AdStage , a Facebook ads API partner, announced Wednesday the launch of campaign automation — as well as a $6.25 million round of Series A funding. ...

Mind blown! Facebook’s f8 makes a mobile move into marketing automation
... Thus, you’ll need to build a mobile app (if you’re enterprise) or use an app-building platform (such as GroSocial). The marketing automation ...

Automation Heroes (@automationhero) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Automation World
Automation World is your link to the why and how of manufacturing automation. The purpose of this group is to connect manufacturing engineers,... ...

Nest gains Android Wear support and new features for better home automation
... up is a new feature that will help your Nest products know whether you're at home or away. Here's the deal - lots of other home automation products ...

GM acquires driverless tech startup Cruise Automation
... GM has added yet another arrow to its autonomous vehicle quiver, announcing the acquisition of San Francisco tech startup Cruise Automation. ...

Automation will take away more than 100,000 jobs within 20 years in the UK
... and Edinburgh, 1 in 20 vacancies could face a similar fate. "We’ve heard that more than a third of current British jobs may be lost to automation, ...

Hoping to catch Tesla, GM just bought Cruise Automation for $1 billion
... taking steps to ensure that the industry doesn't pass them by. Case in point: General Motors today announced its plan to acquire Cruise Automation, ...

Resources last updated: 3/19/2016 8:12:17 AM