Subvi execution/closing

Hi all,
I'm currently working on a project using LV7.1 that invloves the use of multiple subvi's linked back to the top level VI, acting as a main menu screen. However, I am running into a spot of bother when attempting to close a particular subvi panel/block diagram when no longer required and then to return to the top level VI without stopping the program completely.   
I have developed a method of achieving this within the subvi by wiring a true constant from inside a case of a state machine i'm using, to the conditional terminal  outside of the case (but within the while loop). This seems to work ok, but on occasion it can cause the subvi to freeze so that no buttons on the FP can be pressed. Is there any other means of achieving this same result without getting too complicated (as I'm a fairly inexperienced programmer in comparison to some of you folks on here)?
I've set the FP to 'show when called' and 'close afterwards'  using the subvi node setup panel on the top level VI and to 'run when opened' using the vi properties panel.
Could it be that my inexperience here is leading to bad practice which is causing it to run less well?
I've attached some screen shots of my program in the word doc, with some description of what it is I'm actually trying to achieve.
Hope you can help!
Regards,
Kevin
Solved!
Go to Solution.
Attachments:
SubVI structure.doc ‏198 KB

Yamaeda wrote:
Beautiful, what a difference.
I can see one issue and one improvement:
Issue:
Begin X test -> Read DI -> Check X -> ... Message dispatcher through Default. You only check if you're at end position once. You'll need to queue up Message+Read X again. (assuming you want to be able to handle event in the mean time) To not get stuck at event wait you'll need a timeout on the event structure.
Improvement:
Local variables are frowned upon, as you can do without them 80% of the time. Move the controls inside their events and skip the DataCopies (since a LV local /= C++ local)
Setting the tab control through a property is unnecessary, use a local, it's alot faster.
(Not that speed is an issue at this point, but as a general rule the only time you set a value through a property is if you only got a reference to work with)
/Y
Issue:
Begin X test -> Read DI -> Check X -> ... Message dispatcher through Default. You only check if you're at end position once. You'll need to queue up Message+Read X again. (assuming you want to be able to handle event in the mean time) To not get stuck at event wait you'll need a timeout on the event structure.
I was not sure of the exact execution of the program. It can easily be changed.
Improvement:
Local variables are frowned upon, as you can do without them 80% of the time. Move the controls inside their events and skip the DataCopies (since a LV local /= C++ local)
Setting the tab control through a property is unnecessary, use a local, it's alot faster.
(Not that speed is an issue at this point, but as a general rule the only time you set a value through a property is if you only got a reference to work with)
I used local variables here to show concept. I would have used a cluster array to keep up with what is going on. If you use a local variable I have had trouble with it not setting the tab control in the past unless I used the property node.
Tim
Johnson Controls
Holland Michigan

