Jim Kring Posted January 22, 2007 Report Share Posted January 22, 2007 Does anyone know an easy way to set a property by name? For example, if there were a VI Server App method that took an object reference, property name, and property value as arguments. Thanks, Quote Link to comment
Ton Plomp Posted January 22, 2007 Report Share Posted January 22, 2007 Does anyone know an easy way to set a property by name? For example, if there were a VI Server App method that took an object reference, property name, and property value as arguments.Thanks, Hi Jim, I know Jeffrey has done something like this in scripting. I used scripting in my XControl Inheritance property thingy.... (I think I need to come up with some official name), I'll add the related files: Download File:post-2399-1169442833.zip You probably need to modify the template path (and the templates if you want to make them usefull) Ton Quote Link to comment
Jim Kring Posted January 22, 2007 Author Report Share Posted January 22, 2007 Ton, Thanks for this. I was hoping for something with a little less extra baggage (VITs, etc.) I'm working on OpenG Builder and I'm coding in LabVIEW 6.1 and I need to set an Application Property in LabVIEW 8.2. The current solution is to make dynamic calls to a VI that is written in LabVIEW 8.2 that calls the specific property in property node. Thanks, -Jim Quote Link to comment
Ton Plomp Posted January 22, 2007 Report Share Posted January 22, 2007 Ton,Thanks for this. I was hoping for something with a little less extra baggage (VITs, etc.) I'm working on OpenG Builder and I'm coding in LabVIEW 6.1 and I need to set an Application Property in LabVIEW 8.2. The current solution is to make dynamic calls to a VI that is written in LabVIEW 8.2 that calls the specific property in property node. Thanks, -Jim My solution is quite dynamic, in your case (I think I know which property you need ), you could streamline the amount of code, but I don't think you can't change it on runtime, so you'll need the dynamic calling anyway. And does the target reference type exist in LV 6.1? Ton Quote Link to comment
brian175 Posted January 22, 2007 Report Share Posted January 22, 2007 Ton,Thanks for this. I was hoping for something with a little less extra baggage (VITs, etc.) I'm working on OpenG Builder and I'm coding in LabVIEW 6.1 and I need to set an Application Property in LabVIEW 8.2. The current solution is to make dynamic calls to a VI that is written in LabVIEW 8.2 that calls the specific property in property node. Thanks, -Jim I have the same issue for many of our applications/toolkits and had been doing the same thing. However, for our Icon Editor I have tried something new, let the installer do the work for you. The installer (or Package Manager) will install the 6.1 code (in your case), then detect the version of LV and write over specific files with replacement files of the same name but written in another version of LV. I am looking forward to an update to the Builder! I will review my 8.0 and 8.2 modifications and see if there is anything I should let you know about. Brian Quote Link to comment
Jim Kring Posted January 22, 2007 Author Report Share Posted January 22, 2007 My solution is quite dynamic, in your case (I think I know which property you need ), you could streamline the amount of code, but I don't think you can't change it on runtime, so you'll need the dynamic calling anyway. And does the target reference type exist in LV 6.1? Ton, I am trying to setting the Application property named "Run Reserve XI Components". Setting this to FALSE, causes XNodes and XControls to be loaded without running the eXternal Interface (XI) (i, the Facade VI of an XControl). This avoids the problem (er... feature) in LabVIEW 8.2 where you cannot perform a Save As on running VIs. The "Run Reserve XI Components" property was introduced in 9.2, so it doesn't exist in 6.1, unfortunately. Thanks, I have the same issue for many of our applications/toolkits and had been doing the same thing. However, for our Icon Editor I have tried something new, let the installer do the work for you. The installer (or Package Manager) will install the 6.1 code (in your case), then detect the version of LV and write over specific files with replacement files of the same name but written in another version of LV.I am looking forward to an update to the Builder! I will review my 8.0 and 8.2 modifications and see if there is anything I should let you know about. Brian, I think that this solution (packaging up a LabVIEW version support library) would work. I'll think on this and post back with my results, if I go this route. Yes, if you have any feedback for 8.x, we would love to hear it. Currently, the support for all the new stuff (XControls, XNodes, Project Libraries, LVClasses, External Nodes, etc.) is a little sparse. Thanks, Quote Link to comment
crelf Posted January 22, 2007 Report Share Posted January 22, 2007 The "Run Reserve XI Components" property was introduced in 9.2... I thought I was the only one who had access to that version! It's pretty sweet :thumbup: Quote Link to comment
Dave Graybeal Posted January 22, 2007 Report Share Posted January 22, 2007 I thought I was the only one who had access to that version! It's pretty sweet :thumbup: 9.2? Where? Sign me up for this futuristic extravaganza!! Dave Quote Link to comment
JDave Posted January 22, 2007 Report Share Posted January 22, 2007 Does anyone know an easy way to set a property by name? For example, if there were a VI Server App method that took an object reference, property name, and property value as arguments. You can do it by index. But then you have to hunt down the proper index....... :ninja: I would assume that the indices don't change from version to version, but I also assume that is not a safe assumption. David Quote Link to comment
Jim Kring Posted January 22, 2007 Author Report Share Posted January 22, 2007 You can do it by index. But then you have to hunt down the proper index....... :ninja: David, This looks like it could work well for GObjects, however, I'm trying to set a property on an Application reference. Thanks, Quote Link to comment
Yair Posted January 22, 2007 Report Share Posted January 22, 2007 This looks like it could work well for GObjects, however, I'm trying to set a property on an Application reference. If the Application class does have this method and it's simply not exposed, I'm wondering whether type casting it to the generic class would do the trick? Of course, you would need to find the property indexes to test this, and attempting to automate this crashes my copy of LV, but I'm fairly sure I saw a list of indexes around here somewhere (maybe Brian posted it?). Quote Link to comment
JDave Posted January 22, 2007 Report Share Posted January 22, 2007 This looks like it could work well for GObjects, however, I'm trying to set a property on an Application reference. Jim, You are right. I forgot when I played with this that I couldn't get it to work for a VI property. It also crashes LV for me when I try to typecast the App to a GObj and use it. Regarding a list of property indices, there was a post where I requested such a list Here. I never heard from anyone so I started compiling a list. I never finished, nor did I get very far. Quote Link to comment
metin Posted January 24, 2007 Report Share Posted January 24, 2007 Jim,You are right. I forgot when I played with this that I couldn't get it to work for a VI property. It also crashes LV for me when I try to typecast the App to a GObj and use it. Regarding a list of property indices, there was a post where I requested such a list Here. I never heard from anyone so I started compiling a list. I never finished, nor did I get very far. Hi dsaunders: you can get the index of any, even private property. (1) Create a property node (e.g. Panel:SelList[]) (2) Create an indication for this property (3) Finally call GetPropertyCallData linked to any control/indication Unfortunately this works only for Generics and I can not add a picture to this reply. Quote Link to comment
JDave Posted January 24, 2007 Report Share Posted January 24, 2007 you can get the index of any, even private property. Thanks for this!! I was extracting them in a much more painful manner. Quote Link to comment
ragglefrock Posted January 29, 2007 Report Share Posted January 29, 2007 David,This looks like it could work well for GObjects, however, I'm trying to set a property on an Application reference. Thanks, This doesn't solve your specific problem because you're using LV 6.1, but there's a roundabout solution to the problem in general using LabVIEW 8.x, .NET 2.0 or higher and Iron Python, the .NET flavor of Python. It's all described here on Brian Tyler's blog. It involves wrapping the ActiveX server for LV into a .NET assembly, then loading that assembly in Iron Python. The advantage is that Python is a dynamic language and doesn't require precompiled code. So you can dynamically execute actions such as setting properties of LabVIEW objects. I realize it's not sufficient for your needs, but it's pretty cool! 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.