How to run a numeric case structure

How can i control the numeric case structure using prompt user as my numeric input?
Message Edited by unknown\ on 07-12-2005 10:25 AM
Attachments:
Case Structure.vi ‏478 KB

Maybe you want something like in the attached code sketch?
LabVIEW Champion . Do more with less code and in less time .
Attachments:
Case_StructureMOD.vi ‏79 KB

Similar Messages

  • How to run a particular case continuously in event based state machine architecture.

    I am making a program using event based state machine architecture, it is running as expected whenever i am generating an event, case structure corresponding to that event executes.
    we are taking some measurements from oscilloscope e.g. i am having one boolean button for rise time whenever i am pressing that that button it displays the value of rise time, it displays only once( since i have generated an event on that boolean button so it executes only once and displays value for one time and then comeback to timeout state) but in our program what we want, we want it to update value continously once that button is pressed.
    Now for a time being i have placed while loop on the case corresponding to rise time but this is not the right approach.
    since i am using state machine architecture( event based ), i am not getting how to run particular case continuously ,or if there is any other better architecture that i can use to implement the same application.
    Attached below is the program.
    Attachments:
    OScilloscope .zip ‏108 KB

    Say, in the attached program, when the user selects Autoset, it inserts corresponding state (Autoset) and now if you want this state to run again and again, probbbly you can again insert Autoset state while executing Autoset state... ohhh its confusing... check the picture below (A picture is worth a thousand words):
    1. Based on user selection, insert Autoset state.
    2. Re-insert Autoset state again and again while executing Autoset state.
    3. Now to come out of this loop, based on appropriate event generation, insert any other state AT FRONT (equivalent to Enqueue Element At Opposite End).
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • 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

  • How can I make easier case structure? Or can it possible to have one Pause and reset button in same structure.??

    hello,
    I am tring to convert my main test vi in case structure so latter on i can make some changes in that for example i want creat one pause button and reset button in that.
    I am not so much familer with case structure i want your guidence that how can i make my vi in globle case stucture in that i m having case 1 ,case 2...
    i already tried for that but then i got confused.
    here i am attaching my .llb file in that aa.vi is my main testing vi.
    will you plese guide me so i can make confort vi in case structure.
    Or can it possible to have one pause button and one reset button in same stucture,so User can pause or reset execution at any time when they want.
    Thank you very much in advance.
    Attachments:
    aa.llb ‏3338 KB

    Hello,
    I have change my entire structure ,now is it possible to have pause and reset button.
    here i have attached my changed vi.
    if still any changes required then please suggest me.
    Thank you.
    Attachments:
    aa.vi ‏75 KB
    aa1.llb ‏3333 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 CHANGE MY CASE STRUCTURE ?

    I know that my case structure will bring in these results:
    SELECT
    DISTINCT CASE WHEN (V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 0 AND 30 THEN '1-30 DAYS LATE'
    WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 31 AND 60 THEN '31-60 DAYS LATE'
    WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 61 AND 90 THEN '61-90 DAYS LATE'
    WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 91 AND 9999 THEN '91 DAYS+ LATE'
    ELSE NULL
    END DAYS,
    NVL(LCL_PERM_NM,'UNKNOWN')TOR
    FROM NCOER_STATS_VIEW V, LCL_ER_TYPE L
    WHERE L.MIL_CD(+) = V.LCL_ER_TYPE_CD
    AND v.lcl_er_form_cd = '4'
    and NVL(v.lcl_omit_from_stats_ind,'N') <> 'Y'
    AND v.psc_cd = '&&psc'
    and V.lcl_er_recv_dt > ADD_MONTHS(V.ind_er_per_end_dt,3)
    and nvl(v.lcl_omit_from_stats_ind,'N') <> 'Y'
    and v.lcl_er_type_cd not in ('G','Y')
    AND v.lcl_er_recv_dt >= to_date('&&rec_orig_dt','MMYYYY')
    AND v.lcl_er_recv_dt <= LAST_DAY(to_date('&&rec_orig_dt','MMYYYY'))
    DAYS TOR
    1-30 DAYS LATE ANNUAL
    1-30 DAYS LATE CHANGE OF RATER
    1-30 DAYS LATE RELIEF FOR CAUSE/EER SPECL RPT
    31-60 DAYS LATE ANNUAL
    31-60 DAYS LATE CHANGE OF RATER
    61-90 DAYS LATE ANNUAL
    61-90 DAYS LATE CHANGE OF RATER
    91 DAYS+ LATE ANNUAL
    91 DAYS+ LATE CHANGE OF RATER
    However how do I change the query or case structure to count each record?
    I want a count for each line. Do I need a group by clause?

    You can use something like
    SELECT days, count(days) FROM
    SELECT
    DISTINCT CASE WHEN (V.LCL_ER_RECV_DT - ADD_MONTHS(
    GROUP BY days

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

  • 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

  • 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

  • How to change the case structure to string input?

    Hi,
    I have the inner case structure that it will decide to set "DC Voltage" or "DC Current" mode. The "Output Function" contained the selection of function "DC Voltage" or "DC Current". So far it only work with DC Voltage not DC Current. My question is how do I change the case structure to string selector? When the output function is selected to DC Voltage then the case structure is selected DC voltage case. Please help Thanks.
    Attachments:
    test.vi ‏35 KB

    You don't really need to convert the value to a string? The problem is that the value of the individual ring items are not 0 and 1, as you assumed. The values generated by the controls are:
    DC Voltage: 1006
    DC Current: 1007.
    You can find this out by viewing the properties for the "Output Function" and going to the "Edit Items" tab.
    So, all you need to do is change the 0 to 1006 and the 1 to 1007 for your case items.
    By the way, your sequence frame serves no purpose.

  • Resetting a Case structure

    I am writing a VI that reads in a signal to a comparator and sends the
    output
    to a
    case structure.
    The ides behind the project is EMG (monitoring muscle active/inactive
    times).
    The case structure is as follows:
    If 1: count up and if count reaches 10 then green LED on (represents muscle
    active)
    If 0: count up and if count reaches 10 then red LED on (represents muscle
    inactive
    and should be exercised.)
    My question is how could I reset the case structure to start again: i.e, If
    Case=0
    and the inactive time reaches 10 and RED LED comes on, I want this to then
    turn
    off
    and put the count back to 0 if it switches to Case=1.
    (The idea is that this RED LED is representing a Vibrate motor (which I
    will
    output
    to using DAQ) . The motor will switch on as the RED LED does to indicate to
    a
    user
    muscle should be exercised but I do not want the motor to be on constant, I
    need it
    to turn off when the muscle is exercised and then restart the count again)
    I probably haven't explained this very well but I have attached my VI.
    Any help would be appreciated
    Solved!
    Go to Solution.

    PinkLady4128 wrote:
    The case structure is as follows:
    If 1: count up and if count reaches 10 then green LED on (represents muscle
    active)
    If 0: count up and if count reaches 10 then red LED on (represents muscle
    inactive and should be exercised.)
     What is the count interval? How is the count increment triggered (time ie: every second?)
    My question is how could I reset the case structure to start again: i.e, If
    Case=0 and the inactive time reaches 10 and RED LED comes on, I want this to then
    turn off and put the count back to 0 if it switches to Case=1.
    Do you want the reset to occur automatically and restart?  Do you want someone to notice the RED LED?  If it resets, do you want to start again but keep the RED LED on which also indicates that the motor is running?
    (The idea is that this RED LED is representing a Vibrate motor (which I
    will output to using DAQ). The motor will switch on as the RED LED does to indicate to
    a user muscle should be exercised but I do not want the motor to be on constant, I
    need it to turn off when the muscle is exercised and then restart the count again)
    So while it is counting, if there is muscle
    movement detected, do you want the motor to stop and the RED LED to turn
    off?
    I probably haven't explained this very well but I have attached my VI.
    You forgot to attach your VI

  • Case structure greater than or less than

    Hello.
    I am having difficulty with making a case structure that if a numerical input is greater than a number it does one thing and less it does another.
    Basically how do you work with case structures that aren't boolean, specifically if a number is greater than 38 it reassigns it as 0 (multiplies by zero something like that).
    Solved!
    Go to Solution.

    http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/case_selector_values/
    Or use the boolean logic you are talking about.  If you use a greater than on your number and it is greater you will get a true and if it is not greater than it will be false.  You could even use the in range function (comparison pallete) to get a true or false.
    Or give more information about what you are trying to do.  The more info you give, the better answer you will get.  Otherwise we have to guess why you are trying to do it the way you are asking when there could be a better way.

  • Repeating case structure

    This program is supposed to recognize an input voltage of 5V and then proceed to start the vertical bar picture box moving either left or right, per the users choice. The user can also input the desired bar width, scroll speed, and cycle duration (time to get from left to right and back). I want the picture box to move left and right repeately. On frame #3 of the stacked sequence I have made a case stucture that would play the true program if the iteration for the larger for loop is even (or zero) and false if odd. When run, the program will only move left first then right and then stop completely. How do I get the case structure to consistently repeat between alternating the false and true cases?
    Thank you!!
    Attachments:
    vert rect with volt data.vi ‏1387 KB

    Chip,
    Please consider rethinking your code from scratch, the code is virtually unmanageable and full of race conditions due to overuse of local variables. It will never work as desired in its current form.
    You might also read my comment here: http://forums.ni.com/ni/board/message?board.id=170&message.id=112401&query.id=0#M112401
    Unecessary code: Once you create the image in frame 0, its content never changes. There is no need to carry the wire and rewrite the same data to a local variable of the image in subsequent frames.
    I would suggest NOT to use formula express VIs for simple operations sich as "divide by two", "2*x1*x2", etc. Since the formula is hidden it is impossible to see what is going on without clicking the express VI. Use plain wires and basic math nodes!
    Don't use value property nodes if the actual wire is right there. Just use a plain wire, eliminating the property node (property nodes pose a sever performance penalty).
    It is also very confusing to have multiple terminals with the same name (e.g. "Trial Duration (s)", etc.). You have four (!) instances of basically the same while loop, where the only difference is one diagram constant. They can all be combined into one and have the diagram constant be a function of the current "state".
    Race Conditions!!!
    As an example, lets have a look at your first FOR loop. Since several code elements are chopped up without any direct data dependency, there is no way to tell what occurs first. (LAbVIEW does NOT execute left to right!). For example, you cannot tell if "Number of Bars Drawn" (A) gets written first or one or two of its two locals (B,C) get read first.  Similarly, you cannot tell if D and E get updated before F and G get read. In a typical iteration, you'll probably get a random mix of stale and current values. There is no way to predict it.
    The insert shows an alternative implementation. Dataflow exactly determines the sequence of events and no race condition can occur.
    I am sure with very little work your code could be simplified to 10% of its current complexity. At this point we can start troubleshooting the problem you mentioned. Most likely, everything will fall into place.
    Message Edited by altenbach on 06-28-2006 01:09 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    VertRectWidth.png ‏32 KB

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

  • Case structure and dynamic data, maybe once again

    Hi there,
    I`m a beginner in Labview. I´d like to know, how to handle the attached case-structure so that the structure works with each point of the signal.
    Right know the signal is only analyzed one time.
    Thanks for your help
    Michael
    Attachments:
    prob.jpg ‏26 KB

    Thank you Lars!!
    Now it works
    Solution is given as attachment
    Attachments:
    lsg.jpg ‏46 KB

Maybe you are looking for

  • Why wont igoogle work in firefox but works fine in explorer?

    none of the features I choose in igoogle will show up when I use firefox as my browser.

  • Calling packaged procedure from a URL link

    I have created a custom APEX application the will allow us to dynamically build help screens for the pages we create with APEX. In doing this I have created a procedure within a package called "comi_help_util.show_help". This procedure uses the "htp.

  • A huge number of vendor account group

    Hi Experts, Due to our reporting requirement, we need to have huge no of account groups. Currently the count is coming close to 44 account groups. Please let us know whether that will create any issue in the system etc. Regards, Bhavesh

  • Change iweb page names

    Hi, I'm portuguese and I'm trying ou iweb to build a small website. If I create a new webpage with the name "Decoração" when I try to publish it iweb automatically creates an .html page with the name Decoração.html. When I try to view the published s

  • Safari crushing every day

    Hi there, Safari on almost all of my iMacs is crushing every day just by sitting there or when I go to print something from Safari. here is report from last crush: Process:         Safari [5879] Path:            /Applications/Safari.app/Contents/MacO