Resetting of variables in VIs

See KnowledgeBase article: 1IF7T7X4 - If you replace the indicator with an indicator array it does not reset on repeated calls.
Why does this behave differently.

Patrick,
That is an interesting observation. I am not certain why the behavior is not seen with arrays, but if I had to guess, I'd say because an array starts off defaulted to null values, whereas a scalar value defaults to having an actual numeric value (usually 0.00). The scalar will go back to the default value as described in the KnowledgeBase entry, but I guess since the array's default value was null, it simply keeps its current values.
That is the best explanation I can come up with. I hope it made sense.
Have a good day.
Sincerely,
Darren Nattinger
Applications Engineer
National Instruments
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman

Similar Messages

  • Resetting a variable deletes cache in all subject areas.

    I have a static variable as maxdatadate which I use in only one BM LTS to filter data. (There are about 30 BMs in the repository) When I reset this variable to a new date, I lose cache related to all the BMs. Has anyone experienced the same? Version is 7.8.4. Is this corrected in newer versions?
    Thank You

    No need to available it , you just need to use it using expression where ever it is possible.
    Check this http://docs.oracle.com/cd/E23549_01/bi.1111/e10540/variables.htm
    To keep it Physically as you need you may need to create a new logical column Time Logical table in BMM and then use expression as repository variable and put that column in all subject areas
    ~ http://cool-bi.com

  • How reset a variable into a BPM process

    Hi all,
    I'm trying to reset a variable(process data object) using a Script task into a BMP 11g process...but no luck.
    The variable is used many time as a counter and I need to initialize it with a predefinite value.
    Can you tell me how can I do that?
    Thanks.
    Fairlie

    Hi Fairlie,
    Is it the counter used within the context of a single work item instance?  Is it that you're having trouble getting the value of the predefined value?
    Dan

  • Resetting a variable in an event structure (dynamic event)

    I'm working on moving an event structure into a sub VI. This means I have to register dynamic events. 
    The event structure is handling some button clicks. The state of the button (mechanical action = latch when released) resets itself automatically as long as the variable is placed within the value change case.  Leaving the button in this case is not possible when the event structure is put in a sub VI and the variable is located in the parent VI.  How do I make sure the button unlatches after clicking on it?  I have attached an example where all the code is in one VI (the local variable must be moved outside the event structure in order for it to be moved into a sub VI).  Any ideas?
    If you open the VI and run it, you can click Start which will cause the counter to start incrementing.  The button only unlatches as long as the variable is located in the value change case.
    (Btw, how do you put images inline in a post?)
    Rob
    LV2011,LV2012,LV2013
    Attachments:
    img.png ‏18 KB
    main.vi ‏17 KB

    Race conditions are the primary reason not to do that. But since your treating your variable as a latch, I doubt your using the value you read from it anywhere, and in that case it can't create a race condition. There's also the possibility that the control's reference could become invalid. But since this is a sub VI of the control's VI that can't happen (even if it could you can check the error out of the value property node to see when it happens and deal with it).
    I'm not sure about the flickering, Since I can't seem to duplicate it with a simple test case on my machine. It might related to whatever else you're doing in the event apart from reseting the value to false.

  • RT Network Shared Variable and Visa Serial Instr class

    Hi,
    I'm using Labview 2009 SP1 with the RT module. I've had no problems creating a RT Target application and a Host PC application which are interconnected using Network Shared Variables, until I came to the COM ports fitted to the RT Target (PXI Embedded Controller and 2 x 4 port COM cards).
    I can configure and use the COM ports in the RT Target application providing I use constants to define which COM port to use, i.e. VISA OPEN function accepts hardcoded "COM2" , (VISA Serial Instr class).
    But I want to pass the COM Port resource name from my host application. 
    Is there a suitable Network Shared Variable I can create ? or how do I change the string value (COM Port name) of the VISA Serial Instr class variable in the RT Target application ?
    thanks,
    Gary.

    Hi there Gary,
    Thanks fot the post. I think I have found something that may be if use to yourself.
    http://labviewwiki.org/Functional_global_variable
    This is the functional global variable.
    Take a look at it and let me know what you think!
    Many thanks,
    Liam A.
    National Instruments
    Applications Engineer

  • How to reset a variable in RTF templete.

    Need help on this.
    I have a template where i declared a variable(FORMAT_Sal) like this
    <?variable:FORMAT_Sal ;format-number(number(PRO_SAL), '###,###,###,###,###,###,##0.00')?>
    and i am calling the variable(FORMAT_Sal) as show below
    <?xdofx:truncate(ltrim($FORMAT_Sal) ||'/'||P_BASIS , 30)?>
    for the whole templete, i have only one main group <?for-each:invoice?> the variable is not getting reset for each group, it is taking the value of first group.
    <invoice>
    <PRO_SAL>32.892</PRO_SAL>
    </invoice>
    <invoice>
    <PRO_SAL>40</PRO_SAL>
    </invoice>
    <invoice>
    <PRO_SAL>59.326</PRO_SAL>
    </invoice>
    my variable is taking the 32.89 and repeating the same value for all the invoices(group).
    i tried by using variable@incontext and variable@section while declaring it, but it is throwing the variable not found error while previewing.
    thank's in advance.

    Hi Sandy,
    can you paste the entiire xml and put the for loop and the location where you use this variable

  • Reset/Initialize variables in SAPui5

    Dear All,I
    Is there a way to initialize/reset all declared SAPUI5 variable (ex: Textfield values / Table data) all at once when an event triggered ? ex : on Buttonclick?
    Plz help

    Hi Tharu,
    You can bind the values of your controls to a model like this?
    And restore the values of the model if you want to reset/initialize them.
    Thanks
    -D

  • Resetting presentation variable set by prompt

    Say I have 2 prompts, State and City, driven by a single go button. The State prompt sets a presentation variable called STATE_VAR and the City column prompt filters its choice list values based on the STATE_VAR and sets its own presentation variable CITY_VAR when the user selects a choice from the list. Both prompts have defaults - the STATE_VAR prompt defaults to a specific state on initial page load and the CITY_VAR defaults to nothing (None option in the prompt dialogue).
    This issue I want to solve is resetting the CITY_VAR presentation variable to nothing (as per the default None option in the prompt dialogue) when the user selects a different state in the State prompt. The sequence I want to achieve is listed below.
    1) On page load STATE_VAR and State prompt choice are set to Michigan and both the CITY_VAR and City prompt are set to nothing (blank option)
    2) User selects Detroit as one of the cities in the City prompt and clicks the GO button.
    3) On page load, the STATE_VAR presentation variable and corresponding State prompt are set to Michigan, but now the CITY_VAR and City prompt are now set to Detroit
    4) User selects a different option in the State prompt, say Nebraska, and clicks on the GO button
    5) On page load, the STATE_VAR presentation variable and corresponding State prompt are now set to Nebraska, however, the default selected option in the City prompt and corresponding CITY_VAR presentation variable are still Detroit though the choice list now contains different values.
    Is there anyway to reset both the CITY_VAR and City prompt to the default nothing (None) selected state, essentially resetting the presentation variable?
    Thanks.

    i am afraid .. you wont be able to achieve this...
    The best thing that you can do is to check the constrain checkbox in the city prompt..
    Thanks
    Ashish

  • "Reset" declared variables to initialized state?

    Hiya!
    This might sound like a very stupid question, but I have not figured out a way to do this. I am working on a "personal information manager", where users can enter a date in a lovely swing textfield, it get's parsed to Integer and a GregorianCalendar is created with it. Once I created the Calendar, the TextFields are emptied again, but of course the Integer instance variables are still declared with the old values. This leads to the fact that a user could click "add date" again and a date is created without entering any number at all.
    My question:
    Is it possible to set declared variables back to the state they had when initialized? They should be "empty"...
    I can`t set them null...
    Thanks for your help, it's much appreciated!

    The only type of variable where "empty" has any meaning is for an empty string: "". Otherwise there is no empty. Objects are by default initialized to null, numeric primitives to zero, and I think chars to '' but I could be mistaken about that one - I never use chars. So if you're using Integers, they could either be null, or an Integer - nothing else.

  • HELP - email address problem - need to reset a variable

    I created a form that will be submitted to certain different email addresses based on an option selected from a drop-down list (named Customer).
    I tried another script posted here, but that was based on the assumption that there was only one choice per email address in the list.
    I wrote this on the change event of my list. I want the variable "emailAddress" to adopt the correct email address, based on the value of the option selected from the list:
    var emailAddress = "[email protected]";
    if (Customer.rawValue = "3"|"4"|"7") {
    emailAddress = "[email protected]";
    else if (Customer.rawValue = "5"|"8"|"15"|"20"|"21"|"26") {
    emailAddress = "[email protected]";
    else if (Customer.rawValue = "9"|"10"|"13") {
    emailAddress = "[email protected]";
    else {
    emailAddress = "[email protected]";
    Then I copied this (from the other topic), on the click event of a regular button ,which calls for a second, hidden button:
    EmailSubmitButton1.resolveNode("#event").submit.target = "mailto:"+ emailAddress;
    EmailSubmitButton1.execEvent("click");
    The form worked fine the first time, but after that, all submissions are going to [email protected] I'm thinkking that the variable emailAddress has now a fixed value, and does not change.
    I am new to Javascript, so I might have not written the code properly, any help will be greatyl appreciated!
    Thank you.

    Daeveed:
    I think your javascript syntax is problematic. Instead of the syntax
    if (Customer.rawValue = "3"|"4"|"7")
    try
    if (Customer.rawValue == "3"|"4"|"7")
    Note the double equals sign. That's the equality comparison operator in javascript. The single equals is assignment.
    if that still doesn't work, try
    if ((Customer.rawValue == "3") || (Customer.rawValue == "4") || (Customer.rawValue == "7"))
    Hope this helps.

  • Reset a variable from flash in the parent php page

    I know how to pass vars from php to flash and from flash to a
    "new" php page but here is my question.
    I have a php page (page1.php) with some HTML and a php
    variable called $number. page1.php also has an embedded test.swf
    movie. While working with the test.swf movie, I want to send data
    back to the $number var on the page1.php without reloading the
    page1.php because then it would reload the test.swf movie.
    I have been able to use javascript to change background
    colors on page1.php from within the test.swf movie but cannot
    figure out how to set a php variable from within the test.swf
    movie.
    Is this possible?

    That's what I ended up doing.
    I wrote the var to a db from page1.php using a separate php
    page and then changed the data in the db from flash using the same
    separate php page.
    Doing this made the same var or data available to both
    page1.php and test.swf without changing state.
    Just wanted to know if there were another way without using a
    db or xml file.

  • Resetting cpQuizInfoAttempts variable?

    Good morning.  I searched but didn't find the answer, hopefully someone has some tips.
    Cp4, AS3.
    I have a sequence question slide.  If the user gets the wrong answer, I send them to another slide and give them the opportunity to go back and review the material prior to the question, or try the question slide again.  However when returning to the question slide, it of course thinks they've taken the question already, doesn't let them re-answer, and gets them caught in a loop.  I'd like them to be able to review material/retake question as many times as they want/need (not reporting the score)
    I've tried different combinations of the quiz preferences (failing grade attempts) and the If wrong answer settings for attemps and failure levels, but can't achieve the flow I want.  If I set the question attempts to infinite, it doesn't move to the "wrong answer" slide.  If I set it to a number, it keeps them on the question slide until they meet that number of attempts, but then gets them into the loop as described above.  Setting the quiz prefs presents similar challenges.
    My only other thought is to reset cpQuizInfoAttempts to zero after they've answered wrong, but in the slide properties/on slide enter/Assign doesn't give an option to assign a value to cpQuizInfoAttempts.  I tried building an Advanced action, but come to the same roadblock of not being able to assign a value to cpQuizInfoAttempts.
    What suggestions do you have?

    I am having a similar but slightly different issue.
    I am using Captivate 5 on IE 8.  I have created a course with content proceeding the quiz.  The quiz is set to infinite attempts, with each quiz question allowing for infinite attempts.  The learner must receive a score of 100% to pass, which should be easy since they can't move forward until the get the correct.  In the properties I have the quiz set as optional, although it really is required, but I have been told that sometime using the required setting causes some issues. I also have allow for backward movement checked.
    I went in to test it, and after answering a few questions, I tested going backwards to see if the student could review other slides.  That worked fine, but if you go father back than the first quiz question and then click forward to go back tot he quiz, the questions that had already been attempted no longer appear to have been answered and they will not allow you to try to answer them again.
    You can move forward to go to the other questions you did not previously answer and answer those, but when you go to the score slide, it says you didn't answer all of the questions and therefore did not pass.  So the retake quiz slide shows up, but when you click it it takes you to the first question slide, but again you cannot answer any of the questions.
    I have deleted the scoring slide and added it back.  I have deleted the retake quiz button and added it back.  I have reviewed many of the questions posted in this forum and cannot find anything that is stopping you from retaking the quiz with the retake quiz button.
    I have even tried this on my personal Mac and still have the same issue, I loaded it into our LMS, Absorb and still no luck.  So I am completely stumped.  I have had this work previously that you were able to move backwards and then return to the quiz and either it let you re-answer the question or showed that it had already been answered.
    Thanks for any assistance you can give,
    karyn

  • Unable to reset the variable value in the method value change event and use

    Hi ,
    int i=4;
    public changevalue(ValueChangeEvent ValueChangeEvent)
    //some code
    i=5;
    system.out.println("in changevalue method="+i)// this prints i value as 5
    public void submit(ActionEvnet actionEvent){
    //somecode
    system.out.println("in submit="+i) // this prints value 4;though its value is changed as 5 in above mehtod
    how can i get the value as i=5 in second method(i.e, in submit method)??

    Hi 980230,
    When I tried the same thing it gives me 5 in the submit method.
    Are you sure that ValueChange method is getting invoked before the actionEvent method?
    Its better to debug the application, you will get the exact flow and error if any....
    Thanks
    --NavinK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Can you change the value of a variable that is reset by a parameter?

    Sorry if this is simple but I just crashed a package and can't do an autopsy. I suspect I sent it into an infinite loop. I know you can't change the value of any passed in parameters. What I tried to do was have the parameter set the value of a variable
    and then I tried to change the value of the variable. Is that even allowed?
    I was trying to do this:
    MyCheckVariable = MyParameter (which equals true)
    (some cool stuff happens)
    MyCheckVariable = False
    I hit F5 and my package turned into the Energizer Bunny. Is the way I try to reset the variable the culprit?

    This is a prototype so I just created a project parameter and set it to true. In the real world the parameter will be used to control an optional part of the process because on a re-run after error that part doesn't have to be ran again.
    So when I say MyCheckVariable = MyParameter (which equals true) in reality what I actually have is in the variables window I'm using an expression and it looks like this in the variables window
    name = runDownload
    Scope = Package
    Data Type = Boolean
    Value = True (but greyed out)
    Expression = @[$Project::param_runDownload]

  • Variable not resetting properly - IP/WAD

    VARIABLE RESET
    I am  in the IP- WAD environment
    Query A is passing binding values on multiple characteristics to Query B and Query C
    The characteristic are received in query B (input query from designer )  and C (aggregation level - planning sequence simple)  as variables through a Filter Button-Dropdown Single selection.
    This where I set the info-provider parameters and set the variable parameters.
    Every thing work well the first time, however when I change the parameters in the filters, the transfer of the variable values does not reset.
    Any idea????  Points awaitingu2026
    Jean-Marc

    Hi Jean-Marc,
    Is you web template shown in an iView?
    If so you can put the string  '&clear_variables=x'  at the end of your bex string to reset the variables.
    Thanks,
    Nick.

Maybe you are looking for