Cases programmat​ically from xml in case structure

I want the cases in my case structure to be updated programmatically from an xml file. Is this possible?

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>
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
Attachments:
contains case structure.vi ‏9 KB
controls case structure.vi ‏12 KB

Similar Messages

  • Standard Proxy enhanced unable to fill the data from xml to the structure

    Hi All,
      We have enhanced a standard proxy structure in PI, generated the proxy in the target system SCM, but the call transformation is not filling the data from xml into the appended field.
    Am i have to do any thing to fill the data.
    Thanks.
    Chaitanya Naru

    Hi Srikant,
    You can use the following code. This works for me.
      Remember to set the multiplicity of the User structure to 0...N or 1...N
    IGPStructure inputStructure = m_context.getInputStructure();
    Collection inputItems = inputStructure.getStructures("User");
    if(inputItems == null){
    return;
    for (Iterator iter = inputItems.iterator(); iter.hasNext();) {
    //get input item structure and fill context
    IGPStructure item = (IGPStructure) iter.next();
    String attrName=
    item.getAttributeAsString("AttrName");
    Thanks & Regards,
    Dipankar

  • How to get RT IP Address Programmat​ically from Host?

    We have a laptop PC that plugs into a RT PXI to collect data and configure the software on it. How can we "dynamically" discover the IP of the RT so that the laptop can download (FTP) new configuration files to it without user intervention?
    I have discovered a seemingly "unsupported" ActiveX control called "NIMax Viewer" that lets you get miscellaneous information about all the things Max can see, including the RT systems. This control reduces the problem down to a few clicks from the user but its not the transparent solution we want. Unfortuneately, this control doesn't seem to allow programmactic navigation (the user still has to click on it to get it to change its selection).
    If anyone has a general soluti
    on to this problem, or more information about the NIMax Viewer ActiveX control, I appreciate hearing about it. Thanks.

    Hi VI Guy,
    In order to access your RT target you normally need to know its IP address. The example I linked earlier will help in situations where you need to connect to a specific RT target but for some reason do not know its IP address. This can happen if you configure your target to obtain an address from a DHCP server - which means that every time the controller boots it could potentially have a different address. When this happens, you could use this example to reestablish a communication with the RT engine.
    The reason the serial number is required is that we need to know which of all the RT targets found on your network is the one you are interested in. So yes, in order to connect to an RT target you do need to know either the static IP addr
    ess, or its serial number. You could figure out this serial number either from MAX or by looking at the sticker on the hardware.
    The example is provided as an exe because it is meant as a programmatic connection tool, specifically in a situation like the one described above (where a connection is lost). At this time we can't provide the source code that provides this functionality (so I guess calling it an example is a bit of a misnomer.)
    From your original post, I thought you were looking for a tool you could embed in your application that would find your controller. If this is not the case, please let me know. With your feedback, we can look at improving this utility or provide more effective ones.
    Regards,
    Dafna

  • How to load programmat​ically from CVI the specific sequence file in TestStand 3.1

    I am trying to implement TestStand from Windows/CVI 3.1. I need to insert a specific sequence file in TestStand, with all other sequences unloaded. I used TSUI_ApplicationMgrCloseAllSequenceFiles() and TSUI_ApplicationMgrOpenSequenceFile(), but after Username/Password prompt, the TestStand loaded all the old sequences. How to eliminate this?

    Hello,
    I created a function that calls those two methods. When I made a simple CVI button and in a callback for it, I call my function, it does successfully close all open sequencefiles and then load the one I specified; however, it does not work when I call the function just before the call to RunUserInterface! I am very surprised by this and will be bringing it up with our R&D department. There is a simple work-around. Instead of closing all open sequencefiles at the beginning of the OI, close them at the end instead. I have modified the full-featured OI for you and tagged in the code where I made changes. This should do exactly what you want (you may want to change the code around to make it a little cleaner...I left more in code in than I needed for instructive purposes). Please let me know if you have any questions about this. Take care!
    Regards,
    Aaron B.
    National Instruments
    Attachments:
    TestExec.c ‏55 KB

  • XML to ABAP Structure transformation

    Hi SAP,
       Can anyone tell how to transform from XML to ABAP structure. The ABAP structure i'm getting in runtime.
    Please do the needful.
    Thanks in advance
    Vinod.

    using XSLT or ST you can do that check this thread
    https://forums.sdn.sap.com/click.jspa?searchID=5585367&messageID=1661688
    and also search ABAP forum for more code samples

  • Programmat​ically change case structure range

    I think I already know the answer to this, but I'm going to ask anyway. In the attached image, is it possible to programmatically change the range of numbers the case uses?
    Tay
    Solved!
    Go to Solution.
    Attachments:
    case structure.png ‏3 KB

    To use a property node on a case selector, you need to have a reference to it.  There are several ways to open the reference, depending on where the object you want to reference is located.
    EASY - If the case selector is not inside another structure and has a unique name, use Open VI Object Reference with the name of the case selector as the input.  The owner is the block diagram reference and the object class is a case selector.
    FAIRLY EASY - If the case selector is inside another structure or structures and all structures and the case selector have names unique to their diagrams, open the structures from outside to inside as in case 1.  After you open the structure reference, get a reference to the appropriate diagram and repeat until you get to the final case selector.
    HARDER - Case selector has a unique name, but is buried in a container which does not.  Use the Traverse method to find all case selectors, then use the Label property of each to find the right one.
    HARDEST - Case selector does not have a unique name.  Use the Traverse method to find all case selectors, then find the one you want by the frame labels.
    The take-home message from this is that your life is much easier if you give your containers unique names.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How do i output multiple arrays from a case structure to create one larger array

    I currently have a vi that has one hardware input that i needed to take a measurement then be moved and take a similar measurement at a different point.  To accomplish this i used a while loop inside a case structure.  The while loop takes the measurement  and finds the numbers i need while the case structure is changed per the new measurement location.  I want to take the data points i have created in each case and output them into a single table.  I assumed to do this the best way would be to get the data from each case into its own built array and build a larger array but I cant get the information out of the case structure so that it all inputs at different places.
    thanks for your help
    Attachments:
    Array.vi ‏30 KB

    Hi Ross,
    attached you will find a solution for your table building problem.
    I would suggest thinking about program design - having the same case content in several cases doesn't make sense. I also would not want my user to press several stop buttons depending on choosen measurement...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Array.vi ‏45 KB

  • In the attached VI I dont understand why data from the inner case structures are not being transmitted to the array.

    In the attached VI I don't understand why data from the inner case structures are not being transmitted to the array.
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    TEMP.vi ‏25 KB

    It took me some time to figure what you are trying to do but I think I have it now.
    The SR is still required.
    What is happening is your "Bundle By Name" is replacing all of the fields of the cluster, not just the value coming out of the case structure. So to maintain the cluster stuff you do in earlier iterations you can either...
    1) Put the "Index array, Bundle by name, and Replace array" inside the case structure and ONLY bundle the value you are setting in that iteration. (as you will see Tim post shortly)
    OR
    2) Move the Index array before the Case, unbundle all of the fields and feed teh case structure and run them across the case so that ALL of your output tunnels come from the coresponding input tunnel EXCEPT for the filed you are trying to set.
    Ben
    Message Edited by Ben on 05-05-2010 01:31 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Is there any Way to find Which case is Executing in LabVIEW VI programmat​ically and Display it..

    Is there any Way to find Which case is Executing in LabVIEW VI programmatically and Display it..
    Solved!
    Go to Solution.

    I wrote this a few years ago: http://lavag.org/files/file/199-state-machine-foll​ower/
    This JKI RCF Plugin sets the Visible Frame property of a Case Structure while the owning VI is running. Use it to follow the execution through the cases in your string-based State Machine/Sequencer when Execution Highlighting isn't fast enough (and, it's never fast enough).
    The use-case I wrote this to improve is setting a Breakpoint on the Error wire coming out of the main Case Structure and probing the Case Selector terminal so I can float-probe wires during execution. The problem with this is that I had to manually select the current frame every time. This is boring, so I developed this plugin to automatically set the Visible Frame to the case most recently executed.
    You might be able to adapt it to your needs.  The basic idea is that a custom probe on the wire to the Case structure's selection terminal sends a notification to a VI that displays the appropriate case.
    We might be able to help you develop something easier if you'll give us more information.  Is it OK if the code to display the case is in the same VI?
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • Programmatically get names of all cases in a case structure

    Hi All,
              I have a subVI that is a state diagram (controlling some test equipment), with many states (i.e. each "state" is a case of a case structure), a text string chooses the case. All cases are named.
             Within this subVI is it possible for me to programmatically retrieve the text name for each case of this case structure? I wish to be able to retrieve these strings so that the main VI will only be able to call valid states.
            I have error handling to ensure that if an invalid state is called (by using the default case) that an error will be returned to my main vi, yet I would prefer to be able to retrieve the string to prevent any typo's etc.
          Not sure if I've explained this well.
         Thanks,
        ds1
    Solved!
    Go to Solution.

    You can do it with LabVIEW scripting, however, I wouldn't leave scripting in a final application. Use a typedef enum if you don't want to worry about this. If you want to keep it as a string (remember, this is a heavily debated subject) just make sure you test all cases before making it an executable and that should suffice. If you want to check to make sure it's a valid string, this seems like a bit overkill on the error checking! Just work it out when testing, or again as was said above, use a typedef enum.
    CLA, LabVIEW Versions 2010-2013

  • Is there a known issue with emailing from case structures

    Hi,
    I am working on a quality control vi for data coming in as a text string. I need to be able to have the vi perform a check with the responce to the check (true or false) will cause different steps to then be performed. I was able to get the vi to perform 1 check and email out if the responce was false. When I tried to add a second check if the responce was true, the vi would run without any errors but would not email out or would only email out from the first check even if the first check passed and it was the second check that failed. This was all done without case structures. I then started using case structures with the true responce leading to other checks but the false responce leading to an email generation. For some reason even a simple one check with the email generation happening in the false case will not work. There are no errors or anything, it goes through the whole process correctly but will not send an email. Please help!!
    Tim Koles

    Hi,
    Here is the vi and the sample text file it calls for. You will of course have to change the path name. Feel free to call me if you have any other questions. Thanks
    Tim
    410-326-7259
    Attachments:
    SPLIT_WEATHER15.TXT ‏130 KB
    Weather QCexample.vi ‏63 KB

  • Converting from case structure to arrays

    I am working on a set up that write out 8 digit binary to a connector block. I had it set up with a case structure but there are over 40 different writes and it is becoming way too convoluted. I know it would be much easier to do this with arrays but I have no idea how to use them, please help.
    Here is my current program:
    Attachments:
    42sampleWorkingCode.vi ‏974 KB

    Here is a quick attempt to do everything with arrays. See if it makes sense to you. As you can see, the code is much simpler. (LabVIEW 8.0).
    You should be able to adapt some of the ideas. Many additional simplifications are possible, for example you could calculate the port 0 values directly from the outputs of the upper Q&R function. Try it!
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    timedBackboneWithLEDnewlogoMOD.vi ‏384 KB

  • Case structure back and forth from LED

    Hello, I'm trying to make a case structure switch back and forth everytime a boolean LED indicator goes off. I want case one to start when a button is pushed, switch to case two when an LED indicator goes on, then switch back to case one when that same LED goes on again, then case two the next time the light goes on, and so on. The LED is set to go on every ten seconds. So far i have the case structure in a while loop but im not sure how to get them to switch back and forth using this one LED. Any suggestions?

    Then you have two asynchronous parallel loops, and you want one of them to receive information (Boolean) from the other in order to determine its state.
    If the loop with the elapsed time contains nothing but elapsed time, then consider moving it to the first loop.
    Otherwise, you should use a form of synchronization communication, such as a Notifier or User Event, to send data from your loop with the elapsed time to your loop with the case structure.

  • Feedback node from case structure

    checkLED.vi is my first rev of this. Then I realized I can incorporate the 345/348 selection into the case structure, which resulted in checkLED2.vi. However as soon as I did this, the feedback loop inserted itself. I don't understand why this happened and what it means. The string coming from the case structure is an INPUT to the two 34970 vis. There is no feedback going on here. If Labview sees this as feedback, why didn't it insert the feedback node in checkLED.vi?
    Attachments:
    checkLEDs.vi ‏23 KB
    checkLEDs2.vi ‏23 KB

    Look at the dataflow you have created by moving the strings into the case statement. The case statement requires data from the iteration terminal and from the VI in the sequence structure. The sequence structure requires data from the switch VI which in turn requires data from the case statement. This is a clear feedback situation that you did not have before.

  • Case Structure Ranges Determined From Input Variables

    Hello, 
             I am trying to write a vi that will read in a random number, and depending on how close or far away from the intial given value it is, it will do something different to the value using a case structure.(Not positive this is the best way)
    Ideally I would like to somehow incorrporate the value that is on the front panel from the user, into the different ranges so they are not set. Is there any way instead of using [ ..10, 11..15, 15.. ] I could use the [..(indicator - 5), (indicator-4)..(indicator +4), (indicator +5)..] as my three different cases? Or is that just crazy and I should be trying to use a different type of structure maybe? 
    Thanks in advance for the help, 
    KT

    What if you would subtract the reference value before wiring to the case structure?
    (assuming you are dealing with integers)
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • PRoblem regarding Submit - Open/Transfer/Close Dataset

    Hello again, I know I keep asking the same topic (regarding datasets) for the past week. Its been a new topic for me. However, I have a program which I am testing that is shown below. <b>REPORT ZPROG_COOL7 NO STANDARD PAGE HEADING. DATA: ITAB_LIST TY

  • The wifi on my macbook pro (lion) is ridiculously slow. the wifi on my pc works perfectly though. how could i fix this?

    So I recently bought my MacBook Pro, about three days ago, and the wifi connection is horrible. I can barely access anything on the internet. I tried using my PC laptop, and the wifi worked very quickly, so the problem definitely isn't my wifi connec

  • After TimeMachine restore, cannot re-activate Acrobat Pro 9

    My iMac's hard drive crashed last week and after replacement, I restored from a TimeMachine back-up on an external hard drive. The only issues I had were getting Adobe applications (CS4 Web Premium) back up and running. After running the License Repa

  • L_TO_CREATE_DN

    Hi, in my code i have:   SELECT        * FROM lips INTO TABLE tlips WHERE vbeln = likp-vbeln.   IF NOT tlips[] IS INITIAL.     CLEAR: it_delit, l_wa_delit.     REFRESH it_delit.     LOOP AT tlips INTO wa_tlips. Compruebo el estatus de la posición    

  • FLOW n Activity

    Hi, guys i have come across a problem of which i am not able to find solution since last two days, since i a new to xslt and BPEL as well, i am not able to come up with a solution for it. Hope the eldies here could lend a helping hand. So here's the