Programmat​ically altering strings to be evaluated in a Formula Node?

Hello,
I want the user of my program to enter an expression in a string control
that is a function of two variables. I want to be able to evaluate this
string as if it were in a formula node.
Is there a way of programmatically altering strings to be evaluated in a
Formula Node?
Thanks,
Peter

I found 'Eval Formula Node.vi'. That does just what I was looking for.
Thanks
Peter
"Peter T" wrote in message news:3d810eba@newsgroups....
> Hello,
>
> I want the user of my program to enter an expression in a string control
> that is a function of two variables. I want to be able to evaluate this
> string as if it were in a formula node.
>
> Is there a way of programmatically altering strings to be evaluated in a
> Formula Node?
>
> Thanks,
>
> Peter
>
>

Similar Messages

  • Programmat​ically autosize a string indicator

    Here is a real challenge I would say: Programmatically size a string indicator and/or the window size, such that it mimics the behaviour of the 'message' indicator of the One Button Dialog box.

    This isn't difficult. You just have to find the right VIs to do it 
    Use the "Get Text Rect.vi" in picture.llb (in LV7.1). Depending on the
    font and other parameters it'll return the size of the text in pixels.
    Use this output to set the string indicator size (maybe adding a
    constant) and the windows size (adding a constant).

  • Send control image programmat​ically to clipboard

    Hi all
    The right click option allows one to copy or export simplified image to clipboard.
    Programmatically, "export simplified image "is not possible.
    Using "invoke node", it is posible to save in a file as jpg/bmp/pmg.
    Does somebody has a vi to copy graph control image programmatically to clipboard as jpg or emf?
    thanks
    Alipio
    "Qod natura non dat, Salmantica non praestat"

    Hello,
    I have needed to programmatically copy image data to the clipboard too. In the past I have used George's toolset. However with Labview 8.5, you can do it. Attached is a snippet that shows how you can use the picture methods to export to either the clipboard or a file. Can't do it in either LV8, or LV8.2. Sad.
    Attachments:
    copy to clipboard test.vi ‏35 KB

  • String array into formula node

    Hello,
    I am taking data from SQL, I am getting multiple rows of data for many different devices. I would like to wire the data into a formula node so I can sepearate and sort via script. However, I am getting an error for "Polymorphic terminal cannot accept this data type". Is there a work around? Can I not wire in a string array to a formula node.
    /r
    Travo

    There are lots of basic string VIs that you can use to parse the string and separate out the individual fields. I would recommend "programming" your application using script nodes. Use the native language. LabVIEW is a fully functional and capable programming language.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Updating equation in formula node from a string or text file

    Is it possible to have a calculation performed based on an equation stored in a string (read from a text file). I am guessing not because the equation would need be compiled but thought I would ask.

    Hi,
    it depends on how complex the equation is.
    Rather than using a formula node, you could use the eval formula node vi instead. (Functions->Analyze->Mathematics->Formula), but you may needs to re-organise the text formula a little.
    Assuming you're using not the base package, and atleast LabVIEW version 6.1 that shouldn't be a problem.
    Hope that helps.
    Sacha Emery
    National Instruments (UK)
    // it takes almost no time to rate an answer

  • 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

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

  • Possible to return the "Explain Error" string programmat​ically?

    We use custom error handling and I'm interested in being able to return the "Explain Error" string programmatically. I figure, why not have that information available right away?
    I know you can get to it from the right-click shortcut menu after execution, but sometimes it's helpful to get that information, and try to keep the program rolling anyway.
    http://linkd.in/mikele

    Try this:
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    error message.png ‏9 KB

  • How to make my applicatio​n programmat​ically switch between English and Russian

    Greetings from Colorado...
    My application needs to be switchable between English and Russian.  Future languages to add are Spanish and Chinese.  The user selects a language
    from a control before starting the program and then the program changes the Captions, Boolean Texts, Graph Labels, and Enum Type Strings to the
    chosen language.  For Russian, this requires a different set of characters.  I have made substantial progress by:
    Control Panels>Region and Language>Keyboards and Languages>Change Keyboards added Russian>Keyboard>Russian on my development
    computer.
    In the LabVIEW.ini file, I added UseUnicode=TRUE (thanks to a suggestion found in this forum)
    Made property nodes for controls and used properties such as Interpret As Unicode (True for Russian, False for English), Text, Font Name, Font Size, etc.
    I have used fonts Arial and Arial CYR for Russian and MS Sans Serif for English
    Set the keyboard for Russian and enter Cyrillic characters into text constants that are set for Arial or Arial CYR font.  Sometimes one works and
    sometimes the other works.  As long as I set the font name in the property node the same way the text went into the text constant, it generally
    works.  I wish I could understand why one works sometimes and the other works other times!
    I have had trouble with the Boolean Text going off-center when changing fonts and languages and it seems that by setting the Lock Text In Center
    property to False and then True again, it seems to work.  Often changing Boolean texts between short and long texts causes some of the long text
    to be non-displayed; I have remedied this by explicitly setting the width of the Boolean text in a property node.
    Often, the Russian text appears as gibberish with strange right-angle characters, :s, =s, and tiny numbers.  I have been able to remedy this on my
    development computer by ensuring that the text constant on the block diagram has the same size as the caption is supposed to have.  This
    is not necessary for normal programming in English, but it seems to help here.  But it doesn't always solve the problem.
    Sometimes the English text appears as Chinese gibberish in an Enum Type selection list or in a graph label.  On my development computer,
    it seems that making the text the last property to change helps here.
    By changing the sequences of assignments to a single property node with a long list of properties, I have been able to make some of these
    controls to switch between languages without gibberish showing up.
    A few hours ago, I had the Russian strings in the Enum Type control working, except that when selecting from the available items, only the first
    word of the Russian string was displayed.  Two of the items start with the same word, so the user can't distinguish them.  
    At that time the English strings were appearing as Chinese gibberish while the list during the selection process displayed in English.  As soon
    as I changed the selection, future attempts to change the selection gave Chinese gibberish during the selection process, too.  But this was only
    a problem in the executable version; the source-code version worked fine.
    In an attempt to get rid of the Chinese gibberish, I made new constants and retyped the items into them.  This worked!  But then, the Russian
    stopped working and gave gibberish angles and tiny numbers, even though I didn't touch any of the code that sets the properties in Russian mode.
    After trying a few sequences of setting the properties for the graph X label on page 2 of my tab control, this label started working correctly for both
    languages.  But the text of that label comes through on page 1 of the tab control, partly obscured by other controls on that page.  After the
    program runs a few more seconds, these shadows disappear.
    Most times I restart LabVIEW, I get an error message saying there was a crash due to fontmgr.cpp, line 7494.  But there actually wasn't a crash.
    My computer has Windows 7 64-bit.  Deployment Computer has Windows 7 32-bit.  LabVIEW version is 8.5.  
    I have probably 50 or 100 more controls and indicators to change to language programmability and figuring out all this stuff for each one is
    terribly time-consuming and there is no assurance that all of them will ever work.  
    At this point, I'm hoping that I am on an entirely wrong path and someone will send me a clue to get me on a path that is more predictable.
    Thanks in advance to all who post ideas!
    Cheers
    Halden 

    Hi All,
    I've made a lot of progress on this translation, but it's been really hard.  There are lots of weird things going on that must be logical because they're in a computer, but I can't figure out what the logic is.  When changing a font on a caption using the front panel, it sometimes changes the font on the caption and sometimes doesn't although the indicator always indicates the new font.  Removing the first character of the unicode font string being sent to the caption seems to help...huh?  Anyway, tabs still can't change language programmatically, and niether can ring controls (some kinds will take the new list of strings, but when selecting, they only display the first word of the string!).  Boolean text can be reprogrammed, but only if the boolean text is set to be the same for both true and false states.  When reprogramming captions on a non-displayed page of a multi-page tab-controlled user interface, the new text appears on the current page until I change pages back and forth.  What a pain!
    Sooo, NI....does LabVIEW 2011 have support for unicode fonts?  Or, is there anything else in the new control style that will support programmatic language changing?
    Halden 

  • Copy multiple items from ical alters sorting order

    I use OSX leopard with iCal 3.0.1. I would like to select multiple items and copy-paste them into a text document or spreadsheet. I use iCal to keep track of people's working hours and I need to send the hours to salary admin at the end of each month.
    Using the "search" option within iCal, I can select all item concerning the working hours of, let's say, "George". If I copy-paste them into another application (Word, Mail, Numbers, Excel) the sorting order of the items altered. It looks like a rather random order. I want to have it ordered by date opbviously! Does anyone recognize this problem?

    Pieter,
    would send feedback to apple on this, recreated the behavior on both of my macs for multiple search results, and each time same thing, order is altered...
    http://www.apple.com/feedback/ical.html

  • Is there any Way to find Which case is Executing in LabVIEW VI programmat​ically and Display it..

    Is there any Way to find Which case is Executing in LabVIEW VI programmatically and Display it..
    Solved!
    Go to Solution.

    I wrote this a few years ago: http://lavag.org/files/file/199-state-machine-foll​ower/
    This JKI RCF Plugin sets the Visible Frame property of a Case Structure while the owning VI is running. Use it to follow the execution through the cases in your string-based State Machine/Sequencer when Execution Highlighting isn't fast enough (and, it's never fast enough).
    The use-case I wrote this to improve is setting a Breakpoint on the Error wire coming out of the main Case Structure and probing the Case Selector terminal so I can float-probe wires during execution. The problem with this is that I had to manually select the current frame every time. This is boring, so I developed this plugin to automatically set the Visible Frame to the case most recently executed.
    You might be able to adapt it to your needs.  The basic idea is that a custom probe on the wire to the Case structure's selection terminal sends a notification to a VI that displays the appropriate case.
    We might be able to help you develop something easier if you'll give us more information.  Is it OK if the code to display the case is in the same VI?
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • ICal: alter events time format to hh:mm:ss

    What i want to do in iCal is: Execute GarageBuy scripts by an event's alarm on date hh:mm:ss
    Limitations: iCal events are limited to the time format hh:mm
    Looking for: guidance how to alter the iCal code myself to change the time format to hh:mm:ss - if this is possible.
    Background:
    So far i experienced that in system settings / language & text / formats / times let you customize the short time to hh:mm:ss. The short time format will determine in iCal how it displays the time format of events [hh:mm:ss] in the monthly overview but unfortunately not in the event settings itself [where it is still limited to hh:mm].

    closing thread

  • How to get a edited string to be evaluated again

    hello, I'm very new to TS and don't know if I express the problem clearly. however the question below:
    I try to edit a numeric variable before it's evaluate at runtime and what i did is:
    Val(SearchAndReplace("FileGlobals.I_LB_bin[FileGlo​bals.loop_BINi]","LB",FileGlobals.Mode[Locals.mode​i]))/2
    but after the replacement seems the val function can get value with new string.
    how can i get a string to represent a value and be evaluated again after edit?
    thanks a lot!
    Solved!
    Go to Solution.

    Hi,
    I am assuming that you are trying to get  a variable expression evaluated at runtime. I would do the following
    Locals.Num=Val(Evaluate(SearchAndReplace("Locals.V​ar_X","X",Locals.Control_Num)))
    All the  variables are String and the output is a number on which you may perform further arithmetics. 
    You dodnt need the variable Locals.Var_X at all. I just created during my trials. 
    Ranjith

  • Programmat​ically change PXIe-2529 topology with NISE

    Hi !
    I have a PXIe-2529 that I control through NISE to test some products. These products require the matrix topology to be changed while I'm testing them.
    Is there any way to do this programmatically ? 
    Opening/closing NISE session might be solution (even if I would prefer not to close it), but I can't find an option string xorking to change the topology...
    Any ideas ?
    thanks !
    Solved!
    Go to Solution.

    zyl7,
    Unfortunately there is no way to change the topology on the fly with NI Switch Executive. A better method would be to have two NISE Virtual Devices, one for the 4x32 2 wire configuration, and one for the 8x16 2 wire configuration. You would close out the NISE session from VirtualDevice1, and open a session to VirtualDevice2 that references the same hardware. Of course, you would need to make sure that the external connections are connected properly, but this should change the topology for you.
    Note: Closing the NISE session for VirtualDevice1 and Opening the NISE session for VirtualDevice2 will reset the switch module and cause all previous connections to open.
    Hope that this helps!
    Frank,
    National Instruments
    Staff Software Project Engineer

  • Programmat​ically Controllin​g the Combo box

    Hi experts,
    I am developing an application which should allow the user to add/edit  their own fields in the combo box. The attached vi allows the user to add/edit fields in the combo box. but when we run the the program next time the added/edited fields are not available in the combo box.
    Suggest me how to programmatically save the contents of combo box, so that it will retain its previous values in the next run.
    Thanks.
    Attachments:
    Menu(main).vi ‏11 KB
    add menu(subvi).vi ‏9 KB

    Hello tunevr,
    You have  a good start with your code, except I have noticed a couple things.
    1) The string array in the subVI does not get saved, so every time you run the VI it has the original three items
    2) Since we are editing/modifying a control within the VI at run-time, all changes will be lost if we do not save the VI.  Thus we either have to manually save it or invoke the Save VI method.
    I have made a couple modifications to your code and posted it to the Community. 
    http://decibel.ni.com/content/docs/DOC-6791
    Rod T.

Maybe you are looking for