My case structure values chnged form words to numbers.

I have a case structure and the values changed to numbers, also i am not sure why it is not cycling through? any help would be appreciated.
Attachments:
version2.vi ‏121 KB

You have too many cases (167) That is a number you can't maintain.
The reason you get a numeric as datatype and not an enum is because you should change the enum into a type def control.
To do this right click the instance left of the while loop->Create control. On the control on the front panel right click->advanced->Custimize control and set the control to type-def (see attachment).
Then save this control, and use this everywhere.
But first limit you cases, or use a plain string to explain the state...
Ton
Message Edited by TonP on 10-16-2006 08:05 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Attachments:
labviewTD.PNG ‏6 KB

Similar Messages

  • How do I apply a numerical value to a word in numbers

    For example - decision maker = .75

    What is the relationship between the 'word' and the numerical value?
    If it's a mathematical relationship, your use a formula.
    If it's arbitrary, then you need a table showing the value associates with each word (or in this case, phrase).
    Formula in column B of Main:
    B2: =VLOOKUP(A,Lookup :: A:B,2)
    Filled down to B10.
    To avoid the error messages in B6 to B10, Enclose the formula in an error trap as below:
    B2: =IFERROR(VLOOKUP(A,Lookup :: A:B,2),"not found")
    This will replace the error triangle with the words 'not found'.
    Regards,
    Barry

  • 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 to manage a case structure Untill a value is reached

    Dear all,
    I am collecting data with DAQmx and after a value is reached i want to do smthg else, for this reason i created a case structure and i put to the case selector that if a value is smaller than "10" then it is true. If it is false it should stop and do what i say even if the value gets under "10 again". 
     So how can i make this: "once the value is reached then do what i say  even if  the case selector value is back to true state after a while"
    Thanks.
    Kind regards.
    Solved!
    Go to Solution.
    Attachments:
    False-CaseStructure.png ‏15 KB
    True-Case-Structure.png ‏19 KB

    You can use the shift register to make a condition so once it enters into the value greater than limit case then it will not go to the other case even if the value goes below.
    The best solution is the one you find it by yourself
    Attachments:
    Case Selector.vi ‏7 KB

  • Pass the value of the current case in a case structure to a global variable for use in VIs.

    I have built a large queued state machine (>100 cases).  In each state, I run a VI that I have created.  These VIs are usually not very different from one another.  In many cases, I could simply use the same VI over and over again.  There is only one problem with that.  None of these VIs know which case to send the program to next.  I have to change the value of the "NEXT_CASE" constants in the VI and save it under a new name to be inserted into each new case.  Now my program consists of hundreds of VIs whose only difference is the value of their "NEXT_CASE" constants.  This causes all kind of headaches when I have to insert new cases into the state machine, and it is just too much for me to deal with.
    I need to be able to use a global variable to keep track of the current case within my VIs.  I could change it from a string to a number and add or subtract from it to determine which case the program should go to next.  Since I'm usually only skipping from one case to the next (or the previous) I could use the exact same VI in most cases.  Can anyone tell me how to create a global variable that contains the value of the case in my case structure that I could use within my VIs to keep track of the current case?  Let me know if you have any questions.

    Instead of defining the next state inside the subvi, why not do it in the main vi inside each state case?  An output from the subvi could be used with a case structure to determine the next state.  Sort of like, if the subvi returns 0 then next state is State3, else if the subvi returns 1 then next state is State4.
    Message Edited by tbob on 08-19-2005 03:15 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    NextState.PNG ‏5 KB

  • 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

  • Before the selector value reach a Case structure I need to stop it until a push button is pressed. How to do?

    Before the selector value reach a Case structure I need to stop it until a push button is pressed. How to do?

    altenbach wrote:
    UliB wrote:
    simply wire your selector value through a while loop. Stop the loop with your button. After the loop stops, the value will go on to the case structure.
    Hmmmm.....
    Hello altenbach,
    roflol .
    Thank you for the link to 'A Field Guide To LabVIEW Objects - Selfish Loop'. I'll keep that in mind, when answering other questions with while loops.
    Uli

  • 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

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

  • Case structure for comparing values

    Hi,
    i just wanted to know if there is a special way to use comparison in case structures.
    I only kow how to create cases for things like if x=0 then ... if x=1 then ...
    Now I want to make it if x<0 then ... if x=0 then ... if x>0 then ...
    The only solution I found so far is creating a case structure inside a case structure.
    Is there a way to keep it all in just one case structure?
    Thanks and have a nice weekend,
    Bernie

    Case Structures are pretty flexible in how you can specify what triggers a particular case. You can specify ranges or various values per case.
    In your situation, if you specify three cases with the following values, you'll get what you want.
    '..-1' = x<0
    '0' = 0
    '1..' = x>0
    The two periods before or after a number indicate that the case should run if the value is anything less than or greater than the specified number, depending on which side of the number you place it. You can also use this to specify a range of number. '1..10' would trigger the case for any value 1 through 10. Using a comma between numbers lets you specify different non-sequencial numbers. '1,5,10' would run the case only those specified numbers.
    The same basic rules a
    lso work with text based Case Structures.
    Attached image shows the three cases you need.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Case_Range_Values.gif ‏21 KB

  • 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

  • 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

  • Why does Labview insert quotations in the case structure selector box?

    I was building a case structure with an array of strings.  So, I copied the strings from the array on the FRONT PANEL directly into the SELECTOR LABEL.  My 3 strings have the form; to me, these are 5- character strings with spaces, or 7 characters if you count the spaces as string characters 
    A, B, C   
    A, B, D
    A, B, E
    So, when I copied and pasted them directly into the selector box A, B, C appeared as "A", "B", "C" and A, B, D appeared as "A", "B", "C" and then I got an error for selector values not unique.  Why didn't it appear as "A, B, C"?
    Why did it transform the string I pasted and insert the quotation marks?  I used no quotation marks in my array.  Does the selector label interpret commas as functional characters that require quotation marks??
    Thanks,
    Dave 

    dav2010 wrote:
    I was building a case structure with an array of strings.  So, I copied the strings from the array on the FRONT PANEL directly into the SELECTOR LABEL.  My 3 strings have the form; to me, these are 5- character strings with spaces, or 7 characters if you count the spaces as string characters 
    A, B, C   
    A, B, D
    A, B, E
    So, when I copied and pasted them directly into the selector box A, B, C appeared as "A", "B", "C" and A, B, D appeared as "A", "B", "C" and then I got an error for selector values not unique.  Why didn't it appear as "A, B, C"?
    Why did it transform the string I pasted and insert the quotation marks?  I used no quotation marks in my array.  Does the selector label interpret commas as functional characters that require quotation marks??
    Thanks,
    Dave 
    Actually in CASE STRUCTURE, any frame can have multiple values as 'Case Selector value' and these are separated by a comma. Also if you choose to operate a CASE STRUCTURE using string, it will automatically prefixs & suffixs quotes (") to that string.
    But you can enter  "A, B, C" manually and it will remain as it is. But if you copy and paste A, B, C, the CASE STRUCTURE will automatically change it to "A", "B", "C".
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • How to implement Case Structure for multiple inputs to Pic Ring?

    So I have a reasonably simple program which I am almost completeed with. Basically the data of an array is read and then is indexed and a new array is created from the indexed data. And then I use Match Pattern to see if elements in the new array match certain words. And if they do then a number value is allocated to a Pic Ring at the end. And depending on the final number value the Pic Ring changes from one pic to another.
    However, I have the problem that I will be using multiple Match Pattern functions to compare elements in the final array, but I can't attach multiple Match Patterns and their subsequent logic statements to a single Pic Ring, only one. I've been trying to work this out by implementing a Case Structure or Event Structure. But the Event Structure isn't working and with the Case Structure, it is very messy with multiple True/False Case Structures inside of each other. Anyway, hopefully this all makes some sense. I'm attaching the VI program to this post. Thanks.
    Attachments:
    ArrayTest2.vi ‏495 KB
    ArrayTest2.vi ‏495 KB

    Obviously, you can only display one picture.  So then the question becomes which picture to show.  Therefore, you will have to create some sort of preference of one pattern over another.
    I would use a FOR loop so that you can loop through your available patters and their possible results.  Use the Conditional Terminal on the FOR loop so that you can stop the loop on the first match.  Then you just wire up the selected value for the ring outside of the loop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • 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

Maybe you are looking for

  • Can I create a printed calendar in iphoto with ipad.  Don't see that option.

    IPhoto used in past by others in family to create a family calendar as Xmas gift.  This year it is my job. Downloaded iPhoto for iPad from App Store. (Paid $4.99). Now can't find path to create a calendar.  Description of iPhoto includes calendar, bu

  • RCA to miniplug adaptor for coaxial cable to 5.1 speak

    I have Logitech 5. speakers with coaxial or optical digital connectivity. I already have an RCA to RCA 75ohm cable, but I need to connect to the miniplug on my Audigy 2SZ. I can't seem to get a straight answer about what sort of adaptor to use. Can I

  • How can i score some star wars ringtones?

    I downloaded the "star wars sound board" application because I wanted to have star wars ring tones and alerts, etc., on my iphone. I can't create ringtones from that application. Any suggestions on how to get star wars stuff? Hopefully free....

  • JDBC connectivity - MS Access

    hi  I am configuring jdbc sender adapter  for fetching the data from  the MS -Access  remotely.  With available  connection parameter , when I  am running java program then its running fine  but  when I am using the same driver connection information

  • PLEASE help with server-side form validation using PHP!!!

    I feel like im going round and round in circles with this, after looking into all sorts of server-side advice i've come to the conclusion that i want to validate my form using server-side validation with PHP. So my form has several drop down menu's a