Encender led en un case structure

Hola, necesito que el led este encencidido cuando el case es ON y apagado cuando el case es OFF. Como lo hago? el otro case structure es true para que el boolean mande el comando.
Un saludo
¡Resuelto!
Ir a solución.
Adjuntos:
Screenshot - 25_07 005.png ‏8 KB
Screenshot - 25_07 006.png ‏17 KB
Screenshot - 25_07 007.png ‏16 KB

Hola Luko14:
Es muy simple. Solamente tienes que sacar el LED del CASE y conectarle a un Boolean constante True o False dependiendo del caso. Te adjunto figura.
Saludos... Moisés
http://www.aulamoisan.es

Similar Messages

  • Case structure back and forth from LED

    Hello, I'm trying to make a case structure switch back and forth everytime a boolean LED indicator goes off. I want case one to start when a button is pushed, switch to case two when an LED indicator goes on, then switch back to case one when that same LED goes on again, then case two the next time the light goes on, and so on. The LED is set to go on every ten seconds. So far i have the case structure in a while loop but im not sure how to get them to switch back and forth using this one LED. Any suggestions?

    Then you have two asynchronous parallel loops, and you want one of them to receive information (Boolean) from the other in order to determine its state.
    If the loop with the elapsed time contains nothing but elapsed time, then consider moving it to the first loop.
    Otherwise, you should use a form of synchronization communication, such as a Notifier or User Event, to send data from your loop with the elapsed time to your loop with the case structure.

  • 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

  • Range setting in case structure

    Hello everyone! I'm working on an engineering project where I read in a sound input and if it's on high volume, a red led connected to a MyDaq box lights up, if it's on low, the green LED lights up, and both will be off if there's no sound input. I posted a screenshot of how my vi currently looks. The problem I'm having is, I want to set the range that will be considered as the low volume, and a range considered as the high volume on my case structures. I'm not sure exactly how to do that. I currently have an "In range" function there where I set the max and min values. THe problem with this is, it outputs a dynamic data that I cannot connect to the appended array. Any help would be great. Thanks!
    Attachments:
    projecttest2.vi ‏91 KB

    Thanks for your response. I'm new to labview (which isn't really an excuse) and we just went through the real basic stuff for this course. That's why my code just looks like a mess. I'm just trying to use the case selector because I thought it'd be more efficient, since, if I think of it in written code, they're kind of like if-else statements, right? I thought I needed to multiply by a thousand because I am measuring the amplitude of sound input. Whenever I test it out, the numbers are really small. I just figured it'd be easier to multiply it by a thousand and set the range with bigger numbers. I'm also trying to get an LED to light up on a range of volume. That's why I need two comparisons. Like, if the volume is between the range of 2000 to 3000, the green LED lights up, and if it's between 1000 to 2000, then the red LED lights up. If the signal is equal to zero, then no light turns on. Anyway, I scrapped the whole idea of using case selectors because I don't have time to learn my way through it and finish on time. I attached a new version of my VI. It's a more simplified version. I don't know how to connect the LED boolean indicators into my array and into the DAQ Assistant (it's not on the vi yet but I do need one so the program knows to read the output into the LED's on my myDaq box. Sorry for the trouble! Thanks for any advice you can give. 
    Attachments:
    projecttest1.vi ‏55 KB

  • Case structure problem

    Hi Frends,
    I have attached a simple case structure program (use LabView 8.6).
    I just wonder why the LED-2 display are not same to LED-1, (they are connected together).
    Thanks for your help!!!
    Jack
    Solved!
    Go to Solution.
    Attachments:
    case-5.vi ‏21 KB

    If you want both indicators to show the same thing place them next to each other and connect to the same wire. (Of course if the are the same, there is no additional information and only one is really needed.)
    You must have something else in mind, but it is not clear what.
    Your code is overly convoluted and there are a couple of things that don't look right (for example, there is no wait in the main loop).
    Can you explain what the program is supposed to do and how to operate it?
    LabVIEW Champion . Do more with less code and in less time .

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

  • Can I use a formula node to start the execution of a case structure?

    Hi,
    I am working on editing a VI to make it much easier to understand (for colleagues and non LV users). For one reason or another, the VI's creators did not fully make use of the power of case structures and other structure types. In the application we need it for, the instrument cycles and repeats measurements on several objects. We are interested in measuring the motor currents for several motors in the system. As it stands now, for each sample object's run, there is a separate sub-vi diagram which displays its waveform trace and several indicators such as max current, time at max, etc. That code was contained within a T/F case structure and copied and pasted 20 plus times.... Obviously the vi became extrememly cluttered and needed a huge screen to see. The trigger for the current case structures is an EQUALS comparison between one input (which is the sample object counter; and this part I will likely leave unchanged since it makes a lot of sense already) and a constant which was defined 1 through 20+ for case. 
    I have since made one case structure and 20+ instances of that case and have labeled them (at the top selection box near the detent arrows) "1", "2", 3, etc. I am wondering if I can use a formula node to act as the "trigger" which sets each case structure running? I believe that a simple IF statement should work. Please see a snippet of my attempt at making this in C below.
    For the node, I defined X as the input and Y as the output. The input to the node, X, is connected to the sample object counter. The output, Y, is connected to the case selector of the case structure. My attempt at the code is below:
    int32 y
    For(x == 1)
       y = "1";
     For(x == 2)
       y = "2";
    etc, etc.
    Is that above code snippet correct? Do i need something like "ENDIF" or "end if" at the end? Does "y" have to be defined as "int32" or can it be something else?
    Thanks for the help!

    Is your formula node doing anything else besides what is shown?
    Why don't you just wire the value that is going into it at X directly into the selector of the case structure?
    Attachments:
    Example_VI_BD.png ‏2 KB

  • How can I pass data generated in a SubVI inside a Case Structure out of the Case Structure?

    Hello,
    I am using a USB 2701 to control a heater.  I have three SubVIs that are all working properly on their own.  I'd like to use an Enum to select which of the SubVIs is running at a given time.  The problem is that no data is passing out of the case structure.  How can I pass the temperatures and heater outputs acquired by the SubVIs to the main VI?  I've attached my some of my code below.  I can't attach more than 3 files, but you can see how the main VI is configured.  Like I said, the SubVIs are working individually, so you shouldn't really need to look at them.
    Thank you,
    CJones581
    Attachments:
    RampHeater6-21-07.vi ‏305 KB
    69_Heater_Case.vi ‏23 KB
    HeaterTCD6-21-07.vi ‏210 KB

    CJones,
    You might check a couple of things.
    Your HeaterTCD... VI has a While loop with a stop button condition.  HeaterTCD pass out values only when it finishes running.  If it doesn't pop open the front panel (which usually doesn't happen when running a SubVI) you could run into a stuck loop because you don't have access to the Stop button.  This could appear in the form of no data being passed out (because the SubVI never stops running).  The primary VI opens the HeaterTCD VI, starts it, and waits for the VI to finish and pass final values .
    Secondary note: Unless you want your SubVI panel (which probably isn't open when running the main VI) to update continuously, consider moving your Temperature Graph and Temperature oC indicators outside the while loop.  Pass final values to them via a tunnel, since the main VI will only read their values after the loop finishes running, anyway.
    It might help to add error management to HeaterTCD like you have for RampHeater.  If you connect error lines with Error Outs to your main VI, that will help tell if there is an error somewhere that is preventing info output.
    RampHeater SubVI has the same issue with the stop button.  It is also probably getting stuck in the While loop waiting for a manual push of that SubVI's Stop button.
    An easy way to test this would be to set up a logic circuit so that when the While loop iteration counter reaches a certain number, it registers True and sends it to the conditional.  I know this isn't what you want to do long-term, but if that lets your SubVI return outputs it means that the SubVI was just never stopping.
    Hope that helps.
    David C, Applications Engineering
    David C
    Applications Engineering

  • 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

  • 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

  • How can i use a string as a control for case structure?

    my vi is reading data. the output is a string,how can a string can control the case structure? because the there's a constructed vi in that case structure that wll perform a tast after the main vi read.
    Thank You
    (Can you please give me a simple example how can do this)

    Try this vi. You shouldn't have any problems just connecting a string to the case selector.
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor
    Attachments:
    string_to_control_case_structure.vi ‏10 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

  • How to get a case structure to execute only once in a loop

    I have a while loop that is monitoring temperature. Once the temperature meets or exceeds a given setpoint I want to start a timer. At this point I don't want to monitor the temperature anymore. That is, if the temperature should drop below the setpoint, I don't want to execute the case structure again when the temperture meets or exceeds the setpoint(the temp may oscillate about the setpoint for a given period of time). In any event, I need the case structure to execute only one time, not every iteration of the loop.

    You can put a local Boolean variable "Flag" inside that case structure and
    set "Flag" to False. Outside the case structure, use an "AND" function
    output to control the case structure. The "AND" function has two inputs. One
    goes to the comparison results between real temp and setpoint. The other
    inputs connects to the "Flag" variable. In this way, once you entered that
    case structure, the "Flag" will be turned to False, and then in next
    iteration, you won't get into the case again because the "AND" function will
    be False as your "Flag" is False now.
    Hope this helps.
    Rentian
    1. Inside the case structure, put a
    "BB Herman" wrote in message
    news:[email protected]..
    >I have a while loop that is monitori
    ng temperature. Once the
    > temperature meets or exceeds a given setpoint I want to start a timer.
    > At this point I don't want to monitor the temperature anymore. That
    > is, if the temperature should drop below the setpoint, I don't want to
    > execute the case structure again when the temperture meets or exceeds
    > the setpoint(the temp may oscillate about the setpoint for a given
    > period of time). In any event, I need the case structure to execute
    > only one time, not every iteration of the loop.

  • Possible to do this with case structure?

    Essentially I want the case structure to do: If case1 = run OR case2 = run, do this, else do case3++
    I'm using a string case structure right now, where for example, the inputs could be SWEEP_A or SWEEP_B but I want the case structure to use case SWEEPAorB. This is so I can have different names for the input string BUT run the same case (this is to avoid redundant code for what I'm doing).
    Thanks.

    For more complex logic use can use create a boolean array and convert it to a number.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

Maybe you are looking for

  • Asset PO/GR

    HI, For Asset PO, after GR (101 or 105) in PO PO history tab the amount in LC is not showing.  Is this normal or is their any problem?  Kindly advise. Thanks and regads,

  • Change the User ID running the SunOne Directory Server 6.3 on Windows 2003

    Hi Experts, I have an install of SunOne Directory Server Enterprise edition 6.3 running on Windows 2003 server. It was installed using the Zip distribution and is running as a user ID in the Active Directory the server is part of. We are trying to ch

  • Best practice to create users - Hybrid scenario

    I would like to know what is the best practice for creating new users in a Hybrid scenario with all mailboxes hosted and no mailboxes on-premise. Currently when creating a new user we go to our local EMC and create a 'New Remote Mailbox'.  This creat

  • Mainframe adapter support for FOCUS apps

    Does the WebLogic Mainframe Adapter support mainframe FOCUS applications? What about clists? Thanks Glen

  • Phantom Files in iTunes Movie Sync Page

    Hi I seem to have a few movies shown available to sync up to both my iPad and iPhone in the sync movies page in iTunes, however I can't locate them anywhere on my Macbook. They are really old files that I once had synced to a previous iPhone and they