A quesiton about case structure

Hello
I just try to write a simple program.
e.g. I have a for loop (N = 10), if i > 5, I want to output the value into array ([6, 7, 8, 9] is what I want). But in labview I have to wire a value in the "false" case, so my output become [0, 0, 0, 0, 0, 0, 6, 7, 8, 9].
How can I solve this problem?
Many thanks,
Stephen
Attachments:
test.vi ‏17 KB

Hi Stephen,
You need to use a shift register for the array.  In the first half of the iterations, don't add anything to your array.  But once the iteration count passes your threshold, start building the iterations into the array.  I have attached a VI to this e-mail.  Notice also that I've included the logic for switching out cases directly in the case structure with the "..4" and "5.." cases.
You should check out the LabVIEW Help on shift registers...they're a little hard to understand when you first start using LabVIEW, but they are an indispensable feature when dealing with loops.  While you're at it, check out the LabVIEW Help on Case Structures to learn about other neat things like the "..4" and "5.." notation.
-D
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman
Attachments:
test.vi ‏17 KB

Similar Messages

  • Confirmation required about case structure in cursor

    Hi,
    I have been trying to use a case when structure inside a cursor in a stored procedure with regular expressions in it, but its throwing compilation error.
    The error message does seem to be irrelevant.
    Just want to know whether there is any limitation of using case when structure inside a stored procedure in a cursor.
    If no limitation like that, then will try again to debug it.
    -MD

    Manas Datta wrote:
    Hi,
    I have been trying to use a case when structure inside a cursor in a stored procedure with regular expressions in it, but its throwing compilation error.
    The error message does seem to be irrelevant. No it is not. The error message will tell you what oracle or the compiler thought what is wrong. Try to understand it.
    Just want to know whether there is any limitation of using case when structure inside a stored procedure in a cursor.
    If no limitation like that, then will try again to debug it.
    -MDBe aware that the syntax of the case statement is slightly different beween SQL and PL/SQL.

  • How about an Error Case structure with warning?

    Hi,
    while wiring some vis and thinking about error handling....
    In most cases the simple case structure feet by the error cluster will do the job. However in some cases when you deal with warnings, wouldn't it be nice to have an additional (optional) warning case that is true for a not empty source string and/or an error number?
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

    I forget to mention: Of course there is a solution possible by unbundling the cluster and check the error number and string followed by a case. I still remember the time when the case selector couldn't handle the error cluster ... (started with LV3.1 )
    I just thought it would be a nice thing when you wire the error cluster to the selector and get the red and green case and you can right click, add a case and get a yellow(?) case named 'warning'
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'
    Attachments:
    Example_BD.png ‏2 KB

  • I HAVE A QUESTION ABOUT USING CASE STRUCTURE

    Can I compute a percentage using case structure?
    In the following query below, I have been able to use CASE STRUCTURE to add to a counter when days were between 0 and 30, or when days were between 31 and 60 or when days were between 61 and 90 or when days were between 91 and 9999. I have also been able to get a GRAND TOTAL of all days between 0 and 9999. This is done in the LAST ITEM of the SELECT STATEMENT. The FIRST ITEM of the SELECT STATEMENT counts rows of records being processed. I want to take the LAST ITEM of the SELECT STATEMENT and MULTIPLY it by 100 and then DIVIDE it by the FIRST ITEM of the SELECT STATEMENT to get a percentage. I know that you can do this with numeric fields in a file but is there a way to do this in CASE STRUCTURE with calculated totals?
    SELECT
    count(distinct v.rowid) v_cnt,
    SUM(CASE WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 0 AND 30 THEN 1
    ELSE 0
    END) one_mo,
    SUM(CASE WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 31 AND 60 THEN 1
    ELSE 0
    END) two_mo,
    SUM(CASE WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 61 AND 90 THEN 1
    ELSE 0
    END) three_mo,
    SUM(CASE WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 91 AND 9999 THEN 1
    ELSE 0
    END) three_pl_mo,
    SUM(CASE WHEN(V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3)) BETWEEN 0 AND 9999 THEN 1
    ELSE 0
    END) TOT
    FROM NCOER V, NCOER_IN_ERROR NIE, NCOER_ERROR NE, ALL_CMD_VIEW ACV
    WHERE V.MIL_CMD_ASGN_CD IN ('FC')
    and v.lcl_er_form_cd = '4'
    and acv.cmd_cd = v.mil_cmd_asgn_cd
    and nvl(acv.lcl_code_stat,'N') = 'Y'
    and NVL(v.lcl_omit_from_stats_ind,'N') <> 'Y'
    AND V.PSC_CD IN ('FS10')
    AND (V.LCL_ER_RECV_DT >= '01-MAR_2007' AND V.LCL_ER_RECV_DT <= '31-MAR-2007')
    AND V.IND_SSN = NIE.IND_SSN(+)
    AND V.IND_ER_PER_END_DT = NIE.IND_ER_PER_END_DT(+)
    AND V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+)
    AND V.IND_SSN = NE.IND_SSN(+)
    AND V.IND_ER_PER_END_DT = NE.IND_ER_PER_END_DT(+)
    AND V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+)

    Solution for you:
    SELECT
    COUNT(V_CNT) PROCESS_RECORD,
    SUM(CASE WHEN(PROCESS_MONTHS) BETWEEN 0 AND 30 THEN 1
    ELSE 0
    END) ONE_MO,
    SUM(CASE WHEN(PROCESS_MONTHS) BETWEEN 31 AND 60 THEN 1
    ELSE 0
    END) TWO_MO,
    SUM(CASE WHEN(PROCESS_MONTHS) BETWEEN 61 AND 90 THEN 1
    ELSE 0
    END) THREE_MO,
    SUM(CASE WHEN(PROCESS_MONTHS) BETWEEN 91 AND 9999 THEN 1
    ELSE 0
    END) THREE_PL_MO,
    SUM(CASE WHEN(PROCESS_MONTHS) BETWEEN 0 AND 9999 THEN 1
    ELSE 0
    END) TOT,
    (SUM(CASE WHEN(PROCESS_MONTHS) BETWEEN 0 AND 9999 THEN 1
    ELSE 0
    END) *100/COUNT(V_CNT)) TOT_PER
    FROM
    (SELECT     V.ROWID V_CNT, V.LCL_ER_RECV_DT - ADD_MONTHS(V.IND_ER_PER_END_DT,3) PROCESS_MONTHS
    FROM     NCOER V, NCOER_IN_ERROR NIE, NCOER_ERROR NE, ALL_CMD_VIEW ACV
    WHERE     V.MIL_CMD_ASGN_CD IN ('FC')
    AND     V.LCL_ER_FORM_CD = '4'
    AND     ACV.CMD_CD = V.MIL_CMD_ASGN_CD
    AND     NVL(ACV.LCL_CODE_STAT,'N') = 'Y'
    AND     NVL(V.LCL_OMIT_FROM_STATS_IND,'N') <> 'Y'
    AND     V.PSC_CD IN ('FS10')
    AND     (V.LCL_ER_RECV_DT >= '01-MAR-2007' AND V.LCL_ER_RECV_DT <= '31-MAR-2007')
    AND     V.IND_SSN = NIE.IND_SSN(+)
    AND     V.IND_ER_PER_END_DT = NIE.IND_ER_PER_END_DT(+)
    AND     V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+)
    AND     V.IND_SSN = NE.IND_SSN(+)
    AND     V.IND_ER_PER_END_DT = NE.IND_ER_PER_END_DT(+)
    AND     V.LCL_ER_RECV_DT = NE.LCL_ER_RECV_DT(+) )
    Regards,
    Rajs
    www.oraclebrains.com

  • 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

  • Re: Questions about Plan structure

    Reply-To: "Duncan Kinnear" <[email protected]>
    Q. if you have an Employee class with related EmployeeSubordinate and
    EmployeeSalaryHistory classes, should these all be in the same plan?
    A It is better to have them in the same plan.It depends on the design
    you have
    Q Why should the Managers be separated from their business classes?
    A Managers are usually service objects which might require different
    resources.
    These managers when deployed might be required by several other
    applications.
    Seperating them as a different plan will help in just using one
    installed partition to be
    Used by different applications (refer about Reference Partition)
    Q If you have the Database managers separate, what scope does each DB
    manager cover?
    A It is better to have the DB managers in user scope.
    It depends on the numbers of users, u have for the system.
    Since u are talking about 100 tables. It's a huge system.
    It also depends on the user licenses u have for the backend.
    Take care that u use proper load balancing of DB Managers for the
    system.
    Krishna CVSR
    GoldStone Softech Inc
    >
    Hi there,
    We are in the middle of designing the structure of a new system.
    I have read/heard that it is best to break down the plans into the
    following categories:
    Business Classes
    Managers/Services
    Clients
    I have a few questions about this structure:
    Should related business classes be grouped together in Plans? E.g. if
    you have an Employee class with related EmployeeSubordinate and
    EmployeeSalaryHistory classes, should these all be in the same plan?
    Why should the Managers be separated from their business classes?
    E.g. if there is an EmployeeMgr service which deals with anything to do
    with the Employee business class, why separate them in different
    plans? If you need the manager to access the class, you will always
    need both.
    Some of the Forte documentation talks about "Policy" managers and
    "Database" managers. How do the functions of these managers differ
    for a simple CRUD (Create Read Update Delete) class?
    If you have the Database managers separate, what scope does each
    DB manager cover? I.e. do you have one for the entire database (over
    100 tables in our case), or do you break it down by sub-system?
    Thanks in advance for any answers.
    Cheers,
    Duncan Kinnear,
    McCarthy and Associates, Email: [email protected]
    PO Box 764, McLean Towers, Phone: +64 6 834 3360
    Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
    Providing Integrated Software to the Meat Processing Industry for over 10 years
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Reply-To: "Duncan Kinnear" <[email protected]>
    Q. if you have an Employee class with related EmployeeSubordinate and
    EmployeeSalaryHistory classes, should these all be in the same plan?
    A It is better to have them in the same plan.It depends on the design
    you have
    Q Why should the Managers be separated from their business classes?
    A Managers are usually service objects which might require different
    resources.
    These managers when deployed might be required by several other
    applications.
    Seperating them as a different plan will help in just using one
    installed partition to be
    Used by different applications (refer about Reference Partition)
    Q If you have the Database managers separate, what scope does each DB
    manager cover?
    A It is better to have the DB managers in user scope.
    It depends on the numbers of users, u have for the system.
    Since u are talking about 100 tables. It's a huge system.
    It also depends on the user licenses u have for the backend.
    Take care that u use proper load balancing of DB Managers for the
    system.
    Krishna CVSR
    GoldStone Softech Inc
    >
    Hi there,
    We are in the middle of designing the structure of a new system.
    I have read/heard that it is best to break down the plans into the
    following categories:
    Business Classes
    Managers/Services
    Clients
    I have a few questions about this structure:
    Should related business classes be grouped together in Plans? E.g. if
    you have an Employee class with related EmployeeSubordinate and
    EmployeeSalaryHistory classes, should these all be in the same plan?
    Why should the Managers be separated from their business classes?
    E.g. if there is an EmployeeMgr service which deals with anything to do
    with the Employee business class, why separate them in different
    plans? If you need the manager to access the class, you will always
    need both.
    Some of the Forte documentation talks about "Policy" managers and
    "Database" managers. How do the functions of these managers differ
    for a simple CRUD (Create Read Update Delete) class?
    If you have the Database managers separate, what scope does each
    DB manager cover? I.e. do you have one for the entire database (over
    100 tables in our case), or do you break it down by sub-system?
    Thanks in advance for any answers.
    Cheers,
    Duncan Kinnear,
    McCarthy and Associates, Email: [email protected]
    PO Box 764, McLean Towers, Phone: +64 6 834 3360
    Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
    Providing Integrated Software to the Meat Processing Industry for over 10 years
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

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

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

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

  • Case structure problem with default 0, 1, 2

    Good afternoon,
    I have a question about the case structure. If you use 3 cases, default 0, 1 and 2, like in the following VI.
    How can you fix that the sum is never 3? Because when you turn on the switch 1 and 2 simultaneously it gives the sum 3 and the case will go in the default stand.
    Thanks for the help.
    Solved!
    Go to Solution.
    Attachments:
    case_structure_question.vi ‏11 KB

    I recommend changing to using an Event Structure.  That way you react to when a switch is toggled instead of constantly polling.
    What I would do is, with the Event Structure, have a case for each switch's value change.  In the event case, you use a property node to set the Disabled property of the other switch based on the current switches value (Switch 1 goes true, so disable switch 2)
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Using local variables with a case structure

    I recently decided that I didn't want to nest a bunch of case structures for a program I am creating. I have two variables, N1 and N2, and I want to say execute Case 1 if the integer input to the terminal is less than N2. Case 2 if the integer input into the terminal is greater than N2 but less than N2+N1. Case 3, integer greater than N2 + N1, but less than N2+N1+N2. Case 4, you guessed it, Greater than N2+N1+N2, but less than N2+N1+N2+N1. When I try to type the variable name into the bar and use the ... like you do with integers it changes the variable name to a string.
    Am I just thinking of this the wrong way? I have a sensor setup in a square and I am using a matrix card hooked up to the sensor bundle to send signals from each sensor to each other sensor, but not for those along the same sides.
    Tom

    I see the nested case structures which is what I didn't want to do, but I will have to because I am tired of looking at this. Thank you for the help on this. I appreciate it.
    The sensor network is shown in the image included.  Lets say we number the sensors in a clockwise direction starting on the lower left hand corner. Each element needs to both send and recieve data to all other elements except for the one in the row it is in. So sensor 1 would sent to sensor to sensors 5 - 18. Then sensor 2 would send to 5 - 18. Sensor 5 would sent to 1 - 4 and 10 - 18. Etc.
    Lets say if this were a circular array it would be easy. Two nested while loops. And the only condition I need to worry about is that sensor N is not both sending and recieving at the same time. Each while loop, or for loop - doesn't matter, will start at 0 and go to N-1. Each i and j will have +1 added to them, and as long as they are not equal preform the data operation. 
    Just some fun logic to think about
    Tom
    Attachments:
    rectangular.jpg ‏12 KB

  • Programmatically get names of all cases in a case structure

    Hi All,
              I have a subVI that is a state diagram (controlling some test equipment), with many states (i.e. each "state" is a case of a case structure), a text string chooses the case. All cases are named.
             Within this subVI is it possible for me to programmatically retrieve the text name for each case of this case structure? I wish to be able to retrieve these strings so that the main VI will only be able to call valid states.
            I have error handling to ensure that if an invalid state is called (by using the default case) that an error will be returned to my main vi, yet I would prefer to be able to retrieve the string to prevent any typo's etc.
          Not sure if I've explained this well.
         Thanks,
        ds1
    Solved!
    Go to Solution.

    You can do it with LabVIEW scripting, however, I wouldn't leave scripting in a final application. Use a typedef enum if you don't want to worry about this. If you want to keep it as a string (remember, this is a heavily debated subject) just make sure you test all cases before making it an executable and that should suffice. If you want to check to make sure it's a valid string, this seems like a bit overkill on the error checking! Just work it out when testing, or again as was said above, use a typedef enum.
    CLA, LabVIEW Versions 2010-2013

  • Case structure is restarting at 120? should go to 167

    My case structure is restarting at 0 when it gets to case 120 instead of continuing until 167? also, how can I get my vi to execute a certain case for x amount of time, i tried the wait vi but it just wait to execute instead of executing until time is up. I would appreciate any help, thanks.
    Here is my prog.
    Attachments:
    version22.vi ‏1329 KB

    If you go to case 120 you'll notice that you did not wire the ring to the output tunnel. Thus it will get reset to zero.
    (Just right-click on the output tunnel and deselect "use defaut if unwired". Now click on the broken run arrow and search for the error about the missing tunnel assignment and double-click the error. It will get you to the error).
    Your programming style is unbelievable tedious. Why don't you follow our advice and streamline your code. Is there anything in my last example that you don't understand?
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • Windows Vista won't connect after security change

    I have an AirPort Extreme base station, to which we connect using an iMac, PowerBook G4 and a Windows Vista laptop. I used to have it set to WEP, but changed it to WPA for the increased security. After the change, my PowerBook and iMac are connecting

  • I have reset my icloud but still cant sign in , so what should i do?

    i have reset my icloud but still cant sign in , so what should i do? my iOS is 8.1.2 tq

  • How do I revert to an older version of iTunes?

    I'm running OS !0.4.8, and software update upgraded my itunes yesterday. Now, it won't open - it says I need 10.4.9. I CANT upgrade to 10.4.9, because every time I do, Airport Extreme update 2007-001, which is not compatible with 10.4.9, stops workin

  • UOM conversion get changed in PGI

    Hi, Basic UOM is BD Material Master showing 1PL = 39 BD PGI done using 643 showing 1PL = 48 BD. Any idea where should I can look for this difference? Regards,

  • Alternative to Flash HELP

    Hello, I'm new to flash and I have made a few. My question is that some browsers and OP systems do not come with a flash player installed. If I was to make a banner 950x85 or so that had company logo, and info in it what could I do if the visitor to