How do I select different graphs to show using case structure?

Hello,
I am working on a piece of code where I am getting  data from 6 different sources (reading temperature & pH on 6 different tanks)...  I am using
1)  a case structure
2) while loop
3)  waveform chart
Now, I want to have it so, the User selects which graph he wants to see (tank 1, tank 2, tank 3, etc...).  And then, program ONLY SHOWS the graph for THAT TANK...
So I have an Event Structure with the "Tank #" control, which is supposed to change the graph that is on display.  However, right now, it is not working.
Let's say I start the program..., then I click "Tank 1"...  it graphs Tank 1...  then I click "Tank 2"...  instead of COMPLETLY CHANGING the graph, it CONTINUES to graph the data from TANK 2 on the same graph.  I.E.:   it plots points  1 - 7  from TANK 1,  then plots points 8 - 15 from TANK 2,....  on the same Graph.
I don't want that.  I want it to change the graph.   But if I put the graph in the Case Structure, it puts multiple graphs on the Front Panel...  How can I do it?
NOTE:  Ignore case 3.   And each case should be corresponding to Tank #...
Thank your for reading--
Attachments:
GraphProblem_NI forum.vi ‏3166 KB

the easy answer is that you should clear your waveform graph before sending new data to it...
It's as easy as writing an empty array to it's property node Value...
But.. 
you've got much... much more cleaning up to do.  Clearing the graph is just one thing.
Your code is unreadable.  Why do you have 3 While Loops?
What does the bottom one do?
Why are you complicating things with cluster going into the queue?  An enumerator would do the same trick.
Is this code going into a cRIO or cFieldpoint?  If not, what's up with using Shared Variables?  Are you planning to send data over the network?
Debugging this code will become a nightmare.  Scalability will be worse..
I would recommend refactoring the code while it is still manageable.

