08-21-2007 07:30 PM
08-22-2007 04:10 AM
08-22-2007 01:05 PM
08-22-2007 02:43 PM
08-22-2007 06:25 PM
It is optional and i have not used of uninit.vi ability .I searched ni.com for more information about "convert state for save" and "uninit "abilities but I found nothing about them.How can I use of them ?
Thanks for your answers
08-22-2007 06:32 PM - edited 08-22-2007 06:32 PM
Message Edited by brightest on 08-22-2007 06:35 PM
08-22-2007 11:55 PM
08-23-2007 05:27 AM
Hi brightest,
I hope you are doing well today! I tried to build an executable on my own
machine with a very basic project which uses a XControl and did not see any
problems when closing the executable. Is it possible for you to post a stripped
down version of your code which highlights the issues you are facing? Include
both the executable issue and the shared variable issue. I am asking for
your code so as to see what exact steps you have taken to create and run your
executable as well as how you have bound to the shared variable. As mentioned above, we released XControls with LabVIEW 8.0. Any feedback and help on this feature is greatly appreciated!
Uninit Ability:
This is an optional ability and is used to release any resources that you have
allocated for the XControl. Typically such resources are allocated in the Init
VI, although they can also be allocated in the Facade. Open resource references
should be stored in the State so that the Init, Facade, and Uninit VIs can
access them.
Convert State for Save Ability:
Also an optional ability and is used to modify the state information that
LabVIEW stores with a VI. The most common use case is to remove non-persistent
data, such as references, from the state. Removing non-persistent data reduces
the disk footprint of VIs using the XControl. 
Because most modern computers have large storage disks, reducing the disk
footprint does not often justify the additional programming effort and
processor time required to remove non-persistent items. You should primarily
use Convert State for Save to remove large arrays of non-persistent data.
Reducing the disk footprint may be important for applications which are
targeted to non-desktop targets; however, these targets rarely implement
complex user interfaces which would benefit from XControls. 
To convert the state before saving, save a copy of the state cluster and remove
any non-persistent items. Use the Cluster functions to convert the full state
cluster to the save state cluster, and then wire the save cluster into the
variant output. Type define the save state cluster, because you also need to
use it in the Init ability.
When you use the Convert State for Save ability you must also modify the Init
ability to convert the Save State back to the full state. Failing to properly
convert the state results in an error in the Variant to Data function, which
causes the Init VI to use the default state values, thus losing any saved
information. Use the same Save State type definition you used in the Uninit
ability to convert the variant to a cluster. Use the cluster to set persistent
information in the full state, and then initialize non-persistent items
normally.
08-23-2007 09:18 PM
Thank you Adnan Z for your answer
I'm so sorry because I have been so busy today and had not enough time for working on it and just now , I must go somewhere in out of my city for 3 days,anyway.
I send a code here after my come back but I don't think that It could be usefull .
I created an empty Xcontrol without any changes on it and got that problem .
Could be my problem for the application builder settings ? what do you think about it ?
Can you send that your simple tested project or it's setting here ?
Best regards and thanks again
08-24-2007 04:43 AM