Is it possible to get a formula node structure to ouput a string?

I'm trying to get the inputs to be integers (coordinates) and the output to be a string that sends a command to the machine.

A formula node will not output a string. However, you can easily create your machine command with the Format to String function. It is my favorite function in all of LabVIEW. Just drop it down and double-click it to configure all your inputs. You can format a variety of data types into a single string output.
Call on an Alliance Member if you want it done right the first time.
Daniel L. Press
PrimeTest Corp.
www.primetest.com

Similar Messages

  • Is it possible to get the position of a charcter from a string ?

    Hi !
    Is it possible to get the position of a charcter from a string ?
    Example:
    @VAR contains the following text "ABCDEFGHIJKLM"
    I'am seaching for FGH, it start on pos. 6 en ends on pos 8.
    How can I get these numbers 6 and 8 ?
    So, I can use them in the MID(text,start,len) function.
    Thanks!

    Hi Sooraj,
    I'll explain more in detail:
    From a web-service I get a variable called @Spec.
    This variable contains the following:
    "MOTORTYPE[CR]D-QW1234[LF]PART[CR]1234-FRD-X[LF]"
    or
    "MOTORTYPE[CR]ABC[LF]PART[CR]E-435[LF]"
    I need the values behind MOTORTYPE[CR] and behind PART[CR]
    But you’ll see that the positions of these values are different each time.
    If there is a way to get the (start) position of "MOTORTYPE[CR]" or "PART[CR]" and the (end) position of the first "[LF]" behind that,
    then I could use the MID() function to get the correct values.
    The values will be displayed in a table view (between other fields).
    An ABAP-call/function won’t work . . . how should I invoke this within a table column/field object ? (system action ?)

  • Is it possible to get the table by knowing its name only (string)

    public bool IsShowTable
    get { return _IsShowTable; }
    set { _IsShowTable = value;
    if (_IsShowTable)
    //Type type = Type.GetType(GraphSelected);
    //Object o = (Activator.CreateInstance(type));
    using (var ctx = new PD5500DBEntities())
    DataGridSrc = new ObservableCollection<object>(ctx.G2_2_6_0dot01_0dot0); //Using here the TableName in String
    NotifyPropertyChanged();
    private ObservableCollection<Object> _DataGridSrc;
    public ObservableCollection<Object> DataGridSrc
    get { return _DataGridSrc; }
    set { _DataGridSrc = value;
    NotifyPropertyChanged();
    In the code I used ctx.TableName, would it be possible to get a reference by knowing the string of the TableName only. 
    I mean
    TableName = "MyTable";//Type type = Type.GetType("TableName");
    //Object o = (Activator.CreateInstance(type));

    Thanks Magnus.
    But now I have difficulty setting it to datagrid source 
    //public ObservableCollection<Object> DataGridSrc
    // get { return _DataGridSrc; }
    // set
    // _DataGridSrc = value;
    // NotifyPropertyChanged();
    or
    private ICollectionView _DataGridSrc;
    public ICollectionView DataGridSrc
    get { return _DataGridSrc; }
    set
    _DataGridSrc = value;
    NotifyPropertyChanged();
    using (var ctx = new PD5500DBEntities())
    Type type = Type.GetType("PressureVessels.Database.G2_2_6_0dot01_0dot0");
    var entities = ctx.Set(type);
    DataGridSrc = (ICollectionView)entities.Local;
    //or
    //DataGridSrc = new ObservableCollection<object>(entities.Local);
    Before when I was using 
    DataGridSrc = new ObservableCollection<object>(ctx.G2_2_6_0dot01_0dot0);
    it worked but now it doesn't. Though now by using the namespace.name I get the type but still cannot assign it to datagridSr which is ObservableCollection or ICollectionView. 

  • Formula node error: missing right parenthesis

    Hi NI community,
    I am working with the formula node structure for the first time and I came along this error which I can't fix.
    It says it finds a # character, but the strange thing is that there is no character. Is there anyone who can help me with this one please?
    Kind regards
    Thomas Ruts
    Solved!
    Go to Solution.

    You are missing a right parenthesis on your first long formula.  It is in the last half of the formula.  You have two left parenthesis, but only one right.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Recurring "Invalid Node Structure error"

    Hello all,
    Starting a new thread with this one....
    Have done 5 complete re-partitions, clean SL installs and back ups from TM in the last four days. DU disk checks out fine after re-install, DU comes up clean.
    After a few hours, the hanging beach ball returns, I run DU and get the "Invalid Node Structure" error message.
    This in on the iMac that is 42 days out of Apple care......
    Ran techTool after the last install, and it comes up clean....
    What's the soultion? Nuke the drive and get a new on on my dime?
    I've repartitioned, zeroed out the data and sit here with a naked drive, I really don't want to spend another day loading it up if it's shot....
    The TM files and drive I'm backing up from check out fine.
    Thanks,
    Mark

    Took 3+ hours. Came up clean. I have not restored from TM yet. Did the SL updates ect.
    Repaired permissions, ran DU it comes up clean.
    I will do some net surfing tonight (that's all I did this morning) still without loading the back up data, and we'll see if I get the beachball of death.
    I will run another surface scan when I hit the hay, and see what it says in the morning.
    If that is clean, I will restore the back up data, and run the surface scan again.
    One step at a time until I can recreate (or not) the failure mode.
    Tedious, but I have to get to the bottom of this. I don't want to load any of the TM back up on to the Mac Air until I'm sure it's not a software issue.
    Mark

  • Invalid node structure error when verifying hard disk, please help

    My 27" Mid 2011 iMac is having hard disk issues. I attempted to repair the disk but received an error that said the disk cannot be repaired and needs to be re-formatted. I have all my files backed up to an external hard drive so I erased and formatted the disk. After reformatting, I ran the verify disk function and got the message saying the HD appears to working properly. I reload OSX Lion and within a day, my computer freezes up and acts as if something is wrong. When I run the verify disk, I get the Invalid Node Structure error multiple times and then the message saying the disk cannot be repaired and I need to reformat the drive. I have completed this process several times and have had no luck. I have looked at a few forums with people who have had somewhat similar problems but am still unsure. I have seen people recommend programs like Disk Warrior to repair issues the hard disk utility cannot but I don't want to spend $100 dollars on this program if my hard disk is damaged and needs to be replaced. Any suggestions? Thank you

    Make a "Genius" appointment at an Apple Store, or go to another authorized service provider.
    Back up all data on the internal drive(s) before you hand over your computer to anyone. There are ways to back up a computer that isn't fully functional — ask if you need guidance.

  • How do I get an array output on a Formula Node?

    My problem is simply that I cannot figure out how to get an output on a Formula Node to be an array. Documentation states that "you must declare local arrays and output arrays in the Formula Node" but doesn't say anything more than than. Attempts to put something like "float32 out[100];" for an array output called "out" fail.
    If anybody knows how you can do this or even knows if it is possible I would appriciate your help.
    Thanks,
    Naveen

    I found a typo in the formula node I was doing that was making the output not be an array. I don't think I was getting the error before but I was going to put together an example VI to attach here and I found it. So, thanks for your help even tho it was a stupid little mistake on my part.

  • Formula node, keep getting errors

    I am trying to integrate a formula node into an array, I keep getting errors and don't know why. Any ideas?
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    trial7.vi ‏42 KB

    That is a better attempt.
    The problem is that you only defined your output y array to be a 1-D array.  And your math on the input array is also acting like it is a 1-D array.
    See the attached modification.
    But your formula is simple enough that doing it in real LabVIEW code is easier and you don't have to deal with syntax problems of the formula node.
    (Note, since I don't have your data, I couldn't run this, so it is possible there are errors.)
    Attachments:
    trial7MOD.vi ‏57 KB

  • "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 .

  • Array index problem in formula node

    dear friend
    I'm trying to use formula node to solve a problem because I make this program using c at the begining.
    It runs perfectly in turbo c, but somehow it doesn't work in the formula node.
    I try to debug my source code, and I find that the formula node seems can't read the true value in
    the array.
    Here is the code in the formula node.
    int32 i,j,k;
    for ( i = 0 ; i < sopa; i++ )
     j = 1;
     ep[i][0] = pa[i];
     ep[i][1] = np[ep[i][0]][0];
     while ( ep[i][j-1] != exit )
      for ( k = 0 ; k < sonp ; k++ )
        if ( np[ep[i][j-1]][k] != -1 && (pc[ep[i][j-1]][ep[i][j]] + pc[ep[i][j]][exit] >= pc[ep[i][j-1]][np[ep[i][j-1]][k]] + pc[np[ep[i][j-1]][k]][exit] ) && (pc[ep[i][j-1]][np[ep[i][j-1]][k]] == org[ep[i][j-1]][np[ep[i][j-1]][k]] ))
          ep[i][j] = np[ep[i][j-1]][k];
      j++;
    This is the part that I think the problem might be.
    if ( np[ep[i][j-1]][k] != -1 && (pc[ep[i][j-1]][ep[i][j]] + pc[ep[i][j]][exit] >= pc[ep[i][j-1]][np[ep[i][j-1]][k]] + pc[np[ep[i][j-1]][k]][exit] ) && (pc[ep[i][j-1]][np[ep[i][j-1]][k]] == org[ep[i][j-1]][np[ep[i][j-1]][k]] ))
     ep[i][j] = np[ep[i][j-1]][k];
    I state that "np[ep[i][j-1]][k] != -1" but I do get the value -1 in the array "ep".
    Could someone tell me why I get -1 in the array?
    I hope I can finally do it all by labview not using formula node,but array like "pc[ep[i][j-1]][np[ep[i][j-1]][k]] "
    seems very hard to wire in labview. Could someone give me some good advices of doing this?
    Thanks for your help

    altenbach 已寫:
    normanshi wrote:
     ep[i][0] = pa[i];                                          (A)
     ep[i][1] = np[ep[i][0]][0];                            (B)
    ...    if ( np[ep[i][j-1]][k] != -1 && ... )          (C)
          ep[i][j] = np[ep[i][j-1]][k];                       (D)
    I state that "np[ep[i][j-1]][k] != -1" but I do get the value -1 in the array "ep".
    Could someone tell me why I get -1 in the array?
    I hope I can finally do it all by labview not using formula node,but array like "pc[ep[i][j-1]][np[ep[i][j-1]][k]] "
    seems very hard to wire in labview. Could someone give me some good advices of doing this?
    There are many possible scenarios to get a -1 in the ep output. For example if the -1 gets already written in step (A) or (B) at a certain index, and that index does not get overwritten in step (D). You are indexing all over the place! Is there some bounds checking on the array contents? What are typical inputs and array sizes?
    I'm sure about that the -1 doesn't get already written in step (A) or (B) because ep[i][0] and ep[i][1] is fine. What really makes me confuse is that sometimes ep array has the value like this.
    That means it does overwritten some value in step (D). The -1 should never be written into it because I have already state that np[ep[i][j-1]][k] != -1. Somehow I still get -1,and this is really strange! I'm indexing all over the place becuase I can't figure out a better way to achieve my requirement.
    I think I should briefly tell you what I'm trying to do. In this program,I input some values which means the distance from one point to another. Then I use floyd's all pairs shortest-path algorithm to find all the shortest distance. Finally I want to find out the "shortest path". I mean like from point 4 to point 0,the shortest path might be like 4 -> 2 -> 1 -> 0, and what the formula node part do is trying to find out this "shortest path". Maybe you can give me some better advice of doing this, I have been thinking a better way to do it for about two months. I think I'm really not good at this.
    I try to do it all by labview ,but again I get a strange problem. This time the ep[i][j-1] doesn't get the correct value. In the first time i=0 j-1=0 ep[i][j-1] = 1,but the second time i = 0 j-1 = 1 ep[i][j-1] = 0. This makes the "ep[i][j-1]!=exit" get the incorrect boolean value. The ep[i][j-1] should be 2,not 0. I try to use highlight to find if I make any mistake, but I can't one.This is the input and I put the labview program in attached file (temp4.vi).
    Could you help me find out why this happened?
    Thanks for your help altenbach!
    由 normanshi 在 08-19-2006 10:06 PM 上編輯的訊息
    Attachments:
    temp4.vi ‏191 KB
    ep.jpg ‏10 KB
    input.jpg ‏9 KB

  • Array data in formula node

    I want to take the Y value (being the amplitute) from the input signal and put it into a formula node. I keep getting the error signal as in the attached VI. Is there a way of seperating the value in labview?
    Attachments:
    Formula signal.vi ‏32 KB

    Hi Cork,
    yes, it's possible! And WTH: you can do it without a formula node with ready-to-use functions!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Using the Formula Node for PDA

    I get a compile error when I use C code inside the formula node. Is it possible to use C Code inside the formula node for PDA applications? Do I have to include any file while building the executable for the PDA

    Ok, I was able to successfully build an executable file without error. I attached the screen shots of your program in execution. Does this look like the desired result?
    I'm confused as to why I can build and run the program on my machine. I have LabVIEW 7.0 and Windows XP. What version of Windows and LabVIEW are you using? Also, are you getting the error window when you try to build an executable or when you attempt to run the VIs within LabVIEW?
    Regards,
    -Joe-
    Attachments:
    tutor.JPG ‏100 KB
    tutor2.JPG ‏122 KB
    detector.JPG ‏46 KB

  • Casting inside a "formula node"

    Greetings,
          Is it possible to cast a U32 to a SGL - an int32 to a float32 - inside a formula node?  How?
    Thanks!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

    Re: Is there a particular reason you are attached to the formula node?  
    Well... we're just experimenting with the fastest way to unpack ~10,000 U32s into ~40,000 DBLs.  The packed array is U32-aligned mixture of bit-mapped integers, bools, and floats - SGLs and DBLs.  We've tried doing some "vector" (array) shift, mask and scale operations - which are pretty fast, but the float-unpacking seems to require a loop.  After timing a For Loop structure, I wanted to push the for loop into a formula node - where I've hit a wall (without ability to cast) ...
    Since the whole purpose of looking at formula node is to save time, I'm reluctant to roll my own "cast" function.
    Thanks/Cheers!
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • XML DB: is it possible to get a row for each element in a container element?

    I have an XML document containing a container element (collection). If I query, using an XPath expression, the contained elements I get a row for each container element with the contained element concatenated. Is it possible to get a row for each contained element?
    I run this simple query:
    select extract(xmltype('<colors><color>Red</color><color>Green</color></colors>')
    , '/colors/color/text()').getstringval() from dual
    And get this result:
    EXTRACT(XMLTYPE('<COLORS><COLOR>RED</COLOR><COLOR>GREEN</COLOR></COLORS>'),'/COL
    RedGreen
    1 row selected.
    What I would like to have is:
    Red
    Green
    2 rows selected.
    Wishful thinking or possible? Many thanks!

    Sure. This is where our XMLSequence() function comes in. It allows you to treat the top-level nodes in a nodeset as if they were rows in a table when combined with the TABLE() operator. Here's an example.
    First, to make the SQL look a little cleaner, I like to define a function like this:
    create or replace function testdoc return xmltype as
    begin
      return xmltype('<colors><color>Red</color><color>Green</color></colors>');
    end;.
    To break out the nodeset of <color> elements as a table, we use the following query:
    select value(list_of_color_elements).extract('*/text()').getStringVal() as color
    from TABLE( XMLSequence( extract(testdoc(),'/colors/color'))) list_of_color_elements.
    Or, using the new-in-9.2 extractValue() operator so we don't have to remember the text() part:
    select extractValue( value(list_of_color_elements), '.') as color
    from TABLE( XMLSequence( extract( testdoc() ,'/colors/color'))) list_of_color_elements.
    Here the TABLE(XMLSequence(...)) combo produces a table of XMLType, with one XMLType object in each row of the table.
    In general, if the XMLType instance were coming from an XMLType table xmltab the query would look like this:
    select extractValue( value(colors), '.') as color
    from xmltab x, /* Important that this table comes earlier in the FROM clause! */
         TABLE( XMLSequence( extract( value(x),'/colors/color'))) colors.
    And if the XMLType were instead in a column of XMLType named doc in a table xmltab, then we would have the syntax:
    select extractValue( value(colors), '.') as color
    from xmltab x, /* Important that this table comes earlier in the FROM clause! */
         TABLE( XMLSequence( extract( x.doc ,'/colors/color'))) colorsOnce you get the hang of it, you'll see that the combination of TABLE(XMLSequence()) to "shred" XML nodes into rows, and XMLAgg() to aggregate fragments of XML across multiple rows back into a single document, is quite powerful.

  • Formula node uInt32 overflow

    I'm having a weird behaviour in formula node. The overflow of unsigned integer operations simply doesn't match the results of standard LabVIEW blocks as shown in the attached picture.
    How can I deal with this problem? I need the behaviour of the block diagram. I could not do a right logical shift in unsigned integers in block diagram, so I'm using formula node (I could not figure out how to do it because I can't negate a unsigned value).
    I'm using LV2012SP1. Were there any changes in this behaviour in newer versions?
    Thank you.

    I found a problem in hexadecimal and octal numeric representations of the formula node. The picture illustrates the issue. Three variables are assigned with the same value but outputs different results.
    The hex and octal representations only work for half range of the 32 bits unsigned integer. When the value assigned gets beyond this limit the variable receives zero. This doesn't happen with a decimal value neither with 8 bits variables. Seems the problem doesn't only happen with overflow operations.

Maybe you are looking for

  • Importing XLM from iMovie one audio track

    Can someone please help me? When I import my XLM file from iMovie into FCP and open it ... I get one audio track. This is really weird because in iMovie it's stereo and even the videos in QT are stereo. Any ideas ? Thanks in advance.

  • Using a query with bind variable with columns defined as raw

    Hi, We are on Oracle 10.2.0.4 on Solaris 8. I have a table that has 2 columns defined as raw(18). I have a query from the front end that queries these two raw columns and it uses bind vairables. The query has a performance issue that I need to reprod

  • Itunes overlapping content on multiple computers?

    Basically I just got a new laptop. I copied over my entire music folder over to the new laptop, and tried to double check it would sync properly with my iphone4s. The problem is I notice that it doesn't sync all the music, only about 200+ of them wit

  • The requested dashboard does not exist

    Dear Expert, Am using SAP 8.8 PL18, on windows 7. getting below error. The requested dashboard does not exist. Dashboard:/ com.sap.b1.dashboards/0010000101.SAP_DASHBOARD_001.DAB001/default.html Thanks Kevin

  • Calendar issues - bugs or do I misunderstand how it should work?

    I'm having a few calendar issues that seem like bugs. I have the latest release installed but I don't remember seeing these problems before updating. I could be wrong though - my memory ain't what it used to be. On the calendar week view, if I swipe