Similar Messages

  • How to programatically select different JTable cells

    Dear all,
    I need to programatically select different JTable cells.
    I have to make the inverse selection. So if the user has a table of one column and 10 rows, and selects rows 3,6,8, the inverse selection should select all the other remainig cells and deselect 3,6, and 8.
    I tried using the following but it does not work ?
    for (int i = 0; i < table.getRowCount(); i++) {
    table.changeSelection(i, 0, true, false);
    Hope someone can help.
    Regards,
    Kanita

    Dear all,
    I need to programatically select different JTable cells.
    I have to make the inverse selection. So if the user has a table of one column and 10 rows, and selects rows 3,6,8, the inverse selection should select all the other remainig cells and deselect 3,6, and 8.
    I tried using the following but it does not work ?
    for (int i = 0; i < table.getRowCount(); i++) {
    table.changeSelection(i, 0, true, false);
    Hope someone can help.
    Regards,
    Kanita

  • How can I select the existing worksheet while using OLE2 to open the template workboo

    Source:
    application:=ole2.create_obj('Excel.Application');
    workbooks:=ole2.get_obj_property(application,'Workbooks');
    args := ole2.create_arglist;
    ole2.add_arg(args, 'c:\RptTemplate.xlt');
    workbook:=ole2.invoke_obj(workbooks,'Open',args);
    ole2.destroy_arglist(args);
    worksheets:=ole2.get_obj_property(application,'Worksheets');
    args := ole2.create_arglist;
    ole2.add_arg(args, 'Sheet1');      
    worksheet     :=ole2.invoke_obj(worksheets,'Select',args);
    ole2.destroy_arglist(args);
    Problem:
    1. While executing the above code, error -305500 occurs after executing "worksheet := ole2.invoke_obj(worksheets','Select',args)". How can I select the sheet i wanted in the template ??
    2. As I refer to the forms on-line document, it stated that the ole2 programmers documentation can provide all object types and methods that can be used with the OLE2. Does any link can provided to download the specified documentation ??

    The error is probably that your Worksheets variable is actually empty. Looking at your code I think the problem is that you try and get the value of the worksheets collection from the application then you should try and get it from the Workbooks object.

  • Concat strings from different subdiagram​s of a case structures

    I am using a case structure, which has about 8-10 different case and each case has a string constant. I want to show the strings in a single indicator. Suppose if 3 cases runs first then second and then third. Then the indicator should show
    " first case
      second case
      third case"
    initially indicator should be empty then as soon as the first case runs indicator should show " first case"
    after finishing the first case when second case runs then the indicator should show
    "first case
     second case"
    and so on..Please help me.
    Solved!
    Go to Solution.

    $agar wrote:
    Here it is attached with 3 cases........
    Well, that does not look very useful. Try to scale it to 10 booleans!
    Here is a quick draft how it could be done. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ConcatenateCaseStrings.vi ‏9 KB

  • How to create selections-screens to display PO using module pool program

    All,
    I'm new to module pool programming. Can any one please provide me where to create selections screens to display existing purchase orders using the below selection criteria in thr module pool program.,
    SELECT-OPTIONS : S_LIFNR FOR EKKO-LIFNR,
                     S_BSART FOR EKKO-BSART,
                     S_BUKRS FOR EKKO-BUKRS,
                     S_WERKS FOR EKPO-WERKS OBLIGATORY,
                     S_BEDAT FOR SY-DATUM,
                     S_EINDT FOR EKET-EINDT,
                     S_EBELN FOR EKKO-EBELN,
                     S_MATNR FOR EKPO-MATNR.
    provide me step by step to do this.

    Hi,
    Thanks for the reply can you please let me know.
    How can I create the ranges
    like low and high in the selection.
    Using se51 i was able to do only one i,e
    example I need
    purchase order number----
    f4 -
    f4
    Can please tell me how to do this

  • How to pass select-options in key while using Read Statement.

    Hi SAP gurus,
    I was using a select stmt. with were clause of Select-options it was working fine,
    now my scenerio is changed i need to read an internal table
    with key of select-options....
    how to read internal table with key S_MATNR (Select-options).

    Hi,
    We can certainly do this.
    We need to loop the internal table with select-options condition.
    Example  :
    LOOP AT ITAB WHERE FIELD =  S_FIELD.
    ENDLOOP.
    This should solve your problem.
    Plz reward if useful.
    Thanks,
    Dhanashri.

  • How to record 'select' action in alv report using BDC technique

    hi guys, u r the best;)
    my question is: when u select one line in alv report, the line will be high-lighted, right? and suppose there's a button for further processing, then u can click the button to process only this line. ok now, using BDC technique, the system doesn't record the 'select' action! even i go to menu-->select all, it still doesn't work.
    or if anybody knows how to release customer expected price except t-code v.25? cuz, i'm trying to record actions in v.25.
    thx in advance, u helped me a lot.

    Hi :
       you cannot record ALV using BDC.According to ur req., after u enter data in selection screen, it goes to ALV list , there u select particular record and process further rite, say create in bck ground or foreground.
    While doing recording, in selection screen if u have any check box which displays ALV List , uncheck it and continue ur recording.
    In the bdc program u can see a field some thing like p_alvlist ' ', mark it as p_alvlist ' / '.
    If not, copy the program along with includes,  in ur  program comment all the alv part, and  call that particular FM where this selection takes place from ur main program.
    Hope this helps.
    Reward points if this is useful.
    Thx.
    Raghu

  • How do you SELECT ALL on a page (used to CTRL L-CLICK in margin then mouse over selection)?

    In Pages 4x you could hold CTRL+LEFTMOUSE while in the margin area then select multiple things on that page you were looking by mousing over them (including selecting all).  Now you have to go one item at a time to delete? Is there a work-around?

    Ghazgkull wrote:
    . ctrl+clicking in iTunes selects all.
    No, it does not. You are still incorrect.
    ctrl + click does NOT select anything.
    It checks all boxes when you ctrl click on one box.
    If you want to select a bunch of consecutive songs...
    Select one then Shift click another, This will select all items from the first selection to the last selection.
    This is just plain nutty and is normally achieved on Windows 7 using ctrl+a,
    No it doesn't
    ctrl + a selects all.
    You are not selecting anything when you check all boxes. You are sinmply checking all boxes.

  • How to export selected columns in a table using expdp of oracle10g

    Hi all..
    I have a table with 10 columns and i want to export only 4 columns(selected columns) data using expdp
    Pl. tell me if we can do this and if yes what is the syntax.
    Thanks..
    Sekhar

    That's not possible, you could use QUERY to specify where clause but not columns in select clause,
    for example,
    QUERY=employees:'"WHERE department_id > 10 AND salary > 10000"'
    you could use
    create table2export as select c1,c2,c3,c4 from tableof10columns;and export the temp table.

  • How do I select a range of numbers using IF function

    I am trying to select a name in a cell if the value of another cell is either a 5,6,7,8 or 9.  I have had success when I have just wanted numbers above 9 or below 5 by using formulas
    IF(Table 1::C3<5,T(Table 1::A3),T(Table 1::A2))
    And
    IF(Table 1::C3>9,T(Table 1::A3),T(Table 1::A2))
    But for the life of me can't get the range of numbers in between.
    I have tried including AND and OR functions in multiple ways but to no success.  I know I am overlooking some simple thing, I have tried scratching for nested if functions but no help there either, and the information file in numbers is horrendously useless.
    Please help.  I am using an ipad btw.

    This forum is generally for iPad and iOS problems. I doubt that you'll get an answer here.
    Furthermore, you don't say what app you are using. If Numbers, you should post here https://discussions.apple.com/community/app_store/iwork_for_ios
     Cheers, Tom

  • How can I select properties from dropdown lists using only the keyboard?

    Hi,
    I am using SAP Netweaver Studio and when modifying UI elements in views, I want to select the value for a property from the corresponding dropdown list in the Properties view using only the keyboard.
    When a property row is selected, "Enter" toggles to Edit mode, Alt+ArrowDown expands the list, but ArrowUp or ArrowDown directly selects the previous/next item list and changes to Selected mode.  Which key is used to navigate between the list items without selecting them immediately?
    Thanks a lot. I deal with lots of views and this would save me quite a few massage hours
    Maria
    Edited by: Maria Marinova on Feb 14, 2008 9:40 AM
    Edited by: Maria Marinova on Feb 14, 2008 9:40 AM

    Thanks Andrew. When creating an external table does it requires an access to SQL*Loader?
    CREATE TABLE dept_external (
       deptno     NUMBER(6),
       dname      VARCHAR2(20),
       loc        VARCHAR2(25)
    ORGANIZATION EXTERNAL
    (TYPE oracle_loader
    DEFAULT DIRECTORY admin
    ACCESS PARAMETERS
    RECORDS DELIMITED BY newline
    BADFILE 'ulcase1.bad'
    DISCARDFILE 'ulcase1.dis'
    LOGFILE 'ulcase1.log'
    SKIP 20
    FIELDS TERMINATED BY ","  OPTIONALLY ENCLOSED BY '"'
    deptno     INTEGER EXTERNAL(6),
    dname      CHAR(20),
    loc        CHAR(25)
    LOCATION ('ulcase1.ctl')
    REJECT LIMIT UNLIMITED;

  • How do I select a database schema to use for a sequence file?

    I have multiple database schemas on my TestStand system and when I select a sequence file I need to set the schema so the results get entered into the database correctly.
    I use a SequenceFileCallback for DatabaseOptions in my sequence file and in this I set Parameters.DatabaseOptions.DatabaseSchema.Name='xyz' where xyz is the database schema name that needs to be used. This does not work and it reports an error that it can not be loaded or the file may be corrupted. Does this feature work or do I just have an error in what I am setting this equal to?
    Solved!
    Go to Solution.

    Hi plf,
    It seems to me you are going about this the right way. The DatabaseOptions callback is called immediately before the process model fetches the schema statements based on the schema name. I was able to change the schema on the fly in the same way you are attempting (using the default sequential model and TestStand  4.1).
    Ensure you are using a schema that is defined in the Database Options Dialog (Configure»Database Options»Schemas Tab»Schemas Listbox).
    Ensure you are using the exact name of the desired schema (copy it from the Name textbox in the above Schemas Tab).
    Ensure that choosing this schema manually works when you run this sequence file (to be sure it is not corrupted).
    Check that you are using double quotation marks around the schema name, not single marks as in your post.
    Evan Prothro
    RF Systems Engineer | NI

  • How to Dynamically Display Different ViewStack component without using State?

    I have a type column in a datagrid record, when type = A, I want to display ViewStack A, when type = B, I want to display ViewStack B, any body can give me some clues? sample code is best. Thanks a lot. BTW, I don't want to use state to control them, as both ViewStacks are already within the same application state.

    hi,
    you can try something like this.....
    David.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.ListEvent;
    [Bindable] private var arr:ArrayCollection = new ArrayCollection([
    {info:"record 1", type:"A"},
    {info:"record 2", type:"B"},
    {info:"record 3", type:"A"},
    {info:"record 4", type:"B"}
    protected function dg_changeHandler(event:ListEvent):void
    if (arr[dg.selectedIndex].type=="A") tn1.visible = true else tn1.visible = false;
    tn2.visible = !tn1.visible;
    ]]>
    </mx:Script>
    <mx:DataGrid id="dg" x="279" y="239" dataProvider="{arr}" change="dg_changeHandler(event)">
    <mx:columns>
    <mx:DataGridColumn headerText="Info" dataField="info"/>
    <mx:DataGridColumn headerText="Type" dataField="type"/>
    </mx:columns>
    </mx:DataGrid>
    <mx:TabNavigator x="279" y="408" width="200" height="200" id="tn1">
    <mx:Canvas label="Tab 1" width="100%" height="100%">
    </mx:Canvas>
    </mx:TabNavigator>
    <mx:TabNavigator x="507" y="408" width="200" height="200" id="tn2">
    <mx:Canvas label="Tab 1" width="100%" height="100%">
    </mx:Canvas>
    </mx:TabNavigator>
    </mx:Application>

  • How to create an array in if/else or case structure without 0's ?

    Hello,
    I've been trying to do this for a while now.
    I only managed to think of this in three ways:
    1. (What I'm doing right now Create the array by going through a for loop, which populates the array by auto indexing. It populates with correct number if true and with a '0' if false. The idea was to delete the 0's later on in the code. This however seems highly ineffective.
    2. Make use of a shift register, which automatically adds the correct number to an array. The problem is that the array will keep growing and growing and at the very least would tremendously slow down my program. At worst, it would crash.
    So, my question is: How do I create an array that if a comparison is true, it puts the element in and if not it does nothing ?
    I've attached a PNG snippet of my code.
    Kind Regards,
    David.
    Solved!
    Go to Solution.
    Attachments:
    Get_Indices.png ‏24 KB

    Pladio wrote:
    I've been trying to do this for a while now.
    You did not explain what "this" is. Can you give some typical inputs and expected outputs? Populate your controls and indicators with typical data and make it the default efore attaching.
    Pladio wrote:
    So, my question is: How do I create an array that if a comparison is true, it puts the element in and if not it does nothing ?
    Your code show three different comparisons. Which one are you talking about.
    Pladio wrote:
    I've attached a PNG snippet of my code.
    That code makes very little sense. Why is there a shift register if the data in it never changes? What is the purpose of the inner FOR loop? Why are you creating a 2D array?
    Do you want to remove all rows where the corersponding SD is zero, for example?
    LabVIEW Champion . Do more with less code and in less time .

  • Graphing wait period in Case Structure

    I have a VI that is outputting a wave to a linear actuator. The linear actuator should engage then wait a period of time.
    Rightnowthetheprogramcurrentlyexecutestheoutput to the device butIwouldliketobeabletoseethewaitperiodonthegraph. It would be nice to have the wait period be at the new offset as well.
    I have tired to wire a local variable to the graph inside the false structure however this did graph the pause.
    The main VI is the Sinewave generating (KNS)X01 the other two are subVI's 
    Does anyone have any ideas!? 
    Thanks! 
    Attachments:
    HR percent Systolic(SubVI).vi ‏13 KB
    Amplitude and offset VI.vi ‏18 KB
    SineWaveGenerating (KNS)X01.vi ‏48 KB

    Hi kspink, 
    From your code, what I see is that it plots the waveform graph and waits. Graph is not ploted while it is waiting. I'm not sure what do mean by "butIwouldliketobeabletoseethewaitperiodonthegraph". Perhaps you could plot out in a diagram on what do you actually want to see?
    Thanks
    Warmest regards,
    Lennard.C
    Learning new things everyday...

Maybe you are looking for