How to implement index array inside case structure for searching a 3D array?

Well I have a 3D array and I want to index certain elements from that array. And I have thought of one way of doing this is to have multiple index array functions on the block diagram to search the array simultaneously, but that would be messy. Or I could setup some kind of case structure and place each index array function into individual cases. I've tried the latter, but when I connect the 3D array to the case structure at the"?" it doesn't give me permission because it says I'm hooking up two different types of data. Case Structure is for T or F and 3D array is not a boolean.
So how can I setup the Case Structure to work for a 3D array?

A case structure's selection tunnel cannot accept an array.  What exactly are your search criteria?  It sounds like a few FOR loops will be needed.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • How to implement Case Structure for multiple inputs to Pic Ring?

    So I have a reasonably simple program which I am almost completeed with. Basically the data of an array is read and then is indexed and a new array is created from the indexed data. And then I use Match Pattern to see if elements in the new array match certain words. And if they do then a number value is allocated to a Pic Ring at the end. And depending on the final number value the Pic Ring changes from one pic to another.
    However, I have the problem that I will be using multiple Match Pattern functions to compare elements in the final array, but I can't attach multiple Match Patterns and their subsequent logic statements to a single Pic Ring, only one. I've been trying to work this out by implementing a Case Structure or Event Structure. But the Event Structure isn't working and with the Case Structure, it is very messy with multiple True/False Case Structures inside of each other. Anyway, hopefully this all makes some sense. I'm attaching the VI program to this post. Thanks.
    Attachments:
    ArrayTest2.vi ‏495 KB
    ArrayTest2.vi ‏495 KB

    Obviously, you can only display one picture.  So then the question becomes which picture to show.  Therefore, you will have to create some sort of preference of one pattern over another.
    I would use a FOR loop so that you can loop through your available patters and their possible results.  Use the Conditional Terminal on the FOR loop so that you can stop the loop on the first match.  Then you just wire up the selected value for the ring outside of the loop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • 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

  • Tunnel mode: indexing with a case structure

    Hello,
    I have a code like the one  attached to this message.
    I have a case structure in a while loop, and I would like to transfere some data from my case structure to outside the while loop in indexing mode tunnel.
    This is to accumulate results (or to save results) following each iteration.
    My problem:
    I dont want any value in the False case of the case !!
    How can I get rid of that? I do not want to use default value for unwired case and I dont want 0. 
    Many thanks 
    Attachments:
    Untitled 1.vi ‏9 KB

    Your VI is saved in LabVIEW 2014.  So you should have this.  Right-click on the output tunnel of the loop.  There is a tunnel mode->conditional.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Conditional Indexing Tunnel.png ‏7 KB

  • Connecting boolean array to case structure

    I would like to connect a boolean array to a case stucture without having to create a seperate control.  I'm sure that this can be done but I'm not sure how.  Thank you for your time.
    Ron Deavers, CLD

    OK, with this information we can probably assume that exactly one of the arry elements is true and you want to know which one. Feed it to "search array" and hook a boolean true diagram constant to the "element" input. You'll get a number between 0 and 3. WIre that number to your case structure and add two more cases so you have one for each condition.
    Also add a case for -1 in the event that none of the elements is true. Make it the default case, just to be sure.
    Let me know how far you get
    LabVIEW Champion . Do more with less code and in less time .

  • How do you pass values between case structures?

    Hi,
    I have a simple vi where I am measuring voltage in a WHILE LOOP. The WHILE LOOP contains 2 case structures.  Under some measured voltages,  case 1 or case 2 will execute, and under some other voltages, neither case will execute, and the WHILE LOOP simply iterates again. 
    Case 1 and Case 2 both issue commands that are calculated using both the measured voltage and the PREVIOUS command value, using a very simple addition/subtraction sequence.  Case 1 and Case 2 are likely to execute many times before the voltage changes enough to pass into the "in between" range.  Each time either case executes, a new command is issued.  Each new command is a modification of the previous command by the addition/subtraction process.
    The two cases refer to an upper threshold and a lower threshold.voltage value.  There is also a voltage range in between the lower and upper threshold values where we do not issue any commands.  Commands are issued only when Case 1 (voltage<lower threshold) or Case 2 (voltage>upper threshold) is TRUE.
    In the case structures, the measured voltage is used to calculate a command value by adding or subtracting to the previously calculated command, where either Case 1 or Case 2 are TRUE.  The case structures do NOT use any of the voltage values measured in the "in between" range. 
    Suppose that Case 1 is executing and sending commands properly, and then, the voltage value changes to the in-between range and continues to the Case 2 range.  What I want is for the Case 2 to use the last command issued by Case 1 for the Addition/Subtraction.  Recall that many voltage values are likely to be measured in the "in between" range and none of these will result in issued commands.  How do I capture the last command from Case 1.  Of course, I want to go both directions.  A total of four differen sequences are possible:
    Case 1--> In between --> Case 2
    and
    Case 2 -->In between --> Case 1
    and
    Case 1 -->In between --> Case 1
    and
    Case 2 -->In between --> Case 2
    How do I capture that last command issued, and store it until either case becomes TRUE again, and then make the case use this command?  I don't think that a shift register will work because the "in between" range will change the value in the shift register, and I don't see how to implement a shift register with a Case structures.  Will the feedback function work for this?
    Thanks for your thoughts.
    Dave

    Action Engines probably are a good idea.
    I think the state machine in the attached vi should also be sufficient.
    Attachments:
    State Machine Example.vi ‏11 KB

  • How to read shared variables inside event structure ?

    Hi,
    I have a problem that my shared variables do not update inside event structure. The program(s) I am trying to get working is seen in the attached screenshot. It works as follows:
    0. I start the vi that is unsquared.
    1. I write a string to a shared variable using vi in red square. I make sure that its updated using write-wait-read.
    2. I run the other vi (blue square), this changes the boolean shared variable.
    The unsquared vi has been running the whole time, it has event structure bind to boolean shared variable change (the one in blue vi). After I have runned the blue vi, the unsquared vi should change the indicator values to match the ones in red vi. However I have to start the blue vi multiple times to get it to change, sometimes even 6 times.
    Also, when I change the value in red vi to a third value and start blue vi multiple times, the unsquared vi shows all the variables. I.e. I put "cat" to red then start red, put "mouse" to red then start red,... and then start clicking blue... Unsqured shows cat, mouse,..., dog (dog is the default).
    How can I force the shared variable to update inside event sructure. I want the current value of the variable, not some historical values.
    Attachments:
    Screenshot-5.png ‏108 KB

    Found the buffering... disabling it solved the problem... thanks.
    FYI, there is another solution that I just found out... attached. Adding timeout to the event structure and the variable read outside the event structure... This makes the shared variable strings (one that is read outside and the otherone that is read inside) different.
    Could someone explain why the variables are in different state even if they are used in the same place and looped with 10ms intervals?
    Juha
    Attachments:
    Screenshot-6.png ‏110 KB

  • Case structure for comparing values

    Hi,
    i just wanted to know if there is a special way to use comparison in case structures.
    I only kow how to create cases for things like if x=0 then ... if x=1 then ...
    Now I want to make it if x<0 then ... if x=0 then ... if x>0 then ...
    The only solution I found so far is creating a case structure inside a case structure.
    Is there a way to keep it all in just one case structure?
    Thanks and have a nice weekend,
    Bernie

    Case Structures are pretty flexible in how you can specify what triggers a particular case. You can specify ranges or various values per case.
    In your situation, if you specify three cases with the following values, you'll get what you want.
    '..-1' = x<0
    '0' = 0
    '1..' = x>0
    The two periods before or after a number indicate that the case should run if the value is anything less than or greater than the specified number, depending on which side of the number you place it. You can also use this to specify a range of number. '1..10' would trigger the case for any value 1 through 10. Using a comma between numbers lets you specify different non-sequencial numbers. '1,5,10' would run the case only those specified numbers.
    The same basic rules a
    lso work with text based Case Structures.
    Attached image shows the three cases you need.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Case_Range_Values.gif ‏21 KB

  • How to implement paging in webdynpro jave based on search criteria.

    Hi All,
    In a requirement I need to implement paging in webdynpro java development.
    I successfully did it when there is no search criteria is available i.e webdynpro fetched all data from the BO object and I did it using a "indexNO" (unique serial no from 1,2,3,4.....) field available in BO object.
    But when there is search criteria available , i.e the data to be fetched from the BO based on some specific field , at that time the "indexNo"  field of all data fetched based on search criteria are discrete i.e not continious. In that case how to implement the paging concept.
    I am using CE version 7.1 EHP 1.
    Thanks in advance
    Srikanta Satapathy

    Hi,
    If you go to your VO and generate the ViewObjectImpl, in there you can create a method which will contain two parameters, 1 the attribute name and 2 the value.
    Then you can follow something like explained in this post:
    ADF Tutorial: How to apply bulk actions to a view object rows
    The only difference is that you will need to create a method like this:
    public void updateAttribute(String attribute, Integer value){
            RowSetIterator iter = createRowSetIterator(null);
            while (iter.hasNext()){
                Row row = iter.next();
                row.setAttribute(attribute, value);
    Then you expose that as a client interface and then after you filter your table by your criteria you just need to execute this method passing the right parameters.
    Regards

  • How to make a fairly simple keyword structure for a amateur shooter?

    Hi,
    I am trying to find a clever way of keywording my images, and have found the hierarchy that comes standard with Aperture to be unsuitable for my needs.
    I was hoping to share some ideas on how to build a suitable general structure for someone (amateur) that may end up shooting pictures of almost anything. Once again - I am looking for a fairly simple structure that I might actually end up using and not the pro huge hierarchies that some pro shooters use.
    So far, I have identified 3 main questions that I think keywords should answer:
    1. What (description of situation)
    2. Where (location, as spesific as possible, even if some off my photos has got gps data in them)
    3. Who (names, but also classified into family, friends, collegues, anonymous)
    Elabourating on this list, the next branch could perhaps be:
    1.What
    1.1
    1.2 ?
    1.3 ?
    1.4 ...
    Some ideas on categories here are: Work/Leisure, arts/crafts,
    2. Where
    2.1 Country
    2.2 County
    2.3 District
    2.4 Place/location
    3. Who
    3.1 Family
    3.2 Friends
    3.3 Collegues
    3.4 Anonymous
    I would love input on this topic and I would also like the hierarchy be expandable.
    Would also love to know where I can find more information on this topic for amateurs like myself.
    Best regards,
    Kjell Are Refsvik

    An intensity graph is just a 2D array. All you need is initialize a 2D integer array of sufficient size and keep it in a shift register. Increment elements based on the xy coordinates.
    For some ideas, have a look at this old example.
    LabVIEW Champion . Do more with less code and in less time .

  • How to implement boolean comparison and event structure?

    Hello all,
    I'm currently developing an undergraduate lab in which a laptop sends out a voltage via USB-6008 to a circuit board with an op-amp, the voltage is amplified, and then sent back into the laptop. The student is going to have to determine an "unknown" voltage which will run in the background (they can do this by a step test, graph V_in vs V_out and extrapolate to the x-axis).
    Currently, I have two loops that are independent in my VI. The first loop is used to "Set the zero." When 0 voltage (V_in) is sent out of the laptop it returns a value around -1.40V (V_out) typically. Thus, I created the first loop to average this value. The second loop, averages the V_out values that come into the laptop as the V_in numeric control changes. Then I take the "set zero" value from the first loop and subtract it from the second loop average to get as close to 0V for V_out when V_in is 0V.
    The problem I'm facing is, the event structure waits for the V_in numeric control value change, but after "SET ZERO" is pressed, if there is an unknown value, it will not be added to the average for V_out until V_in is changed by the user. So, I tried implementing a comparison algorithm in the "[0] Timeout Case." This algorithm works for step tests with positive values for V_in, but there are two problems.
    1) Negative values cannot be used for V_in
    2) If a user uses increasing positive values for V_in there is no trouble, but if they try to go back to 0, the value change event has been called and it is added to V_out as well as the timeout case.
    Sorry for the extremely long post, but I've been banging my head over this and can't figure out how to properly implement this. I'm using LabVIEW 8.0.
    Attachments:
    Average Reset Test.vi ‏371 KB

    OK you have bigger problems than Raven's Fan is pointing out.
    When the first event loop stops ( after pressing "") (the boolean text is "Set Zero")  The second loop may start- (AND PROCESSES all of the events it was registered to process before the loop started!)  that would enclude the value change event from "" (The boolean text is Stop) Being pressed bebore the loop started.  Of course, since the labels of "Set Zero" and Stop are identical nulls....................................................BOTH event trigger at the same time and are processed as soon as the event loop they are registerd to is available.
    Get it ... The two buttons labeled "" both queue Value change events to both loops registered to act on the value change of the control labled ""!
    Both loops will do what you programmed in the case of "" Value Change!  This can, (as you have observered) lead to confusing code actions.
    Do avoid controls with duplicate labels (There is a VI Analizer test for that!)  Do avoid multiple event structures in the same hierarchy. 
    DO NOT bring this to your studients to help you learn LabVIEW!  We get enough studii asking embarassing questions
    VI Analizer will help you provide sound templates.  If you need help with that hit my sig line- e-mail me and I'll always be willing to help.
    Jeff

  • How to populate a Table inside a structure?

    Hello,
    Im very new to ABAP and Im having a rather sily problem. I have a Structure (ZSHIPMENT) with one component (CASES) of the type Z_CASE_TABLE. Z_CASE_TABLE is a table with a line type of ZCASE_STR. ZCASE_STR is a Structure with one Component (CASE_ID) of type String.
    So ZSHIPMENT - ZCASE_TABLE - ZCASE_STR - CASE ID.
    I want to write some code to create this object and use it in a method.
    This is what Im trying:
    method TEST_02.
      DATA: Shipment TYPE ZSHIPMENT,
        case TYPE ZCASE_STR.
      case-case_id = 'case1'.
      INSERT case INTO Shipment-cases.
    endmethod.
    But I get this error: CASE is not an internal table - the "OCCURS n" specification is missing.
    Can someone give me a hint on how to populate my memory object?
    Ive tryed all shorts of things but I never get it to work.
    Thanks in advance.
    Gonso

    Ramiro,
    wow! you hit the nail in the head! The zshipment type was not active to its latets version. Thanks to the debugger I could see its real face.
    Thanks!!!!

  • How to implement navigation control inside view controller project

    Hi,
    I am trying to implement an navigation control in a view controller project.
    I am unable to do that process.
    Can anyone please suggest me how to do this navigation flow which should be placed inside view controller.
    SRI.

    Hi,
    I am using Jdeveloper 11.1.1.4.0.
    To use the appModules methods, I am creating the service interface and then I am creating the webservice proxy into another view controller project and access the appModule methods.
    Now, I don't want to create the webservice proxy. I want to directly access the appModule methods.
    Thanks,
    Rohit.

  • Is a functional global with loops inside case structure subject to race condition?

    Such as this one:
    Solved!
    Go to Solution.

    bmihura wrote:
    I'm being a bit dense here... would somebody write an example VI that demonstrates how functional global variables eliminate race conditions whereas a normal global variable would not? Or just describe it and I'll write the VI?
    The classic example used is a bank account.  Say you are making a deposit.  You have to read the current balance, add the deposit amount, and save the balance.  Now say you are making a withdrawal.  You have to read the current balance, subtract the withdrawal amount, and save the new balance.  Now let us say that both of these events happen at the same time.
    If you are using global variables, you read the global, perform the action, and save to the global.  But who reads what balance.  If both events read the balance at the same time, then whoever writes last will overwrite the other's action.  This is bad, especially if your deposit "didn't happen".
    Now using a FGV (or Action Engine), you can contain the critial parts of the code.  In this case the critical parts are the full read, act, and write.  So with the AE, you store the balance in a shift register.  You can perform whatever action you want inside of the AE VI.  Because the AE is not reentrant, only 1 action can be performed at a time.  So you make sure that deposit happens and is not overwritten by the withdrawal.
    Now for my caveat.  If all you do is a Get and Set inside of the FGV, it is basically a global variable, just slower.
    Read that acticle I linked to earlier and also read up on the Action Engine nugget.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How can write select statement inside case operator

    Hi all,
    I like to write a query which get result from other table in case operator.
    e.g
    select a,b,c from dual
    where a=1
    and b=case when b is null then "select any value from other table" else null end;
    Please help me to write this query.
    Thanks

    sorry, but thats funny.
    You ask for case with subquery and choosed a solution with decode as correct.
    Furthermore, the solution proposed might not be so useful.
    First of all many people prefer case over decode, because of understandability and readability of the code (toad has this as a coding rule built in too)
    Secondly in this case the decode does nothing. Take a closer look:
    select a,b,c from tableA a
    where a.a = 1
    and a.b =(select decode(a.b,null,( select 1 from tableB b where rownum = 1 ),a.b) from dual)the decode chooses the subselect if a.b is null. But if a.b is null the a.b on the left side is null also, so the predicate will never be true.
    aside from this, you can write this shorter as
    a.b=nvl(a.b,(select 1 from tableB b where rownum = 1))so what will work in such a case might be
    ANEXPRESSION(Literal, scalar subquery, ...) =nvl(a.b,(select 1 from tableB b where rownum = 1))otherwise look for a solution with case ;-)
    regards
    Edited by: chris227 on 12.05.2012 02:12

Maybe you are looking for