Example on how to set an array as a Global Variable (LV2?).

Hi,
I am new to Labview and recently I have been given the task to evaluate labview as our new data acquisition software.
Let me briefly describe what we currently have set-up and what I need to accomplish.
We have developed several dll's (created in C) to access the shared memory where the data is located and I have imported these dll's in labview and read them in as one big 1-d array. (There are several 1-d array's that I import but I will try to keep things simple by starting out with one)
Now I want to share this array to several sub-vi�s, which will I am planning to call from the run-time menu. How can I assign this array globally so that I can access it from any sub-vi?
For example, lets say
that my array name that I imported is called ARRAY1 (name created using the local variable option). ARRAY1 is a 1-d array with 10000 elements.
I would like to access only a few elements of this array on another sub-vi by its name and index number i.e. ARRAY1[10], ARRAY1[20].
Please let me know if you need any more information.
I would really appreciate it if someone can help me out.
Thanks
Nish
My E-mail: [email protected]

Attached is the VIs in LV 6i format...The advantage of those VIs is that they allow you to read and write subsets of the array, not just one element at a time.
MTO
Attachments:
Example.vi ‏27 KB
ArrayGlobal.vi ‏27 KB

Similar Messages

  • How to set an array element in an object type of array??

    Hi,
    I have set attribute as follow:
    Color[] colors;
    Color[] colors = new Color[20];
    colors[0] = "Red";
    colors[1] = "blue";I can't compile this code. It said:
    "Incompatible type -found java.lang.String but expected Colors
    Could you tell me how to set an array elements when the array type is an object?

    in your case, the array shouldn't be Color[] but String[] since you re intending to put strings into it
    by the way, you could also use a hashmap to map a string to a color:
    HashMap<String, Color> hm = new HashMap<String, Color>();
    hm.put("Red", Color.RED);
    hm.put("Blue", Color.BLUE);
    etc.

  • How to set a value to a Presentation Variable using GO URL?

    Hi All,
         I am working on a drill (GO URL) from Dashboard page1 to Dashboard page2.
         The problem I am facing is, I am not able to pass a value to the presentation variable through GO URL. (I have to pass "Customer Category" static
    value to The presentation variable present in Dashboard Page2 ).
         The Dashboard page2 is having a view select in which we are using presentation variable to select the report based on the value selected in
    View Select.
         For example: If the user selects "Customer Category" value in View select and clicks on GO button Customer Category report will show the out put.
         When i am drilling from Dashboard Page1 I have to pass a value to the presentation variable used in view select and also pass some filter condition in
         GO URL.
         Please let me know if it is feasible to pass a value to the presentation variable through GO URL in OBIEE 10.1.3.4.
         It will be greate if you can provide me with the syntax to set a value to the presentation variable of dashboard page2 through GO URL.
    Thanks and Regards,
    Sagar Vishwanathwar.

    1) You have to navigate to dashboard page, not to answer request = you have to use "Dashboard URL API" not GO URL API.
    2) On the target page, you have to place dashboard prompt, which sets required presentation variable.
    3) Refer to the target using Dashboard URL API and set filter on prompt column using URL parameters. Example: http://localhost:9704/analytics/saw.dll?Dashboard&PortalPath=%2Fusers%2Fadministrator%2F_portal&Page=page%201&Action=Navigate&P0=1&P1=eq&P2=D_TIME.YEAR_CODE&P3=%221996%22
    Do not forget to use Action=Navigate. The syntax for setting filters using url parameter is the same as for GO URL API described in Business Intelligence Presentation Services Administration Guide.
    This is the way, you can implement navigation to parametrized direct SQL reports including passing filter values...
    Regards K.

  • How to get the value of the global variable of test stand in labview User interface?

    Hi.
     Can anyone Please share examples and tell me to how access the test stand global variable using labview user interface.
    Solved!
    Go to Solution.

    I'm not surprised that what you are doing doesn't work.  The Start Execution UI Message is triggered when the user clicks a button to start an execution.  Realize that most executions go through a process model.  So you could be looking at the sequence context of the process model and not your client sequence file.
    I recommend reading that link I posted above.  UI Messages are your best bet but you cannot just piggy back on an existing UI Message like this.  They may not be getting sent at the time you need them to be.  The only way to ensure you get what you want is to trigger one yourself at the right time.
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How do i create and pass a global variable from one vi to several sub-vi's?

    Hi Guys,
    I am trying to create a program that opens several front panels (sub-VI's) in sequence. in each front panel, the user would open a file that the name is obtained from the previous sub-VI. I would like to know how i could pass the filename and refnum of the file thorough from one sub-vi to another. A global variable would do it in VB, but how do we do global vars in LABWIEW. thanks
    Papish

    I put together a sample VI and Sub VI that illustrates how to pass a Refnum and access a data file while in a Sub VI.
    For multiple VIs just repeat the sub VI process.
    You probably don't wanna use a Global Variable if not needed (can add to the mess down the road haha).
    Let me know if it helps you out! Or if I can clarify anything else!
    Chances are if you have seen VI in the forest it hasn't fallen.
    Attachments:
    Passing Refnum.zip ‏21 KB

  • How do I store VI References in global variables and access them later

    From what I know, Labview automatically deletes VI references when they go out of use. Is there a way for me to override this so that I can access a set of preloaded references in a separate VI? Essentially I would like to open the VI's dynamically into the memory, store the references in global variables and access them at a later time. The VI's I'm referencing won't be known until runtime. I know its not the safest way to do it, but it would be the most productive on my end.
    Thank you
    Clay Upton

    I'm not sure what you mean by "a later time", but a VI reference will remain valid as long as the VI is in memory. If you don't unload the VIs, the references will remain valid.
    If you do need to unload the VIs, for whatever reason, I would suggest the following:
    Create a functional global as your interface for obtaining the references.
    Feed the paths to the VIs into the VI when initializing it (since you don't know which VIs in advance).
    When calling the VI to obtain the references, have the VI check them first (using the Not a Number... primitive). If it sees that they're invalid, it can open a new reference and return that.
    You should note that when a VI is removed from memory, the data space is used is released, so if those VIs are expected to hold data (using shift registers, etc.) this will be a problem.
    The description I've given will only be usable in certain instances (and it has its intricacies), but you didn't really give any details about what you're actually trying to accomplish.
    Try to take over the world!

  • How can i notice the name of global variable ?

    When the customizing.fmx calls the standard.fmx, I came accross an error "FRM-41067 Can not find menu Item".
    customizing.fmx --> call --> standard.fmx
    So, I want to assign a global variable to standard.fmx in the customizing.fmx.
    How can i find out the name of global variable ???
    Can I catch the name of global variable??
    For expamle..
    :global.menu_id was not the answer.
    :global.mn_id was not the answer.
    :global.mnid was not the answer.
    HOW!!!!!!!!!!!!!!!!!!!!
    Please HELP ME!!!

    Hi
    Can I catch the name of global variable?? yes u can , if u use a message after each type like...
    :global.menu_id
    MESSAGE (' global.menu_id = ' || global.menu_id );
    SYNCHRONIZE; Hope this helps...
    Regards,
    Abdetu...

  • How do I load a vi of global variables whenever LabView opens?

    I want to be able to load a VI with Global Variables whenever I open Labview, and not have it open dynamically. So in short, how do I bind or attach a VI to open every time LabView opens and starts up.

    Look at this KnowledgeBase article:
    http://digital.ni.com/public.nsf/3efedde4322fef198​62567740067f3cc/44e99cc41aa39f538625694b005679c0?O​penDocument

  • How to set the array size

    Hi,
    below is my sample code
    class test
    int sample[][]=new int[10][10];
    int rows=0,k=0;
    int columns=0;
    public void meth()
    rows=9;
    columns=9;
    }//end of meth()
    public meth_2()
    for (int i=0;i<rows;i++)
    for(int j=0;j<columns;j++)
    sample[i][j]=k;
    k++;
    for (int i=0;i<rows;i++)
    for(int j=0;j<columns;j++)
    System.out.println(sample[i][j]);
    }//end of meth_2()
    public int[][] getList()
    return sample;
    }//end of classNow that my question is, i need to set the size of array sample[][] to sample[rows+1][columns+1].. but to do so, 'rows' and 'columns' values will only be generated upon the execution of method meth() . I need sample[][] array to be declared right after the class begins. The values that are returned from sample[][] array through that getList() method is been used in another class.. So how do i set the size of sample[][] array to
    int sample[][] = new int[rows+1][columns+1];Any response is highly appreciable.
    Thanks in advance
    Edited by: netbeans2eclipse on Sep 14, 2008 1:20 PM

    It seems you answered your question yourself ;-)
    Just split this:
    int sample[][] = new int[rows+1][columns+1];in two parts.
    Declaration:
    int sample[][];and instantiation in meth() or meth_2():
    sample = new int[rows+1][columns+1];

  • How to pass the array as a hidden variable

    hi im trying to pass the list of employees as an array and pass it to servlet as a hidden variable and retrieve the same array in servlet
    can any one help me in this . urgently required.

    I have created only one
    <input type="hidden" name="empName">
    when the user check the check box i want to add all the values in the empName, click the Next page, Again we show some check box i want to add some more names to the hidden value
    When the user click back i want to show which chekboxes user selected.

  • How to set timing of migration of Substitution Variables to Planning

    Hi,
    After we update Substitution Variable, we noticed it takes a 5 mins before it flows to Planning
    I read somewhere that there is a way to set timing (5 mins) of migration of Substitution Variables to Planning. Anyone knows where that is?

    Hi,
    You need to set a property, details are all here :- http://download.oracle.com/docs/cd/E12825_01/epm.111/hp_admin/ch06s03s12.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to set array length correctly in this case

      class RunJavaCode implements ActionListener{
        public void actionPerformed(ActionEvent e){
          try{
            Process proc=Runtime.getRuntime().exec("java javaapp");
            InputStream input=proc.getInputStream();
            byte[] b=new byte[3000];
            input.read(b);              
            String javaReport=new String(b);
            input.close();
            outputText.setText(javaReport);
          }catch(IOException ioex){System.out.println("IOException is "+ioex);}
      }how to set this array(byte[] b) length correctly? I mean this array length should not only save memory,but also enough to use('enough to use' mean that read outputed info from console to this byte array never overflow)

    Hi,
    you cannot know in advance, how many bytes will be read. But the read-method returns the number of bytes actually read and this is important!
    So at least you have to write:        int r = input.read(b);
            String javaReport=new String(b, 0, r); However, you still do not know, whether there is even more output available. You could however retrieve the data in a loop and append it e.g. to a StringBuffer, until EOF is encountered.

  • Sending image sequence job to compressor in command line : how to set the framerate?

    Hello,
    In Compressor, when you import a image sequence, it's possible to set the framerate and add an audio file before choosing a preset and lauching the encoding task.
    I want to dlo the same thing with command line. I know how to send a compressor job with command line, but no how to add theses settings.
    In the compressor command line help, we've got this :
    Job Info: Used when submitting individual source files. Following parameters are repeated to enter multiple job targets in a batch
              -jobpath <url> -- url to source file.
                                               -- In case of Image Sequence, URL should be a file URL pointing to directory with image sequence.
                                               -- Additional parameters may be specified to set frameRate (e.g. frameRate=29.97) and audio file (e.g. audio=/usr/me/myaudiofile.mov).
    So there are also framerate and audio parameters in command line but i've no idea how to write the command line with theses parameters
    Here is an example of command line for Compressor (by Apple) :
    ./Compressor ‑clusterid tcp://127.0.0.1:51737 ‑batchname myBatch ‑jobpath /Volumes/Source/ShortClips/NTSC24p.mov ‑settingpath /Users/stomper10/Library/Application\ Support/Compressor/PhotoJPEG.setting ‑destinationpath /Users/machinename/Movies/myDestinationFilename.mov.
    Thank you for your help!

    You can see in the command sh running-config command
    show running-config : Displays the current access point operating configuration
    Use the guest-mode SSID configuration mode command to configure the radio interface (for the specified SSID) to support guest mode. Use the no form of the command to disable the guest mode.
    [no] guest-mode .
    Here is the guideline for usage
    The access point can have one guest-mode SSID or none at all. The guest-mode SSID is used in beacon frames and response frames to probe requests that specify the empty or wildcard SSID. If no guest-mode SSID exists, the beacon contains no SSID and probe requests with the wildcard SSID are ignored. Disabling the guest mode makes the networks slightly more secure. Enabling the guest mode helps clients that passively scan (do not transmit) associate with the access point. It also allows clients configured without a SSID to associate.
    Examples
    This example shows how to set the wireless LAN for the specified SSID into guest mode:
    AP(config-if-ssid)# guest-mode
    This example shows how to reset the guest-mode parameter to default values:
    AP(config-if-ssid)# no guest-mode

  • How to set the value of process variables/payload using a managed bean?

    Hello,
    Someone can give me an example about how to set the values of a process payload in a managed bean?
    thank you!

    Try this:
    jsf page:
    <af:selectOneChoice label="Select Suburb"
    requiredMessageDetail="Select a suburb"
    valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
    validator="#{selectOneChoiceBean.validate}"
    unselectedLabel="None" autoSubmit="true"
    binding="#{selectOneChoiceBean.selectOneChoice}"
    value="#{selectOneChoiceBean.value}">
    <f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
    </af:selectOneChoice>
    backing bean:
    public class SelectChoiceBean {
    private List<SelectItem> selectionList;
    private String value = "B";
    private RichSelectOneChoice selectOneChoice;
    public SelectChoiceBean() {
    initSelectionList();
    public void setSelectionList(List<SelectItem> selectionList) {
    this.selectionList = selectionList;
    public List<SelectItem> getSelectionList() {
    return selectionList;
    public void onValueChanged(ValueChangeEvent valueChangeEvent) {
    System.out.println(valueChangeEvent.getNewValue());
    // Add event code here...
    public void validate(FacesContext facesContext, UIComponent uIComponent,
    Object object) {
    // Add event code here...
    private void initSelectionList() {
    selectionList = new ArrayList<SelectItem>();
    selectionList.add(new SelectItem("A", "A label"));
    selectionList.add(new SelectItem("B", "B label"));
    selectionList.add(new SelectItem("C", "C label"));
    public void setValue(String value) {
    this.value = value;
    public String getValue() {
    return value;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    }

  • How to set font of a row in DataGrid? (FB3)

    I have found examples of how to set the background color of a row based on an attribute of the data item in the row, but I cannot find anything that tells me how to set the font style. Ideally I want to choose either normal or italic based on an attribute which is not displayed in the data grid (as is possible for background color).Can anyone help?
    Thanks

    The first item renderer post on my blog has an example that colors text
    differently.  You can use a similar technique to change the fontStyle

Maybe you are looking for

  • Solution Design questions/suggestions/help needed

    Hi, I would appreciate any inputs regarding this. I am thinking of designing Solutions in Solman for our landscape which consists of ECC 6 and PI 7.1; each having a 3 system landscape D-Q-P. Is there an issue if I create Solutions Dev, QA and Prod vs

  • Re:Bursting control file with multiple sub templates

    Hi Can any one let me know how to create a bursting control file for multiple sub templates. I.e I have one main template which will invoke other templates. the normal bursting control file which i have created is sending an output with no data , but

  • Command R Recovery Not Working

    Dear All, I'm a little stuck.  There's something wrong with my OSX (Mavericks 10.9.5) that is stopping me from booting in the regular way ( I get stuck @ the grey screen), Booting and using Command R does nothing (tried many times for long periods),

  • Can't transfer book to device - Mac Adobe Digital Edition for kobo

    Everytime I try to transfer a book in my library (downloaded from the public library) to my ereader it has an error and unexpectedly shuts down. Help? Process:         Adobe Digital Editions [365] Path:            /Applications/Adobe Digital Editions

  • Protected Tab Titles not allowed

    Hi Experts, I have created a tab strip by using tab strip wizard. Now while executing my transaction I am getting message. " Protected tab titles are not supported (tab 'my tab name' title 'TAB STRIP TITLE') ". How to remove this message. Please expl