Ton Plomp Posted January 2, 2007 Report Share Posted January 2, 2007 Hello, I am trying to generate properties for XControls. I know how to add them to the XControl. But when I open the Xcontrol the XControl is broken and says the property is missing. And if I open the new property VI, it needs to be updated to get linked to the XControl. To prevent this I save the property and close, add it to the XControl, save the XControl, open the property and save the property. This has not solved my issue. Does anyone know how to do this (Jeffrey?) Ton PS it is currently the only thing between inheritance for XControls Quote Link to comment
Aristos Queue Posted January 3, 2007 Report Share Posted January 3, 2007 To prevent this I save the property and close, add it to the XControl, save the XControl, open the property and save the property. This has not solved my issue.Does anyone know how to do this (Jeffrey?) A bit of glancing at XControls suggests to me that you may have a problem doing this... The properties of an XControl are VIs, true, but they are specific kinds of VIs. Adding a VI to the XControl library and adding it as a property are two different things. In fact, I don't think there's any way to add a VI as a property. You can only create new property VIs. A property VI is a special type of VI and I'm not aware of any way to change one type into another. I think what you'll have to do is create a new property and then copy the block diagram contents from the original VI into the new VI, and then hook up the controls on the front panel. XControls aren't my area of expertise -- I only play with them because I think they're neat -- so I may be wrong. But that's what it looks like to me. Quote Link to comment
Ton Plomp Posted January 3, 2007 Author Report Share Posted January 3, 2007 Hi Aristos, I allready solved that, with this code: So the XControl knows it is a property inside the right property folder. The problem is the VI, it doesn't know it is part of the XControl. In a way XControls behave like lvlib's (here kicks in your knowledge about classes) The library is looking for: thisXcontrol.xctl:myProperty_read.vi This is not found on the disk only myProperty_read.vi, and I have to browse to the file. When I open the item from the XControl I get the following: Does anyone have a clue to resolve this? Not that this are normal properties and methods not supersecret...... Ton Quote Link to comment
PJM_labview Posted January 3, 2007 Report Share Posted January 3, 2007 I think this might be due to the fact that member of lvlib are marked (a feature I really dislike). When you are dynamicaly generating the properties VIs, they are probably not marked and therefore the lvlib does not know it belong to itself. Just my guess. PJM Quote Link to comment
Ton Plomp Posted January 3, 2007 Author Report Share Posted January 3, 2007 Just my guess. You're right, but I wonder is there anyone who has generated lvlib's? NI is doing it so there should be a property/method to claim a VI. Ton Quote Link to comment
Jim Kring Posted January 3, 2007 Report Share Posted January 3, 2007 You're right, but I wonder is there anyone who has generated lvlib's? NI is doing it so there should be a property/method to claim a VI.Ton Have you tried this?... 1) Load the VI into memory (open a VI Server reference to the VI) 2) Add the VI to the library/xcontrol while the VI is in memory 3) Save the VI 4) Close the VI Server reference to the VI I believe that the VI will "sense" that it has been made a member of the library if it is in memory when the operation is performed and that this "sensation" will be persistent if the VI is saved. I hope it works... Quote Link to comment
Michael Aivaliotis Posted January 3, 2007 Report Share Posted January 3, 2007 You're right, but I wonder is there anyone who has generated lvlib's? NI is doing it so there should be a property/method to claim a VI.Ton Maybe something like this? Quote Link to comment
Jim Kring Posted January 3, 2007 Report Share Posted January 3, 2007 Maybe something like this? Michael: Yes, will probably work. Don't forget to save the VI and the XControl afterwards. You should probably save the VI first, so that the XControl "senses" the new file name/path of the VI. Quote Link to comment
Michael Aivaliotis Posted January 3, 2007 Report Share Posted January 3, 2007 Ok, I solved it. Here it is: Quote Link to comment
Ton Plomp Posted January 3, 2007 Author Report Share Posted January 3, 2007 Michael, That was the trick. And I thought I had looked everywhere. Only this list is not alphabetically sorted..... aaaahhhhhhh :headbang: And Jim is right you should save the VI and XControl afterwards! Ton Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.