08-03-2011 03:15 AM
I want the cases in my case structure to be updated programmatically from an xml file. Is this possible?
08-03-2011 04:38 AM
This is only possible in the IDE when the vi with the case structure is not running. You can use VI scripting to programatically create the cases.
Felix
08-03-2011 04:45 AM
I want to create a service of this vi. So when it reads the xml it need to update its case structure.
08-03-2011 05:13 AM - edited 08-03-2011 05:16 AM
You can, but don't forget what Felix wrote - a VI can't programmatically change itself. You'll need a separate VI to modify the Case Structure you're working with.
This example gets a reference to the target VI, traverses for all Case Structures, selects the target by its label, adds a frame and gives it a Selector Label. You'll need to modify the last three VI Server nodes to accommodate your particular application.
Good luck.
<edit> take a look at my CaseSelect JKI RCF Plugin, it contains a bunch of Case Structure manipulation code.</edit>
08-03-2011 07:38 AM
Are you planning to programmatically add code inside the new frames from information in the XML file?
JKI's award winning EasyXML Toolkit can help you process your XML files.
08-04-2011 02:57 PM
Depending on what you are trying to do, it may be easier to replace the case structure with a LabVOOP command VI (see command pattern here). This will allow you to dynamically add code as well as "cases."
What problem are you trying to solve?
08-05-2011 02:30 AM
It's not realy a problem. It's more an implementation. I have a config file in XML and I want a process configure it's ID's along this XML structure.
08-05-2011 08:54 AM
Are you changing just the IDs or also the code which executes for each ID?
08-05-2011 02:43 PM
the code also....
08-08-2011 07:32 AM
Then you do want a command pattern. You have a couple of options.
Note that in both cases you can use a subpanel to host a UI for each new plug-in. This works quite well. Let us know if you need more information.