In formula node how to use array outputs

someone has talked about this. but it is still a problem to me.
no matter how i declare the variable, the output terminal keeps a scalar.

You should be able to declare it using:
int32 VarName[x][y];
That should make an array of 32bit integers.
See one of my earlier posts here: http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000EE2C0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_TIER_0=0&USEARCHCONTEXT_TIER_S=0&USEARCHCONTEXT_QUESTION_0=array+formula+node&USEARCHCONTEXT_QUESTION_S=0
Try copying the code that I posted into your formula node and see if you get an array out. Or try the example I attached with the same code in it.
Let us know if you are still having trouble.
Brian
Attachments:
ArrayFormulaNode.vi ‏23 KB

Similar Messages

  • How to use the Output clause for the updated statment

    How to use the output clause for the below update stament,
    DECLARE @MyTableVar table(
        sname int NOT NULL)
    update A set stat ='USED' 
    from (select top 1 * from #A 
    where stat='AVAILABLE' order by sno)A
    Output inserted.sname
    INTO @MyTableVar;
    SELECT sname
    FROM @MyTableVar;
    Here am getting one error incorrect syntax near Output
    i want to return the updated value from output clause

    see
    http://blogs.msdn.com/b/sqltips/archive/2005/06/13/output-clause.aspx
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • "Eval Parsed Formula Node VI" does not return outputs in predefined order

    I make a data analysis program, where the data consists of some million events and each event has e.g. 4 channels and 1-5 hits on each channel. 
    I would like the user to select different expressions of these channels to give coordinates to plot in a 2D histogram (increment a bin in Intensity Graph), e.g. for some experiment you want to show x=ch1-ch2; y=ch1+ch2+ch3+ch4; while in another experiment you want x=ch1-123; y=123-ch2;
    There are other VIs that use static LabView-code for the normal things, but now after a few years of adding to this program I find that it would be quite good with a general plotter and let the user specify simple expressions like this. Also with the "normal" static plots, there is a need to filter out bad data and then it would be much simpler both to program and use if you could write text expressions with boolean logic to combine multiple filters. Making a LabView code and GUI that allows AND/OR/parenthesis combinations of expressions will be quite an effort and not very reusable.
    So, with the above motivation, I hope you see that it would make sense to have a useable string formula evaluator in LabView. I find some info about MathScript's user-defineable functions, but haven't managed to get MathScript working in LV2010 yet (maybe some licensing or installation issues, I think I had it in 8.6). But I think it would be possible to do most of what I want for the display-part (not the filtering) with the simpler Eval/Parse Formula Node VIs and suitable use of the limited variable name space. So I started testing, and found a quite annoying issue with how the evaulator works.
    To the parser, you are expected to send an array of output variable names. But then it ignores this array, and returns one output per assignment/semicolon in the formula, in the order of the formula text. Since the static parts of my program need to know what the output values mean (which of them is x and which is y), I would have to rely on the user not using any intermediate variable and defining x before y. The attached screenshot demonstrates the problem, and also that it has been solved by NI statff in the "Eval Formula Node VI" which does the appropriate array-searching to extract only the pre-defined outputs, in their expected order. But using that VI is about 100 times as slow, I need to pre-compile the formula and then only use the evaulator in the loop that runs over a million events.
    I don't know if I'll take the time to make my own tweks to the parsing stage (e.g. preparation of array-mapping to not have to repeat the search or maybe hacking the output list generated by the parser) or if I'll have to make it in a static Formula Node in the block-diagram (which supports more functions), so that the user has to run with development environment and stop the program to change the plotting function. But I wanted to share this trouble with you, in hope of improvments in future LabView versions or ideas from other people on how I could accomplish my aim. I have MATLAB-formula node possibility too, but is far as I have seen the only place the user could update the formula would then be in a separate .m file, which is re-read only when typing "clear functions" in the Matlab console window. (Having this window is also an annoyance, and perhaps the performance of calling Matlab in every iteration is not great.) 
    Besides this issue, it also seems very strange there is virtually no support for conditional expressions or operators in Formula Node evaulated formulas (called Mathematics VIs in the documentation). Maybe using (1+sign(a-b))/2 you can build something that is 0 when a<b and 1 when a>b, but it is not user friendly! Would it really be diffcult to add a function like iif(condition, return_value_if_true, return_value_if_false) to replace the unsupported "condition ? if_true : if_false" operator? Would it really be difficult to add support for the < <= >= > == || && operators? Although compiled to an assemply language, this can't exactly be difficult for a CPU.
    Attachments:
    LV script test.png ‏62 KB
    LV script test.vi ‏18 KB

    (1) You can put any kind of code inside an event structure with the limitation that it should be able to complete quickly and without user interaction.  For example a while loop for a newton-raphson method is fine, but an interactive while loop where the stop condition depends on user iteraction is not recommended. By default, event structures lock the front panel until the event completes, so you would not even be able to stop it.
    (2) Yes, you can do all that. LabVIEW has no limitation as a programming language. Use shift registers to hold data and state information, the manipulate the contents as needed.
    (3) I would recommend to use plain LabVIEW primitives instead of formula nodes. Show us your code so we can better see what it's all about. Obviously you have a mismatch betweeen scalars and arrays. It is impossible from the given information where the problem is.
    (4) Yes, look inside the nonlinear curve fit VI (you can open it an inspect the code!). One of the subVIs does exactly that. Just supply your model VI.
    LabVIEW Champion . Do more with less code and in less time .

  • Can formula node take string input and output string?

    I am wondering if the formula node can take string input variable and output string variable after calculation. otherwise I have to output integers and then use case structure to select different output strings, that is kind of redundant in coding.
    ping

    If you are just trying to read lines that have mixed formatting, you don't need any script nodes.
    Can you attach a tpyical flne and a description of the desired read operation so we have a better idea what you are trying to do? Do all lines have the same overall format?
    LabVIEW Champion . Do more with less code and in less time .

  • How to use "Referenced Output"

    Dear Sir/Madam,
    I find the concept "Referenced Output" in the GSM user guide, How to use or set Referenced output in formulation?
    Thanks
    Terry

    You can also "graduate" an external output material to a referenced product. From the External Product Material specification, look under the Material Attributes section, you should see the Output Type property with a "graduation cap" next to it (you made need specific role membership, the Oracle docs would have the specifics for this). Clicking the cap icon will change the output type from external to your choice of Referenced - Product, By-Product or waste. Saving the spec will change the output type, but be aware that changing to a referenced output type severs the theoretical roll up link with the original formulation (nutrients will no longer be rolled up from the formulation, nor will breakdowns and compliance information, etc.)

  • How to use Bpel output as input in stored procedure

    I am a SOA beginner. The scenario is to use the output from a BPEL process in a stored procedure as input and validate it against the data in the database. The data received from BPEL is compared with fields from different tables.
    It is basically a business process data validation.
    Will the output of BPEL be a Xml file and how it can b used in query of a procedure?
    Edited by: 869091 on Jun 29, 2011 12:14 AM

    The output from the BPEL process will be in XML format.
    Your requirement is not clear, please state it properly what are you trying to do.
    -Yatan

  • How to use array or type in "IN" criteria

    Hi all,
    anybody knows how to use group of same datatype data ( array or type ) in SQL statement
    For example
    ls_dept[1] = 'abc';
    ls_dept[2] = 'xyz';
    ls_dept[10] = 'ppr';
    i want to use this group of data in "IN" criteria like
    Select * from department where dept in ('abc','xyz'.....''ppr');
    if anybody know how to use please reply me as soon as possible.
    Thanks,

    I hope you are not suggesting concatenating literals from a web front-end application ;) Is it not what he was saying.. he is getting user input info from an application.. if the user sends multiple values.. he has to build a string with concatenating literals..
    correct me if I am wrong.

  • How to use array as parameter in procedure

    Hello,
    I am using Oracle SQL Developer 1.5.5
    I wanted to write a procedure which does insert into table.
    It should take 2 parameters.How to take array as parameter?
    One is a array of strings ('abc','def','erg') and another is a varchar ('abc').
    How to do this?
    Can somebody pls give a small example?
    Thanks
    Edited by: user13305573 on Aug 5, 2010 11:27 PM

    Hello,
    I am sorry if u didnt get my point.
    My req is i am using Orcale SQL Developer.
    Db is Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    I want to write a procedure which will be called from a java file.
    The parameter to that procedure will be a arr(array of strings) and username(varchar).
    I want to insert that data into a tableA.
    like if parameters are
    (abc01,edfg02,efg03) as arr and honey as username
    then it should insert 3 rows to the tableA
    abc01 honey
    edfg02 honey
    efg03 honey
    Thanks
    Edited by: user13305573 on Aug 5, 2010 11:54 PM

  • How to use central output server in JSP application

    Dear All,
    We have developed a jsp application which is running on JBoss.We want to create receipts in PDF format.For this we are using central output server.Our approach is as follows:
    When request comes from the user, we are generating .dat file by fetching data from the Oracle database depending upon credentials and then pushing this file into data folder of Central output server.From there we are waiting for PDF file in predefined path.Here we found this is asynchronous way of producing receipts.
    Is there any other way that is synchronous or the way we are approaching is the only way of doing it.A sample would be of immense help.
    Note:The concurrent hits would be around 5000 in a peak hour.Any help would be highly appreciated.

    I don't think you can get things to operate in a synchronous manner. You have one application - perhaps running on a totally separate server - feeding data files to a different application. The only way to make it even semi-sychronous would be to throttle the JSP application in some way to prevent it from placing a new file into Central's data folder while there was already one there.
    I assume your problem is knowing which PDF belongs to which user. If that is the case you could send some type of unique identfier (IP#?) as a "job" parameter that would then be used as the specific PDF file name instead of letting Central create a random file name.

  • How to use array of Point Class

    I use Point class as array. I already create that. However I can't access to setLocation.
    Ex.
    Point myPoint[] = new Point[10];
    myPoint[0].setLocation(10, 2);
    It has a error.
    Please Explain me.

    DeltaGeek wrote:
    BalusC wrote:
    Or use [Arrays#fill()|http://java.sun.com/javase/6/docs/api/java/util/Arrays.html]. Point[] points = new Point[10];
    Arrays.fill(points, new Point());
    That doesn't do what you think it does, unless you want your array to contain 10 references to the same Point object.The OP has received a good answer, I believe. So it's worth risking diverting this thread into the weeds by pointing out that if Java had closures then BalusC's code could be modified to work.

  • How to use Array in Formcalc?

    Please share syntax for using Array in Formcalc.

    Hi,
    FormCalc is a simple scripting language and does not support objects like arrays.
    The only function that come close to an array in JavaScript is Choose(),
    This first parameter selects the nth value of the following comma separated strings.
    Choose(3, "String1", "String2", "String3", "String4")
    returns String3

  • How to use Array in Calc script.

    Hi, <BR> I want to use Array in Calc scripts. Can anyone provide me some examples. <BR><BR>Thanks<BR>Murali

    For information on the ARRAY command, check out <a target=_blank class=ftalternatingbarlinklarge href="http://dev.hyperion.com/techdocs/essbase/essbase_712/Docs/techref/techref.htm">this hyperlink</a>.<BR><BR>Click on <b>Calculation Commands</b>, then choose <b>ARRAY</b>.<BR><BR>Can you give me some information explaining why you want to use ARRAY? It's use is pretty rare and I would like to understand what you're trying to do.

  • How to use array?I am a newer   ------:(

    In C language I can use array this way:
    char array[10][20];
    fread(array[1],20,1,fp);
    but in java,what to do?
    char array[][]=new [10][20];
    and the code below will cause an error:
    binstream.read(array[1]);//error line
    pls help me and tell me what to do,thank you very much

    Hi evilstar007!
    1st) There aren't unsigned primitives in Java, all primitives are signed.
    2nd) The loop in previous message will read an entire line filling the buffer without length contraints. If there are n^z then it will read n^z "chars". This is is for text but I know there is a special one as you need, for bytes (primitive byte). You can also retrieve the bytes from stream:
    data = new byte[dim];
    inp.read(data);
    I'm not sure about, there are a lot of methods and classes.
    You pretend to read from stream and fill the contents of RomBanks array with length 32768L ok ?
    Read the entire line and retrieve bytes.
    Since you are a C programmer will be easy to understand Java.
    Best Regards!

  • How to use Digital output to turn on sensor for Analog Input?

    I am trying to use a digital output to turn on an array of sensors that I then wish to read on 16 analog input lines. I have a 6024E DAQ card. I am planning to take data at 10-20 hz, so not terribly fast, but I will be acquiring for long periods of time (days) so I will be streaming data to disk.
    I have a fair bit of experience in Labview basics, but can quickly get out of my depth when I try something new (like this). I have V6.01.
    It looks as though the best way might be to do the DO and then a single AI as individual events, then write to disk and continue through the loop. I am puzzled, however, how to keep this cycle on schedule given that I don't know how long it will take to sample 16 channels
    , write the data to disk and get back to the starting point... perhaps this is so fast that I don't need to worry about it? The actual timing of the samples (be it 10 or 20 hz) isn't too critical, as long as I can record at what time they were taken... it would be frustrating to find that I was several seconds off after days of data.

    Hello,
    Thank you for contacting National Instruments.
    If you are worried about the time of your acquisition being off, then you should associate each voltage measurement with a timestamp. This will allow you to know the exact time at which the sample was taken and you will never be off. You can use the Get Date/Time in Seconds.vi in our while loop with your AI code so that you can read a sample and read the time. You can than log the voltage value and the timestamp to your file.
    Regards,
    Bill B
    Applications Engineer
    National Instruments

  • How to use counter output pulses to trigger analog input?

    Hello all,
    I hope the kind people using this forum can help me, a lowly beginner LV programmer! I have been attempting to create a VI that produces a user defined number of TTL pulses, separated by every n seconds. Each TTL would be outputted to a stimulator, which in turn generates its own TTL. Using the stimulator-generated TTL, I would like to trigger finite analog data acquisition (e.g. for every TTL, trigger the collection of a data sweep that contains 4000 samples (collected at 4000 Hz), with 1000 samples collected pre-trigger. I would like to also be able to see each data sweep as it is triggered on a chart. As I understand things (lots of online/book/forum reading), I should be using the counter output to generate my TTL pulses, and syncing each counter produced TTL with analog input, as well as using a reference trigger. Also, the AI part should be started first, so that I don' t miss any counter outputs. If it matters, I also need to use one of the AI channels to acquire the TTL, so I can see my stimulator-induced responses to the stimulator in time.
    I am able to generate the TTL pulses from the counter output, but I am having a problem with the AI part. I am unsure how to sync the counter output with AI. Also, since I need to acquire pre-trigger samples, I would be needing to acquire samples continuously, but when I set 'continuous samples' on daqmx timing, the VI doesn't work (hence why's its set to 'finite samples').
     I hope someone out there can help, as I have been at this for what seems ages, with limited success. I am using a USB-6259 and LabView v8.2. Thanks!
    Attachments:
    RC001 v_1.vi ‏49 KB

    Hello,
    Due to the fact that analog tasks themselves are not retriggerable, a
    pulse train produced by a counter is always used as the sample clock
    for the analog input task in order to recreate a retriggerable effect
    for analog input. This can be done by creating a finite pulse train set
    to retriggerable using the DAQmx Trigger Property Node, or the pulse
    train could be continuous and just be gated by another signal. Neither
    of these methods can be properly applied in hardware to create a
    retriggerable reference trigger. You can however implement something
    similar in software by just stopping and restarting your reference
    triggered analog input task within a loop. There will be some delay
    between when the task is stopped and restarted, as these events require
    software intervention, but if there is enough time between when each
    trigger signal is generated, there should not be any noticeable delay
    or missed samples.
    I have attached an example of this!
    Mark B
    ===If this fixes your problem, mark as solution!===
    Attachments:
    RC001 v_1mod.vi ‏25 KB

Maybe you are looking for

  • How to read Skype connection logs (.log files in /...

    Hi all, A funny problem but really important - please help! I set up logging to find out causes of some tech problems occuring during my calls, as it described here: https://support.skype.com/en/faq/FA12321/how-do-i-create-log-files So, I get now /Lo

  • Can a Column in a Project Plan be set to Read Only for everyone except Admins

    At my company the Project Server Admins create the initial project plans.  We want to add a new column that will designate each task in the plan as Capital or Operational.  We do not want anyone to have the ability to change these. When the Project M

  • S5 - little piece covering charging port & lack of customer service

    Argh - just typed entire message, clicked submit and then it asked me to log in...guessing my post was lost.  here I go again.  Got the S5.  Knew right away that the little piece opening from left-right to charge was going to be an issue.  and, sure

  • Order By Query  runing very slow

    I am facing a problem when doing order by on a table. My select query is working fine, but when i do order by (even on the primary key) it just goes on and on with no results. Finally i need to kill the session. The table has20K records. Any suggesti

  • Tables not showing in a new Database created using CREATE DATABASE command

    Hi there! I've created a database using "Script Database As" in SSMS. Here's the code generated: USE [master] GO /****** Object:  Database [PLMAINDB]    Script Date: 08/22/2014 11:25:44 ******/ CREATE DATABASE [PLTESTDB] ON  PRIMARY  ( NAME = N'CLIEN