Case structure no false output

Hey guys,
To start off, I am very new at Labview.  I have posted about this project before but my professor has changed the assignment slightly.
- Generate a random set of N points (x,y) between 0 and 100
- Find the closest point to each point
- Calculate the number of points with a closest point of less than D
- Graph the points with the points with a closest point of less than D clearly marked
So far I have manged to get everything done except for the last part, at least completley.  My approach was to create a case structure with < D as the requirement, if true build array if false I wanted it to do nothing, but I can't seem to do that.  I tried using a number ourside of the array size but that doesn't seem to work either.  Then I tried using a a shift register to do the same thing but had the same problem.  I could use some help if at all possible.  I have posted both codes below.  1_9 is the case structure alone and 1_10 is the shift register approach.
Attachments:
Assignment 1_10.vi ‏27 KB
Assignment 1_9.vi ‏31 KB

Not bad- monor tweaks set off with some color attached.
NOTE use BD comments. Watch your data types (point closest should be an Integer type not a double) use increment rather than adding 1. kill the iteration indicators you are outo indexing off of an array generated with the Number of Points(N) control- there is no need to write N number of times to each indicator.  why you CHOSE to cross the wires into and out of the fourth loop baffles the mind
 EDIT: the SR should be initialized with an EMPTY array I just noticed that it has 1 element. that is a bug
Jeff
Attachments:
Assignment 1_10_MOD.vi ‏26 KB

