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

Similar Messages

  • 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

  • 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 .

  • 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

  • Please Clarify the Errors (Case Structure)

    I am using numeric case structure but I don't understand the errors, can anyone clarify what they are mean and what I have to do to change it. Thank you in advance.

    (This is a new problem, so you should have started a new thread.)
    The solution is simple: Things are case sensitive!
    A case labeled "Divide" is different to a case "divide"! Correct the first characer for each case and you're all set.
    In scenarios such as this, easiest is to hook up an empty case structure to the radio control, then right-click the case structure and select "Add case for every value". Voila! No chance for mispellings!
    Message Edited by altenbach on 08-07-2006 09:49 AM
    LabVIEW Champion . Do more with less code and in less time .

  • 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

  • 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}

  • Multiple boolean values to be used in case structure

    Hi,
    I am trying to implement a case structure with multiple boolean cases and am having trouble with that. What I want to do here is : I have a set of 5 values, each of them being "true" or "false". For each "true" value, I have a certain set of steps to be executed. The "false" of each can be ignored. Ideally, I would like to have a case structure for the 5 "true" cases. I am not sure how to go about wiring these boolean outputs to my case structure. Also am using LabView 6.1.
    Any ideas?
    Thanks,
    Sukanya
    Solved!
    Go to Solution.

    Additional comments regarding code:
    It is a mistake to configure the serial port inside the loop. This is a waste of time and resources. Configure outside, read in the loop, and close outside after the loop is done. The flushing of the buffer would be part of the "configure outside".
    The default values of the controls for the VISA Configure Serial Port VI are such that the termination character for reads is enabled, and the character is set to a linefeed. This means the VISA Read will read until it sees a linefeed or reaches the value wired to its byte count input. Thus, the VISA Bytes at Serial Port isn't really necessary.
    You should not rely on the settings in the LabVIEW option for automatic error handling. You should explicitly handle errors in your code. Thus, you probably want to stop the loop on an error and provide a dialog via the Simple Error Handler.

  • How can i set case structure always true on boolean impulse?

    Hello everyone! I need a little help. All i want is to set a condition when to acquire data from my acquisition board. I have a sinusoidal pulse and when value its near zero (between 0.5 and -0.5) i want to start to write data and also stop condition. How can i make my case structure to remain set to true until next condition? Thanks in advance!
    Attachments:
    Untitled.png ‏104 KB

    sdadasdas wrote:
    Thank you! I'm a beginner in labview and any advice is welcome!
    I highly recommend tutorials if you are really new.  Otherwise, just keep asking questions.  You'll figure it out soon enough.
    3 Hour Introduction
    6 Hour Introduction
    LabVEW Basics
    Self Paced training for students
    Self Paced training beginner to advanced, SSP Required
    LabVIEW Wiki on Training
    Learning NI
    Getting Started with NI Products
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Concat strings from different subdiagram​s of a case structures

    I am using a case structure, which has about 8-10 different case and each case has a string constant. I want to show the strings in a single indicator. Suppose if 3 cases runs first then second and then third. Then the indicator should show
    " first case
      second case
      third case"
    initially indicator should be empty then as soon as the first case runs indicator should show " first case"
    after finishing the first case when second case runs then the indicator should show
    "first case
     second case"
    and so on..Please help me.
    Solved!
    Go to Solution.

    $agar wrote:
    Here it is attached with 3 cases........
    Well, that does not look very useful. Try to scale it to 10 booleans!
    Here is a quick draft how it could be done. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ConcatenateCaseStrings.vi ‏9 KB

  • 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.

  • 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

  • How can I have multiple inputs into the selector terminal of a case structure

    Hi everyone
    I have a question on how to wire multiple inputs in to the selector terminal of a case structure. 
    Currently, I have three switches, each switch determines different case. So if I switch the switch 1 is on, the numeric indicator will show 1. If the switch 2 is on, the numeric indicator will show 2, so on and so forth. However, the selector terminal will not allow me to wire multiply inputs into the case structure, I tried Bundle by Name, Bundle and Array to Cluster, but they did not work. I set the case structure with 3 cases, they are 1, 2 and 3.
    Could someone help me please. I have attach an image and the VI of the work I did so far.
    I have another question, is there a function which can toggle other switches to off when there is a switch has been toggled on.
    Thank you very much
    Tommy
    Attachments:
    Trial - Case Structure.vi ‏7 KB

    Tommy, attached find a cheeseball way of doing this that has given me a LOT of mileage over the years.  IT lends itself nicely to a couple of really good practices that NI recommend, but I have given you the bare-bones to "see under the hood".  
    The recommended practices:
    1. You can make this a nice tight sub-vi where you can put it into a core library of routines that you'll use over the years, even extending the logic to look only for changes, etc.
    2.  If you are thinking about Front Panel design considerations, you'll want to use arrays of controls where possible, as that's a nice neat way of containerizing your switch for both the FP and Block Diagram.
    Have fun.  I have TONS of these types of things, so feel free to PM me if you have any other needs.
    Wes
    Wes Ramm, Cyth UK
    CLD, CPLI
    Attachments:
    Boolean Switch Logic.vi ‏11 KB

  • Run only once in case structure

    Hello,
    I have a menu set up that is wired to a case structure.  Of course the menu is some boolean buttons that are set to switch when pressed so the case will stay open as long as the button is true.
    inside that case I have another menu and a case structure that operates the same.  In one of these cases I have a piece of code that I only want to run once.  I have tried the while loop that runs once and a for loop that only runs once, but the section of code seems to run continuosly instead of just once.  It works ok if I use any of the latch functions but not the switch when pressed functions.  However, I need the button to stay pressed until the user is finished with that case.
    I really don't want to use an event structure as I was saving that for another piece of code that monitors inputs.
    Anyone have a suggestion?

    Typically, this works easiest with a shift register and and a boolean "implies" function.
    In the code example (see image), the button is set to "switch until released". (Of course you probably don't need the NOT, simply place your one-time code into the FALSE case )
    Message Edited by altenbach on 01-26-2007 01:52 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    implies.png ‏8 KB

Maybe you are looking for

  • Using a Mini as a DVR?

    I want to buy a new mini and ideally be able to use it to record tv shows, and archive some of those shows to DVD. I know that there is some 3rd party software to do this. I do not want to have to open it and hack it for any modifications though. 1.

  • Validation on Master Project

    Hi, I need to make a validation on Master Project, is it possible to do that? I have 1 UDF here, and every project has this 1 UDF and I'm about to make a validation that each project will only have 1 UDF. I tried  this : SELECT U_ProjectDetail, PrjCo

  • How to use Update Statement in ODI Procedure

    Hi, How can I use an update statement inside an ODI procedure. Thanks

  • Why is the iPhone cheaper from Apple store than elsewhere?

    Hi there, possible silly question for you here! Why is the iPhone 5C £319 from apple and £399 from the likes of Carphone Warehouse or Virgin Mobile?? What am I missing? Having been with Virgin for a very long time and using basic phones I need someth

  • Want to configure Oracle EDI Gateway for Inbound Invoice Interface

    Hello, Newbie to Oracle Apps and want to configure Oracle EDI Gateway for Inbound Invoice Interface. We are having Oracle EBS R12 installed on OEL 5.6 Do i need to install EDI Gateway or it comes with APPS R12 installation ? if i have to install it e