Dragging case structure to include objects

Hi,
This might be a very noob question.
I have made a case structure with a lot of code inside it. And I also have a lot of objects/code outside it, so that the outputs from the code inside the case structure go to the ones outside it.
Now I want to include the objects that were outside, inside the case structure. There is a LOT of code outside too, it is a pain to increase the structure size, and then cut/paste the objects inside. Not to mention the multitude of rewiring.
Is there a way to include the objects outside when i extend the case structure over them? Right now it just pushes them and does not inlcude them inside it. I have tried all combinations: Ctrl drag, Ctrl+shift drag etc..
Thank You

The problem with that is that there are multiple cases.
If I remove the case structure, it will retain the case that is currently displayed but delete all the other cases behind it.

Similar Messages

  • Editor bug if you drag a case structure over an index/replace elements node on a in place structure

    To reproduce:
    Drag a case structure over a index/replace array node
    You'll end up with this train wreck. Autocleanup no longer works
    Interestingly, you can still get it to compile but setting the boolean to true doesn't run the true case. Warning: dragging the below snippet onto your block diagram will probably crash LabVIEW
    Select all that and drag it into a new VI. Run autocleanup and the development environment will crash: Exception: Noncontinuable exception (0xC0000025) at EIP=0x00000000
    Running LabVIEW 2014 SP1 with nothing special.

    To quote Obi-Wan
    This is not the bug you are looking for..........
    Now search for "Clear as mud"
    Having a Wired treminal inside an IPE driving conditional code should break the snot out of that code and cause the compiler to puke all over!  The lack of check for that insanity is causing the crash!  Don't do it!  Just think of how you are abusing the poor IPE.  What if you had a breakpoint on the Inplace Boundary and changed the boolean?  That would necessatate a copy inside an inplace structure....... NO!!!!
    Or, more to the point as best I understand: (Add duct tape adound head as needed)
    An IPE must exist in one "Clump"  Terminal Reads exisist in their own "Clump" (although you can read many terminals in one clump)  So you require a clump to read the boolean terminal inside another clump.  Clumps cannot reside in clumps since clumps are clumps that stand apart from each other by definition.  The run arrow should be broken but is not- hence LabVIEW crashes. Makes sence to me  except the clumping algorythm didn't catch the insanity and the run arrow wasn't broken.  so the next edit caused all hell to break loose.
    (If I missed domething here I am going to learn something today)
    Jeff

  • Can I put a READ function in a TRUE/FALSE case structure?

    Hi,
    I have a vi that operates as controller for a mechanical system of motors.  There are several sensors of various types, that provide input to the vi, including encoders, whose period is being measured.  The attached vi is the encoder period measuring part. It measures 15 periods and tells me the average of the 15 with each loop iteration.
    In my application, the encoder period measurement is not needed unless the vi knows that ALL THE OTHER sensors in the hardware configuration are measuring values within the desired range.  For example, Sensors A, B and C should all measure between 5-10.  If they are all showing values between 5-10, then, we want the encoder value to read and display.  If only one of the sensors, say A, is measuring 12, then, we don't want the period value to READ or be subsequently processed.  So, it is easy to set up the sensors A, B, C, to give a TRUE or FALSE based on whether they are within range or not, and if all 3 are TRUE, then, that value can easily be passed to the case structure that holds my READ function for the period.  Is this a good way to do this?  The goal is to eliminate unnecessary execution time that the period READ function would consume, as well as all subsequent calculations that are performed on the period value collected.  The period data is of no use if any one of the other sensors is not in the correct range.
    If any one of the other sensors is out of range, we want to skip the encoder READ step altogether.  So, it is easy to structure a BOOLEAN in my vi as shown in the attachment.  If I do it this way, will it throw an error, or just skip the READ until the BOOLEAN is true again?  Is there a better way to prevent the READ from happening if one of my other sensor values is not within the correct range?
    Thanks,
    Dave
    Solved!
    Go to Solution.
    Attachments:
    forum JUly 18.vi ‏26 KB

    Sure, you can put a Read inside a case structure. For your application, just check that your sensors are all within range (Comparisons palette), then AND the T/F's and use the result of that for your case structure. (If you are already doing the in-range check, I can't see it here because you have 5 subVIs that I cannot open here.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • Can I use a formula node to start the execution of a case structure?

    Hi,
    I am working on editing a VI to make it much easier to understand (for colleagues and non LV users). For one reason or another, the VI's creators did not fully make use of the power of case structures and other structure types. In the application we need it for, the instrument cycles and repeats measurements on several objects. We are interested in measuring the motor currents for several motors in the system. As it stands now, for each sample object's run, there is a separate sub-vi diagram which displays its waveform trace and several indicators such as max current, time at max, etc. That code was contained within a T/F case structure and copied and pasted 20 plus times.... Obviously the vi became extrememly cluttered and needed a huge screen to see. The trigger for the current case structures is an EQUALS comparison between one input (which is the sample object counter; and this part I will likely leave unchanged since it makes a lot of sense already) and a constant which was defined 1 through 20+ for case. 
    I have since made one case structure and 20+ instances of that case and have labeled them (at the top selection box near the detent arrows) "1", "2", 3, etc. I am wondering if I can use a formula node to act as the "trigger" which sets each case structure running? I believe that a simple IF statement should work. Please see a snippet of my attempt at making this in C below.
    For the node, I defined X as the input and Y as the output. The input to the node, X, is connected to the sample object counter. The output, Y, is connected to the case selector of the case structure. My attempt at the code is below:
    int32 y
    For(x == 1)
       y = "1";
     For(x == 2)
       y = "2";
    etc, etc.
    Is that above code snippet correct? Do i need something like "ENDIF" or "end if" at the end? Does "y" have to be defined as "int32" or can it be something else?
    Thanks for the help!

    Is your formula node doing anything else besides what is shown?
    Why don't you just wire the value that is going into it at X directly into the selector of the case structure?
    Attachments:
    Example_VI_BD.png ‏2 KB

  • How can I put a numeric indicator into a case structure using VI scripting

    I'm using VI scripting and I'm trying to add a numeric indicator inside a case structure.  I'm able to add the case structure and the numeric indicator just fine, but as soon as I specify the case structure as the "owner" of the numeric (as opposed to the block diagram being the owner) I get error 1060.  Is there any way around this?
    Note:  The reason I am doing this is because this specific pattern (indicator in a case structure) will prevent a VI from being inlined when it is being built.  This pattern will provide no functionality in itself, it only prevents the inlining.  It is added to a larger VI which is use to initialize objects in a simulation, and there are many of them in the total simulation.  If they are inlined, it takes a VERY long time to generate the C code, and performance on this VI isn't an issue since it is performed only once at the beginning of the simulation.  The rest of the VIs do need to be inlined for performance reasons.  Therefore, I'm open to other options to prevent a VIs from being inlined if the "indicator in a case structure" cannot be performed via scripting.
    If any of this is unclear please let me know and I can clarify.  Thanks.
    Solved!
    Go to Solution.

    I now understand what you were saying about inlining a subvi.  I did as you said and made a subvi with a case structure and an indicator within it.  I use the New VI Object node to add that subvi to the slow-inlining parent VI.  Then I tried to inline it using the invoke node, but I got error 1399, which make sense.  Is this what you meant for me to do, or did I misunderstand?
    Also, I tried the ControlTerminal reference approach you mentioned earlier.  Unfortunately when I called the move method on the control terminal property and had the 0th frame of the case structure as the owner I got error 1060 again.
    I really appreciate your help.  Do you have any other thoughts?

  • How do I get a case structure's panel?

    I am trying to place a boolean indicator within a case structure via LabVIEW scripting and am not having any luck.
    I started with the following source code, which creates and populates a case structure from an array:
    https://decibel.ni.com/content/docs/DOC-22703
    So my code, rather than put an enum inside each case, creates some compound arithmetic and a mask for each case.  This is all working fine.  I now want to place boolean indicators on the front panel that correspond to each case, and this is where my problem is.  I can create the indicators, but when I look at the block diagram view, all of the indicators are located outside of the case structure, rather than the indicators being inside of each respective case.
    I think the reason is that a boolean indicator is created by passing a reference to the front panel.  But the problem with this is that the VI panel reference does not indicate that the boolean should be placed inside the case structure, just on the panel, so when you view in block diagram mode, it's just thrown the indicators all outside the case structure and wired them up via tunnels.  I am getting the panel reference by accessing the OwningVI field of my CaseSel object.  I feel like there must be some field I should be able to access that indicates to put the block-diagram boolean inside of the respective case structure, but I can't find it.
    I've attached a file with 3 pics in it.  One shows a pic of the code I'm using to create the indicators.  One shows the type of output I'm looking for.  One shows the type of output I'm getting.
    Solved!
    Go to Solution.
    Attachments:
    lv_case_struct.jpg ‏221 KB

    Before you connect the wire to the terminal, call the Move method on the indicator's terminal and use one of the case structure's Diagrams[] as the owner. This will move the terminal into the structure.
    Try to take over the world!

  • Using local variables with a case structure

    I recently decided that I didn't want to nest a bunch of case structures for a program I am creating. I have two variables, N1 and N2, and I want to say execute Case 1 if the integer input to the terminal is less than N2. Case 2 if the integer input into the terminal is greater than N2 but less than N2+N1. Case 3, integer greater than N2 + N1, but less than N2+N1+N2. Case 4, you guessed it, Greater than N2+N1+N2, but less than N2+N1+N2+N1. When I try to type the variable name into the bar and use the ... like you do with integers it changes the variable name to a string.
    Am I just thinking of this the wrong way? I have a sensor setup in a square and I am using a matrix card hooked up to the sensor bundle to send signals from each sensor to each other sensor, but not for those along the same sides.
    Tom

    I see the nested case structures which is what I didn't want to do, but I will have to because I am tired of looking at this. Thank you for the help on this. I appreciate it.
    The sensor network is shown in the image included.  Lets say we number the sensors in a clockwise direction starting on the lower left hand corner. Each element needs to both send and recieve data to all other elements except for the one in the row it is in. So sensor 1 would sent to sensor to sensors 5 - 18. Then sensor 2 would send to 5 - 18. Sensor 5 would sent to 1 - 4 and 10 - 18. Etc.
    Lets say if this were a circular array it would be easy. Two nested while loops. And the only condition I need to worry about is that sensor N is not both sending and recieving at the same time. Each while loop, or for loop - doesn't matter, will start at 0 and go to N-1. Each i and j will have +1 added to them, and as long as they are not equal preform the data operation. 
    Just some fun logic to think about
    Tom
    Attachments:
    rectangular.jpg ‏12 KB

  • Changing an output box in a case structure to an input box

    Hi, I have been struggling with the following problem in Labview:
    Hi, I was working on a wiring diagram in Labview and I was trying to
    wire an absolute value symbol to the right border of a case structure.
    The problem is that I get an output box (an white filled box with an
    orange border) instead of an input box (an orange filled box). How
    would I change the output box into an input box? I have tried Ray
    Kong's method, which is to add a constant and that would make the box
    solid. It worked only once but when I tried it on another output box
    it did not work. Any suggestions would be appreciated. Please
    include step by step instructions as I am still learning Labview.
    Thank you
    Muhammad Asfour

    The box type will be appropriate for what you have wired to the box.
    When you say you want an "input box", do you REALLY want an input box (ie, a
    connection bringing a value from outside of your case statement to the
    inside of your case statement) or do you mean that you want your output box
    (a connection bringing data from inside your case statement to the outside)
    to be solid orange? The output box will go solid orange when you have a
    connection from EACH case to the box. Remember that a single output box
    (usually on the right side of the case statement) must be connected to
    something in each case of your case statement. It will be filled white
    until all cases are wired.
    Write back if this isn't clear of if I have mis-understood your situation.
    Hope this hel
    ps.
    Jim
    "Muhammad Asfour" wrote in message
    news:[email protected]..
    > Hi, I have been struggling with the following problem in Labview:
    >
    >
    > Hi, I was working on a wiring diagram in Labview and I was trying to
    > wire an absolute value symbol to the right border of a case structure.
    > The problem is that I get an output box (an white filled box with an
    > orange border) instead of an input box (an orange filled box). How
    > would I change the output box into an input box? I have tried Ray
    > Kong's method, which is to add a constant and that would make the box
    > solid. It worked only once but when I tried it on another output box
    > it did not work. Any suggestions would be appreciated. Please
    > include step by step instructions as I am still learning Labview.
    >
    > Thank you
    >
    > Muhammad Asfour

  • Case Structure timing/ writing data to a excel

    Hi all,
    I have written a program that has the main functions of allowing the user to generate a random number between either 0-10 or 5-15 by using the labelled switch. I also have a control which can switch this function on or off. When this switch is true it will display the random number and also write this number to an excel spreadsheet every 1 second (I hope). When false this will stop displaying the number and hence not write the number to a file.
    However, I am having the following issues:
    1. Excel file is corrupt once I begin to write the generated numbers to the spreadsheet. (I am trying to write to a .xlsx file)
    2. Once I begin to try write the numbers to file, the elapsed timer only displays the time is 1second intervals rather than the full time.
    I changed the .xlsx file to a .csv file and this solved issue 1. but it only recorded one random number rather than the numbers that were generated in that time since switched on/off.
    Should I have the write to spreadsheet function in the timed case structure?
    Should the file path control be outside this case structure?
    Have I set up the write to spreadsheet VI correctly?
    If anyone could help with these issues that would be a big help.
    Thanks!
    Attachments:
    Random Number tester.vi ‏30 KB

    lneill65 wrote:
    There is still an issue with the elapsed time. Once I begin I turn the top boolean control to true, the elapsed time begins changing at the set time increment inside the case structure. Is there anyway to stop this from happening?
    Your elapsed time display is independent of the boolean switches because it is on the toplevel loop diagram. I am not sure why you place a five second wait inside the case structure if you want to write once per second.
    I am not sure why you have two sequential case structures since the calculations of the first structure is not needed unless the other case is also true. Why not place it inside the true case?
    You should also adhere to some basic coding styles. Avoid overlapping and floating objects, hidden wires, right-to-left wiring.
    If it is sufficient if the code reacts once per second, just run the loop with a 1 second wait. If you don't want to display a stale random number if the switch is off, place the indicator after the case structure.
    Here's a quick draft. Modify as needed. I probably would use an event structure, but let's keep it simple at this stage. You should also modify it so it does not try to write with an illegal path and also retain the selected path once selected. I propably would use a file dialog instead of a FP Path control.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Random Number testerMOD.vi ‏9 KB

  • Before the selector value reach a Case structure I need to stop it until a push button is pressed. How to do?

    Before the selector value reach a Case structure I need to stop it until a push button is pressed. How to do?

    altenbach wrote:
    UliB wrote:
    simply wire your selector value through a while loop. Stop the loop with your button. After the loop stops, the value will go on to the case structure.
    Hmmmm.....
    Hello altenbach,
    roflol .
    Thank you for the link to 'A Field Guide To LabVIEW Objects - Selfish Loop'. I'll keep that in mind, when answering other questions with while loops.
    Uli

  • Execute Case Structure with Button Press Slows Down VI

    Hi -
    I'm fairly new to LabView, and I am having some issues with using a button to run a timed while loop.
    I am writing a VI that outputs a timed voltage pulse to an output channel on a DAQ; meanwhile, the VI reads and graphs the voltage on three input channels on the DAQ. When I use a timed loop that automatically executes when the VI runs, the program works. However, I would like to include a button so I can control the timing and number of voltage pulses sent to the output channel, instead of sending only one voltage pulse each time the VI runs. I have tried to do this using a button wired to a case structure. If the button is 'true,' the VI should send the voltage pulse. If the button is 'false,' the VI should keep the voltage at zero.
    When the button is 'false,' the VI runs normally; however, when the button changes to 'true,' the VI slows down and never sends the pulse. Why does this happen? How can I fix it?
    Also, how can I send the voltage pulse only when the value of the button changes?  I only want the timed loop to execute once when the button changes value.
    Thanks for any help or advice!!!
    Attachments:
    Sensor Read6.vi ‏85 KB

    The graph is in the same while loop as the case structure.  The while loop won't iterate until all the code inside of it has completed.  So the graph only gets updated once, and won't update again until the while loop iterates again.  If you need more continual updating you may want to put that in a loop that executes a couple of times, or completely separate your code into 2 while loops.  Is it that long of a wait considering your pulse length is 1 second?
    Your analog output code is just writing a voltage out (7 volts) until it eventually writes out 0 volts.  There is no reason for it to drop down unless you have some sort of electrical problem between your DAQ device and the device on the other end that is reading the 7 volts.  What are you connecting that analog output too?
    What if you don't use LabVIEW and try to test out that analog output using Measurement and Automation Explorer?  Does it do the same thing?

  • Modify Case structure with VI Scripting

    This is possible:
    you need a file, where only a case structure is on the BlockDiagram (BD).
    This file is called (e.g. Test1.vi)
    Then you start this VI:
    And in your test1.vi you have updated the case structure ( CaseStructure ) with VI Scripting
    Sometimes you will need this
    BR
    Eugen Wiebe
    Eugen Wiebe
    Bernstein AG
    CLAD - Certified LabView Associate Developer

    I now understand what you were saying about inlining a subvi.  I did as you said and made a subvi with a case structure and an indicator within it.  I use the New VI Object node to add that subvi to the slow-inlining parent VI.  Then I tried to inline it using the invoke node, but I got error 1399, which make sense.  Is this what you meant for me to do, or did I misunderstand?
    Also, I tried the ControlTerminal reference approach you mentioned earlier.  Unfortunately when I called the move method on the control terminal property and had the 0th frame of the case structure as the owner I got error 1060 again.
    I really appreciate your help.  Do you have any other thoughts?

  • A quesiton about case structure

    Hello
    I just try to write a simple program.
    e.g. I have a for loop (N = 10), if i > 5, I want to output the value into array ([6, 7, 8, 9] is what I want). But in labview I have to wire a value in the "false" case, so my output become [0, 0, 0, 0, 0, 0, 6, 7, 8, 9].
    How can I solve this problem?
    Many thanks,
    Stephen
    Attachments:
    test.vi ‏17 KB

    Hi Stephen,
    You need to use a shift register for the array.  In the first half of the iterations, don't add anything to your array.  But once the iteration count passes your threshold, start building the iterations into the array.  I have attached a VI to this e-mail.  Notice also that I've included the logic for switching out cases directly in the case structure with the "..4" and "5.." cases.
    You should check out the LabVIEW Help on shift registers...they're a little hard to understand when you first start using LabVIEW, but they are an indispensable feature when dealing with loops.  While you're at it, check out the LabVIEW Help on Case Structures to learn about other neat things like the "..4" and "5.." notation.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    test.vi ‏17 KB

  • 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 use a Case Structure with Strings?

    I need to use a string list to set up a set of cases to be performed. Is it possible to tell a single case structure to do "a, b, c, and d, but not e or f" or "do a, c, d, and f, but not b or e" etc... when you use a string containing the cases to be used?

    Blackavar,
    A case structure will only execute a single case at a time. If you want to have multiple cases execute in parallel, then you would need to have multiple copies of the case structure and split the string apart and wire them to all of the needed case structures.
    This could be done with reentrant subVIs to run truely in parallel. Anther method would be to have 6 different case structures, all with 7 cases each. The 7 cases would be "a", "b", "c", "d", "e", "f", and "0". Your input sting will need to be built up so that it will always be 6 characters long and then split up so that each character goes to one of the case structures. You would have your needed code for cases a - f. Case "0" would do nothing.
    Randy Hos
    kin
    Applications Engineer
    Nationsl Instruments
    http://www.ni.com/ask

Maybe you are looking for

  • Multiple databases with the same name ... only one named DB can be found

    Hi All We are currently in the progress of migrating over to APEX 3.2 from HTMLDB 2.1. We have 3 instances on each version - DEV, UAT, LIV. The HTMLDB servers and databases are set up with no problems in grid control. However, the new apex instances

  • About CAST function in oracle

    Hi , Now iam migrating my system from SQL to ORACLE 9i. Here USERID is of NUMBER(38) type   and DATA is of LONG type in SQL. I  have table named :      PEOPLE  and DBATABLE and i run the following code in oracle but found the following error... ORA-0

  • Sap Conatiner Concept

    hello all, I was Trying to open a web application inside SAP and a PDF inside the sap Screen but in both the case it is opening in new respective window. I tried to open it through the Container concept but was not able to open it. I am able to creat

  • Business Catalyst tools and services

    is Business Catalyst tools and services included in Muse membership ?

  • Need  help finding tutorials for segmenting and contouring

    I'm completely knew to photoshop and other image editting software so I'm rather lost at the moment. Would someone please direct me to a tutoral or tutorials detailing the proper method to contour or segment an image? Thanks for the help.