Case structure help

Rusty with labview and need help.
Each value (13 total) from an array is selected one at a time to form part of a command which is sent to test equipment.
The first frame of the stacked sequence structure should execute all of the array values then move to frame 2. 
Note: The only difference in each frame is a value of a channel card, channel "1"  is selected first then channel "2" is selected in the second frame.
My problem is the frame doesn't execute all the values in the first frame before moving to frame 2.  
If there is a simpler way of doing what I am trying to do please let me know.
Mike 
Attachments:
test 71.vi ‏66 KB

I am planning to expand the test capability of my first test program I created in LabView a few years ago. Back then it was my first shot using LabView so my final version of this test program became a monster. I have a chose to start from scratch and put together a new, more creative and mainly more efficient program or modify the beast of a program I already have. I'm not sure what direction to go right now. I am not an expert using LabView by no means; this is basically my first and last test program I created. This test program does the following:
I push the start button on the front panel
LabView commands the data switch (34970) to output a logic high to switch a multi-channel RF relay. This relay is a one in, 12 out coaxial relay with 12 logic terminals for switching the relay.
So, one at a time the relay switches in and out depending on the logic line selected from LV (array). Each of the twelve coaxial outputs from the relay is connected to the device under test (DUT). The RF input port of the relay is connected to a network analyzer (also under the command of LV) to measure VSWR. 
When all connected and test program is running, each of the 12 DUT's are measured at room temperature. Then the temp chamber (not under command of LV but running in auto mode) goes to 100 deg and soaks for one hour.
After one hour all 12 DUT's are re-measured. The process is repeated when the temp chamber goes cold.
There are 15 temperature cycles total. At the end of each half cycle data or VSWR is measured and stored as a *.png file within the network analyzer.
m