Similar Messages

  • White tunnel in a case structure at every output

    I´m working with a TCP READER in a case structure. But every output fron the case get white tunnel. What`s happening?

    A white tunnel on an output of a case structure indicates that the tunnel is unwired in at least one case. If you're using LabView 6.1 or 7, one option is to right-click on the tunnel and select Use Default If Unwired. But I prefer to wire to the output tunnels in every case: it removes any question about what value is presented to the case outputs.

  • The case structure is not working well on comaring two strings using true or false string matching VI

    I need an execution of commands after the reply from the instrument matches with the string I provided for that i used true or false string match VI on which the true string the matching command and the string is the reply from the instrument. And I put the further executionable commands in frame after frame of sequence loop in the true of the case structure. Amd finally I given all the output strings to the concatenate string to get all the replies as one loop. But when I execute the program the desired result is not available. So kindly please help me to overcome this problem.  
    Attachments:
    basic serial with changes.vi ‏24 KB

    You VI makes absolutely no sense and I would recommend you start with a few simple LabVIEW tutorials before trying to tackle this.
    What is the point of the FOR loop with 1 iteration, it might as well not even be there, same difference.
    Why is there an abort primitive in the FOR loop, this mean the program will unconditionally stop abort before any downstream code will ever go into action. The program will never get past the FOR loop.
    You created a circular data dependency and LabVIEW inserted a feedback node automatically, making things even worse. (see also)
    You need to learn about dataflow, execution order, and data dependency.
    You need to learn about the various types of tunnels (plain, autoindexing, etc.)
    There is a tremendous amount of duplicate code. Large code sections are the same, differeing only by a string. You should only have one copy of that code inside a proper state machine. Have a look at the design templates and examples that ship with LabVIEW.
    LabVIEW Champion . Do more with less code and in less time .

  • Output of case structures

    My problem is that outputs of two cases(of the same case structure) are used at the same time to get a new number.
    For example, output of case 1 times 20 plus output of case 2.
    How to implement it? Thanks.

    There is only one case active at the time, you can't have two cases at the
    same time, it would be a contradiction to the Case-structure (e.g. a Boolean
    is either true or false or unknown, but never two states at a time).
    But that's more a question of philosophy.
    I think I know what you want to do!
    You have to execute your Case-statement several times and store your several
    Case-Outputs. You should use a Case within a For oder While-Loop (For or
    While depends depends on your iteration condition: Fixed times or variable).
    Then wire the Case-Outputs to the Loop-Outputs and enable Auto-Indexing.
    Store your values in an array and scale and add the array after you have
    collected all the Case-Outputs.
    Another solution is to use a Shift-register of the While
    or For to create a
    running sum of the cases.
    Which one do you prefer ?
    Oliver Friedrich
    "haodage" schrieb im Newsbeitrag
    news:[email protected]..
    > My problem is that outputs of two cases(of the same case structure)
    > are used at the same time to get a new number.
    >
    > For example, output of case 1 times 20 plus output of case 2.
    >
    > How to implement it? Thanks.

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

  • Changing an output box in a case structure to an input box

    Hi, I have been struggling with the following problem in Labview:
    Hi, I was working on a wiring diagram in Labview and I was trying to
    wire an absolute value symbol to the right border of a case structure.
    The problem is that I get an output box (an white filled box with an
    orange border) instead of an input box (an orange filled box). How
    would I change the output box into an input box? I have tried Ray
    Kong's method, which is to add a constant and that would make the box
    solid. It worked only once but when I tried it on another output box
    it did not work. Any suggestions would be appreciated. Please
    include step by step instructions as I am still learning Labview.
    Thank you
    Muhammad Asfour

    The box type will be appropriate for what you have wired to the box.
    When you say you want an "input box", do you REALLY want an input box (ie, a
    connection bringing a value from outside of your case statement to the
    inside of your case statement) or do you mean that you want your output box
    (a connection bringing data from inside your case statement to the outside)
    to be solid orange? The output box will go solid orange when you have a
    connection from EACH case to the box. Remember that a single output box
    (usually on the right side of the case statement) must be connected to
    something in each case of your case statement. It will be filled white
    until all cases are wired.
    Write back if this isn't clear of if I have mis-understood your situation.
    Hope this hel
    ps.
    Jim
    "Muhammad Asfour" wrote in message
    news:[email protected]..
    > Hi, I have been struggling with the following problem in Labview:
    >
    >
    > Hi, I was working on a wiring diagram in Labview and I was trying to
    > wire an absolute value symbol to the right border of a case structure.
    > The problem is that I get an output box (an white filled box with an
    > orange border) instead of an input box (an orange filled box). How
    > would I change the output box into an input box? I have tried Ray
    > Kong's method, which is to add a constant and that would make the box
    > solid. It worked only once but when I tried it on another output box
    > it did not work. Any suggestions would be appreciated. Please
    > include step by step instructions as I am still learning Labview.
    >
    > Thank you
    >
    > Muhammad Asfour

  • Building a case structure with four boolean (true/false) inputs.

    I currently have two boolean inputs that I would like to use to select cases in a case structure. I would like to have four cases, each one dependent on the true/false condtions of the two booleans. If boolean 1 =true, then case 1 should be used, if boolean 2=true, then case 2 should be used, etc.
    What structure should I use to convert these boolean inputs into numeric cases?

    Or build them in to an array and "Search 1d Array".  If you are only looking for a single bool being true, this would be easier because your cases could be {0,1,2,3} instead of {1,2,4,8}

  • How do I delay 1 of many outputs exiting a case structure?

    I have a system here which is sort of a finite state machine, using digital I/O, I am monitoring a series of digital inputs which in turn form a binary number which is the input to a case structure. Depending on the binary string (number) that is read by the case structure, a particular series of boolean constants (T or F) exit through the case structure which are then used as my digital outputs (in my case they are controlling a series of relays). Basically, I have a condition where I would like one of the relays to be time delayed when switching in one direction, but not in the other. The problem is that when I do delay this bit, it also delays all of the bits coming from the case structure.
    i.e. all the relays are delayed. How can I delay just one of them?

    Well, I can't think of a really easy way. You could generate a delayed pulse on a counter output, instead of using a digital line. Otherwise you will need to keep track of the delay time in your loop somehow. The timing is only going to be as accurate (deterministic) as your loop rate, and will be operating system dependant. You may have some jitter. Attached is an example of a software delayed boolean indicator. Download both VIs.
    -Jim
    Attachments:
    delayed_relay.vi ‏30 KB
    boolean_trigger.vi ‏14 KB

  • Wiring inputs n outputs for case structure

    Hi everyone...
    I have a simple basic question...How to wired the correct tunnel for output in case structure.Because when I try to wire the build array to the case structure, It shown as white terminal....How how to make solid color terminal for output tunnel...Actually I forgot how to wire it correctly..so...I hope u guys can remind me again...thank u very much...
    Attachments:
    Cepat21.vi ‏43 KB

    Hi Altenbach...
    Thank u very much for ur
    help.I'm always make a careless mistake.thanks to u guys.Now,I'm be able to display my
    data into table something like attachment below.Actually I'm using IIOA
    to parse the value into string...something like that...
    V = 238.25 I = 23.82 P = 5676.12
    V = 237.79 I = 23.78 P = 5654.28
    V = 237.35 I = 23.74 P = 5633.54
    V = 236.94 I = 23.69 P = 5614.09
    V = 236.56 I = 23.66 P = 5596.12
    V = 236.22 I = 23.62 P = 5579.80
    V = 235.91 I = 23.59 P = 5565.29
    V = 235.64 I = 23.56 P = 5552.72
    V = 235.42 I = 23.54 P = 5542.22
    V = 235.24 I = 23.52 P = 5533.88
    V = 235.11 I = 23.51 P = 5527.78
    V = 235.03 I = 23.50 P = 5523.98
    V = 235.00 I = 23.50 P = 5522.52
    V = 235.02 I = 23.50 P = 5523.40
    V = 235.09 I = 23.51 P = 5526.62
    V = 235.21 I = 23.52 P = 5532.16
    V = 235.37 I = 23.54 P = 5539.95
    V = 235.58 I = 23.56 P = 5549.92
    V = 235.84 I = 23.58 P = 5561.99
    Then I try to convert this string into numeric or dbl coz I want to
    merge it with signal.So, it looks like complicated like u imagine.
    Now,I have one other question.refer to my vi, I have used elapsed time
    so that it will run from the start time until target time.But its only
    can be determined in seconds.So, how can I modify it with using elapsed
    time for day.I mean this prog will start on Monday for example n stop
    at wednesday.It means it will run for 3 days...thank u very much...
    Attachments:
    build table1.PNG ‏36 KB
    Cepat2122.vi ‏165 KB

  • Once I have sent an email I cant switch my case structure back to false

    This may be a stupid question because nobody else seems to have had a problem with it, so sorry if this is the case.
    Using the email Vi example provided with Labview, in a case structure, when the case structure goes true, it stays true as soon as the email vi is running, even after it has sent the email.
    Is there any way to stop it or does it need a specific timeout period?
    My very simple example is provided.
    Thanks for any help
    Alexi
    Attachments:
    mailtest[1].vi ‏28 KB

    alexi wrote:
    > This may be a stupid question because nobody else seems to have had a
    > problem with it, so sorry if this is the case.
    >
    > Using the email Vi example provided with Labview, in a case structure,
    > when the case structure goes true, it stays true as soon as the email
    > vi is running, even after it has sent the email.
    >
    > Is there any way to stop it or does it need a specific timeout period?
    > My very simple example is provided.
    Are you sure hotmail.com has an SMTP server running? I really doubt
    that. Or even if it does you may not be able to contact it, as most ISP
    block outgoing port 25 on their network to reduce problems with virus
    hyjacked boxens spamming the internet. Don't blame him, it is a very
    sensitive thing to do.
    If one of these p
    roblems occurs the Open TCP Connection function will
    timeout after 60 seconds and return with an error 56, network timeout.
    You will probably have to use the SMTP server of your ISP to send the
    messages to and this server will further send it to the correct receiver
    even if that one is on hotmail.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

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

  • I want to display strings which are in case structure ,into one text box

    hi,
    i am writing a vi, which has event structure inside that a
    case structure.
    i problem is , i have two cases,
    1) when the value is true it executes the true case, first it reads the string constant and second is the string indicator which is my out put.
    2) in the false case it does pritty much same.
    i want to display the inputs and out puts of different cases into the same text box that is one for input and one for output.
    Can some one help me.
    Solved!
    Go to Solution.

    Did u tried as Ravans suggested.
    Put the indicators outside of the case structures.  Wire across the borders of the case structure.  It creates "tunnels".
     I am not getting
    but it displays both result at a time. but i want
    to display the instruction first, to the user, so that they act
    according to the instruction and ,than i want to display the result.  
     Try this VI.
    Balaji PK (CLA)
    Ever tried. Ever failed. No matter. Try again. Fail again. Fail better
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    string display-1.vi ‏22 KB

  • Tunnel mode: indexing with a case structure

    Hello,
    I have a code like the one  attached to this message.
    I have a case structure in a while loop, and I would like to transfere some data from my case structure to outside the while loop in indexing mode tunnel.
    This is to accumulate results (or to save results) following each iteration.
    My problem:
    I dont want any value in the False case of the case !!
    How can I get rid of that? I do not want to use default value for unwired case and I dont want 0. 
    Many thanks 
    Attachments:
    Untitled 1.vi ‏9 KB

    Your VI is saved in LabVIEW 2014.  So you should have this.  Right-click on the output tunnel of the loop.  There is a tunnel mode->conditional.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Conditional Indexing Tunnel.png ‏7 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.

Maybe you are looking for

  • Overcharged and cannot seem to get it sorted

    Hi, I hope somebody can help me! In July 2010 I was overcharged on my BT Bill so I called to cancel my account and was told that I could have BT Broadband option 1 and BT anytime call package for £19 per month for 12 months if I stay with BT, I was a

  • Installing SAP IDES 4.6c with Oracle DB under Windows 2000 server

    Hi everyone. As many people, i would like to learn MM module and the only way is installing SAP IDES on my computer. I have a SAP IDES 4.6 with oracle DB and i want to install under w2k server. Is there any weblog explaining how to install it? If the

  • Email Campaign created in Muse

    Does anybody know if it is possible to get a Muse created layout into a BC email campaign. I like the idea of quickly created good looking email layouts all done in Muse and sent out using a BC campaign. If this is possible it would save me many hour

  • Repeat Spry Region problems

    First of all, I am very new to Spry in Dreamweaver, but have an effect that I know must be possible to create using the Spry Regions tools. I have a two column webpage. On the left column I want to have 3 rows of 3 thumbnail images that represent dif

  • Car Stereo, Stream Music, Take Calls - BlueNEXT Adapter. Please help.

    Hi I've just changed my car and need some help and understanding. The car has an integrated bluetooth hands free kit. My wifes samsung paired immediately, my iPhone 3G had no joy pairing. I have bought a BlueNext Bluetooth adapter from ebay. Although