The initialization of the array in a Unique way

Hi all

I'm new on this and tried for several hours, how do the following "simple" without success. I am using a cDAQ 9171 with a NI 9263 analog output module.

My problem: I need to start the program after, when the Start button is pressed. Please, in order of priority I give you what I have to do.

1. output of an analog picture that affluent fixed values. Be it 5; 4; 3; 2; 3; 4. I so need to stay 1 min in each value, and then repeat the set for 10 times more.

I tried with the attached draft, but it produces only a signal of 1V, even when the annexed table is changing... I don't know what happened.

2. I wanted to automatically create the table that I mentioned earlier. But it gave me headaches so I left it.

Thanks in advance for your help.

Stream.

No data is written to the DAQ hardware write until your loops to complete.  That's because the writing is outside the loop For.

I would recommend you put put highlight execution and watch our your VI is slow.

Then I recommend looking online LabVIEW tutorials
LabVIEW Introduction course - 3 hours
LabVIEW Introduction course - 6 hours

Tags: NI Software

Similar Questions

  • Best way to initialize a queue with the elements of the array

    Hi guys

    I'm looking for a bit of performance optimization...

    I'm developing an application of measure of noise using LV8.6 and Win Xp /Win 7.

    To say things very simple, I have a loop that samples and a loop that does the calculation. data are shipped in a queue waiting, producer / consumer lifestyle.

    So far so good.. It is - is there a specific and more optimized way to declare this queue?

    I was wondering if the notifier queue with an initialized in fixed size array element (the number of samples PR. read sound card will be known at run time) would produce a line which would be less burdensome on the dynamic memory compared to an allocation obtained using a simple queue control no value.

    I have attached a copy of Θcran to maybe make the most obvious question...

    I've been thru "clear as mud" thread, as recommended in other threads that covers this topic - but I get very high-tech, and I lost my way into it so... If you are looking for a more simple "you must use the #x solution, because...". »

    Thank you in advance.

    H ha wrote:

    you use solution # 2 because the initialization of an array first and by replacing its elements allocates any memory needed both as opposed to reorganize the memory as the table grows in size.

    That your response has to do with a queue?

    Using the option 2 is not a thing about creating a queue with a fixed number of items. Either you start with an empty queue. If you used a constant empty table with option 1, then this would require less memory in the VI himself. If you want to set the size of the queue, thread of something of this entry.

  • Initialization of an array to match another size of array using the formula node.

    I want to get a few different pictures of the same length and constants in the formula node and output a table corresponding to their length after some minor calculations. Another post, I discovered that I can simply initialize the table as such:

    float pp [100];

    The problem is that I find myself with a much bigger picture than what I need. I want to do is something like:

    float [n] pp.;

    where n represents the entry of an array size in the form node or is something like:

    n = sizeOfDim(td0,0);    Here I use a table 1 d

    None of these methods seem to work. How do I initialize my picture 'pp' such that it matches the length of array 1 d of "td0?

    The more likely your initialization externally.  Create an entry named pp and wire td0 inside as well.  Now create an output with the pp even name and it will contain an array of the desired length.  Of course, this assumes that you want to edit all items in pp.  Otherwise, just use initialize the array to create a new table and feed in the length of td0, and whatever default value you want (ie. 0 or NaN).  The blank values will keep this value after the node of the formula.

  • 'Replace the element of the array' replaces not only indexed items

    Hey masters LabView,.

    Fairly new to Labview and I'm trying to sort out how to create a table of images. I know that the total number of images I want in my 'stamp' (not the buffer of LabView), so I'm the initialization of an array of this size. Can I bring this table in a loop For with a shift register, and I want to capture images and write them in the table of the buffe continuously (a comment: I do a circular buffer, but I don't want to implement in LabView, because there a lot of things that I don't need and I will eventually have to the process to be as thin as possible).

    Here's the problem (I assume an implementation, that does not decompose LabView):

    I expect:

    AN element of the array, in the position indicated by the index of the loop [i], is replaced by the image newly caught

    I get:

    All THE elements of the array becomes the image newly caught.

    (I can tell because I taste under the table, grabbing a single image from a constant "Check Array" index - may 7, for example.) But my index of the loop [i] value is 13, and the subsample becomes again the image newly caught.

    What a ridiculous thing I am doing wrong?

    Any help would be greatly appreciated.

    Ah, I just noticed something.  Initialize you an array of references at the beginning of your program, but it is a complete picture OF THE SAME REFERENCE: you must call the IMAQ Create in a loop so that you actually get unique references in your table.  You must have a different NAME for each image.

  • Type a table defined clusters to hold configuration data - definition of default values for each element of the array

    Hello

    I was wondering if I could get some information and opinions on the use of an array of type defined clusters to store configuration data.  I am creating a program to test several EHR and wanted to have a control of type defined for each HAD with the information needed to create the DAQmx tasks for all signals for it must HAVE.  I am eager to do so that the data are encoded in hard and not in a file that the user might spoil.

    Controls of type def are then put into a Subvi who chooses as appropriate, one based on the enumeration of Type DUT connected to a case structure.

    I have problems with the control of the defined type.  I see issues when you try to save a configuration unique to each element of the array in the array of clusters.  Somehow, it worked at first, but now by clicking on "Operations on the data--> default font of the current value ' on individual elements of the cluster or the entire cluster (array element) does not save data when I re - open the command def.  What I am doing wrong?  I'm trying to do something with the berries of the clusters that I shouldn't do?

    I enclose one of the defined reference type controls.  I tried to change it bare to see if that helped, but no luck.

    To reproduce, change the resource string for the element 0 of the array and do the new value by default.  Then close the def of type, and then reopen it.  The old value is always present in this element.  The VI is saved in LabVIEW 2012.

    The values of a typedef are not proprigated to the instances of the control. They get if created WHEN data values have changed. They will be not updated with the changes to come. You must create a VI specifically to hardcode your values or to implement a file based initialization. The base file would be much better and more flexible. If you don't want users to change the data simply encryption. There is a wedding blowfish library that you can download.

  • compare a variable to all elements in the array

    I know that this could be done by declaring unique visitors [10] instead of calling a variable for the length, but I'm learning how to use java more effectively. Here's the complete code:
    [code]
    package findunique;

    /**
    *
    * @author user
    */
    import java.util.Scanner;
    to import java.util.Arrays;

    public class findUnique {}

    /**
    @param args command-line arguments
    */
    Public Shared Sub main (String [] args) {}
    bring the scanner to capture the entrance
    The scanner keyboard = new Scanner (System.in);
    initialize variables and arrays
    int [unique];
    int loop;
    int loop2;
    int rt;
    [] int number;
    single int;
    unique = 1;
    Loop =-1;
    loop2 =-1;
    unique visitors = new int [unique];
    number = new int [10];
    loop for 10 entries
    While (loop < = 8) {}
    Add 1 to the loop counter
    ++ loop;
    RT = 1;
    Launch iner loop in order to ensure the entry is acceptable parameters
    While (rt == 1) {}
    System.out.println ("Please enter an integer between 10 and 100 :");
    Number [Loop] = Keyboard.nextInt ();
    If (number [loop] > 10 & & number [loop] < 100)
    RT = 0;
    else System.out.println ("Input out of range. Please try again. ») ;
    }
    Make sure the number is unique
    If (number [loop]! = unique visitors [0] & & number [loop]! = unique visitors [1] & & number [loop]! = unique visitors [2])
    & & number [loop]! = unique visitors [3] & & number [loop]! = unique visitors [4] & & number [loop]! = unique visitors [5]
    & & number [loop]! = unique visitors [6] & & number [loop]! = unique visitors [7] & & number [loop]! unique = [8])
    {++ loop2;}
    {If (loop2 > unique)}
    ++ unique ;}
    visitors unique [loop2] = number [loop] ;}
    }
    System.out.println ("unique integers entered are:" + Arrays.toString (unique));
    }
    }
    [/ code]


    I get an error IndexArrayOutOfBounds because of this line:

    If (number [loop]! = unique visitors [0] & & number [loop]! = unique visitors [1] & & number [loop]! = unique visitors [2])
    & & number [loop]! = unique visitors [3] & & number [loop]! = unique visitors [4] & & number [loop]! = unique visitors [5]
    & & number [loop]! = unique visitors [6] & & number [loop]! = unique visitors [7] & & number [loop]! unique = [8])

    I need to find a way to say:
    If (number [loop]! = unique visitors [allElements])

    where [allElements] is all the elements of the array in time.
    The goal is to keep the size of the visitors array [unique] only the actual number of unique integers entered.

    802281 wrote:
    using the loop check that the number is unique
    for (int i = 0; i)< 10;="">
    If (number [loop1]! = unique visitors [i] & number [i]! = 0) {}
    If so add a new one at loop2 and assign the number of the index following unique visitors]
    ++ loop2;
    visitors unique [loop2] = number [loop1];
    } }

    As I mentioned in the post above, here's the problem. See the code above I gave properly.

  • Elements of the array and the data binding

    In Flex 1.5 elements of the array do not support data binding. Here is an excerpt from a document of Flex 1.5 older ( Chapter 18, data binding):

    Quote:
    The tables can be used in the bindings in the same way as other types of object. However, the elements of array do not pull a ChangeEvent when their value is changed, so that they can not be used as a binding source when running.
    Data binding does not, however, copy initial values in the request or the instantiation of the component, so the connections with their source as an array element will be set to the value of the element of array (only once, at initialization time) and will not be updated later if the array element is changed.
  • Questions about to determine the size of the array of data storage with flexibility

    I try to use the CVI function below to load data from .csv file to the table that I was intending to use later:

    filereturnvalue = FileSelectPopup ("c:\\Users\\Desktop\\FileDirectory", "*.csv", "", 'Select the data file', VAL_LOAD_BUTTON, 0, 0, 1, 0, LoadFilePath);

    FileToArray (DATAArray, VAL_CHAR, LoadFilePath, MaxDataSize, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS, VAL_ASCII);

    For the data table "predetermined", it is quite straightforward, because the size of the table is already set.  However, I wonder if there is anyway I could use CVI directly import data and determine the size of the array on the fly?  Which means that the user need not know the length of the data, and it could be determined then to import the file.

    Hello

    for ASCII files, you can do so in any first read the file and counting the newline characters, something like:

    int file_handle;
    int index;
    int size = 0;
    char line_buffer [80];

    If (OpenFile (...) > 0)
    {
    While (ReadLine (...) > 0)
    {
    size ++;
    }
    }
    CloseFile(f) (file_handle);

    This way you can determine the number of rows you have, but you must have an idea of how long a line may be, one number per line or 32000 because you must specify the size of your line_buffer.

    In the next step you analyserions monotube for occurrence of your column separator (say a ;) to determine the number of columns (separators found + 1).

  • How can I index an element of the array as "index Board" function to labview?

    Hello:

    I am looking for a method to search an array with indexes and return the element specified by the given index.

    as the array index of the labview function, but I can't find an exact symbol in teststand-table-operations/functions.

    I am new to teststand and everyone knows how to use labview in teststand.

    anyone can teach me?

    Thanks in advance!

    Thanks anyway, found in the API

  • What is READ the array returned by the DAQmx meter? How can I know the two functions DAQmx READ data stream in the same WHILE loop?

    I have a question about the order of execution.  In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter.  In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine.  It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.

    (1.) I'm a little confused on what the meter of the READ function is back because it's a table.  What is a picture of?  I thought that it was up to the value of the individual periods between rising edges.  The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table?  Are the elements of the array the individual delays between the edges?  How many values are stored in the array by executing?   We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what.  How to understand the composition of this painting?  How can I change the composition of this painting?  Is it possible to measure only one period at a time, for example the time between TWO edges?

    2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop?  In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported.  The structure for the delivery of vi will be attached data in pairs like this?  I understand that one of the READING functions run not before the other function of READING in the WHILE loop.  I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?

    Thank you

    Dave

    Hi David,

    I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.

    The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

    Kind regards

    Jason D

    Technical sales engineer

    National Instruments

  • How to change the value of the array element by using the property node

    Hello all :)

    IM using a table in the drop-down list box. the size of the array is not fixed.

    I want property strings [] from the drop-down list box to enter text in selection, but since I placed it inside the table im unable to use this property.

    I used 'arrayelem' reference property and property node connected to it but got no strings [] in the selection.

    so is it possible that I can use property strings]


  • Calc independent PtByPt on the elements of the array

    Hello

    I have a double table as input, and with each iteration of the main VI, I would calculate the average and standard deviation separately on all the elements using PtByPt VI.

    Fortunately, in my case, I know that the size of the array is maximum 11. My solution works, but I would like to know what is the best approach, if I have to deal with a wider range, and especially if I don't know the maximum size in advance...

    That's my solution and the VI.

    Thank you!

    PS: I have renamed the extension VI VI lives to fool the buggy uploader...

    It is not too difficult to change the screw 'PtByPt' to be RowByRow by changing state data.  But I would probably go the dynamic road first if I knew the number of columns where bounded by a reasonable number.

  • Reference to the array of Clusters with an array element

    Hello

    I have an array of clusters of CONTROL (qualifying as "upper-tier cluster table") with one of the items is an array of cluster cluster (see attached).

    I intend to "reference" of this cluster of high level at different screws (as add item VI, insert item VI, delete the item VI etc.) and access (add/edit delete) the elements of this array.

    In my code, how I cataloged the array element (cluster) on the cluster internal (as shown on the figure)?

    I use LV RT on PXI.

    Hello smercurio_fc,

    Thank you for your example! Just a question: actually, with shift registers, is an example of creating a local copy of the full range? Even if the value of the lowest level cluster is changed, is the complete table is updated at the end (registry value to offset the full picture at the right end is updated using the reference node and property)? This VI will be slow when the size of the array becomes great?

    Comment of nicely.

  • change the array type in a script

    I have a script that uses a model to generate code. So far, I have a refnum in an array of doubles (the default type of the table in the model). Now, I need to change the types of elements in the array. I tried the 'set' vi in utilities VariantDataType table, but does not. How can I do this?

    Here is a way.

  • copy data in the array constant

    Hi, I have seen in an example that someone stores data of a spectrum in a constant, table joint please.

    I am trying to do the same and copy a colum given the same constant and found that it is not easy, as I thought?

    Can someone help me please?

    Thank you

    The array to an indicator of output, right-click in the table and replace constant.

    /Y

Maybe you are looking for

  • Satellite Pro M40 does not using full RAM

    Hi all I have a Satellite Pro M40 which has a 512 band on board, but allocate only 448Mb. Any ideas? Dice

  • Satellite A350D-10Y - failure of the external graphics card?

    Hello guys,. I have a toshiba Satellite A350D-10Y and I get some sounds of the sound system of the laptop, but a kind of Mermaid on the mother, accompanied by lights driver dvd, map emitte acoustics is two short beeps. I'm getting these two short bee

  • Remove the lower panel of application (touchscreen devices)

    Hello I want to remove the Panel from the bottom (in red) of the application screen. It appears when I extend screen. How can I do? Also I have complex available on my screen and scrolling works incorrecly (it is always scroll to the top of the scree

  • How to partition the drive in Windows 7?

    I have Norton Ghost, which can create a backup for exisiting C: to restore image. My laptop doesn't receive a C: drive, and I want to the C: and D: partition and would like to know how to do it.  Should I compress the drive before performing any part

  • export of 400 x 225

    Why can't I export to 400 x 225? Whenever I have it try forces either 400 x 224 400 x 226. I tried using "Custom" and changing of square pixels. I have even made 400 x 225 sequence again when I export, it force although it is 400 x 224 when I check t