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.

Similar Messages

  • Calculate maximum value of subarray while creating it using a case structure and shift registers

    I have two 1D arrays that contain cyclical information (kind of like a sine wave).  One that contains information on position in degrees and another that contains torque.  I would like to calculate the maximum torque value each time the position is within a certain range (e.g. from 30-80 degrees).  The ranges are repeated - that's why it is cyclical.   I use the "in range" function, a case structure and shift registers to build a new array with values that fall within the range I specify - this was the easy part (see VI attached).  I'm struggling with a way to calculate a maximum value for each subarray formed when values are "in range".   Your help is much appreciated.
    Solved!
    Go to Solution.
    Attachments:
    Simple Calculate between anatomical position range.vi ‏16 KB

    It's not really noise - it's more inconsistency.  So a position output can run: 20, 30, 40, 50, 60 etc.  OR, it could run: 21, 24, 32, 41, 44, 51, 59 etc. But, it is always cyclical. 
    Attached you will find a .csv file with the data arrays - I'm using POS (ANAT) degrees column (column D if you open in excel).  There you also see torque in ft-lbs along with some other information.
    Attachments:
    025C.csv ‏224 KB

  • 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

  • Hold last value on unconnected tunnel in case structure

    I have a true/false case structure as below. I am using it to run some code when an input is true. False condition is empty.
    after performing some calcs I tunnel the value out, I wish the false condition to hold the same value, 
    how do I achieve this?
    Use default if unwired returns a 0 value which I don't want.
    Thanks
    Solved!
    Go to Solution.

    hydzik wrote:where do I create the shift register?
    I assume that this is running inside of another loop.  You would put the shift register on the loop.  If not, then use a feedback node.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    FB Node.png ‏15 KB

  • Is it possible to use the case structure in on board progamming

    Hi
    I want to load a certain value in a variable in on board programming based on the encoder. How to implement this in 7344.

    No, it is not possible to use the labVIEW case structure in an onboard program. However, it is possible to implement the functionality you need by using a label, a jump to label on condition function and two on board variables. What you need to do is read the value of your encoder into one of the variables, once this value is in there you will use some of the variable arithmetic functions to compare its value to a value you would load into the second on board variable (the most common way is to use the subtract variables function). The result of the last varible operation is the used inside the jump to label on condition fucntion to evaluate the condition and to jump or not jump back to the label dependding on the result. For a much clearer explanation of this functional
    ity as well as some example code, please refer to chapter 15 of the following manual:
    http://digital.ni.com/manuals.nsf/websearch/EB609F​9BA065EA7A86256D350060C9A0?OpenDocument&node=13210​0_US

  • Boolean switch until released using an event structure

    I am using a boolean control with the mechanical action set to switch until released, I want the button to go back to the original state.
    I am using it in an event structure set to trigger on a value change. The action of pushing the button is generating two events, one of the on state and one for when it returns to the off state.
    How do I control this so that only one event is triggered and the second event that is queued up is ignored, I would like the button to go back to the original state and not execute code twice.
    Thanks
    Jim
    Solved!
    Go to Solution.

    You can use the value from OldVal or NewVal in the event case and a conditional structure to mask it off.  Do you really need switch until released functionality?  That's intended to give you two events, as the click and release are different actions.  Switch when released might be a better fit for you if you only want one event.
    --Using LV8.2, 8.6, 2009, 2012--

  • Is it possible to use a Case Structure to hide numeric indicators on the Front panel when they are not in use?

    I am rather new to LabVIEW, have only been using it for about 1.5 weeks as of this post, which means I may be missing something rather obvious due to ignorance, but is there any way to have my front panel change as my case changes due to user selection of a certain case via the front panel?
    The goal of the program is to make a simple layout for a user that is using the digital multimeter that the proposed code is designed for and I don't want tons of numeric controllers and such clogging up the screen space that don't work with the function the user is using to measure with.
    Thanks in advanced.
    Solved!
    Go to Solution.

    Check out the property node for the controls
    Visible Property
    Short Name: Visible
    Requires: Base Package
    Class: Control Properties
    Displays the front panel control.
    This property is similar to the Show Control and Hide Control options on the shortcut menu of a control.
    Also look at the TAB control to control which controls are available to your user.
    Omar

  • 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

  • How to use integer in case structure on FPGA

    Hi there,
    I was trying to use a case structure on FPGA module. The input to case selector terminal could be arbitrary integer like 0x1EEE or 0x2000 or 0x3FFF. Since I cannot find integer-string conversion on FPGA, how can I do it? Thanks

    Hello!
    If you want to create a case structure to handle arbitrary integer values, you can always use the decimal representation of the hex value (i.e. instead of 0x00FF, use 255).  If you want to create cases for the hex values, you can right-click on the case structure, and choose Radix>>Hex.  You should notice that all cases are now preceded with an 'x' to denote hex values.  This will allow you to create cases called x00FF, which sounds like what you're looking for.
    Cheers,
    Matt Pollock
    National Instruments

  • How can I determine whether to use an event structure or a case structure?

    I'm starting a large project and need a state machine. I can't decide on whether to use a case structure or event structure. Is there an article  or other information that describes criteria for selecting between the two approaches?
    Thank you,
    Chuck
    Solved!
    Go to Solution.

    Hi Chuck,
    Well case structures and event structures differ quite alot.  Here's a link for indepth information on Event Structures, and using them in state machines: http://zone.ni.com/devzone/cda/tut/p/id/2962.  Hopefuly this will help you make up your mind.  
    Let me know if you have any questions after reading it. 
    Regards,
    Dominic Walker
    Cardiff University
    Electrical and Electronic Engineering Student

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

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

  • 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

  • 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 Ranges Determined From Input Variables

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

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

Maybe you are looking for