From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-05-2006 11:38 AM
04-05-2006 01:07 PM
10-04-2006 02:29 PM
Hi Peter,
It doesn't look like anyone's posted to this thread in quite a while, but I'd like to followup anyway. What's stated above here is correct. The variable properties page is a static configuration -- it's saved in the .lvlib file. Thus, there is no link between a type definition and the shared variable like there is with a VI block diagram constant or front panel control. A custom control is simply the most direct means of specifying a complex datatype for a shared variable. You can think of it as a template. After the lvlib is saved, it does not retain a reference ("link") to the custom control -- it only remembers the datatype.
I suspect you are seeing coercion dots after changing the data type of the shared variable, because whatever wire you previously had on your block diagram no longer matches the new data type of the shared variable. For example, you could configure a shared variable to accept a cluster with a DBL in it. Then, if you change that DBL to a SGL later on, you'll see coercion dots everywhere going into your shared variable nodes on your block diagram -- LabVIEW's converting the DBL data type in the wire to the SGL data type that the shared variable expects. If I'm way off the mark here, just let me know -- I didn't see your attachment above, so I couldn't be sure.
As for a better way to do this, I'm not sure that there is one. There is a shared variable on-line creation API available with the DSC module, but it limits you on the data types for your shared variables. (The tradeoff is, of course, that you can new shared variable programmatically without using the project window!) There is also a data type property for shared variables, but that isn't going to change the shared variable nodes on your block diagram -- you would have to code with Datasocket functions instead. Furthermore, if you re-deploy your .lvlib those changes will be overwritten.
I hope this helps clear up any confusion. Please let me know if you have further questions.
Thanks!
10-05-2006 05:24 AM
10-07-2006 12:09 PM