How to creat a global variable?

I want to creat a start button of global variable to control different programs in the sequence structure. But I do not know how to creat it. Thanks for answering.
Solved!
Go to Solution.

Perry Liu wrote:
Thanks for answering. I attached the code below.
What I want to do is to combine Get Voc/Isc and GO buttons (shown in the front panal) to one button, and also combine Setup Linear Stair Sweep and start sweep together. I do now find a good way to do that. Thanks so much for your kind help.
There is no "Get Voc/Isc" or "GO" button anywhere on the front panel, and I have no idea what you mean by "Setup Linear Stair Sweep" and "start sweep". Are you sure you uploaded the correct code?
Other VI comments:
You are abusing/misusing global variables. 
You already have a state machine, so you can actually code this using just the state machine without actually needing the separate event structure loop. Even if you do keep it, that still does not require you to use global variables.
Why do you have a loop around the Write to Spreadsheet File? This serves no purpose and actually stops your code in that loop until the Stop global is set. This doesn't make much sense.
Since you do not have a path wired to the Write to Spreadheet File VI, you will be asked for a path each time the loop iterates. Use a shift register to hold the value of the path from iteration to iteration.
Get rid of the Build XY Graph Express VI and those Convert to Dynamic Data functions. Replace with a single Bundle function.

Similar Messages

  • How to create a global variable in forms 6i

    How to create a global variable in forms 6i

    :GLOBAL.my_var := 15; Well, this statement is not correct! Global variables
    stores a character string of up to 255 characters in
    length. Thus, valid statement for Khurram example
    is:
    :GLOBAL.my_var := TO_CHAR(15);
    or
    :GLOBAL.my_var := '15';
    But numeric values are implicitly converted by oracle so there's nothing in fact wrong with the statement...
    :GLOBAL.my_var := 15;
    ;)

  • How to create a "global" variable in Photoshop (or let a script "sleep" in the background)

    I tried to toggle the select-tool and the move-tool with a script. Seems simple enough. Something like:
    var toggleState;
    if (toggleState == true){
        activateMoveTool();
        toggleState = false;
    if (toggleState == false){
        activateSelectTool();
        toggleState = true;
    should do it (well, beside the "activateMoveTool" and "activateSelectTool" functions, which are not a problem).
    But how to rember the variable toggleState? I tried to make it global, but did not find a way. Is there any?
    Or could I just have an objekt(or funktion) running in the background that would keep track of variables like that one?

    Not having X's programing background I think of an action reference as something that tells Photoshop what to do. And yes it is like a little action that you write instead of record. For example the code that I and X posted could also be written like this
    var ref = new ActionReference();
    ref.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID('tool') );// what key to get
    ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );// where to get it from
    var cTool = executeActionGet(ref);// in this case returns a one key descriptor
    var cToolTypeID =  cTool.getEnumerationType( stringIDToTypeID('tool') );// get the value of that key
    alert( typeIDToStringID( cToolTypeID ) );// make that value readable
    Most of the ordinals you will see will be target as Photoshop likes whatever you are working on to be active. You sometimes see next or previous. I can't recall seeing a 'normal ordinal' like first or second.
    There is not much in the way of documentation. Most of what I know comes from looking at the scriptlistner log, xtools and X himself, and a little bit of code I put together for exploring action descriptors and action list. It's not as nice as X's getterdemo but works more the way I think. It sends it's output to the ESTK console window
    var ref = new ActionReference();
    ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
    var desc = executeActionGet(ref)
    var c = desc.count ;
    //for(var i=0;i<c;i++){ // to enumerate list
    //  $.writeln('Key '+i+' = '+desc.getType(i))
    for(var i=0;i<c;i++){ //enumerate descriptor's keys
      $.writeln('Key '+i+' = '+typeIDToStringID(desc.getKey(i))+': '+desc.getType(desc.getKey(i)))

  • How to auto create a global variable with specific variable name in a global vi ?

    how to auto create a global variable with specific variable name in a global vi using lv ? Because i need to add a lot of global variable in this global vi. But you know, if  i manually add them , it will be a much time-costing work. So i want to use someway to auto generate ? Can i ?? Thanks a lot !

    Hi
    what aartjan is saying is the way for you. but you can develop an utility which will actually help you create global variables. To get the details on this just have a look at VI Scripting section on LAVA forum.
    But i would like you to suggest few things
    1. If your programs have so many global variables (Thats why u want utility) then you should take out some time to read about LabVIEW design patterns. I think if programmer follows these practicess he dont need a single global variable.
    2. Their are some other ways to achieve similar functionality as of global variables (Uninitialized Shift Registers, Single Element Qs and so on) but they are much faster than global variables.
    I am Attaching Whatever Resources i am having I will also attach the template of the design pattern i generaly use in short duration
    Message Edited by Tushar Jambhekar on 10-06-2005 07:33 PM
    Message Edited by Tushar Jambhekar on 10-06-2005 07:36 PM
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog
    Attachments:
    LabVIEWDesignPatterns.zip ‏1505 KB
    Large_Code_Implementation.zip ‏522 KB
    Database Tests.zip ‏868 KB

  • How can I access global variables in a loaded Applescript?

    How can I access global variables in a loaded script, in Xcode, ApplescriptObjC? Basically, I have a global variable defined in my parent script using "property", and I need to modify objects connected to those variables inside of a loaded script.
    Example:
    Parent script:
    script AppDelegate
    property myTextField : missing value
    //linked to a text field object
    tell myScript to myAwesomeHandler_()
    end script
    Loaded script:
    on myAwesomeHandler_()
    myTextField's setStringValue_("The new Xcode is so glitchy ugh")
    //changes value of linked text field of parent script
    end myAwesomeHandler_
    The problem is, the variable is undefined in the Loaded script, and I need it to have the same value as the parent script, and I don't want to pass the variable through the Handler. Any ideas?

    I think want you are looking to do will need to be done in two steps. Because myTextField needs to be a property for the ObjectiveC part of the code you cannot turn it into a global.
    However if you make a temporary variable global assign the string to it in the handler then set myTextField off of it.
    global myTextFieldGlobal
    script AppDelegate 
    property myTextField : missing value 
    //linked to a text field object 
    tell myScript to myAwesomeHandler_() 
    myTextField's setStringValue_(myTextFieldGlobal)
    end script 
    on myAwesomeHandler_() 
    set myTextFieldGlobal to "The new Xcode is so glitchy ugh"
    //changes value of linked text field of parent script 
    end myAwesomeHandler_ 
    I know you stated you did not want the handler to return a value but I have to ask why? Global's, imo, are not a good idea and really should be used as a last resort.
    One other possibility is to pass a reference to the property to the handler. Not sure if that works in AS of if that would satisfy our requirement of not passing the variable through the handler
    <edit>
    Another though have you tried to define the property outside the script?  That is
    property myTextField : missing value
    script AppDelegate
    Not sure if that will work.
    You might also want to have a look at Scope of Properties and Variables Declared in a Script Object

  • How to use a global variable for reading a query resultset in JDBC lookup?

    Hi Friends,
    Using JDBC lookup, I am trying to read from a table Emp1 using a user defined function. In PI 7.0, this function returns values of a single column only even if you fire a " Select * " query. I am planning to use a global variable(array) that stores individual column values of the records returned by a "select *" query. Need pointers on as to how a global variable can be declared and used to acheive the above scenario. Kindly explain with an example. Any help would be appreciated.
    Thanks,
    Amit.

    Hi Amit,
    Sounds like a good idea but then you would need an external db and update the table in a thread safe way !.
    Regarding your question as to how to work with global variable please refer https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1352. [original link is broken] [original link is broken] [original link is broken]
    Rgds
    joel

  • How to Create a Session variable in JSP?

    How to create a session variable and add attributes to it?
    For example i want to create a session variable called "name" and add value "user" to it? if i try to do it with setAttribute(), it is giving error as both is of type string? how to do it? kindly help me

    This is variable what is working in my aplication
    String variable;
    if(user == null){
                   user=new String("");
         }//if you don'y do this you will have null pointer exception
    session.setAttribute("user",user);//put value
              String name=(String)session.getAttribu("user");      //get value;
    I hope this will help

  • How to create a session variable in Apex?

    Hello colleagues,
    Is there someone do know how to create a session variable in Apex?
    How to get them?
    Thanks
    Best Regards

    Hello,
    What do you mean by 'session variable'? You mean something that stores the value int he users session state?
    I really recommend reading the 2-Day Developer guide documentation, there is a complete section on session state -
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/concept.htm#CIHCFHBD
    Hope this helps,
    John
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd

  • How to Create a Text Variable

    Hi Experts...
    Can you please explain me how to create a Text variable...
    In my Cube i had 3 different date fields....
    and as per my requirment i need to create a rolling report for which will display data for 6 months rolling.
    As the date field which i need to use is not mapped to Time Char's (Cal Year,Cal Month...etc)
    For that reason i created below customer exit variable and used offset variables to achieve the rolling 6 months report
    Code used for Customer Exit VAriable:
    WHEN 'ZC_Cmonth1'. " Current Cal Month Car Expiry
    IF i_step = 2.
          CLEAR l_s_range.
    determine date
        LV_SYDAT     =  SY-DATUM.
        LV_YEAR_ACT  =  SY-DATUM+0(4).
        LV_MONTH_ACT =  SY-DATUM+4(2).
    Set begin date of intervall
    CONCATENATE LV_YEAR_ACT LV_MONTH_ACT '01' INTO LV_DATE_LOW.
    Set end date of intervall
    CONCATENATE LV_YEAR_ACT LV_MONTH_ACT '31' INTO LV_DATE_HIGH.
    Fill ranges-tab with: include all values between beginning of year
    and actual date
      CLEAR E_T_RANGE.
      CLEAR L_S_RANGE.
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT  = 'BT'.
      L_S_RANGE-LOW  = LV_DATE_LOW.
      L_S_RANGE-HIGH = LV_DATE_HIGH.
      APPEND L_S_RANGE TO E_T_RANGE.
    ENDIF.
    Now i need to create TEXT VARIABLE that will display the Month Name in the column name
    Please update in detail step how to create a Text Variable

    In your specific requirement select the which ever the keyfigure you want  to analyse, go to edit mode of keyfigure propeties there select the newvariable type and create the Text variable by maintaining the proper offset start and length and also maintain the in whcih format u want see the month name in column headers. Maintain the Text format or key format. it totally depends on u r requirement.
    Hope it will help ful for u.
    Bye,
    Chandu.

  • Business Rules : Unable to create a global variable (Fixed)

    Hello all,
    I try to create a global variable in order to use it in a business rule;
    I selected an outline.
    I chose the type "Member"
    I chose the dimension "Period"
    I clicked on the lookup button in front of the default value and chose the member "January"
    Finally, I chose the usage type "Run-Time prompt" and type in a prompt string.
    Unfortunately, when I click on save, I get an error message : Variable value ["January"] is invalid.
    If I try to do not specified a default member, it is possible to save.
    But when I launch the business rule and specified a member in the the prompt message, I get an error 1060120 : OLAP error.
    I cannot figure out what's going wrong, so any help is welcomed.
    Thanks,
    DLP
    Message was edited by:
    user639769
    Message was edited by:
    user639769

    Thanks for your answer,
    I finally figure out what's going wrong.
    This issue is due to the fact that the outline is configured to accept duplicated names.
    When I create the same outline but with duplicated names turn off, every thing goes perfectly.
    I don't know why the outline accepts duplicated name.
    In fact, I do not understand what are the reasons for using duplicate name...

  • How can I define global variable in user exit whic I can use anywhere.

    Hi all,
    How can I define global variable( Table ) which I can use when it come back to same user exit where I defined and stored some data.
    What I mean is I want to define 1 global table.
    In user exit when it comes I store some information. and again when it will come I will have that stored information so I can use it.
    Thanks a lot in advance.

    You can use EXPORT  TO MEMORY ID and IMPORT FROM MEMORY ID Statement for this.
    EXPORT T_ITAB FROM T_ITAB TO MEMORY ID 'ABC'.
    IMPORT T_ITAB TO T_ITAB FROM MEMORY ID 'ABC.'

  • How to create an array variable

    Hi folks,
    I'm developing a flowN activity , for each branch created, I need to pass different values (values I get from DB).
    For this my plan would be,
    -create an array variable , load all the values(from DB) into the array
    -pass the array to each branch in flowN activity based on the index
    As I'm newbie to BPEL, I do not know how to create an array variable.
    Could you people guide me please.
    Regards
    Viki

    Hi,
    I created my string array like
    <element name="string_array">
    <complexType>
    <sequence>
    <element name="input" type="string" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
    </complexType>
    </element>
    <variable name="arr" element="client:string_array"/>
    I am able to add values to my array variable named as "arr"
    When I use the following code snippet, it gives my the value of the entire list.
    <%ora:getNodeValue(bpws:getVariableData('arr'))%>
    But when I try retireve values one by one like <%ora:getElement('arr','/client:string_array/client:input',[0])%>, its giving me error.
    Guide to get throu' this.
    Viki

  • How to create User Defined Variables in Procurement Contract 12.1.3

    Hi,
    We are using Procurement Contract 12.1.3. As per our business requirement while creating contract template we need to use many variables which are not available in 'System Defined' variable list. Please guide us with some samples (step by step) how to create the 'User defined' variables.
    Regards,
    Prabhu

    Hi Prabhu,
    Did you get the setps how to create user defined variables in Procurement contracts? if so please share me the setp by step flow.
    Prakash

  • How to create characterstic formula variable in reporting

    how to create characterstic formula variable in reporting
    tell me any one in steps
    thanks

    HI
    Query Designer -- Select your Char -- Create Char Variable -- Processing type should be Replacment path =In the Replace Variable with drop down box, choose Attribute Value. In the Attribute drop down, select Characteristic Reference
    http://help.sap.com/saphelp_nw70/helpdata/EN/03/6ba03cc24efd1de10000000a114084/frameset.htm
    Hope it helps

  • How to create charasteristic value variable step by step please?

    How to create charasteristic value variable step by step please?
    I searched the previous threads it is not listed.
    I will assing points to only valuable information.
    York

    Hi Les,
    http://help.sap.com/saphelp_nw04/helpdata/en/ac/789b3c4d4d8d15e10000000a114084/content.htm
    In the left hand side of the query designer, find your char and under than there will be a button with text called Characteristic Value Variables. Right click this and choose New Variable. This will open the variable wizard. You need to follow the screen to define a technical name and description, the processing type, the user entry options and if the variable will accept single or multiple values, and also if you want to set a default value.
    Hope this helps...

Maybe you are looking for

  • Product Variances in COPA for SFG

    Hi Freinds, I am facing a issue relating to production variances arising from settlement of production order for SFG. As SFG is not sold in my case and is being used for producing 2-3 types of Finished goods, therefore client wants that the productio

  • Can't boot 10.4.7

    I have an iBook G4. I wanted to copy a file to my iBook from my Winodws PC via firewire by booting my iBook into Target Disk Mode. When I got everything connected, my Windows PC did not mount my iBook as an external harddrive. I think this had someth

  • IMovie is crashing after creating the large movie for YouTube.

    Hey Guys! So, I have been uploading to YouTube from iMovie for several years now and today I uploaded again as I usually do. The problem was that about 30 seconds before the end of my video it went black on YouTube! I deleted it off YouTube and reupl

  • ASUS G73JH-RBBX05

    Can someone help me out? I want to know if this laptop : Asus - Laptop with Intel® Core™ i7 Processor - Black  G73JH-RBBX05 Will be available on August on this Best Buy store: Laredo TX 7905 San Dario Ave,  78045-7253 If its possible to know of cours

  • [XFCE] After changing window style X crashes

    I was changing window styles in Window manager (I think that is the name). During the change, screen goes dark and i got only console. I tried to start xfce again but unsuccessful. Here is picture of Xorg.0.log. http://img72.imageshack.us/img72/6960/