i2dx Posted October 28, 2004 Report Share Posted October 28, 2004 Hi, i have a little problem with LV Scripting and i hope to find some help here. The problem is: i am duplicating cases of a case structure with LV Scripting, but i have no idea, how to set the selector label. Does anyone know, how this could work ? thx, cb Quote Link to comment
David Boyd Posted November 4, 2004 Report Share Posted November 4, 2004 Hi,i have a little problem with LV Scripting and i hope to find some help here. The problem is: i am duplicating cases of a case structure with LV Scripting, but i have no idea, how to set the selector label. Does anyone know, how this could work ? thx, cb 2500[/snapback] My, you've been busy I can't find this in the 'bag of tricks'. You can get a reference to a 'Case Selector', and it has properties and methods to get references to its subdiagrams, add/duplicate/delete cases, get/set the default case, and GETTING the array of selector strings, but I see nothing that allows one to set the selector values. So, another one that probably has to 'wait for eight' . Best regards, Dave Quote Link to comment
i2dx Posted December 4, 2004 Author Report Share Posted December 4, 2004 My, you've been busy I can't find this in the 'bag of tricks'. You can get a reference to a 'Case Selector', and it has properties and methods to get references to its subdiagrams, add/duplicate/delete cases, get/set the default case, and GETTING the array of selector strings, but I see nothing that allows one to set the selector values. So, another one that probably has to 'wait for eight' . Best regards, Dave 2561[/snapback] thanks for the labour anyway... i was searching very long, but now i am convinced, that there is no way to do this. i tried to handle this problem by using enums and creating a new enum (using VI scripting) for the cases i need ... best regards, cb Quote Link to comment
hviewlabs Posted January 23, 2005 Report Share Posted January 23, 2005 You can get a reference to a 'Case Selector', and it has properties and methods to get references to its subdiagrams, add/duplicate/delete cases, get/set the default case, and GETTING the array of selector strings, but I see nothing that allows one to set the selector values.So, another one that probably has to 'wait for eight' . Best regards, Dave 2561[/snapback] I don't see neither in properties nor in methods for it even how to "get/set the default case, and GETTING the array of selector strings". Can you tell us how to do that at least? Quote Link to comment
David Boyd Posted January 23, 2005 Report Share Posted January 23, 2005 I don't see neither in properties nor in methods for it even how to "get/set the default case, and GETTING the array of selector strings". Can you tell us how to do that at least? 3635[/snapback] See the attached VI. If you are unable to create these nodes on your BD, you need to reread other posts in this forum on how to access scripting features. Dave Download File:post-195-1106468566.vi Quote Link to comment
hviewlabs Posted January 23, 2005 Report Share Posted January 23, 2005 See the attached VI.If you are unable to create these nodes on your BD, you need to reread other posts in this forum on how to access scripting features. Dave 3639[/snapback] Thank you very much, David! Sorry, I thought I read this this entire thread. I also didn't realize, that even if you have a ref to a private class, say, CaseSelector. you can't expect that the property node will list all the properties if you just click on one of them. In this case if you have a property node for CaseSelector already, the list that pops up when clicking on a property doesn't show neither SelStrings, nor Default Case. That's apparently a second line of defense/hiding. I didn't think they would do that for private classes they thought we would not get our hands on anyways. Well, I was wrong. Thanks again. Now watch what the next version of LabHSM will be able to do soon! Stanislav Rumega Quote Link to comment
hviewlabs Posted February 19, 2005 Report Share Posted February 19, 2005 Did anybody discover already how to programmaticaly do Rearrange Cases.../Sort on a Case Selector? Quote Link to comment
Jim Kring Posted February 26, 2005 Report Share Posted February 26, 2005 Did anybody discover already how to programmaticaly do Rearrange Cases.../Sort on a Case Selector? 3957[/snapback] You can add, duplicate, and delete case frames but there does not appear to be a way to sort/change/reassign them. Quote Link to comment
i2dx Posted February 27, 2005 Author Report Share Posted February 27, 2005 You can add, duplicate, and delete case frames but there does not appear to be a way to sort/change/reassign them. 4045[/snapback] that's what i experienced, too Quote Link to comment
jbrohan Posted February 27, 2005 Report Share Posted February 27, 2005 One path forward might be that after a "Duplicate Case" operation the text cursor is on the case selector and has focus; Generating simulated keystrokes should make a new case! This research fascinates me. I have a method of storing the Menu tags and need a method to verify that corresponding cases are missing or misspelled. Quote Link to comment
Barrie Posted November 21, 2006 Report Share Posted November 21, 2006 I've been using LV for more than a week or two but I must confess I am having some diffculty getting my head around some new features. The behaviour of the standard case structure has been compiler optimized to discard any code eliminated by a constant. Cool. So now we also have conditional disable and diagram disable. With the changes in the case structure behaviour the differences are, to me. subtle. Apart from the search function which allows me to find unique structures (and presumably delete them prior to a build), I don't have a solid understanding of where, when, or why I would use the two new features. Anyone care to enlighten me? What am I missing? Cheers, Barrie Quote Link to comment
Aristos Queue Posted November 21, 2006 Report Share Posted November 21, 2006 The behaviour of the standard case structure has been compiler optimized to discard any code eliminated by a constant. Cool.So now we also have conditional disable and diagram disable. With the changes in the case structure behaviour the differences are, to me. subtle. The "case structure" must have good wires in all of its frames. The "diagram disable" structure may have missing subVIs, broken wires, unwired required terminals and other broken bits in the disabled frames. The "code disable" structure is for multi-platform loading. "I want this to be enabled on Platform XYZ, and that to be enabled on Platform PDQ". This handles cases where you used to have a constant wired to the case structure for "Mac" that, when you loaded on a PC, you had to remember to go find all the instances of that constant and change them to "PC". It's also able to handle other configuration changes using the keywords that you define as part of the project environment. ("I'd like to build a debug version of my VIs, which has all this slow sanity checking code, and now, with just a change to the project, I'd like a release version which leaves out all the double-checking.") Quote Link to comment
Mellroth Posted November 21, 2006 Report Share Posted November 21, 2006 The "code disable" structure is for multi-platform loading. "I want this to be enabled on Platform XYZ, and that to be enabled on Platform PDQ". Just as a side note; if you use this strucure in a RT project, and you have a VI used on all targets but with different code (through a code disable structure) for Windows/RT/cRIO. When you deploy to a target, you will probably have to save the VI again, since the target symbol has changed from previous run. If you are running your VI from your SourceControl system directly, this means that you will have to check out/hijack the VI in order to be able to run it on all platforms. Sometimes I wish that there was a way to tell LabVIEW to keep code for all targets... /J Quote Link to comment
Chris Davis Posted November 22, 2006 Report Share Posted November 22, 2006 ... It's also able to handle other configuration changes using the keywords that you define as part of the project environment. Thats a new one to me, where are these keywords defined in the project? Quote Link to comment
JDave Posted November 22, 2006 Report Share Posted November 22, 2006 Thats a new one to me, where are these keywords defined in the project? If you right click on the Project Name in the Project Explorer (top line), the last option will be Properties. You can set them in there (Conditional Disable Symbols). Quote Link to comment
Chris Davis Posted November 22, 2006 Report Share Posted November 22, 2006 If you right click on the Project Name in the Project Explorer (top line), the last option will be Properties. You can set them in there (Conditional Disable Symbols). Thanks, I'll have to take a look at those! :thumbup: Quote Link to comment
Mellroth Posted November 22, 2006 Report Share Posted November 22, 2006 Aristos, is it possible to get the symbol names and symbol values other than through a conditional disable structure, e.g. using VI server? /J Quote Link to comment
Aristos Queue Posted November 22, 2006 Report Share Posted November 22, 2006 is it possible to get the symbol names and symbol values other than through a conditional disable structure, e.g. using VI server? I have no idea. What does the documentation say? Quote Link to comment
Mellroth Posted November 22, 2006 Report Share Posted November 22, 2006 I have no idea. What does the documentation say? Thanks anyway. Documentation does not explicitly state that it is possible. The reason I asked was that I got the impression that you were really familiar with the conditional disable structures (maybe even reponsible ), so I thought that perhaps you knew a way to get the available symbols. /J Quote Link to comment
Barrie Posted November 23, 2006 Report Share Posted November 23, 2006 The "case structure" must have good wires in all of its frames. The "diagram disable" structure may have missing subVIs, broken wires, unwired required terminals and other broken bits in the disabled frames. The "code disable" structure is for multi-platform loading. "I want this to be enabled on Platform XYZ, and that to be enabled on Platform PDQ". This handles cases where you used to have a constant wired to the case structure for "Mac" that, when you loaded on a PC, you had to remember to go find all the instances of that constant and change them to "PC". It's also able to handle other configuration changes using the keywords that you define as part of the project environment. ("I'd like to build a debug version of my VIs, which has all this slow sanity checking code, and now, with just a change to the project, I'd like a release version which leaves out all the double-checking.") Thanks Aristos and others: This "leg-up" prompted me to dig deeper into these structures and I must confess that my original question was an RTFM. The differences are not as subtle or obscure as I first thought. Call it laziness or fear of the unknown. I am using various versions of GPS receivers that are wildly different in their protocol (and data content :headbang: ) so selectively including drivers programatically will reduce the code size by quite a bit, but would lock me into a device-specific build. One thing that is not explicitly stated (or I couldn't find); I am assuming that any code that is logically eliminated from executing is eliminated from a build, based on the target system and user defined symbols but this will only occur when the diagram is removed. I am futher assuming that this feature would not be appropriate for selecting features or functions at run-time in an .exe. Is this correct? In other words, are these features best used to control code size, execution speed or both? Any insight into the internal mechanics would be welcomed. In the bigger picture, I don't think the full capabilities of the Project are appreciated without a lot of digging, but perhaps I am just futher exposing my laziness . Does one maintain one project and then manage the symbols and build specifications for platform or device specifics, or does one create a different project for each build? It seems to me that this question starts to merge into SCC issues and is perhaps outside the scope of a LV discussion. Further (at the risk of rambling) how many of you out there are full adopters of the project paradigm? - Do you always create a project, even when you are just trying out new ideas? - Are you converting older projects to .lvproj? - Does anyone use SCC in a single user environment for automatic archiving? I am always trying to improve my software skills so all opinions and philosophies are welcome. Cheers, B. Quote Link to comment
crelf Posted November 24, 2006 Report Share Posted November 24, 2006 Further how many of you out there are full adopters of the project paradigm?- Do you always create a project, even when you are just trying out new ideas? - Are you converting older projects to .lvproj? - Does anyone use SCC in a single user environment for automatic archiving? G'Day Barrie, Looks like you're hijacking your won thread My suggestion is that you start new parallel threads asking those questions, rather than having this thread go off in all different directions - this makes it easier for people to search for topics in the future. cheers, crelf 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.