Output of an Array

Hi everybody,
I was just playing with the CFLIB metaheaders and everything works fine for a beginner (http://cflib.org/udf/GetMetaHeaders). Now I see all the results in the cfdump, but I want these results in a cfoutput. How can I work it out, that I can have an output of this array, because I want to save these results in a database?
Any help is appreciated

If it's a 1D array, it's a simple loop from 1 to the arraylen.
For 2D arrays, I'd try something like this, and this will only work if there are no blank cells in the array.
<cfset Columns = 1>
<cfset FoundNumCols = false>
<cfloop condition = "FoundNumCols is false">
<cftry>
<cfset x = TheArray[1][Columns]>
<cfset Columns = Columns + 1>
<cfcatch>
<cfset FoundNumCols = true>
closing tags.
Same thing for rows.
<cfoutput>
<cfloop from = 1 to = Rows index = "row">
<cfloop from = 1 to = Columns index = "column">
#TheArray[row][column]
closing tags

Similar Messages

  • Output of piped array only showing one result

    I thought what I was doing was pretty simple, but I am a bit stumped on what is happening here. First, I have an XML document I am importing. Here is a sample of the XML
    <Sites>
    <Site Url="http://sharepoint/personal/joe" />
    <Site Url="http://sharepoint/personal/mary" />
    <Site Url="http://sharepoint/personal/nick" />
    <Site Url="http://sharepoint/personal/walter" />
    </Sites>
    The output I want to achieve through PowerShell is just a list of the user names: joe, mary, nick, and walter
    Here is my PowerShell
    [xml]$MySites = Get-Content C:\Sites.xml
    $MySites.Sites.Site | Select Url | Out-String | % { $_.Substring($_.LastIndexOf("/")+1)}
    This code only outputs 'walter'. If I remove the last part of the pipe and just run this
    [xml]$MySites = Get-Content C:\Sites.xml
    $MySites.Sites.Site | Select Url | Out-String
    then the output is everything as expected, but as the full URL. I have also tried changing the code a bit to this
    [xml]$MySites = Get-Content "C:\Sites.xml"
    $Users = $MySites.Sites.Site | Select Url | Out-String
    foreach ($user in $Users) {
    $user.Substring($user.LastIndexOf("/")+1)
    But this still just gives me 'walter'.
    Any ideas why a substring would change the output of an array like this?

    You aren't creating an array. You are giving the variable a string. Pipe $Users to Get-Member to see that it is a string.
    Here is an alternate way to do what you want
    Split-Path (([xml](Get-Content "C:\Sites.xml")).Sites.Site.Url) -Leaf

  • How can i save the values of output waveform in array ?

    hi
    how can i save the values of  output waveform in array ?

     how can i save the values of  output waveform in array ?
    the program is attachment bellow
    Attachments:
    closed loop transfer fn+fuzzy.vi ‏28 KB

  • How to output last 4 arrays from a For Loop?

    Hi People,
    I am almost at the end of my tether. I really hope someone could please help me.
    Any input would be welcome. VI attached.
    VI explanation:
    I initialize an array.
    The random number generator simulates my camera input.
    Depending on which iteration it is, the data is added into one of four output arrays.
    'x-y*floor(x/y)' gives a remainder value of 0, 1, 2 or 3.
    'Case Selector' just adds 1 to 'x-y*floor(x/y)' to get case 1, 2, 3 or 4.
    Shots 1, 5, 9 etc are added to Array 1 (Case 1).
    Shots 2, 6, 10 etc are added to Array 2 (Case 2).
    Shots 3, 7, 11 etc are added to Array 3 (Case 3).
    Shots 4, 8, 12 etc are added to Array 4 (Case 4).
    Averaged Output displays the averaged value i.e. the total value divided by the number of shots saved in that array ('Set (IQ+1)').
    My problems are:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)
    Putting it outside the main For Loop with auto-indexing off gives me only the last set of data. (I need the output for 4 Arrays, not just the last run)
    Putting it inside the main For Loop (as shown) gives me the same number of files as number of iterations. (Again not feasible due to large number of files that will be generated and slow camera capture)
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I am using Labview 2010.
    Thanks so much,
    Jaslyn
    Solved!
    Go to Solution.
    Attachments:
    Help Understanding Arrays and file paths (10).vi ‏26 KB

    Thanks so much Lennard!!
    Hi JKSH,
    I've been busy trying to complete the dang code, but for completeness so that other users can learn too, I shall answer your queries. Thanks for looking in.
    First, what do you mean by "add"? Your code in your case strcuture sums your input values, so your array size doesn't change. However, you also said "Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)" -- it sounds like you are expecting an array with thousands of elements. So, what should "Output Array N" look like?
    Ans: Output Array N should be a 4x4 array of the summation of all the numbers generated during every 4th iteration.
    i.e. if random number 1=1, random number 2=2, etc, And 'No of iterations' is 12,
    Output Array 1 should be 1+5+9:
    15 15 15 15
    15 15 15 15
    15 15 15 15
    15 15 15 15
    (Note: Most of your arrays are 4x4, but in Case #2 you created 128x128. I prersume this is a typo?)
    Ans: Kind of, I'm using a 4x4 array of randomly generated numbers as an example but my actual data will be the 128x128 pixel output of a camera. And during actual experimentation, 'No of Iterations' will number in the thousands.
    Second, why do you add your "simulated camera input" to the "Initialized Array"? You can add it direcly to the previous output inside your case structure.
    Ans: See answer to question 3
    Third, have a look at shift registers: http://www.ni.com/gettingstarted/labviewbasics/shiftregisters.htm. Use them instead of Feedback Nodes to make your code tidier.
    Ans: I did try.. But I can't seem to add shift registers to the case structure, only the for loops outside. Are you sure it can be done..?
    jaslyn wrote:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    You will need to call "Write to Text File.vi" 4 times to write 4 files. So, you should finish your loop, then call this VI 4 times.
    Ans: How do I get it to extract the data from each of the 4 cases in my case structure?
    jaslyn wrote:
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    You can create strings first, then convert them into paths: http://zone.ni.com/reference/en-XX/help/371361G-01/glang/string_to_path/
    Thanks
    jaslyn wrote:
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I'm not sure what you're asking; can you please clarify what you mean by "avoid using Memory Manager"? But anyway, you've actually initialized FIVE arrays: 1 outside the loop, and 1 inside each case.
    I've read that to avoid fluctuations in memory usage, it is a good idea to initialize arrays to their expected size before the start of data collection. That was just what I was trying to do.

  • Can I have both static text and the output of an array in the body of an email?

    I have been scouring forums for something on this for a while now and have not found a whole lot. I'm trying to send a group of emails out to server owners in our company for a cleanup/consolidation project. I have a working script and of course now my boss
    wants it changed. I have the script set up to find all the servers a person owns and put it into a CSV file. Then it attaches it to an email with instructions on how to get everything updated. Now my boss does not want the list in an attachment but right in
    the body of the email. I'm pretty sure this is something Powershell can do, but I'm clueless on where to begin let alone how that would work.
    Here is my current script minus the confidential stuff :) I just need to know where to start since it can't be in html format. I'd probably know if I knew powershell a little better, but well I've only been working with it for a few months now.
    #Get SQL Database objects and places them into array $Sqldb
    $Sqldb = New-Object System.Data.DataSet "myDataSet"
    $sqlConn = New-Object System.Data.SqlClient.SqlConnection("Data Source=<SQL Server>;Initial Catalog=ServerBook;Integrated Security=True")
    $adapter = New-Object System.Data.SqlClient.SqlDataAdapter("SELECT ServerName,Owner,SupportContact,SupportExternal,ServerDescription FROM v_ServerBook_BasicInfo",
    $sqlConn)
    $adapter.Fill($Sqldb)
    #reorganizes $Sqldb by property owner
    $Sqldb = $Sqldb.Tables[0] | Sort-Object -Property Owner
    #stores list of unique owners and eliminates duplicates
    $owners = ($Sqldb.owner | Get-Unique)
    #eliminates null values from the list of owners
    $owners = $owners | where{$_ -ne "" -and $_ -ne $null -and $_ -ne [dbnull]::value}
    foreach($owner in $owners){
    #Get the servers for the current owner
    $servers = $Sqldb | where{$_.owner -eq $owner}
    #CSV output filename ($owner.csv)
    $newfile = "\\file\path\$owner.csv"
    #Export the servers to the filename
    $servers | select ServerName, Owner, SupportContact, SupportExternal, ServerDescription | Export-Csv -path $newfile -NoTypeInformation
    #copies the server owners name to $ownername variable
    $ownerName = $owner
    #switches the format of the ownername variable to lastname,firstname
    $Username = "$($Owner.Split(" ")[1]), $($Owner.Split(" ")[0])"
    #gets email address for owner from AD
    $EmailAddress = Get-ADuser -Filter "Name -eq '$Username'" -properties emailaddress -server ads.domain.com | select-object emailaddress
    #splits the $emailAddress vaiable to help eliminate extra text original text looks like @{emailaddress = [email protected]}
    $Emailaddress = $Emailaddress -split '[=}]' ,0
    #removes extra text at the beginning of the variable leaving just [email protected]
    $Emailaddress = $Emailaddress.TrimStart("@{emailaddress")
    #stores the body of the email into a variable
    $message = "Hello,
    Blah Blah Blahbity Blah
    Thank You,
    <Signature Block>"
    #Sets the from email address
    $emailFrom = "[email protected]"
    #Sets the email subject
    $subject="Test Email"
    #sends the email with attachement for the current owner
    Send-MailMessage -To "$EmailAddress" -Subject $subject -Body $message -SmtpServer "<smtp.domain.com>" -From $emailFrom -Attachments $newfile -DeliveryNotificationOption OnSuccess

    So I can just put my output variable into the email body variable.... since it's a table with headers should I do anything special for formatting the table?
    My output now looks like :
    ServerName
    Owner
    SupportContact
    SupportExternal
    ServerDescription
    Server1
    Me
    Me
    TrendMicro OfficeScan 10.5
    Server2
    Me
    Me
    TrendMicro Deep Security Test
    Server3
    Me
    Me
    Test Server
    Server4
    Me
    Me
    Application Server
    Well it's a little garbled there but you get the idea

  • Output problem in array, code included.

    Been hacking away at a starting java class for a few months now, and never had to resort to asking you guys for help.
    However, i missed class all week due to work conflicts, so i couldn't question my professor on this problem. Oddly, the actual array bits i'm fine with, but the output has me stalled.
    The program is ment to square the numbers 1-10, and then it wants me to output the square and the original number on the same line (It also wanted me to use Math.pow to get the squares, but that gave me a whole slew of syntax errors i couldn't figure out, so i did it the easy way).
    I'm not sure how to do this, have tried quite a few things, but i'm fairly certain i'm just missing something obvious, any tips would be helpful.
    import javax.swing.*;
    public class J6E1 {
       public static void main( String args[] )
          int []  Data = new int [11];
          for (int x=1; x<Data.length; x++)
              Data[x]  =  (x*x);
          for  (int x=1; x<Data.length;x++)
                   System.out.println(Data[x] );
          System.exit(0);
    }

    So for a given x, you have stored x*x value in Data[x].
    What about printing both x and Data[x] then?

  • Problems with the output of an array

    Hallo,
    I have got problems with giving out an array.
    I declared two arrays and puted them out, but with the
    resultarray it doesn�t work. Cansomebody help me?
    Here is a runtime output:
    Grad eingeben!
    1
    Koeffizienten eingeben!
    1
    2
    1x^0 + 2x^1 +
    1
    Grad eingeben!
    3
    Koeffizienten eingeben!
    2
    3
    4
    5
    2x^0 + 3x^1 + 4x^2 + 5x^3 +
    3
    p:1
    this:3
    And here is the source code
    // Die Klasse Polynom dient dem Umgang mit dem Polynom
    //Sie enth�llt die Methoden:
    //   > public void readCoeffizients()
    //   > public void show()
    //   > public int getGrad()
    //   > public Polynom add(Polynom p)
    //Und den Konstruktor:
    //   > public Polynom(int  n)
    public class Polynom
      private int grad;
      int [] coeffizient;
      private Polynom q1;
      public Polynom(int  n) //Konstruktor mit Stanard-Initialisierung
        this.grad = -1;
        this.coeffizient = new  int [n+1];
        for(int i=1; i<(n+1); i++)
          this.coeffizient[i] = 0;
      public void readCoeffizients() // Methode zum Einlesen der Koeffizienten
        this.grad = (coeffizient.length)-1;
        System.out.println("Koeffizienten eingeben!");
        for(int i=0; i<(grad+1);i++)
          this.coeffizient[i] = Eingabe.intValue();
      public void show() // Methode zum Ausgeben des Polynoms
        for (int i=0; i<(this.getGrad()+1);i++)
          System.out.print(coeffizient[i] + "x^" + i + " + ");
        System.out.println();
      public int getGrad()
        return this.grad;
      public Polynom add(Polynom p) // Methode zum Addieren zweier Polynome
        System.out.println("\np:" + p.getGrad());
        System.out.println("this:" + this.getGrad());
        if(p.getGrad() >= this.getGrad()) // Vorgehen falls p.getGrad() gr��er als this.getGrad()
          q1 = new Polynom(p.getGrad());
          grad = p.getGrad();
          for(int i=0; i<(this.getGrad()+1);i++)
            q1.coeffizient[i] = this.coeffizient[i] + p.coeffizient;
    for(int i=(this.getGrad()+1);i<(p.getGrad()+1);i++)
    q1.coeffizient[i] = p.coeffizient[i];
    else // Vorgehen falls this.getGrad() gr��er als p.getGrad()
    q1 = new Polynom(this.getGrad());
    grad = this.getGrad();
    for(int i=0; i<(p.getGrad()+1);i++)
    q1.coeffizient[i] = this.coeffizient[i] + p.coeffizient[i];
    for(int i=(p.getGrad()+1);i<(this.getGrad()+1);i++)
    q1.coeffizient[i] = this.coeffizient[i];
    return q1; // R�ckgabe des Ergebnisspolynoms
    // Diese Klasse testet die Klasse Polynom
    public class Test
    public static void main(String[] args)
    System.out.println("Grad eingeben!");
    Polynom p1 = new Polynom(Eingabe.intValue());
    p1.readCoeffizients();
    p1.show();
    System.out.println(p1.getGrad());
    System.out.println("Grad eingeben!");
    Polynom p2 = new Polynom(Eingabe.intValue());
    p2.readCoeffizients();
    p2.show();
    System.out.println(p2.getGrad());
    //Polynom p3 = (p2.add(p1));
    //p3.show();
    (p2.add(p1)).show();
    Thanks for your help!

    Ehm, this should really be obvious: because in the
    first two cases you are using the constructor
    and readCoeffizients(), whereas in the third
    case you are only using the constructor.You?re right, but I initiate grad in the add method.Then look again: you don't! You are calling the constructor, but the constructor is not assigning grad in a proper way. If you are refering to the line grad = p.getGrad();this is in fact equal to this.grad = p.getGrad();But this.grad is not q1.grad (which is private). Assign grad in the constructor only (where it belongs) or better still don't use grad at all and derive the degree of the polynom from the length of the coefficients array.

  • Output from an array

    forgive me for this but i need some guidance.
    Ive got an array of integers, how can i convert these to a string. I was sure there was a toString function but having checked the API for arrays im in trouble.
    I tried to set a string variable like you output to the screen:
    String arrayAsString = array[0] +" "+ array[1] +" "+ array[2] +" "+ array[3] +" "+ array[4];but it wouldnt work.
    This is what i want:
    Array:
    | 1 | 9 | 17 | 23 | 40 | ------> String: "1 9 17 23 40"
    Any help? is there a toString function??? im sure ive seen it before somewhere
    Thanks

    I tried to set a string variable like you output to
    the screen:
    String arrayAsString = array[0] +" "+ array[1]
    +" "+ array[2] +" "+ array[3] +" "+ array[4];
    That's what you'd do, or better yet concatenate together in a loop ranging from 0 to the length of the array.
    but it wouldnt work.Yes it would, given an array containing at least 5 integers anyway.

  • How come the output of the Array Subset VI is 2-D when I specify a 1-D subset?

    1. I'm trying to strip off a row from a 2-D array so I can search for a match within that row. When I use Array Subset and specify one row as the subset (for example, Row Index=0, Row Length=1, Column Index=0, Column Length=(a variable, typically 255), the output is a 2-D array.
    2. Do I have to use Reshape Array on the output of Array Subset to get the desired 1-D array? The help popup says I have have to add m dimension sizes to have the output be an m-dimensional array. If I add a dimension size, I get a 2-D output. If I fall back to one dimension size and hardwire it to '1', I get a 1-D array wire type but apparently the array doesn't contain all the data in the row from the original 2-D array.
    I'm using LV 5.1. What is the easiest way to strip off a row from a 2-D array in LV 5.1?
    I appreciate any help you can provide.
    Thanks,
    Jeff Bledsoe
    Jeffrey Bledsoe
    Electrical Engineer

    JeffreyP wrote:
    What is the easiest way to strip off a row from a 2-D array in LV 5.1?
    The easiest way to has always been just to use the "Index Array" function, choosing the indice of the row you wanted and with nothing wired to the column terminal (the lower one).
    Edit: I'm assuming that by "strip off" you mean "access", not "strip out"/"remove".Message Edited by Donald on 05-13-2005 02:03 PM
    =====================================================
    Fading out. " ... J. Arthur Rank on gong."
    Attachments:
    Index Out Row.jpg ‏6 KB

  • How to see the output of associative array in procedure

    Hi ,
    I tried the following code
    And confused about looking at the output of the associative array.
    CREATE OR REPLACE PACKAGE test_pak1
    AS
       FUNCTION map_object (obj_typ_in VARCHAR2)
          RETURN VARCHAR2;
       CURSOR c_c1
       IS
          SELECT * FROM emp;
       TYPE test_ttyp IS TABLE OF c_c1%ROWTYPE
                            INDEX BY PLS_INTEGER;
       PROCEDURE search_obj (obj_type VARCHAR2);
    END;
    CREATE OR REPLACE PACKAGE BODY test_pak1
    AS
       FUNCTION map_object (obj_typ_in VARCHAR2)
          RETURN VARCHAR2
       IS
       BEGIN
          dopl ('Hello');
          RETURN abc;
       END;
       PROCEDURE search_obj (obj_type VARCHAR2)
       IS
          test_tab   test_ttyp;
       BEGIN
            DOPL  (test_tab);
          end;
       END;In the above code i want to see the output of the test_tab which is in the procedure search_obj.
    could you please help me in this
    Thanks

    Hi ,
    Though the table has the records , the associatve array declared on this table is showing 0 records..
    Create or replace package test_pak1 as
    FUNCTION map_object ( obj_typ_in VARCHAR2 ) RETURN VARCHAR2;
      CURSOR c_c1
        IS
    SELECT  *
            FROM dept;
        TYPE test_ttyp IS TABLE OF c_c1%ROWTYPE INDEX BY PLS_INTEGER;
    procedure search_obj(obj_type varchar2);
    end;
    Create or replace package body test_pak1 as
    FUNCTION map_object ( obj_typ_in VARCHAR2 ) RETURN VARCHAR2
         IS
      begin
           dbms_output.put_line ('Hello');
      return 'abc';
    end;
    procedure search_obj(obj_type varchar2) is
       test_tab test_ttyp;
      begin
        DBMS_OUTPUT.put_line ('nested array count value'|| test_tab.COUNT);
                             FOR i IN 1 ..  test_tab.COUNT LOOP
                                 dbms_output.put_line( test_tab(i).deptno||' '|| test_tab(i).dname);  end loop;
       end;
    end;  
    begin
      test_pak1.search_obj('HYD');
    end;  Though the table has the records the count of the associative array is showing 0 records ... Why
    Thanks

  • 2D array output in a loop

    Hello,
    I need output data (several array string) from FOR-loop to 2D array. I use Replace array subset inside the loop (after array initialize). Output works (I see each step right string in its right place), But each next loop clear all previous strings to 0 0 0 . Finally stay only the last string in result array (see fig). Output to file works perfectly.
    Similarly, no result outside of loop. 
    WHY?
    I'm beginner...
    Solved!
    Go to Solution.

    Hi zazra,
    But outside Out_array 2 and Out_array are empty (grey zero fields). 
    THINK DATAFLOW!
    Those two array indicators stay empty UNTIL the FOR loop finishes!
    How to use out_array 4 - data outside the loop?
    Either finish the FOR loop - or use a local variable (as easiest, but not the only solution)…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Formatting array output

    how do i format the output of an array so that only a certain number of the elements print per line. i know this is basic, i am a beginner and need help.

    final int itemsPerLine = 5;
    int counter = 0;
    String myArray[]; // This will contain your array
    while (counter < myArray.length) {
        System.out.print(myArray[counter]; // Print out the item
        counter++; // increment our counter;
        if (counter%itemsPerLine == 0) {
            System.out.print("\n"); // ad a line return
    }This is one example. It prints out the next string in the array (which you need to initialise and populate first), increments the counter, then checks the modulus to see if its time for a newline.
    Rob.

  • LabVIEW DLL 2D Array output deallocati​on

    Hey everyone,
    I am using a custom built DLL made with LabVIEW.  One of the functions outputs a 2D array of data by "handle".  I can catch the 2D array from the function just fine from within my C program, however I have a question about deallocating the memory allocated by the LabVIEW DLL for the 2D array.
    I call the DLL function repeatedly in a loop and as this occurs the RAM used on my machine continues to increase until it is full or I exit the program.  There are no other dynamically allocated peices of data within the C program that could be causing this.
    The question is, can I call free() on the 2D array handle safely?  Is this the correct way to deallocate the 2D arrays passed out of LabVIEW DLL functions?  One dimension of the 2D array is always the same size, but the other dimension varies per call.
    Here is an example (I have renamed function calls and library headers due to security reasons):
    #include "DLLHeader.h"
    int main(void)
        ResponseArrayHdl myArray = NULL;
        DLL_FUNC_InitializeLibrary();
        DLL_FUNC_ConfigurePortWithDefaults("COM3");
        DLL_FUNC_StartAutoSend(9999999);
        while(DLL_FUNC_IsTransmitting())
            DLL_FUNC_GetAllAvailableResponseMessagesByHndl(&my​Array);      // gets the 2D array
            // do something with array data here!
            free(myArray);   // is this the appropriate way to clean up the array?
            Delay(0.05);
        DLL_FUNC_GetAllAvailableResponseMessagesByHndl(&my​Array);      // gets the 2D array
        // do something with array data here!
        free(myArray);   // is this the appropriate way to clean up the array?
        DLL_FUNC_ShutdownLibrary();
        return 0;
    from DLLHeader.h:
    typedef struct {
        } ResponseMessage;      // created by the LabVIEW DLL build process
    typedef struct {
        long dimSize;
        ResponseMessage Responses[1];
        } ResponseArray;
    typedef ResponseArray **ResponseArrayHdl;   // created by the LabVIEW DLL build process
    I want to make sure this is an appropriate technique to deallocate that memory, and if not, what is the appropriate way?  I am using LabVIEW 7.1 if that matters.  The C program is just ANSI C and can be compiled with any ANSI C compliant compiler.
    Thanks!
    ~ Jeramy
    CLA, CCVID, Certified Instructor

    Tunde A wrote:
    A relevant function that will be applicable in this case (to free the memory) is the "AZDisposeHandle or DSDisposeHandle". For more information on this function and other memory management functions, checkout the " Using External Code in LabVIEW" reference manual, chapter 6 (Function Description), Memory Management Functions.
    Tunde
    One specific extra info. All variable sized LabVIEW data that can be accessed by the diagram or are passed as native DLL function parameters use always DS handles, except the paths which are stored as AZ handles (But for paths you should use the specific FDisposePath function instead).
    So in your case you would call DSDisposeHandle on the handle returned by the DLL. But if the array itself is of variable sized contents (strings, arrays, paths) you will have to first go through the entire array and dispose its internal handles before disposing the main array too.
    Rolf Kalbermatter
    Message Edited by rolfk on 01-10-2007 10:43 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • DAQmx continuously update output array from example

    Hello,
    I am using the example Synch_AI-AO in the DAQmx folder and it works great for sine waves, pulses, triangle waves or anything periodic. However, I would like to output a noise array which is generated from the WhiteNoise function, which is continously updated every N seconds. 
    I have tried calling the StopCallback then the StartCallback after delaying for N seconds, but since I have to be in function when I call these callbacks I end up getting back to the place where I called them before exiting them (like recursion), which kills my program.
    Is there a way to update output so that it doesn't cause the recursion issue that locks up my program?
    Thanks.

    Hi EricJR,
    Rather than calling the StopCallback and StartCallback functions, have you tried calling the DAQmxWriteAnalogF64 function every time new samples are generated?

  • Usb 6009 continuous analog output

    Hi
    I'm pretty new to Labview, so you may have to bear with me. I have a USB-6009 and I want to generate a continuos analog output voltage. I've got the example you have posted 'Gen Mult Volt Updates-SW Timed_LV7.1 (0 to 4).vi' working and it outputs a continuous sine wave.
    In a similar manner I need to generate:
    1. Ramp up voltage (and ramp down voltage): starting with a continuos constant voltage, which after a period of time linearly increases to another constant voltage, and which allows me to specify the 3 time intervals and the rate of increase.
    2. Pulsations: whereby I can specify the amplitude and time interval of each pulsation
    This is so that I can control voltage to a valve which regulates my pipe flow. In the example I have (one stated above), I do not understand specifically:
    i. Why I need both a 'Software Loop Time (ms)' as well as 'Timeout'
    ii. The 'Sinusoidal Pattern' input which seems to generate data for a sine wave- I can't get a description of that and there are no similar VIs for other waveforms; and what is the function of the two numbers it has?
    iv. How do I change amplitude and time period for the wave?
    iii. What does 'Index Array' do?
    thank you

    Hi there,
    I'm guessing the VI you are using is the one from this KB:
    http://digital.ni.com/public.nsf/allkb/6F2C2B49A89D685C8625711D007BDD64
    i. The software timed loop control is to control the rate at which you change the voltage output.  The timeout on the DAQmx Write VI is the maximum time in seconds the VI will wait to output a sample (eg. if the write buffer is full, the Write VI will wait for it to become available for 'timeout' seconds before outputting an error).
    ii. The sine pattern is just an array constant of doubles that make up the sine wave voltage values, and the for loop adds an offset (of two volts) to every single one of those values. You might want to replace that entire array constant and for loop with a Simulate Signal Express VI (just search for Simulate Sig or look in the Functions >> Input palette) and convert the dynamic data output to an array of doubles.  You can configure the type of waveform, amplitude, and time period from that express VI as well.
    iii.  Refer to previous answer.
    iv.  Index array returns an element of an array based on the index input.  You can turn on the context help and move your mouse over functions to get more help on them.
    I hope that helps!
    Way S.
    NI UK Applications Engineer

Maybe you are looking for

  • Solaris 10 Ldap Client user authentication against edirectory

    Hello, We have moved some of our oracle databases from linux to solaris 10 u7, I need to setup secure ldap authentication for the users against a linux based eDirectory server. Can some one point me in the right direction of good documentation or a g

  • AIR 1.5 Install problem

    Hi I have the same problem as many others but I could not find my solution. I get this error when trying to install AIR 1.5: An error occurred while installing Adobe AIR. Installation may not be allowed by your administrator I have 1.1 installed when

  • How to move all contacts TO the SIM card on an N97

    I have searched and while some topics exist on taking from the sim card using Nokia Suite, none address my issue of moving contacts from phone memory to the SIM Card. I have the latest N97 and Nokia Suite updates, but I can find no way to write to th

  • Edit css for a theme

    Hi, How can we edit the css file for a built-in theme? Can we upload a new css file and use it instead of the default css, if so how? Thanks, Machaan

  • HT1430 I changed my password at another station n the iPad email is not working. What should I do

    On the iPad there is email. I changed e password at another station at work and now the one on the iPad is not accepting new mail. How can I restart the email on iPad?