Similar Messages

  • Control subvi execution order

    I have a test program with 2 subVIs and the first one simply creates a text file and writes a large string to it, the second one writes another string to the same file and then closes it. Is there a way to set execution order as the subVI that writes and then closes the file seems to be executing first. The subVis are independent from each other. Thanks.

    No.  Just wire the error out of the first VI to the error in of the second VI.
    When you switch from a text-based language to LV, the hardest thing to realize is that the position on the diagram has essentially nothing to do with the order of execution.  The dataflow concept is very powerful but quite foreign to text programming.  The core point is that any node (function, subVI, structure,...) may begin to execute when data is present at ALL of its inputs.  Similarly, the node's outputs are not available until the node completes its execution.
    Lynn

  • SubVI not closing properly

    Hi,
    I'm new to Labview so please bear with me. I'm calling a subvi in my main vi and when I close it using the "X" button the main vi freezes. However, if I hault the exceution of the subvi using the red button (which I know shouldnt be done for standard practice), the main vi completes execution. I'm definitely doing something wrong, I just can't seem to figure it out. I've attached the vi's. Any ideas?
    Attachments:
    main.vi ‏41 KB
    24xx Swp-I Meas-V gpib.llb ‏422 KB

    Your problem is that the subVI is still actually running.  What needs to happen is your event structure in the 2400 swI Linear Stain MeasV - LED.vi needs to handle the <This VI>anel Close event.  You can just add that event to the event case handling the Quit button's value change event.  This way, when you close the panel, the code knows to run the cleanup and finish the state machine.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Open excel sheet by sheet name .... subvi not closing

    Hi all,
    I am experimenting with excel and labview and I want to open an excel sheet by its name.  I have created a project with a main vi where I hit a button to start the process.
    When this button gets hit an event handler opens my subvi that actually asks for a file, then scans all the sheet names and then in this subvi I have another subvi that pops up and gets this sheet names.  When I hit OK this one should close and the first subvi should continue.  This all works fine and I am able to read the preferred sheet name but the subvi that asks for sheet name to read does not close.  When I run this subvi by itself then it closes when I hit ok.
    I have added the whole project here so if anybody could have a look at it and tell me what I am doing wrong I would appreciate it.
    Thanks
    Lieven
    Solved!
    Go to Solution.
    Attachments:
    EXCELPROFILE.vi ‏48 KB
    Choose Excel Sheet.vi ‏30 KB
    Main VI.vi ‏20 KB

    Ok .... I've found the problem thanks to another post on the forum.  I changed the window appearance to dialog which solved the problem.
    Lieven

  • Subvi execution issue after building .exe

    Hi all,
    I've seen a lot related to this topic but haven't found anything specific to my situation.
    I built a simple wrapper to launch different subvi's depending on if it is saturday or not.
    The vi works perfectly fine as a vi in LV2012. But when I build the application, both cases execute-that is, both subvi front panels appear and i get a message warning me that I can't run multiple instances of the same subvi.
    I expect it to execute either the true or false case and open the correct subvi once and be done with it. Not sure why both cases try to execute more than once only after I build the application. Ideas?
    Solved!
    Go to Solution.
    Attachments:
    wrapper.png ‏15 KB

    ben64 wrote:
    To begin with, you will never get a TRUE (Sat) output because you wired 3 to the offset input of the String Subset function. It should be wired to the length input.
    None of this can explain the observed behavior, mo matter how buggy the comparison is.  Only one of the cases will execute. It is never possible that "both cases execute" as described.
    What is the exact error message? Can you attach the full toplevel VI? What else is in there?
    Once you build an application, the toplevel VI will run when opened, of course. Is this handled correctly in the code?
    Can you attach the full project, including the build specs?
    LabVIEW Champion . Do more with less code and in less time .

  • Closing subvi with a button?

    Hi all,
    i have a question here. Well i needs to put in a button in my subvi front panel so that when the button is clicked, the subvi will closed.
    i needs the subvi to actually save the data during runtime in a configuration file. fyi the 'OK' button is for saving it.
    attached is my program.
    Attachments:
    newUImotor.vi ‏37 KB

    Dear nyp,
    Thank you for contacting National Instruments.
    To address your question, instead of placing a FALSE constant to the STOP of the outermost while loop, include constants in every case of your case statement. This way whatever happens in the case structure determines whether or not the VI closes.
    Include a button in your Menu for closing your program (EXIT). Add another case (3) to account for this button. Inside this case, have a True constant wired out to STOP. From every other case, make sure to wire a False constant to STOP. If you fail to wire constants from all cases, the program will not compile without an error.
    I've included the VI you sent with the new ability to close it.
    Let me know if you have any further questions or
    if this does not resolve your issue.
    Thanks again and have a great day!
    Chad AE
    Applications Engineer - National Instruments
    Attachments:
    Stopping_Sub_VI.vi ‏40 KB

  • Implement my own timeout to abort subVI

    I need to abort a subVI without closing the main program after a certain amount of time. I tried dynamically opening the subVI using the "call by reference node" VI, and invoking the method "abort VI" on that VI refnum, but that doesn't work--my program remains stuck in the execution of the subVI. Can anyone help me solve this problem?

    Thanks Jim and Waldemar. The subVI I'm trying to make a timeout for is serial port read, and I don't think it's running around in an infinite loop--I think it's freezing when it encounters a problem reading from the port. I tried to follow Waldemar's suggestion, and call the serial port read VI using invoke nodes, but now I've run into more trouble. When I use an invode node to "Run VI", I get "error 1000: the VI is not in a state compatible with this operation". What do I have to change to get the run method to work? I've attached a file that tries to do this with an infinite loop simulating the subVI I'm trying to abort.
    Attachments:
    infinite_loop.vi ‏19 KB
    njdmain.vi ‏47 KB

  • Main VI stops fucntioning after i open and close a subvi from an event structrue.

    Hi,
    I am trying to open a pop up vi from an event. I have been struggling with this for a while now. When i open a pop up vi and close it, the main vi stops running properly.
    I have narrowed it down to the fact that the event which calls the subvi never finishes when the subvi is closed.
    The attached image is an example of what I am currently doing. When I run this, i never see the dialog box that says 'here'
    maybe useful as a hint to the problem...
    This does work properly if I run the vi, click to open the subvi, close the subvi, (here the main vi is not working properly, cant click anything)  then stop the main vi, run the main vi again, open and close the subvi, and then i see the 'here' dialog, and my main vi functions properly.
    thanks
    J
    Solved!
    Go to Solution.

    What is actually happening is you hit the Ok button and your panel closes and you set the Stop 2 to True.  Ok, that is fine except for the fact that the Stop 2 terminal has already been read during that iteration of the loop.  So the loop will go again.  This time is has read the Stop 2 at a TRUE, but the event structure needs an event before the loop can complete.  But the front panel has been closed already and you are stuck.
    As Dennis said, get rid of the Stop 2 and just wire the TRUE constant straight out of the event case.  Wire a FALSE for all of the other event cases.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Main vi and sub vi execution

    I am struggling a lot with my Main vi and Subvi execution problems a lot !
    I have a complicated system. To explain it, I create a simple main vi and 2 subvis. Please have a look at the attachment.
    It is working as expected. The boolean button in the main vi is active when the subvi-s are not running. But while the sub vis are running I can not access the boolean button. I understand why it is happening. The execution is stuck in the subvi and can not see any new input in the main vi.
    My question is how can I solve this?
    What I want is,
    1. When the subvi is running, I still want the boolean button in the main vi to behave in the same way as compared to when the subvi is not running.
    2. I should also be able to run the 2nd subvi when the 1st subvi is still running.
    Please help me out (I am using Labview 2010.)
    Solved!
    Go to Solution.
    Attachments:
    main.vi ‏12 KB
    sub.vi ‏14 KB
    sub2.vi ‏15 KB

    Oh sorry, I thought I saved them to LV2010 but I guess I accidentally recompiled them to latest version.. Attached VI's for 2010.
    Seems I cannot edit my previous post so forgive me for sending VI's twice and if any moderators happen to see this, feel free to remove the VI's in previous message..
    Attachments:
    main.vi ‏23 KB
    sub.vi ‏24 KB
    sub2.vi ‏25 KB

  • How do I get values into a vi from a subvi while the subvi is still running within the vi?

    Hello
    This is my problem. I have a subvi that runs an experiment. At different point in the experiment different instruments are on or off and I have a boolean array display this info. It is updated at various points of the experiment via a local variable. That works fine. Here is the problem though. I run that subvi from a main vi program (that runs it several times for several experiment cycles). I would like to pass the status of that array onto the mainvi to display there too. The problem is that the array in the main vi is not updated until the subvi is done running and thus displays only the array status at end of experiment (instead of changing
    as the status changes within the subvi). I tried using a global variable to write to it in the subvi every time there is an update, and read from it in the mainvi, but that doesn't work, it still displays just the status at the end of the subvi execution. Does anyone know how to make this work, or if there is a workaround this? Thanks.

    If you have LabVIEW 6i, you can update indicators of a calling VI from
    a SubVI, while the subVI is running.
    In your case you need
    1) an indicator on the main VI panel to display the boolean array
    2) to pass a reference to that indicator to the subvi when you call it
    3) to use this reference in the subVI, connect a property node to it and
    write the values to be displayed to the 'value' property of this node
    If you don't have version 6, you can write the values to be displayed to
    a global and display this global in the main VI from within a while loop
    which must run in the main VI in parallel to the running subVI.
    It's more complicated, since you need a mechanism to gracefully shut
    down the while loop after subVI finishes. You could do this with
    another global control boolean which is not displayed but just connected
    to the repeat terminal of the while loop. Don't forget to put a 'Wait' of,
    say, 50...100 msec in that while loop.
    -Franz
    zkajan schrieb:
    > Hello
    > This is my problem. I have a subvi that runs an experiment. At
    > different point in the experiment different instruments are on or off
    > and I have a boolean array display this info. It is updated at
    > various points of the experiment via a local variable. That works
    > fine. Here is the problem though. I run that subvi from a main vi
    > program (that runs it several times for several experiment cycles). I
    > would like to pass the status of that array onto the mainvi to display
    > there too. The problem is that the array in the main vi is not
    > updated until the subvi is done running and thus displays only the
    > array status at end of experiment (instead of changing as the status
    > changes within the subvi). I tried using a global variable to write
    > to it in the subvi every time there is an update, and read from it in
    > the mainvi, but that doesn't work, it still displays just the status
    > at the end of the subvi execution. Does anyone know how to make this
    > work, or if there is a workaround this? Thanks.
    Franz Josef Ahlers
    Section Semiconductor Devices
    Physikalisch-Technische Bundesanstalt
    Bundesallee 100
    D-38116 Braunschweig
    phone: (+49) 531 592 2410
    fax: (+49) 531 592 2405

  • How to operate main vi with active subVI dialog?

    Hey all,
    I'm currently working on a user interface for a test facility. On the main screen you have all the data you want to see at a blink. However for a more detailed view I'd like to make pop up windows showing the details while still being able to control the mainVI.
    I tried using a subVI with window appearance set to "Dialog Box", but this blocks the mainVI until the subVI is closed. Is there a way to have a subvi pop up like a dialog box, but without it blocking the main VI?
    Thanks in advance.
    Solved!
    Go to Solution.
    Attachments:
    ui_forum.PNG ‏100 KB

    Hey GerdW, thanks for the quick reply!
    It didn't fix my problem though. I still can't use the controls on the mainVI like that.
    I'm calling the subVI through an event value change of the button. Button is set to switch when released. Could it be that this is blocking it? (I would'nt see how, but who am I )
    I've attached a picture and the subVI.
    Attachments:
    setup.PNG ‏33 KB
    Details_A.vi ‏19 KB

  • Instantaneous Output to MainVI from Currently Running SubVI

    My mainVI calls a subVI which outputs a value based on the given input. I want the output from the subVI to update in my mainVI instantaneously as the subVI is running. Currenlty the output in my mainVI arrives only after the subVI has completed execution. I need to have instantaneous output from subVI in my mainVI so that way I can use that instantaneous value to do other calcuations. 
    I tried using reference as the output, but even with that method the output only arrives at the end of the subVI execution. 
    Attachments:
    mainVI.vi ‏13 KB
    subVI.vi ‏14 KB

    Your VIs are a mess and full of race conditions and beginner mistakes. Many code parts don't make a lot of sense.
    If you read and write to local variables (e.g. the done?" boolean), you need to ensure that it is set to FALSE before the loop starts and the code has a chance to read the potentially stale value. Else you get race conditions. (LabVIEW does not execute left-to-right, execution order is only determined by dataflow).
    Incrementing in a loop is better done with shift registers instead of hordes of local variables.
    Here's a simplified and corrected version. See if it does what you want. Modify as needed. There are many improvements possible.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    subVI_MOD.vi ‏14 KB
    mainVI_MOD.vi ‏12 KB

  • Algorithm comparison FLOPS

    Hi Everybody,
    Is there a method to compare two algorithms in Labview(v.7) when it comes to their floating point calculations or number of FLOPS?
    I am looking to compare two algorithm (roughly),  something like FLOPS command in Matlab if any. I know one way for performance comparison might be comparing their looped execution time. But any FLOPS alike command ?
    Thanks

    Hed wrote:
    FLOPS is just the number of floating point operations.
    The more common definition is "FLoating point Operations Per Second", comparing different hardware with the same algorithm.
    http://en.wikipedia.org/wiki/FLOPS
    (You seem to be using the plural definition of FLOP, which is not as common, comparing the number of operations needed to perform a certain task, irrespecitve of hardware).
    Both definitions are not really useful to compare two algorithms in LabVIEW. The only thing you should do is compare the timed performance between the two algorithms. Be aware that even the same algorithm can be implemented more or less efficient, depending on the skill and knowledge of the programmer. Make yourself a small bechmarking operation as a three-frame flat sequence. Make sure that nothing can run in parallel with the middle frame. Pure coding cosiderations such as "inplaceness" and avoidance of extra datacopes are crucial for very efficient code.
    Take a tick count in each edge frame and place your code in the middle. If it is a fast code, put it in a loop for a few million iterations. Take the difference in tick count and divide it by the number of iterations, convert to seconds, and display it in SI units e.g. 45u (=45microseconds) per loop.
    Watch out for constant folding. If your loop is folded into a constant, you might get false ultrafast readings. If you have LabVIEW 8.5, try the new inplace structure.
    If you are dealing with variable size arrays, measure the speed as a function of array size: Is the execution time linear with N, with NlogN, with N*N, etc. How is the memory use? Plot log(time) vs. log(size). What is the slope of the curve? Are there any breaks? (e.g. when you exceed the cache size or when you start swapping).
    If you are running on a multipurose OS (e.g. windows, mac, linux), there are many other things running at any given time, so the speed will have some variations. Some people are tempted to e.g. take the average, while the fastest speed is probably a better measure of true speed.
    You can norrow the variation by raising the priority of the subVI (careful!). If the computation is within a subVI, you should make sure that the front panel of the subVI is closed. Often, you gain speed by disabling debugging.
    If you have multiple CPUs/cores, watch the task manager? Are both being used? Code optimized for multicore might have a slight penalty on a single code system.
    LabVIEW RT has much tighter controls on execution and you can debug down to the clock tick using the execution trace toolkit(http://sine.ni.com/nips/cds/view/p/lang/en/nid/13746). I am not familiar with RT, though.
    Anyway, I am curious what kind of algorithms you are trying to test. Maybe it is of general interest. You could even start an informal "coding callenge" to tap into the collective wisdom of the forum members.
    For some ideas, here is a link to the coding challenge archive: http://zone.ni.com/devzone/cda/tut/p/id/5174
    LabVIEW Champion . Do more with less code and in less time .

  • Script not working in SharePoint content editor webpart

    Hi All,
    <html>
    <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script language="javascript" type="text/javascript">
    $(document).ready(function () {
    //Call your function here like
    //retrieveListItems();
    ExecuteOrDelayUntilScriptLoaded(retrieveListItems, "SP.js");
    var siteUrl = '/vceo/PMO/EPMO/';
    var close1 = ''; var close2 = ''; var high = ''; var low = ''; var medium = ''; var lowMedium = ''; var mediumHigh = '';
    var open1 = ''; var open2 = ''; var high1 = ''; var low1 = ''; var medium1 = ''; var lowMedium1 = ''; var mediumHigh1 = '';
    var count = 0; var count1 = 0;
    var initiate = 0; var planning = 0; var execution = 0; var closing = 0;
    var sumMinimal = 0; var sumModerate = 0; var sumCritical = 0; var sumSevere = 0;
    var sumHighlyLikely = 0; var sumLikely = 0; var sumSomewhat = 0; var sumUnlikely = 0;
    var sumBudget = 0; var sumCommitted = 0; var sumConsumption = 0;
    function retrieveListItems() {
    alert("Welcome to Dashboard");
    var clientContext = new SP.ClientContext(siteUrl); alert("site url");
    var oList = clientContext.get_web().get_lists().getByTitle('Project Issues and Risks');
    var oList1 = clientContext.get_web().get_lists().getByTitle('Project');
    var oList2 = clientContext.get_web().get_lists().getByTitle('Risk Impact');
    var oList3 = clientContext.get_web().get_lists().getByTitle('Risk Probability'); alert("get by title");
    var camlQuery = new SP.CamlQuery(); var camlQuery1 = new SP.CamlQuery(); var camlQuery2 = new SP.CamlQuery(); var camlQuery3 = new SP.CamlQuery(); var camlQuery4 = new SP.CamlQuery(); var camlQuery5 = new SP.CamlQuery(); var camlQuery6 = new SP.CamlQuery();
    camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Issue</Value></Eq></Where></Query></View>');
    camlQuery1.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Project_x0020_Issue_x0020_Status" /><Value Type="Choice">Risk</Value></Eq></Where></Query></View>');
    camlQuery2.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Open</Value></Eq></Where></Query></View>');
    camlQuery3.set_viewXml('<View><Query><Where><Eq><FieldRef Name="Overall_x0020_Status" /><Value Type="Choice">Closed</Value></Eq></Where></Query></View>');
    camlQuery4.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery5.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    camlQuery6.set_viewXml('<View><Query><Where><IsNotNull><FieldRef Name="Project_x0020_Code" /></IsNotNull></Where></Query></View>');
    this.collListItem = oList.getItems(camlQuery); this.collListItem1 = oList.getItems(camlQuery1); this.collListItem2 = oList1.getItems(camlQuery2); this.collListItem3 = oList1.getItems(camlQuery3);
    this.collListItem4 = oList2.getItems(camlQuery4); this.collListItem5 = oList3.getItems(camlQuery5); this.collListItem6 = oList1.getItems(camlQuery6);
    clientContext.load(collListItem); clientContext.load(collListItem1); clientContext.load(collListItem2); clientContext.load(collListItem3); clientContext.load(collListItem4); clientContext.load(collListItem5); clientContext.load(collListItem6);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
    alert("retrieve list");
    function onQuerySucceeded(sender, args) {
    alert("succeed");
    var listItemEnumerator = collListItem.getEnumerator(); var listItemEnumerator1 = collListItem1.getEnumerator(); var listItemEnumerator2 = collListItem2.getEnumerator();
    var listItemEnumerator3 = collListItem3.getEnumerator(); var listItemEnumerator4 = collListItem4.getEnumerator(); var listItemEnumerator5 = collListItem5.getEnumerator(); var listItemEnumerator6 = collListItem6.getEnumerator();
    var sumClose = 0; var sumClose1 = 0; var sumHigh = 0; var sumMedium = 0; var sumLow = 0; var sumLowMedium = 0; var sumMediumHigh = 0;
    var sumOpen = 0; var sumOpen1 = 0; var sumHigh1 = 0; var sumMedium1 = 0; var sumLow1 = 0; var sumLowMedium1 = 0; var sumMediumHigh1 = 0;
    while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); sumClose += oListItem.get_item('Close'); sumOpen += oListItem.get_item('Open'); sumHigh += oListItem.get_item('High'); sumMedium += oListItem.get_item('Medium'); sumLow += oListItem.get_item('Low'); sumLowMedium += oListItem.get_item('LowMedium'); sumMediumHigh += oListItem.get_item('MediumHigh'); }
    while (listItemEnumerator1.moveNext()) { var oListItem1 = listItemEnumerator1.get_current(); sumClose1 += oListItem1.get_item('Close'); sumOpen1 += oListItem1.get_item('Open'); sumHigh1 += oListItem1.get_item('High'); sumMedium1 += oListItem1.get_item('Medium'); sumLow1 += oListItem1.get_item('Low'); sumLowMedium1 += oListItem1.get_item('LowMedium'); sumMediumHigh1 += oListItem1.get_item('MediumHigh'); }
    while (listItemEnumerator4.moveNext()) { var oListItem4 = listItemEnumerator4.get_current(); sumMinimal += oListItem4.get_item('Minimal'); sumModerate += oListItem4.get_item('Moderate'); sumSevere += oListItem4.get_item('Severe'); sumCritical += oListItem4.get_item('Critical'); }
    while (listItemEnumerator5.moveNext()) { var oListItem5 = listItemEnumerator5.get_current(); sumUnlikely += oListItem5.get_item('Unlikely'); sumSomewhat += oListItem5.get_item('Somewhat'); sumLikely += oListItem5.get_item('Likely'); sumHighlyLikely += oListItem5.get_item('HighlyLikely'); }
    while (listItemEnumerator6.moveNext()) { var oListItem6 = listItemEnumerator6.get_current(); sumBudget += oListItem6.get_item('Project_x0020_Budget_x0020_Amoun'); sumCommitted += oListItem6.get_item('Committed_x0020_Budget'); }
    count = this.collListItem2.get_count();
    count1 = this.collListItem3.get_count();
    while (listItemEnumerator2.moveNext()) {
    var oListItem2 = listItemEnumerator2.get_current();
    var stat = oListItem2.get_item('Project_x0020_Status');
    if (stat == "Intiation") {
    initiate = initiate + 1
    if (stat == "Planning") {
    planning = planning + 1
    if (stat == "Execution") {
    execution = execution + 1
    if (stat == "Closing") {
    closing = closing + 1
    //alert("initiate" + initiate); alert("planning" + planning); alert("execution" + execution); alert("closing" + closing);
    //alert("countOpen" + count); alert("closed:" + count1);
    window.close1 = sumClose; window.close2 = sumClose1; window.high = sumHigh; window.low = sumLow; window.medium = sumMedium; window.mediumHigh = sumMediumHigh; window.lowMedium = sumLowMedium;
    window.open1 = sumOpen; window.open2 = sumOpen1; window.high1 = sumHigh1; window.low1 = sumLow1; window.medium1 = sumMedium1; window.mediumHigh1 = sumMediumHigh1; window.lowMedium1 = sumLowMedium1;
    drawChart();
    function onQueryFailed(sender, args) { alert('Request failed.. ' + args.get_message() + '\n' + args.get_stackTrace()); }
    google.load("visualization", "1", { packages: ["corechart"] });
    function drawChart() {
    var data = google.visualization.arrayToDataTable([['Task', 'Issues'], ['Close', window.close1], ['Open', window.open1]]);
    var data1 = google.visualization.arrayToDataTable([['Task', 'Risks'], ['Close', window.close2], ['Open', window.open2]]);
    var data2 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high, window.mediumHigh, window.medium, window.lowMedium, window.low]]);
    var data3 = google.visualization.arrayToDataTable([['Program', 'High', 'Medium-High', 'Medium', 'Low-Medium', 'Low'], ['Category', window.high1, window.mediumHigh1, window.medium1, window.lowMedium1, window.low1]]);
    var data4 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Closed', count1], ['Open', count]]);
    var data5 = google.visualization.arrayToDataTable([['Project', 'Status'], ['Initiation', initiate], ['Planning', planning], ['Execution', execution], ['Closing', closing]]);
    var data6 = google.visualization.arrayToDataTable([['Program', 'Impact'], ['Minimal', sumMinimal], ['Moderate', sumModerate], ['Severe', sumSevere], ['Critical', sumCritical]]);
    var data7 = google.visualization.arrayToDataTable([['Program', 'Probability'], ['Highly Likely/Probable(76%-100%)', sumHighlyLikely], ['Likely(51%-76%)', sumLikely], ['Somewhat Likely(26%-50%)', sumSomewhat], ['Unlikely/Improbable(0%-25%)', sumUnlikely]]);
    var data8 = google.visualization.arrayToDataTable([['Project', 'Budget'], ['Approved', sumBudget], ['Committed', sumCommitted]]);
    var options = { title: 'Program Issues', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options1 = { title: 'Program Risks', width: 200, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options2 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options3 = { width: 200, height: 200, legend: { position: 'top', maxLines: 3 }, bar: { groupWidth: '25%' }, isStacked: true, vAxis: { title: 'Open', titleTextStyle: { color: 'red' } } };
    var options4 = { title: 'Project Status', width: 225, height: 300, legend: 'bottom', pieSliceText: 'value', pieStartAngle: 180, };
    var options5 = { width: 175, height: 200, legend: { position: 'top', maxLines: 10 }, pieSliceText: 'value', };
    var options6 = { title: 'Program Risk Impact', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options7 = { title: 'Program Risk Probable', width: 300, height: 300, legend: 'right', pieSliceText: 'value', };
    var options8 = { title: 'Project Budget', width: 300, height: 300, legend: 'bottom', pieSliceText: 'value', };
    var chart = new google.visualization.PieChart(document.getElementById('chart_div3'));
    chart.draw(data, options);
    var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));
    chart1.draw(data1, options1);
    var chart2 = new google.visualization.ColumnChart(document.getElementById('chart_div1'));
    chart2.draw(data2, options2);
    var chart3 = new google.visualization.ColumnChart(document.getElementById('chart_div2'));
    chart3.draw(data3, options3);
    var chart4 = new google.visualization.PieChart(document.getElementById('chart_div4'));
    chart4.draw(data4, options4);
    var chart5 = new google.visualization.PieChart(document.getElementById('chart_div5'));
    chart5.draw(data5, options5);
    var chart6 = new google.visualization.PieChart(document.getElementById('chart_div6'));
    chart6.draw(data6, options6);
    var chart7 = new google.visualization.PieChart(document.getElementById('chart_div7'));
    chart7.draw(data7, options7);
    var chart8 = new google.visualization.ColumnChart(document.getElementById('chart_div8'));
    chart8.draw(data8, options8);
    </script>
    </head>
    <body>
    <table >
    <tbody>
    <tr>
    <td id="chart_div8" colspan="2" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div4" style="border-bottom:ridge;border-left:ridge;border-top:ridge"></td>
    <td id="chart_div5" style="border-bottom:ridge;border-right:ridge;border-top:ridge"></td>
    </tr>
    <tr>
    <td id="chart_div" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div2" style="border-bottom:ridge;"></td>
    <td id="chart_div3" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div1" style="border-bottom:ridge;border-right:ridge""></td>
    </tr>
    <tr>
    <td id="chart_div6" colspan="2" style="border-bottom:ridge;border-left:ridge;"></td>
    <td id="chart_div7" colspan="2" style="border-bottom:ridge;border-left:ridge;border-right:ridge"></td>
    </tr>
    </tbody>
    </table>
    </body>
    </html>
    This content editor webpart not working in sharepoint page. Once I checked out to the page then chart is working. When i checkedin function not get called. How to fix this?
    THanks in advance!

    In SharePoint 2013, sp.js and sp.runtime.js does not load on the page in published mode. You need to explicitly load these files. You can check using IE developer tools in the Script section that in published mode these files are missing.
    In order to fix this issue explictly refer these two js files on your page.
    <script type="text/javascript" src="_layouts/15/sp.runtime.js"></script>
    <script type="text/javascript" src="_layouts/15/sp.js"></script>
    Geetanjali Arora | My blogs |

  • How to pass realtime data from a sub vi to a calling vi?

    I'm trying to pass some data from a called (sub) vi to the calling vi,
    while the sub vi is running. I've tried passing to a global, but the
    calling vi doesn't show the results until the sub vi has completed
    execution. I understand why this is happening, I'd like a method, if
    one exists, to work around it.
    Thanks!
    Bill

    You've done several things incorrectly. First, the subVI has a while loop that terminates with a front panel Boolean. Since you don't make the front panel of the subVI visible, the subVI just runs with no way to stop it. When you call a subVI, execution passes to the subVI and the calling VI is paused. Since the subVI has no way to stop and return to the main, the while loop in the main is not running and reading the global variable. If you were to drag the subVI outside the while loop, then you would see the global update. You still would need to make the subVI visible in order to be able to press it's stop button. Of course, with the subVI visible, it's front panel is showing the value getting updated and there's no reason to have a global in the main anyway.
    If you want to have a subVI remain hidden, you can't use a while loop with a front panel control that's needed to stop it. Well, you can but that gets kind of complicated. If you do have a subVI and want to update an indictor with a global, the reading of the globabl should be done in a separate while loop. To keep the update in the same loop, don't use a global. You can create a reference to a front panel indicator and pass that to the subVI. The subVI writes to the value property. Here's a real simple example of that in 7.0.
    Attachments:
    Reference.llb ‏23 KB

Maybe you are looking for

  • Why is iCal suddenly trying to use an old email address?

    In the last month or so iCal keeps sending all of my alerts to an old email address. None of my alerts are set to be sent via email, much less the defunct account. This is happening at the same time that Mail refuses to send and displays the wrong co

  • Read images from a jar file?

    Hello, I'm converting a 6i app to 10g. This app does a ton of read_image_file() calls to change GIF images on the screen based on user actions. In 6i the images are all stored on the local hard drive. The images are not icons for buttons, but images

  • Ldb selection screen pnp.

    hi experts, i am using ldb pnp. i would explain my problem through an example: suppose i enter , cmpny code:1000 personal area/subarea/cost center: 14000002*                    "GET pernr" statement returns 13 personal numbers and executes code for p

  • Apex 2.0 - using a list entry shall not generate a report

    Hello ALL, how can I avoid that when I click a list entry in my list area (which will lead in a new page) that the new page will be rendered but the report shall first start after a user click on a "run-report" button. The point is that every time I

  • Can someone explain what all the Virtualbox modules do?

    I see these modules: vboxdrv, vboxguest, vboxnetadp, vboxnetflt, vboxpci, vboxsf, and vboxvideo I know vboxdrv is required, obviously, but I'm having trouble finding documentation about the other modules. vboxnetflt and vboxnetadp are obviously netwo