Case structure issue

I can not get this case structure to run.
the error is "no case for some selector values"
Thanks in advance
tomiee
Attachments:
switch.vi ‏19 KB

You have stumped me on this one.
The VI you posted runs fine for me.
Generally speaking that message indicates that LV has not figured out what to do with all of the possible values that can be passed to a case structure. This is not the case in the VI you posted.
Please recheck what you posted and reply with more info if you still need help.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • Is there a known issue with emailing from case structures

    Hi,
    I am working on a quality control vi for data coming in as a text string. I need to be able to have the vi perform a check with the responce to the check (true or false) will cause different steps to then be performed. I was able to get the vi to perform 1 check and email out if the responce was false. When I tried to add a second check if the responce was true, the vi would run without any errors but would not email out or would only email out from the first check even if the first check passed and it was the second check that failed. This was all done without case structures. I then started using case structures with the true responce leading to other checks but the false responce leading to an email generation. For some reason even a simple one check with the email generation happening in the false case will not work. There are no errors or anything, it goes through the whole process correctly but will not send an email. Please help!!
    Tim Koles

    Hi,
    Here is the vi and the sample text file it calls for. You will of course have to change the path name. Feel free to call me if you have any other questions. Thanks
    Tim
    410-326-7259
    Attachments:
    SPLIT_WEATHER15.TXT ‏130 KB
    Weather QCexample.vi ‏63 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 put a numeric indicator into a case structure using VI scripting

    I'm using VI scripting and I'm trying to add a numeric indicator inside a case structure.  I'm able to add the case structure and the numeric indicator just fine, but as soon as I specify the case structure as the "owner" of the numeric (as opposed to the block diagram being the owner) I get error 1060.  Is there any way around this?
    Note:  The reason I am doing this is because this specific pattern (indicator in a case structure) will prevent a VI from being inlined when it is being built.  This pattern will provide no functionality in itself, it only prevents the inlining.  It is added to a larger VI which is use to initialize objects in a simulation, and there are many of them in the total simulation.  If they are inlined, it takes a VERY long time to generate the C code, and performance on this VI isn't an issue since it is performed only once at the beginning of the simulation.  The rest of the VIs do need to be inlined for performance reasons.  Therefore, I'm open to other options to prevent a VIs from being inlined if the "indicator in a case structure" cannot be performed via scripting.
    If any of this is unclear please let me know and I can clarify.  Thanks.
    Solved!
    Go to Solution.

    I now understand what you were saying about inlining a subvi.  I did as you said and made a subvi with a case structure and an indicator within it.  I use the New VI Object node to add that subvi to the slow-inlining parent VI.  Then I tried to inline it using the invoke node, but I got error 1399, which make sense.  Is this what you meant for me to do, or did I misunderstand?
    Also, I tried the ControlTerminal reference approach you mentioned earlier.  Unfortunately when I called the move method on the control terminal property and had the 0th frame of the case structure as the owner I got error 1060 again.
    I really appreciate your help.  Do you have any other thoughts?

  • Case Structure timing/ writing data to a excel

    Hi all,
    I have written a program that has the main functions of allowing the user to generate a random number between either 0-10 or 5-15 by using the labelled switch. I also have a control which can switch this function on or off. When this switch is true it will display the random number and also write this number to an excel spreadsheet every 1 second (I hope). When false this will stop displaying the number and hence not write the number to a file.
    However, I am having the following issues:
    1. Excel file is corrupt once I begin to write the generated numbers to the spreadsheet. (I am trying to write to a .xlsx file)
    2. Once I begin to try write the numbers to file, the elapsed timer only displays the time is 1second intervals rather than the full time.
    I changed the .xlsx file to a .csv file and this solved issue 1. but it only recorded one random number rather than the numbers that were generated in that time since switched on/off.
    Should I have the write to spreadsheet function in the timed case structure?
    Should the file path control be outside this case structure?
    Have I set up the write to spreadsheet VI correctly?
    If anyone could help with these issues that would be a big help.
    Thanks!
    Attachments:
    Random Number tester.vi ‏30 KB

    lneill65 wrote:
    There is still an issue with the elapsed time. Once I begin I turn the top boolean control to true, the elapsed time begins changing at the set time increment inside the case structure. Is there anyway to stop this from happening?
    Your elapsed time display is independent of the boolean switches because it is on the toplevel loop diagram. I am not sure why you place a five second wait inside the case structure if you want to write once per second.
    I am not sure why you have two sequential case structures since the calculations of the first structure is not needed unless the other case is also true. Why not place it inside the true case?
    You should also adhere to some basic coding styles. Avoid overlapping and floating objects, hidden wires, right-to-left wiring.
    If it is sufficient if the code reacts once per second, just run the loop with a 1 second wait. If you don't want to display a stale random number if the switch is off, place the indicator after the case structure.
    Here's a quick draft. Modify as needed. I probably would use an event structure, but let's keep it simple at this stage. You should also modify it so it does not try to write with an illegal path and also retain the selected path once selected. I propably would use a file dialog instead of a FP Path control.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Random Number testerMOD.vi ‏9 KB

  • Org structure issue

    Hi,
    I have a question related to an org structure issue. Let me explain by taking an example:
    The Org set up we have goes like this, let A1 be the VP of a particular division, he has a director B1 reporting to him. B1 has four different employees C1, C2, C3 and C4 reporting to her. The interesting part here is, C1 and C2 belong to a different cost center (say CC1) and C3, C4 belong to a different one (CC2). Both CC1 and CC2 are managed by B1. The tricky part is CC1 comes under the VP 'A1' while CC2 does not have any supervisior above. B1 is the final supervisor.
    The problem is, when I run the Org report to find all the employees coming under A1, C3 and C4 also show up. How to correct this?
    In our system, the org structure is driven by position of the employee and not by the cost center. However we have an relationship record (A011) in HRP1001 between the Org unit of the employee and the cost center but it does not serve the purpose because B1 is placed in one cost center CC1 and manages the other cost center CC2 too. Since she can be in one cost center at a time say CC1 there is no record pertaining to CC2 for her.
    How to resolve this? what kind of config change needs to done?
    Any leads or suggestion would be helpful.
    Thanks in advance,
    SG

    Hi,
    You can define your organization structure except the cases you have exceptional .
    For the exceptional Objects create them in Expert mode and maintain infotype 1001 depending upon the requirement.
    Warm Regards,
    Kapil Kaushal

  • Cluster value lost when leaving case structure

    Hello all,
    I am having an issue with a particular VI I am working on. (FYI this is in Labview 8.0)
    The VI is set up to run a current source, voltmeter, and thermometer and then record and graph data in various ways that are selectable by the user.
    Everything seems to be working fine except one particular graphing method. When I try to graph Current vs. Voltage, the current value is gettiing lost. Within a case structure the current and voltage are combined into a cluster and then exit the case structre to be later appended to a cluster array.
    However, the value of the cluster is being lost when the graph is set for Current vs. Voltage. Any other method and it is working properly.
    I can't seem to figure out why this is happening as it does not make much sense that the other methods of graphing work but this one doesn't when it is coded the exact same other than having different variables.
    I have attached the VI with added indicators showing that the cluster value is being lost once it exits the case structure. Any help would be much appreciated.
    Thank you very much and I apologize for my extremely messy VI.
    - Nathan Cernetic
    Solved!
    Go to Solution.
    Attachments:
    IV-RT.vi ‏185 KB

    You really need to boil this down to something we can run and reproduce the issue.
    Have you tried to break a few relevant connections and rewire? Maybe something is corrupt.
    Beside being a mess, your VI has quite a few glaring mistakes.
    Let's have a look at the structures in the upper right:
    90% of the code is the same in all three case structures, so all that needs to be inside the case structure is the small part where you built the 2D array. Everything else belongs outside the case.
    The sequence structure has no useful function.
    Why do you need to reverse the array with each iteration of the small FOR loop? Once before the loop would be enough. Right?
    Why do you use built array inside the small FOR loop, but don't autoindex at the loop boundary? All you ever get is an array with exactly one element, no matter how much the loop runs. Seems useless! (see below image for an alternative).
    You would not even need to reverse if you would use "built array" instead of "insert into array at position 0" in the central part.
    Others: You constantly hammer all your property nodes. The only need to be called when things change. Again, you have way too many instances. For example in the case structure where you are having problems, the same property nodes exist in all cases. A single instance of the property node belong outside the case and only the string constants inside each case. Whenever code is the same in all cases of a case structure, that code belongs outside!
    Message Edited by altenbach on 06-19-2009 03:39 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RubeLoopII.png ‏10 KB

  • Tab control with a case structure

    I am having trouble getting my tab control to work with case structure. I have 4 tabs that i want displayed on my front panel, each with a separate graph. When I click on any tab besides the first one there is nothing shown on the graph. I think i have some wiring issues. Any ideas?
    Attachments:
    version1.vi ‏379 KB

    See also this and this discusion. Most of the time, tab controls don't need any code.
    (You also have a couple of breakpoints (one on the entire diagram and one on the while loop). Make sure you remove them. Look for the red outlines.
    LabVIEW Champion . Do more with less code and in less time .

  • PROGRAM SLOWS DOWN WHEN IT ENTERS A CASE STRUCTURE

    OK so here is the problem i am making this pid controller the output range is 0-100  in this program i am just trying to get it to work so i  did a compair function whereby when the controller output is 0 and the constant is 0 i start a case loop which will turn the output on for one second and off for one second .   when i enter the case structure the rest of my program slows down
    i have no idea why , i have tried to make a while loop and a case structure outside my main loop but i cannot get my signal from my compair statement to enter the second loop where i get my output to cycle in 1second intervals 
    below is the VI please help
    i am still learning how to use labview by the way
    thank you
    gary
    GR
    Solved!
    Go to Solution.
    Attachments:
    TMP36working!vi.vi ‏225 KB

    gary,
    The next thing you need to learn about LabVIEW is dataflow. This is the fundamental paradigm of LV and will explain your slow down issues.
    The basic dataflow concept is that any node (node = function, subVI, structure) can begin to execute when data is present on all its inputs and that no data will be present at its outputs until the node comopletes execution.
    How does this affect your VI? The true case has a 1000 ms Wait (actually two, one in each case of the inner case structure = redundant code). The case structure will not complete execution until the wait completes. And, the while loop does not complete its iteration until the case structure completes. The result: When the PID.vi output = 0, the loop will run at 1 second per iteration.
    What is the fix? Continue running the loop at 100 ms intervals. Keep a count in the case structure (true case) and another shift register of how many 100 ms intervals have passed. When the count reaches ten, toggle the output line.  Do not use the 1000 ms Wait.
    All the code in your inner case structure is unnecessary. Wire the Remainder output directly to the Arduino Digital Write VI.
    Be careful with the comparison to zero with floating point data. If the calculation which produces the data has round off errors you might get a value like 0.573E-15, but that is not equal to zero. It is better to compare to a small range of values above and below zero.
    Right to left wiring is much easier to follow when trying to understand what a program does. Using the Clean Up tool occasionally will help (although it will eventually frustrate you also).
    Lynn
    Attachments:
    TMP36working.2.vi ‏214 KB

  • NXT case structure

    Hey Im making an nxt robot for a competition and it has to go thru two phases for the competition.  Shifting between phase 1 and 2 is controlled by a timer.  the only issue im having is how to setup multiple shift registers for my program
    Attachments:
    Group2Phase2.vi ‏16 KB

    Sorry, I don't have the NXT toolkit installed, but maybe you should move the select node outside the case structure and wire the output to the outer case selector to swrich between Phases 1 and 2.
    If you need more shift registers, just add them.
    LabVIEW Champion . Do more with less code and in less time .

  • Execute Case Structure with Button Press Slows Down VI

    Hi -
    I'm fairly new to LabView, and I am having some issues with using a button to run a timed while loop.
    I am writing a VI that outputs a timed voltage pulse to an output channel on a DAQ; meanwhile, the VI reads and graphs the voltage on three input channels on the DAQ. When I use a timed loop that automatically executes when the VI runs, the program works. However, I would like to include a button so I can control the timing and number of voltage pulses sent to the output channel, instead of sending only one voltage pulse each time the VI runs. I have tried to do this using a button wired to a case structure. If the button is 'true,' the VI should send the voltage pulse. If the button is 'false,' the VI should keep the voltage at zero.
    When the button is 'false,' the VI runs normally; however, when the button changes to 'true,' the VI slows down and never sends the pulse. Why does this happen? How can I fix it?
    Also, how can I send the voltage pulse only when the value of the button changes?  I only want the timed loop to execute once when the button changes value.
    Thanks for any help or advice!!!
    Attachments:
    Sensor Read6.vi ‏85 KB

    The graph is in the same while loop as the case structure.  The while loop won't iterate until all the code inside of it has completed.  So the graph only gets updated once, and won't update again until the while loop iterates again.  If you need more continual updating you may want to put that in a loop that executes a couple of times, or completely separate your code into 2 while loops.  Is it that long of a wait considering your pulse length is 1 second?
    Your analog output code is just writing a voltage out (7 volts) until it eventually writes out 0 volts.  There is no reason for it to drop down unless you have some sort of electrical problem between your DAQ device and the device on the other end that is reading the 7 volts.  What are you connecting that analog output too?
    What if you don't use LabVIEW and try to test out that analog output using Measurement and Automation Explorer?  Does it do the same thing?

  • Broken Arrow with Case Structure Input Selector

    Generally We get a broken arrow when a case structure 
    is wired incorrectly to its case selector .
    I found that even after this is fixed, the arrow remains broken.
    however when you click on the broken arrow, the VI 
    starts to execute instead of highlighting the error.
    Seems like a compiler Issue.
    I want to know if anyone has faced this issue.
    I am currently using LV 8.6
    Regards,
    Sundar.

    SUNDAR.N wrote:
    Generally We get a broken arrow when a case structure 
    is wired incorrectly to its case selector .
    I found that even after this is fixed, the arrow remains broken.
    however when you click on the broken arrow, the VI 
    starts to execute instead of highlighting the error.
    Seems like a compiler Issue.
    I want to know if anyone has faced this issue.
    I am currently using LV 8.6
    Regards,
    Sundar.
    I can confirm that. I HAve seen it with type defs as well as LVOOP classes.
    I have never been able to reproduce it on demand but it always seesm to be associated with situations where a type or class definition was changed. I think I have seen this issue on and off from LV 8.2 thru LV 8.6.
    Ben
    Message Edited by Ben on 07-31-2009 06:59 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How do you pass values between case structures?

    Hi,
    I have a simple vi where I am measuring voltage in a WHILE LOOP. The WHILE LOOP contains 2 case structures.  Under some measured voltages,  case 1 or case 2 will execute, and under some other voltages, neither case will execute, and the WHILE LOOP simply iterates again. 
    Case 1 and Case 2 both issue commands that are calculated using both the measured voltage and the PREVIOUS command value, using a very simple addition/subtraction sequence.  Case 1 and Case 2 are likely to execute many times before the voltage changes enough to pass into the "in between" range.  Each time either case executes, a new command is issued.  Each new command is a modification of the previous command by the addition/subtraction process.
    The two cases refer to an upper threshold and a lower threshold.voltage value.  There is also a voltage range in between the lower and upper threshold values where we do not issue any commands.  Commands are issued only when Case 1 (voltage<lower threshold) or Case 2 (voltage>upper threshold) is TRUE.
    In the case structures, the measured voltage is used to calculate a command value by adding or subtracting to the previously calculated command, where either Case 1 or Case 2 are TRUE.  The case structures do NOT use any of the voltage values measured in the "in between" range. 
    Suppose that Case 1 is executing and sending commands properly, and then, the voltage value changes to the in-between range and continues to the Case 2 range.  What I want is for the Case 2 to use the last command issued by Case 1 for the Addition/Subtraction.  Recall that many voltage values are likely to be measured in the "in between" range and none of these will result in issued commands.  How do I capture the last command from Case 1.  Of course, I want to go both directions.  A total of four differen sequences are possible:
    Case 1--> In between --> Case 2
    and
    Case 2 -->In between --> Case 1
    and
    Case 1 -->In between --> Case 1
    and
    Case 2 -->In between --> Case 2
    How do I capture that last command issued, and store it until either case becomes TRUE again, and then make the case use this command?  I don't think that a shift register will work because the "in between" range will change the value in the shift register, and I don't see how to implement a shift register with a Case structures.  Will the feedback function work for this?
    Thanks for your thoughts.
    Dave

    Action Engines probably are a good idea.
    I think the state machine in the attached vi should also be sufficient.
    Attachments:
    State Machine Example.vi ‏11 KB

  • 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

Maybe you are looking for

  • How do i import the content on my iPod touch onto my new mac

    When i connect my ipod to the computer and sync it with itunes it only transfers 31 songs out of 303. I have purchased songs as well as downloaded ones that i wish to transfer if it makes a difference.

  • Samsung galaxy nexus camera not working

    So all of a sudden my camera doesn't work. It tells me unfortunately gallery has stopped working. I went into safe mode still didn't work did a factory reset but even that failed. HELP!!

  • Playing tunes in a playlist in random order

    How does one set music in a playlist to play in random order (is that the same as 'shuffle'?) Within my various playlists I've set them all to be 'shuffle' by clicking on the shuffle button in the bottom-left of the itunes screen (the button turns bl

  • Migrating Oracle database from 8.1.6 to 8.1.7

    Hi I am having an Oracle database 8.1.6, but I need to improve this to 8.1.7 version, but at the same time, I would like to keep the existing data in the database, so please advice me how should i improve my version, or migrate to the new database or

  • Exporting AVI to DV - wont work - why?

    Hi there, Im having problems exporting about 40mins of AVI footage to DV PAL format. Im doing it using Premiere Pro CS3 on a PC with more than sufficient spec. The error message i keep getting is as follows: "Error compiling video. Cannot create or o