Re: Object is not Valid Error
- From: rolfk <x@xxxxxxxx>
- Date: Wed, 12 Apr 2006 09:40:07 -0500 (CDT)
keithely wrote:Hi,
I am facing a problem in GetdatatoModify.vi.I am calling
GetdatatoModify.vi in one of my application called write.vi.Once this
is called from my frontend application ,it is showing error that
"ERROR1 object say xxxxx is not valid".This object actually I am
getting from referance from create.vi.I verified referance getting from
create.vi and referance passed to GetdatatoModify.vi are same.
The interesting thing is if I have opened my write.vi in
background,everything will work properly.Then no object invalid problem
comes.I
have no idea what VI you are refering to with GetdatatoModify.vi but I
have a good guess what is your problem. LabVIEW deallocates objects
automatically when the top level VI in whose hierarchy the object was
created goes idle (ceases to run). What you are probably doing is
opening the object reference in one VI writing it to a global and then
doing a Read or write on that object reference from another VI. This
will not work. You have to keep the VI that created the object alive
somehow for the entire duration of your application.
Yet even better is to use dataflow dependancy (thus wiring the refnums
from the create function to the actual read or write function and
structure your program such that this can be done nicely) and forget
about globals for this purpose altogether. Globals are the poor mans
solution for those that can not be bothered to sit down and think about
a design before starting to actually code according to that design
sketched out beforehand.
Rolf KalbermatterMessage Edited by rolfk on 04-12-2006 04:18 PM
.
- References:
- Object is not Valid Error
- From: anurag_cm@xxxxxxxxxxxxxx
- Object is not Valid Error
- Prev by Date: Re: LV5: pause hot key
- Next by Date: Re: mousemove+eventstructur
- Previous by thread: Object is not Valid Error
- Next by thread: Re: Dynamic Calling of DLL
- Index(es):
Relevant Pages
|
Loading