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 .

Similar Messages

  • How to connect 1d boolean array in case selector?

    hi
    i am using two different types of sensor to make a controller. this is the initial part. when i tried to get the real time data of my sensor through labview, i found some unwanted data. e.g. after every 5/10 data set, suddenly i got (o.oo o.oo) type data. interesting fact is that, usually two sensor didn't give this (0.00, 0.00) type data set at the same time. (please see the attached font panel and a array named (x+y), first 2column from 1 sensor and next 3column from another sensor...if u look at row no 7 and 12, u will see the data set of 2sensors are 0.) i wanted to remove this type of data for real time operation. thats why i tried to make a program who would filter those data. . i used comparator to check wheter all data are 0 or not. if all were 0 then it was supposed to operate true operation of case structure and eventually there would b no output. but unfortunately it didn't work. the block diagram is attached herewith. i am very new in labview. can anyone please help me and let me know what wrong i did?
    thanks at advance-
    Taslim
    Solved!
    Go to Solution.
    Attachments:
    Untitled_1d.png ‏14 KB
    Untitled_1p.png ‏18 KB

    hi... thanks for ur reply. my actual VI and the data file (in .doc format. this post doesn't support .dat format) are attached here. actually i have to execute it for real time data. in that case number of row would be unpredictable. in the first stage i only tried to have it using offline data. please feel free to ask me if u want to know more. for ur convenience i've uploaded VI for 2011 and 2013 both. BTW, i used the "or" boolean... so why do u think that it would work only when rows all elements  are 0 at a time... i m just curious...
    Thanks-
    Taslim
    Attachments:
    Untitled 1-2011.vi ‏10 KB
    Untitled 1.vi ‏16 KB
    stand.docx ‏23 KB

  • 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

  • Numbers into textfield using boolean buttons and case structure?

    Hi!
    I'm very new to these forums, and to LabVIEW in general. I'm currently trying to implement a calculator-ish, but without the operations (+ - * /).
    I have 10 boolean buttons, named 0-9, and with these I want to basically write a sequence of numbers into a textfield. I've managed to solve the problem using an Event structure, but now i'd like to achieve the same result using a Case structure instead. The problem is that I can't identify which button has been pressed, so I can't make the program go to the correct case (0 to 9). Is there any simple solution to this that you guys could help me with? Maybe a property node that's generic for every button? I dont know
    Anyways, I'm attaching a simplified version of what I'm trying to achieve, withouh the code I don't know how to write obviously.
    Thanks for your help in advance!
    /Sebastian
    Solved!
    Go to Solution.
    Attachments:
    help.vi ‏12 KB

    Here is a way to do it: bundle the boolean values into an array, turn that into an 8 bit number and wire that to a case structure with a boolean radix
    Message Edited by jmcbee on 03-31-2009 02:29 PM
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    helpMOD.PNG ‏13 KB
    helpMOD 80.vi ‏20 KB

  • Boolean in empty case structure

    Hello Everybody,
    I am a bit stuck with one of my case structures. I am trying to set "True" for Boolean constant in order to enable "write to file" of the data once the number in one of the  dynamic data flows reaches threshold value 79. I want to make sure that all numbers will be written after that, and not only numbers >=79.
    My idea was to put Boolean "True" in the true part of the case structure, and leave nothing in the false part of the case structure. That unfortunately did not work  
    Does anybody know if there is a way to set Boolean to "True" after I reach desired number and keep it at "True" afterwards for continuous recording?
    I would really appreciate any help
    Oleks
    Solved!
    Go to Solution.
    Attachments:
    loadcell_final_trig_qsw_3_08_2009.vi ‏416 KB

    Just use a gobally initialized feedback node, less code.
    Message Edited by altenbach on 08-03-2009 07:44 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Loadcell.png ‏1 KB
    LoadCell.vi ‏15 KB

  • Timed boolean switches with case structure

    I am trying to implement a control for a switch that when toggled, turns a "key signal" on for 2 seconds, and then turns off, as soon as the key signal has been on for two seconds the VI should send say that the switch has been enabled.  I cannot get this to work how I want. I think there might be a way to do this with a state machine, but I do not know much about them.
    Solved!
    Go to Solution.
    Attachments:
    VFD on switch.vi ‏26 KB

    Hi,
    I changed your Boolean to latch so it would snap back to the off position.  This stops the VI from entering the on case over and over till turned off.  Then I added two shift registers to hold the indicator values. 
    I guess my bias is that you would want to continue to run in the While loop, going back to the "OFF" case.   If you expand this to a state machine, you might have multiple cases, the shift registers would provide the "flag" status access to the other cases.
    This is only one method, it matches you request.  How would you fit this into a larger design?
    Copy snippet to desktop, drag onto VI.
    Did you want the keyturn to turn on for the two seconds, and then have the enabled LED turn on?   If so you have to move the location of the indicator into the time target while loop, this will allow it to turn on while the time target loop is timing two seconds.
    Mark Ramsdale

  • Stooping a case structure

     Hi everybody..
    I want stop the most inner case structure after executing only once but the count is keep on increasing i cannot use STOP...please help
    Thanks in advavce
    Attachments:
    Modified_DiscreteInput..vi ‏27 KB

    Hi Everybody
    In this VI when Boolean UDA is connected to single case structure is working fine but when it is connected to a another case structure it is showing abnormal result.
    I am attaching both the VI. Any suggestion will be helpful  
    Attachments:
    Modified_DiscreteInput1.vi ‏29 KB
    Modified_DiscreteInput2.vi ‏28 KB

  • Better alternative to case structure

    Hi,
    I am trying to find a cleaner way of doing the attached vi. In the vi I have booleans wired to case structures. If the boolean is false it sends a string to an array and into a dialog box.
    Solved!
    Go to Solution.
    Attachments:
    error.vi ‏26 KB

    Think about the duplicate code, you have, and how you might eliminate 3 instances of it, and use the one remaining as a subVI to handle all the buttons.  Also think about how those four buttons could really be an array of booleans that could be parsed with a for loop, with each indexed boolean feeding into that subVI.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Multiple booleans controlling one boolean input for a case structure

    Hello,
    I have four boolean buttons and a case structure with a boolean input. I would like to write the program so that whenever any one of the four boolean button changes value, the case structure reads true for one loop interation, and then returns to false.
    I have tried all sorts of things and can't seem to figure it out.
    Ultimately, the ideal function of the program is so that whenever you push any one of the four boolean voltage controllers, that voltage case is chosen in the case structure, the time in seconds is written to a file, and the elapsed time timer is reset.
    I have attached my program. Let me know if you have suggestions. Thanks.
    Attachments:
    Volt_Control_And_Time_Counter.vi ‏71 KB

    Zappow wrote:
    However, with this setup, the time counter still doesn't work.
    The event structure for all four buttons has a true boolean constant connected to my file-saving case structure. If I connect this to my elapsed time express VI reset button, the timer doesn't count.
    The timer does not count because you have not wired a timeout to the lower event structure. The default timeout is -1, so the lower loop never spins via timeout
    It is useless to have a wait in a loop that also has a timeout case. Just wire an approriate timeout value to the timeout terminal and remove all waits. It is also not necessary to have a 1ms ttimeout if your timeout values only displays to 100ms resolution. Can you explain why you think you need two loops and all that extra code?
    Attached is a quick rewrite that solves some of the problem. Since I don't have any hardware, I replace the voltage out with a meter.
    You have way too many FP controls and indicators. Use arrays!
    Let me know if yo have any questions. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Volt_Control_And_Time_CounterMOD.vi ‏63 KB

  • Trying to clear an array inside a case structure

    Good morning all.  I am trying (unsuccessfully, obviously) to clear an array inside a case structure.  (See case structure at right side of vi, I colored it green to make it easy to find).  Here's (briefly) what I'm trying to do.  I have 6 test probes in the process.  All six probes are connected to the Alcatel Detector through a 6-solenoid manifold.  As I run the test, I want to sample 1/second, for let's say 3 minutes.  For the first 30 seconds, I want to pull a sample from from probe 1, so I turn on solenoid one and leave it open for 30 seconds.  Now all 30 values are tagged as having come from Probe 1, and they're stored in array 1.  I can now compute an average value for probe 1. Then I close solenoid 1 and open solenoid 2, saving the next 30 values to array 2.  (and so-on, until I have measured all 6 probes for 30 seconds each).  Then I wait a pre-determined amount of time and repeat the process.  Here's my problem.  I want to clear out each array as I begin the second iteration, so that I can easily compute the average of the last 30 values.  If I initialize the array by connecting a constant 0 to the shift register on the for loop insid ethe case structure, it does not work, nor does it work to place the 0 outide the overall for loop (the next for loop going out, NOT the OVERALL for loop).  I know my programming skills are still crude, but I'm putting everything into this.  Anyone have any suggestions? 
    Attachments:
    HCMF rev 1 25 Apr.vi ‏485 KB

    Altenbach, I definately understand your approach, and I like it much better than my own.  But I still have no luck making it work.   I get the same result as before (my original attempt).  Value 0 of the array simply changes each iteration, with nothing "saved".  Each new value simply overwrites the last value.  Can you take a look at my new vi, with changes, and see if you can find the error of my ways.  I am but a rookie Jedi in the vast reaches of LabVIEW Space, and you are no doubt a Jedi MASTER
    Attachments:
    HCMF rev 1 25 Apr pm.vi ‏374 KB

  • How to manipulate arrays using case statements and boolean conditions?

    In the vi that is attached I am trying to compare two values in two different arrays and delete the value that is equal to zero.  The values of each array are rounded to the closest integer.  Then I attempted to apply the ">0" boolean as the condition for my case statement, but I am getting an error.  Any tips on manipulating arrays with case statements?
    Attachments:
    Patient Movement Monitoring.vi ‏141 KB

    Thank you!!! that was a huge help. I don't think I need the case structures at all.  The next part of the code compares the 4 values in the array. 
    If columns 0 and 1 are both positive -> output 1
    If column 0 is negative and 1 is positive -> output 2
    If columns 0 and 1 are both negative -> output 3
    If column 0 is positive and 1 is negative -> output 4
    (0 is x-axis value, 1 is y-axis value.....outputs are assigning quadrants to the combination)
    Only one of the "AND" booleans will return true for each index.  Is there a way to initialize another array of outputs 1-4 depending on which AND returns true?
    Attachments:
    Patient Movement Monitoring.vi ‏144 KB

  • Building a case structure with four boolean (true/false) inputs.

    I currently have two boolean inputs that I would like to use to select cases in a case structure. I would like to have four cases, each one dependent on the true/false condtions of the two booleans. If boolean 1 =true, then case 1 should be used, if boolean 2=true, then case 2 should be used, etc.
    What structure should I use to convert these boolean inputs into numeric cases?

    Or build them in to an array and "Search 1d Array".  If you are only looking for a single bool being true, this would be easier because your cases could be {0,1,2,3} instead of {1,2,4,8}

  • Case Structure using Byte Array

    I have an array that has 9 bytes. I need to determine method for selecting a case in case structure when a bit is high.
    I know how to do it when it is 1 byte but I am not sure the best method to use when its nine byte array.
    Can someone provide me suggestions? Or example code?
    Thanks..... 

    altenbach wrote:
    Assuming you have a Boolean array with 9 elements, use "boolean array to number" and wire to the selector terminal. Create cases for all relevant patterns and leave the default case empty.
    If only one element can be true at any given time, use search array and search for TRUE. Wire the output to the selector. Leave the "-1" case empty.
    I think the poster has an array of nine bytes, each with the appropriate booleans.  Therefore, I like jcarmody's suggestion that he index the array and performs the operations that the poster is already familiar with.
    Assuming an array of booleans, the first method you described is okay if there is a specific action for each pattern.  In most of the scenarios I've worked with, each bit represented a specific test, for instance, and there would be a lot of duplicate code if I used that method.  (For instance, binary cases 10 and 11 would both have test subVIs for test 2.)  For something like that, I would all my tests in sequence (using error in/out for dataflow, of course) and have T/F cases around each one with the indexed boolean array controlling which tests would be run.  Of course I tend to see things in a literal way, so if the requirements say "do the selected tests in this order", that's how I would develop it.  Maybe there's a better way programmatically?
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • 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

Maybe you are looking for

  • UCCX 7 - Advanced Reporting - Grade of Service Realtime Report

    Is there any sample of what DB fields would be required to build/calculate an Advanced Report for seeing Grade of Service (GoS) for a particular CSQ? Since there is nothing in the Supervisor Agent to display this, can it be built using the Advanced R

  • Contacts 8 into Numbers 3

    I'd like to paste a group from my Contacts into a Numbers spreadsheet. There are a lot of good tutorials online (this one, for example) on how to do this with earlier versions of these two applications, but they don't seem to work with the ones on my

  • Strange behaviour when using connection pooling with proxy authentication

    All I have developed an ASP.NET 1.1 Web application that uses ODP.NET 9.2.0.4 accessing Oracle Database 8i (which is to be upgraded to 10g in the coming months). I have enabled connection pooling and implemented proxy authentication. I am observing a

  • Ipod 80G classic Restore Loop

    A few months ago i accidentally dropped my ipod onto its corner. after that it would freeze and not work properly. eventually it set itself to disk mode. i have no idea how or why. it just did. now when i connect it to itunes it says i need to restor

  • Can I make it so Records can be edited only by person who added

    Is there a way to restrict each record so that only admin and the user who added it can edit it? Thanks!