Similar Messages

  • Case structure help needed~

    Hi guys, i am running into some problem trying to output multiple data source into one single indicator, i have attached a screen shot of my schematic below. let's to refer to it...
    i need to run the big case structure after condition is met, but once it is met it will also need to check for certain condition, like '21' and '31' (i have many more) and display whatever constant that is to be displayed, but after i wired it up, it says wire connects to a undirected tunnel. is there is way to wire this sort of logic? i already tried it for quite sometimes, but still couldn't get it to work...
    Thanks in advance for all your help~
    Attachments:
    error9.JPG ‏63 KB

    Simmy,
    1st) Please do not use variables if not really neccessary
    2nd) Think of the wires in LabVIEW just like wires in electronics. Connecting two sources lead to a short. In your case, the short is not obvious since LV didn't typify the outputtunnel from the lower case structure.... which is strange to me, but for usage just as bad as a short....If you like to create a string "21" out of "2" and "1", you have to concatenate the two strings "2" and "1".
    hope this helps,
    Norbert
    Message Edited by Norbert B on 08-01-2008 02:18 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Need help with case structures- please help :)

    Hey all.
    I'm currently trying to program a infrared furnace. I'm setting a temperature, subtracted my set temperature from the actual temperature (thermocouple hooked up to SCB-68), and voltage is being sent to the controller of the furnace accordingly. However, I need to hold the set temperature for a certain amount of time. I need help programming this: when the VI reads the set temperature from the thermocouple, it results in a timer running down. When the timer runs down to 0, the While Loop ends. I'm thinking case structures is most appropriate, but if you have a better suggestion, please let me know.
    Thanks

    You should probably implement a state machine.
    The state machine would keep track of the temperature and making ajustments on a timely basis.
    There is a template of a state machine is you select under the File menu > New > From Template.
    You can also look under Help > Find Example > and do a search for state machine.
    There are lots of state machine examples on this forum, some of which may be quite useful.
    RayR

  • Help with case structure

    In the VI that i'm enclosing, i have used a boolean array of two booleans to operate two case structures. Inside the case structure, when the boolean is true the shift register value is to be incremented once.The difference between the two incremented values is taken as count. I am facing two problems, firstly, the increment takes place continously instead of just once every time the boolean is true, secondly, the count switches to zero when the switch is turned back to false.
    Thanks in advance.
    Attachments:
    New.vi ‏11 KB

    Try something like this.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    NewMODCA.vi ‏8 KB

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

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

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

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

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

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

  • How can I have multiple inputs into the selector terminal of a case structure

    Hi everyone
    I have a question on how to wire multiple inputs in to the selector terminal of a case structure. 
    Currently, I have three switches, each switch determines different case. So if I switch the switch 1 is on, the numeric indicator will show 1. If the switch 2 is on, the numeric indicator will show 2, so on and so forth. However, the selector terminal will not allow me to wire multiply inputs into the case structure, I tried Bundle by Name, Bundle and Array to Cluster, but they did not work. I set the case structure with 3 cases, they are 1, 2 and 3.
    Could someone help me please. I have attach an image and the VI of the work I did so far.
    I have another question, is there a function which can toggle other switches to off when there is a switch has been toggled on.
    Thank you very much
    Tommy
    Attachments:
    Trial - Case Structure.vi ‏7 KB

    Tommy, attached find a cheeseball way of doing this that has given me a LOT of mileage over the years.  IT lends itself nicely to a couple of really good practices that NI recommend, but I have given you the bare-bones to "see under the hood".  
    The recommended practices:
    1. You can make this a nice tight sub-vi where you can put it into a core library of routines that you'll use over the years, even extending the logic to look only for changes, etc.
    2.  If you are thinking about Front Panel design considerations, you'll want to use arrays of controls where possible, as that's a nice neat way of containerizing your switch for both the FP and Block Diagram.
    Have fun.  I have TONS of these types of things, so feel free to PM me if you have any other needs.
    Wes
    Wes Ramm, Cyth UK
    CLD, CPLI
    Attachments:
    Boolean Switch Logic.vi ‏11 KB

  • How do i output multiple arrays from a case structure to create one larger array

    I currently have a vi that has one hardware input that i needed to take a measurement then be moved and take a similar measurement at a different point.  To accomplish this i used a while loop inside a case structure.  The while loop takes the measurement  and finds the numbers i need while the case structure is changed per the new measurement location.  I want to take the data points i have created in each case and output them into a single table.  I assumed to do this the best way would be to get the data from each case into its own built array and build a larger array but I cant get the information out of the case structure so that it all inputs at different places.
    thanks for your help
    Attachments:
    Array.vi ‏30 KB

    Hi Ross,
    attached you will find a solution for your table building problem.
    I would suggest thinking about program design - having the same case content in several cases doesn't make sense. I also would not want my user to press several stop buttons depending on choosen measurement...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Array.vi ‏45 KB

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

  • Resetting a Case structure

    I am writing a VI that reads in a signal to a comparator and sends the
    output
    to a
    case structure.
    The ides behind the project is EMG (monitoring muscle active/inactive
    times).
    The case structure is as follows:
    If 1: count up and if count reaches 10 then green LED on (represents muscle
    active)
    If 0: count up and if count reaches 10 then red LED on (represents muscle
    inactive
    and should be exercised.)
    My question is how could I reset the case structure to start again: i.e, If
    Case=0
    and the inactive time reaches 10 and RED LED comes on, I want this to then
    turn
    off
    and put the count back to 0 if it switches to Case=1.
    (The idea is that this RED LED is representing a Vibrate motor (which I
    will
    output
    to using DAQ) . The motor will switch on as the RED LED does to indicate to
    a
    user
    muscle should be exercised but I do not want the motor to be on constant, I
    need it
    to turn off when the muscle is exercised and then restart the count again)
    I probably haven't explained this very well but I have attached my VI.
    Any help would be appreciated
    Solved!
    Go to Solution.

    PinkLady4128 wrote:
    The case structure is as follows:
    If 1: count up and if count reaches 10 then green LED on (represents muscle
    active)
    If 0: count up and if count reaches 10 then red LED on (represents muscle
    inactive and should be exercised.)
     What is the count interval? How is the count increment triggered (time ie: every second?)
    My question is how could I reset the case structure to start again: i.e, If
    Case=0 and the inactive time reaches 10 and RED LED comes on, I want this to then
    turn off and put the count back to 0 if it switches to Case=1.
    Do you want the reset to occur automatically and restart?  Do you want someone to notice the RED LED?  If it resets, do you want to start again but keep the RED LED on which also indicates that the motor is running?
    (The idea is that this RED LED is representing a Vibrate motor (which I
    will output to using DAQ). The motor will switch on as the RED LED does to indicate to
    a user muscle should be exercised but I do not want the motor to be on constant, I
    need it to turn off when the muscle is exercised and then restart the count again)
    So while it is counting, if there is muscle
    movement detected, do you want the motor to stop and the RED LED to turn
    off?
    I probably haven't explained this very well but I have attached my VI.
    You forgot to attach your VI

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

  • Problem with a case structure

    I have the following problem:
    I want that the structure from the TRUE case of the bigger case structure to start only when I switch from the button and activate the TRUE position. I observed with the probe tool that the structure is still executed in backgroun even if the bigger case is on FALSE. I want to make it start from the first position (the default case) of the inner case structure whenever I will switch from the button. I hope I made myself cleared. Thanks
    Solved!
    Go to Solution.
    Attachments:
    Untitled 3.vi ‏77 KB

    Hi maryus,
    your observation (or better assumption) is wrong.
    As long as you set your button to FALSE the inner case structure in the TRUE case is not executed!
    But: when you switch to TRUE case you wired the loop iterator to the inner case selector. So the inner case structure is not starting with it's first case but with the case corresponding to loop iteration count!
    You can see all this by using execution highlighting!
    Btw. when you have several cases in a case structure you can combine them to one case. It's all explained in the context help of the case structure! So you can combine cases (1, 3,4,6) and (2,5,7) into just one case each…
    Edit: Damn, Christian was faster (with same conclusions)…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Transfering a case structure to event structure

    Hi, I am trying to transfer case structures that are currently set up to a control that if on prompt the user where to save and then save all following files to that location till end of program and if off the do nothing. I would like to enable these to be switched on and off at any point and know to use an event structure. The problem is I am new to coding with an event structure and have been able to get the button to work but not continuously save. I attached a screen shot of the original case structure and was wondering if someone could show me how to change it to the event structure format with the same functionality. I'm getting a little lost and confused. Thanks!
    Attachments:
    alltruecases.jpg ‏534 KB

    I can't attach the vi due to the size and I do not think a simplified piece of code is going to help. I did however go through and stitch two jpegs together of the main two sequences. hopefully this gives a better idea of what I am trying to do and where to go from here. thank you.
    Attachments:
    1.jpg ‏669 KB
    2.jpg ‏317 KB

  • 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

Maybe you are looking for

  • Unable to access public ip from branch vpn (Cisco ASA 5510 Firewall)

                       Hi, As per the above diagram in Head office -  able to access public ips In Branch office - unable to access public ips only accessing head office servers and internet is shared from head office. please see the below configuration

  • Need BAPI for uploading "Qty in Delivery Note" in MIGO

    Hi All, Please find the details of my requirement as below : Goto T-code MIGO and select goods receipt for a PO , here under material Item tab there is a field as "Qty in Delivery Note" under Quantity tab. I need to update this field using my BAPI. I

  • My CS6 files will not open in CS4

    I own the CS4 creative suite, and for a period over the last few years have been using CS6 from school.  Now that my License has expired for cs6 my files wont open in cs4 at all.  Is there a way to retrieve them with out having to buy cs6?

  • My iPad is possessed or something close to it.

    My iPad is possessed or something close to it. It types by itself. Starts email and iMessages on its own, switches between apps and scrolls up and down. It's freaky to watch and I cant get anything done because it switches to other things on its own.

  • Just bought panasonic hdc sd60 but software not for imacs!

    What is best way to import videos from the camcorder into imac? Will my imovie 09 be ok for this task? Any help with previous experience would be appreciated.