Problem using local variable in event loop

I have a state machine from which I want to monitor various controls, including "Start" and "Stop" buttons.  Not every state needs to monitor the controls.  At present, most states run timed loops.  In the first state that reads the front panel, I have an Event structure (inside a While loop) that monitors the various controls' Change Value events.  For numeric controls, I update variables (in shift registers) as needed.  The "Start" button is used to end the While loop controlling the Event structure, allowing the State to exit to the next state.
My problem comes in subsequent states that employ this same idea.  Here, I put a Local Variable bound to the Start button and use the same code, but it frequently happens that when I enter this particular state, I cannot "turn on" the control -- I push the button, but it stays off.  Curiously, if it was On when I enter, I can turn it off, but then I'm stuck not being able to turn it on.
I mocked up a very simply routine that illustrates this.  There are two sequences (corresponding to the two states).  Both use an Event loop with a local variable bound to my Stop button (really this is an LED control with custom colors).  I've deliberately moved the "initialization" (the declaration of the control in the block diagram) out of the Event loops -- putting it inside the first loop modifies the behavior in another strange way.
Here's my thinking on how I would expect this to work:  The code outside Event Loop 1 should have little effect.  Assume the Stop button is initially Off.  You will "sit" in Event Loop 1 until you push the Stop button, changing its value to True; this value will be passed out of the Event case and cause the first While loop to exit.  You now enter the second sequence.  As I understand the Exit tunnel, it defaults to "False", so I'd expect to stay in the second Event loop until I turn the Stop button from On to Off, which will pass out a False, and keep me in the While for one more button push.  However, this doesn't happen -- I immediately exit, as though the "True" value of the Stop local variable is being seen and recognized by the Event loop (even though it hasn't changed, at least not in the context of this second loop).
An even more curious thing occurs if I start this routine with the Stop button turned on.  Now I start in my Event loop waiting for a change, but this time the change will be from On to Off, which won't cause an exit from the frame.  This will be reflected by having the While loop count increment.  We should now be in the state of the example above, i.e. in an Event loop waiting for the control to be pushed again, and turned On.  However, clicking the control has no effect -- I cannot get it to "turn on".
Where am I going astray in my thinking?  What is it about this method of doing things that violates the Labview paradigm?  As far as I can tell, what I'm doing is "legal", and I don't see the flaw in my reasoning, above (of course not -- otherwise I'd have fixed it myself!).  Note that because I'm using local variables inside Event loops (and I'm doing this because there are two places in my code where I want to do such testing), the Stop control is not latching (as required).  Is there something that gets triggered/set when one reads a latched control?  Do I need to do this "manually" using my local variable?
I'll try to attach the simple VI that illustrates this behavior.
Bob Schor
Attachments:
Simple Stop Conundrum.vi ‏14 KB

altenbach wrote:
Ravens Fan wrote:
NEVER have multiple event structures that share the same events. 
Actually, that's OK.  NOT OK is having multiple event structures in the same sequence structure.
See also: http://forums.ni.com/ni/board/message?board.id=170&message.id=278981#M278981
That's interesting.  I had always thought I read more messages discouraging such a thing rather than saying it was okay.  Your link lead me to another thread with this message. http://forums.ni.com/ni/board/message?board.id=170&message.id=245793#M245793.  Now that thread was mainly concentrating on registered user events which would be a different, but related animal. 
So if you have 2 event structures they each have their own event queue?  So if you have a common event, one structure pulls it off its event queue and it does not affect the other structure's event queue?  I guess the inherent problem with this particular VI was that the second event structure locked the front panel.  Since the code never got to that 2nd event structure because the  first loop never stopped because the change was from true to false.  After reading your post and the others, I did some experimentation and turned off the Lock front panel on the 2nd structure, and that prevented the lockup of the program.
Overall, the example VI still shows problems with the architecture and I think your answer should put the original poster on the right track.  I think as a rule I would probably never put the same event in multiple structures, I feel there are better ways to communicate the same event between different parts of a program,  but I learned something by reading your reply and about how the event structures work in the background.  Thanks.

Similar Messages

  • How to use local variables to pass an image mask correctly

    I'm kind of new to labview but i'll try to explain the problem as best as i can: I'm trying to pass an image mask (basically an image) to the next iteration of a while loop using local variables. I think the image passes through the loop with the local variable but i can't read from it correctly for some reason. And I don't think the problem has to do with local variables because i've tried using shift registers and that didnt work either. I think the problem is that you need to do something to read the image correctly again, like using IMAQ copy or something (that didnt work tho), but i can't figure out what the problem is. Does anyone know what the problem is? I know this isnt a great explanation and if its too confusing i could send some snapshots of the program or something. Any help would be greatly appreciated though.
    Thanks,
    Will

    So i attached 2 snapshots of the program to give a better idea of the problem. The first snapshot shows an image getting written to the local variable SavedMask. The second snapshot, which is run on the next iteration of a while loop, shows the local variable SavedMask being read to other image operations. When i run the program, the SavedMask image is always displayed correctly on the front panel, but i can't read from it for whatever reason. I think the problem could be like you said, that im only passing an imaq reference, and i think theres a certain way to extract the image data. Do you know the correct way to extract the image data or how to pass the image data and not just a reference to the data.
    Attachments:
    first.jpg ‏81 KB
    second.jpg ‏68 KB

  • Possible to use local variables in Calculation Manager

    Hi,
    I'm using calculation manager in EPMA for the first time. Have not found any function for using "local variables", i.e. variables that can be used for fixing on the current members a user has selected in a form. Do someone know if it is possible to use that functionality in calculation manager? And in that case, how do I find it?
    Thanks!
    Regards
    Mats

    Hi,
    I guess you are referring to local variables in Essbase Administration Console. When you are in calculation manager (System View), you can go to Tools->Variables. There you can create variables at application, database (global) or business rule level (local variable). You can use these in Business rules by placing the name in curly bracket {...}.
    The usage of the variables in the forms is the same as before.
    If however, what you meant to say by local variables is substitution variables, yes you can use them in Calc manager the same way you use in calc script.
    Cheers,
    Alp

  • Can I use a variable across events?

    Hi there,
    SDK newbe! I'm successfully parsing an GroupWise WebAccess event log.
    At the beginning of each days log is a line with the server name and IP
    address. Subsequent events only have the date/time and event message.
    How can I capture the name and IP of the sever and then use it for
    SourceIP and SourceHostName for all the other subsequent events?
    if (this.s_RXBufferString.search(/^.*?IP Address: (\w+) \((.+)\)/) !=
    -1) {
    /^.*?IP Address: (\w+) \((.+)\)/.exec(this.s_RXBufferString);
    var InitSrvr = RegExp.$1;
    var InitSrvrIP = RegExp.$2;
    this.evt = "Test_IP_Variable";
    this.bm = this.s_RXBufferString;
    this.sip = InitSrvrIP; //This does work
    this.shn = InitSrvr; //This does work
    this.sun = ("KirkWasHere " + InitSrvr);
    instance.SEND_EVENT = true;
    return true;
    // give the following a try. $1-$3 are mm-dd-yy, $4-$6 are hh-mm-ss,
    else if (this.s_RXBufferString.search(/(\d{2})-(\d{2})-(\d{2})
    (\d{2})\d{2})\d{2}) (Login failed): (\S+)/) != -1) {
    /(\d{2})-(\d{2})-(\d{2}) (\d{2})\d{2})\d{2}) (Login failed):
    (\S+)/.exec(this.s_RXBufferString);
    this.evt = RegExp.$7;
    this.sun = RegExp.$8;
    this.sip = InitSrvrIP; //This does not work?
    this.shn = InitSrvr; //This does not work?
    this.bm = this.s_RXBufferString;
    this.sev = "3";
    instance.SEND_EVENT = true;
    return true;
    kmaule
    kmaule's Profile: https://forums.netiq.com/member.php?userid=306
    View this thread: https://forums.netiq.com/showthread.php?t=46902

    kmaule,
    First, ARGH! Why can't systems create audit data? Or if just logging
    data, why can't they do something sensible like have a date in there like
    everything else? *sigh*
    Okay, I feel better now. I have not tried either of the following ideas,
    but I want to share them so you can figure them out and hopefully post
    back their feasibility. I'm hoping to have time to test this next week,
    but who knows with how things have been lately... busy busy. Here are the
    two ideas:
    1. Collector development has the idea of a 'Session' object which is made
    to span across two events. This is useful when you need to link two
    original events to create one Sentinel events, such as with OES and
    filesystem auditing; in that case the OES system sends three lines per
    filesystem event and Sentinel must group them to create one Sentinel
    event. Similarly, eDirectory object-create events are actually two events
    (object create without object class, and add-value with the object class)
    that become one in Sentinel (eDir auditing is just THAT lost-level...
    crazy) and also LDAP events from eDir consist of the LDAP Request event
    and the LDAP Response event. Session objects make this possible, but they
    are meant to exist for a short period of time (I think usually one second
    or so, though they have a customizable timeout as I recall) and are meant
    to be created and then used when other conditions are satisfied. My hope
    is hat you can abuse this functionality to store a variable between events
    and then nuke the old session object when a new date comes through. More
    on sessions:
    http://www.novell.com/developer/plug..._sessions.html As I
    read more about this I think it's not going to be as possible as I
    thought. Hmmmm
    2. Set a variable on the collector object somehow, and I mean in-memory,
    not in the hard-coded plugin or something. I need to get the debugger
    going to see how this could work, but the problem with your local
    variables is that they're local variables, so they do not persist when the
    current variable scope (the current function/method) returns to whatever
    called it, so the next time something calls it then they are brand new
    again. The logic needs to set these variables somewhere that will persist
    (Session or collector object instance level) so that it can be retrieved
    from there for each subsequent event.
    Other dirty things I would not recommend, but which may work. I believe
    you can get at dynamic list data in collectors. You could potentially
    store the date there when it comes in and then retrieve it on subsequent
    events.
    Other dirty things... use the current date for everything. Pulling this
    up in code should be trivial, but it implies that events come in on the
    current date. That's probably a safe assumption 99.99% of the time, but
    some events may come in wrong at the start of a new day, though you could
    add logic to help with that too.
    Ideally GW needs better logs, and more than that it needs a true auditing
    interface of some kind.
    Good luck.
    On 02/21/2013 08:54 AM, kmaule wrote:
    >
    > Hi there,
    >
    > SDK newbe! I'm successfully parsing an GroupWise WebAccess event log.
    > At the beginning of each days log is a line with the server name and IP
    > address. Subsequent events only have the date/time and event message.
    > How can I capture the name and IP of the sever and then use it for
    > SourceIP and SourceHostName for all the other subsequent events?
    >
    > if (this.s_RXBufferString.search(/^.*?IP Address: (\w+) \((.+)\)/) !=
    > -1) {
    > /^.*?IP Address: (\w+) \((.+)\)/.exec(this.s_RXBufferString);
    > var InitSrvr = RegExp.$1;
    > var InitSrvrIP = RegExp.$2;
    > this.evt = "Test_IP_Variable";
    > this.bm = this.s_RXBufferString;
    > this.sip = InitSrvrIP; //This does work
    > this.shn = InitSrvr; //This does work
    > this.sun = ("KirkWasHere " + InitSrvr);
    > instance.SEND_EVENT = true;
    > return true;
    > }
    >
    > // give the following a try. $1-$3 are mm-dd-yy, $4-$6 are hh-mm-ss,
    > else if (this.s_RXBufferString.search(/(\d{2})-(\d{2})-(\d{2})
    > (\d{2})\d{2})\d{2}) (Login failed): (\S+)/) != -1) {
    > /(\d{2})-(\d{2})-(\d{2}) (\d{2})\d{2})\d{2}) (Login failed):
    > (\S+)/.exec(this.s_RXBufferString);
    > this.evt = RegExp.$7;
    > this.sun = RegExp.$8;
    > this.sip = InitSrvrIP; //This does not work?
    > this.shn = InitSrvr; //This does not work?
    > this.bm = this.s_RXBufferString;
    > this.sev = "3";
    > instance.SEND_EVENT = true;
    > return true;
    >
    >

  • Data Acquisition - using local variables to write data to a file

    Hello,
    I am running a Data Acquisition vi (currently in LabVIEW 7.1 but soon to be updated to 8.2) that collects ~100 parameters of data from several sources contained in a while loop. The current configuration (which I did not write) uses very few subVIs and writes to ~100 local variables to store each parameter. It then reads all the local variables and builds an array of all the strings, converts then to a spreadsheet string, then uses the write characters to file function to append to a datafile. I am trying to clean things up and have came up with subVIs to collect the data from the following sources:
    8 serial port sources collecting btwn 8 and 20 parameters each
    ~15 thermocouple readings
    ~10 analog inputs
    ~20 parameters read off an ARINC 429 bus.
    I have come up with a subVI to read each of the sources and have placed the subVIs in the while loop. Each subVI outputs the data that it collects in array or cluster form. I was wondering how best to write each parameter to a CSV file at between 1 and 10 Hz. Should I write each subVI output to a LV and then read them off as was done before (the difference being that I have reduced the # of LVs to ~10 vs >100?
    I should add that precise timing is not that important, so if all the subVIs are not collecting simultaneously (which I understand that they won't be), it does not really matter.
    Thanks.

    Hi jilla,
    jilla wrote:
    What I think that you are saying is to turn the outputs of the 4 subVIs into inputs of a 5th subVI that writes to the data file. Correct?
    Yes.  It may sound like a fine-point, but I beileve it's better to create a VI specifically for formatting data - in your example, 4 arrays IN, a single string OUT.  Then write the string to file as a seperate operation.  GUI-displayed data can go through a similar transformation, the four arrays wired to a subVI which builds output-structures specifically for display.  It's a beginner's mistake to put lots of individual controls and indicators on the screen when groups of them are naturally related (in an object-oriented sense.)  Use clusters to group related controls - this will keep the diagram much cleaner.
    One more question: at what point (either # of data points or frequency of data collection) does it become necessary to use queues? Thanks.
    Well, there's not really a clearly definable "point".  I'd say if your update-rate climbs above 100Hz, or you witness poor program or system performance, then it's time.  The scenario you've described is a fairly simple acquire/display&log loop - and simple is good.   Then-again people can't see/react-to updates faster than about 10Hz - so it doesn't make sense to sacrifice performance - if performance becomes an issue.
    Re: queues:  Queues are sometimes used to buffer data that's "produced" in one place and "consumed" in another.
    Here, if/when logging data, you're logging with every DAQ.  I wouldn't recommend using a queue to transport data from a "DAQ loop" to a "Logging-loop" - those functions can be in the same loop.  Should/could a queue be used to get data from a "DAQ loop" to update the GUI at a lower frequency?  Sure, but a Notifier might be a better choice.   Further, in the (simple?) program you've described, you might use a case structure (True/False) to only update FP indicators every "X" iterations - a simple solution that doesn't require Queues or Notifiers.
    Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • How to solve error using local variables?

    I've created a sequence with a local variable.
    But when I execute it, an error occurs since the first step (before the step where I manipulate the local variable).
    The error code is something like:
    Error in Evaluation. Syntax expression. Column [0-0]
    It's interesting because it seems that once I've executed my sequence for the first time I can't create any other sequence where this error doesn't appear.

    Pparo,
    The problem does not occur under TS 1.0.3 on my system. However, I think we can get to the bottom of this.
    When at a breakpoint in your sequence, if I type the expression "Locals.nls == 15-" in the TestStand watch window, I will get the message
    Evaluation Failed: Syntax error in expression (Column 18-18)
    I believe that this is the same type of error that you have encountered. Correct me if I am wrong.
    The numbers after the word "Column" indicate where the error has occurred in the expression. In your case the error occurs at the beginning of an expression. The question still remains as to in which expression is error occurring.
    Are you seeing this error reported in the watch window? If so, then you have typed the expression in the watch window.
    If I copy the bad expression above into a the expression of a Statement step I get a run-time error of
    An error occurred in the 'Statement' step of the 'MainSequence' sequence in 'Sequence File1'.
    The post-expression for the step 'Statement' could not be evaluated.
    Syntax error in expression.
    Error Code: -17322
    From what you report, the error appears to be located in your watch expression. When I executed your sequence with a breakpoint on the first step, I added the watch expression by selected the Context tab, expanding the Sequence Context tree view until I could see the nls variable, and then I dragged nls from the tree view to the watch window. This created the watch expression of Locals.nls. I also created the same watch expression by right clicking in the watch window, selecting Add Watch from the context menu, and selecting (or typing) Locals.nls. The expressions all evaluated to 24 without error.
    This process has NOTHING to do with creating local variables. You asked if you are creating variables properly. There are only 2 ways to create variables in TestStand 1.0.3, neither of which you have described. The most common method is to select the Locals tab after opening your sequence (not during execution), right click in the right pane and add the variable of your choice. It seems like you did this correctly based on the sequence file you sent. The other method of creating variables is to do so programmatically. However, this is beyond the scope of this answer.
    You ask a question about "the best way to create three constants in LabVIEW and pass them to a LabVIEW VI that is a step?" This implies to me that you want to create the strings within a VI called by one sequence step, and then use them in another VI called by a different sequence step. I would recommend taking a look at the example AccessingPropertiesAndVariables.seq that ships with TestStand. The first 3 VIs write values back to step properties, but could just as easily write them back to local variables. The 4th VI writes a file reference back to a TS local variable. The 5th and 6th step get the file reference from the TS local variable. You want to do something similar to the 4th and 5th VI, however, you want to send 3 strings to local TS variables, and then get them in the following VI. This will require using "TestStand - Set Property Value (String).vi" and "TestStand - Get Property Value (String).vi" which can be found in the TestStand function palette in LabVIEW. After reviewing this example you can then ask additional question. I recommend posting the question on a different thread since it is unrelated to your original question about the syntax error.

  • How to use local variable in member formula?

    Hi Expert,
    We would like to use a {local variable} in a member formula, so that it can pick up the prompt from webform upon save. Would like to know if it is possible to do? If so, what is the correct syntax?
    We attempted to use brace {scenario}, blacket [scenario], blacket with quote ["scenario"]. None of these work.
    We are using 11.1.2.1 version, EPMA, Hyperion Planning.
    Thanks in advance for your help!

    One other pointer. Where did you define your variable? Hopefully you went into Calc Manager and selected <Tools>, <Variables>. From there, navigate to your application or database. Right-click on your application or database and select "New". In the bottom panel, you'll need to select your Variable Type. Make sure you select "Member", and not "Members". You cannot pass "Members" (plural) to a web input form. Also, if you want to define a variable for a custom dimension, you'll need to do it at the database level. Standard dimension member variables can be defined at the app level. (Not sure why this is the case, especially when my custom dimension exists in all plan types . . . . )
    Anyway, hope this helps,
    - Jake

  • Problems using substitution variable in Web Analysis

    Dear all,
    I have a Web Analysis report that I need to show a raking table with the current month.
    For that I create a variable in Essbase that is updated with that date (E.g.: varCurrentMonth).
    After that I use it as my substitution variable to filter my date dimension in a report data source (E.g.: Scr5, row: product, column: date dimension & measure):
    2008 (current month)
    Product $ qty.
    AAA 100 10
    BBB 90 7
    CCC 80 5
    The problem is that in our cube we need to use an alias in every dimension not to have duplicate members (E.g.: DT.Date, MS.Measure, PD.Product, etc). And when we use it we need to set up the variable in Essbase using that alias (E.g.: DT.Feb/05/08). And if we use that variable as a substitution variable in the report data source the label displayed is the DT.2008 and not 2008 as expected.
    Does anybody have an idea how to solve that?
    Many thanks,
    Thiago Gabriel

    You usually get this error message if you are trying to assign a value from a sub var to a member that does not exist.
    e.g. trying to put FY08 which is a year member against a period dimension
    or trying to use a sub var of FY09 which does not yet exist in the essbase, so say you added a new year in planning FY09 and used the sub var in the form but have not refreshed the database then it would fail because the year would not have been pushed down to essbase yet.
    or the value of the subvar does not match a member name exactly
    or using a sub var name that does not exist in essbase, e.g. using &nextYear but the sub var has not been created in essbase.
    You can definitely use subsitution variables in columns in the version you are using and prior version.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can I use local variable in LabVIEW-Action?

    Hi All!
    There is local variable (for example "MyVariable") in local scope of project. There is Action-step, created by LabVIEW. One of input terminals step is "Sequence Context".
    How can I access to MyVariable by Sequence Context? Unbundle? It does't work.
    Thank you.

    On the TestStand palette there is a VI called TestStand - Get Property Value.vi.  Use that.  Attached is an image showing how to use it.  The trick is making it produce the correct data type.  Do that by right clicking on the VI and selecting Select Type.  Then you can choose the type.  I think in LV 2010 and TS 2010 it is a polymorphic VI and you can just change it.  I wrote an example here for Chaz: http://forums.ni.com/t5/NI-TestStand/How-to-execute-two-steps-in-parallel/td-p/1449874
    It's the second example that's attached.
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~
    Attachments:
    AccessLocalVar.JPG ‏67 KB

  • How to use local variables declared in b/t the methods in other views

    Hi
    i need to use the value of the local variables declared in b/w the views in one other view,as i have manipulated the value based on some condition & want to use it in 1 more view for my req.,but that variable is not global one just for once i need to use it,and i can't again write the whole for its conditions,as its there in initialization view,which if coded again,can hit the functionality there,so is it possible to use the value of such local variables thereafter or not,if yes pls let me know,or i need to declare the global variable for this.

    hi,
    1.Declare an Attribute in Component controller.
    2. Pass the value to this Attribute in View V1.
             using :
      wd_comp_controller->Att = 'Saurav'.
    3. Now in view2 , you can access this Attribute using:
      data lv type string.
         lv = wd_comp_controller->Att .
    Here Att is my attribute of type string declared in component controller.

  • Using local variables

    trying to use a simple local buffer to get an interger value and use it some where else. any help?

    If you are using a state machine, here is another way to create local variables.  Create a cluster with all local variables that you need.  Wire into a shift register.  Use Unbundle to get the value and Bundle to change the value.  See code below:
    Message Edited by tbob on 05-09-2007 11:58 AM
    - tbob
    Inventor of the WORM Global
    Attachments:
    Local.png ‏4 KB

  • Using local variables to "clean up" diagram

    I have attached a photo with red circles indicating my use of local variables to "clean up" a block diagram. Would I run into any issues doing this? Can I leave this task and error unwired?
    -Sarah
    Solved!
    Go to Solution.

    I see some possibly really bad race conditions with your VISA Resources.  For instance, if Task Out 3 is empty (by default), it is likely that the local to read will happen before the local to write.  What this will turn into is you loosing your VISA Reference in the shift register.  Use wires.  Locals very rarely clean up your diagram.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • Problem using List of Lists in loop

    I'm working on a test program that will pull in two text files and return a list of the words that are common among in each. I'm running into a logistical problem when trying to add elements of a list to a list of lists, and then clear the primary list for the next iteration of the loop. Here's my code:
    import java.util.*;
    import java.io.*;
    public class IOList {
       private static List<File>();
       public static void main(String[] args) {
          files = new ArrayList<File>();
          Scanner s;
          List<String> words = new ArrayList<String>();
          List<List<String>> allWords = new ArrayList<List<String>>();
          File a = new File(args[0]);
          File b = new File(args[1]);
          files.add(a);
          files.add(b);
          for (File file : files) {
             try {
                s = new Scanner(new BufferedReader(new FileReader(file)));
                while (s.hasNext()) {
                   words.add(s.next());
                int n = words.size();
                allWords.add(words.subList(0, n));
                words.clear();
             } catch(FileNotFoundException e) {
                System.err.println("Could not find file " + file);
                System.exit(1);
          List<String> fileA = allWords.get(0);
          List<String> fileB = allWords.get(1);
          fileA.retainAll(fileB);
          fileB.retainAll(fileA);
          fileA.addAll(fileB);
          int size = fileA.size();
          for (int i = 0; i < size; i++) {
             String str = fileA.get(i - 1);
             System.out.println(str);
    }When I step through this code, netbeans gives me a message:
    words.subList = >"subList" is not a known variable in current context<
    If I use allWords.add(words); instead, the String elements populate to the first List of Strings contained in allWords, and are then removed when I call
    words.clear();in the next step to prep it for the next iteration.
    Can anyone suggest another way to do this while still working with the loop?
    Thanks in advance

    Just to make clear: subList() does not (necessarily)
    create a new list but a view on the original list. If
    that original list is modified, the sublist might
    change and vice versa.subList() never creates a new list, the subList is always backed by the original list. If the original list is modified, the sublist is too, always. If the original list is structurally modified, the result is undefined, so don't do that.
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/List.html#subList(int, int)

  • Can not use Global Variable in Event Structure

    I am using LabVIEW 2009.
    In my LabView project I have a Boolean Global variable called EStop. I can read and write the Global variable. If I double click on the Global variable, it takes me to EStop.vi which includes a Text Button. EStop.vi is part of my Project.
    In one of my VIs, I have an Event Structure. If I go to one of the Event Handlers in that Event Structure and right click and then select Add Event Case, I get a list of possible events. But that list does not include EStop or an EStop events.
    I want to Add an Event Case for EStop: Value Changed.
    Why can't I Add events to an Event Case that include events on Global Variables like value changed?
    How do I add EStop: value changed event to my Event Structure.
    Solved!
    Go to Solution.

    dbaechtel wrote:
    I have many events throughout the system that might need to cause the system to do an Emergency Stop action. So I want ro use a Global variable that is accessible from anywhere in the system. Any action or condition that occurs anywhere in the system can activate the emergency Stop condition by setting the boolean EStop Global variable to True. When the Global bolean variable goes true(value changed), I want to detect that event in an Event Structure and do the actions necessary to accomplish a system Emergency Stop.
    Sorry, I am not familiar with your terminologies. What is your definition of a "system".
    One big VI with many parallel loops?
    Several VIs running in parallel?
    LabVIEW Champion . Do more with less code and in less time .

  • Is there a way to 'latch' a boolean condition when using local variables? Help!

    Hello all
    I've made LOTS of progress on my vi over the weekend and even today.  I've been battling with a project with this scope:
    1.  Read temperatures from 24 locations (6 banks of four thermocouples).
    2.  Set individual channel temperature upper limits
    3.  Output temperatures, elapsed time and time stamp to file in 5 minute increments AND write data when an overtemperature condition occurs.
    4.  Use NI-switch to shut off a motor related to each of the 6 banks of thermocouples independently
    5.  Be able to start/stop elapsed timers on each of the 6 banks based on user input (start/pause) OR conditions (pause at overtemperature)
    6.  Be able to reset those elapsed timers with user input as well.
    I've gotten 1-4 working nicely (although my example included has the DAQ assistant replaced with random number generation) and the NI-switch cases replaced with a simple boolean indicator.
    My problems lie in two areas now.  First, I need the switch condition AND the 'pause time' to be 'latched' when an overtemperature is reached and NOT continue operation until user input.  Basically, when the motor relay is triggered to shut the motor off, I need the timer to stop with it and not restart when the input condition changes (in this case, when the thermocouple drops below the control temperature) until an operator tells it to resume.  I also need the switch condition to stay true so that my 1160 isn't switching back and forth every iteration until the temperature drops.
    You'll notice there's 5 'elapsed time' express VI's in conditional loops on there--and one time structure in a parallel while loop.  The outside structure is the way I'm heading as it retains the value in the elapsed timer when paused.  This is critical to the test!  All 5 of those elapsed time express VI's will be leaving in favor of more of those outside loop structures.  My issue with the outside timing loop structure is that I can't figure out how to 'reset to zero' with a user input like you can with the express VI's, and that it outputs only ms data rather than a HH:MMS format (not a complete deal breaker but would be nice).
    Please, anyone in the know, I need to button this up so I can get it implemented soon.  My old VI which is currently running the tests is far too user-unfriendly for most of the users to handle and the output to file is a wreck...  THANKS so much in advance.
    Ralph
    Still confused after 8 years.
    Attachments:
    temperatures.vi ‏730 KB

    I've looked up the enum constant and am completely baffled as to how to use this to do what I'm trying.  Can you shed a bit more light on the subject?
    Still confused after 8 years.

Maybe you are looking for