Jump to content

Updating formula node dynamically


Wolfram

Recommended Posts

Could you make a version of that attachment in LV 6.1? (or is it a LV 7 feature only?)

This is a topic is of some value to me.  The old Eval methode is too slow (and ugly).

5981[/snapback]

This will not help you. The Eval Formula VI works at run-time allowing formula parsing and evaluation. The Scripting VI indicated above is a development tool that creates a formula node during edit time. Here is a picture of the code so you can create it yourself in 6.1

post-2-1125800145.gif?width=400

Link to comment
This will not help you. The Eval Formula VI works at run-time allowing formula parsing and evaluation. The Scripting VI indicated above is a development tool that creates a formula node during edit time. Here is a picture of the code so you can create it yourself in 6.1

post-2-1125800145.gif?width=400

5985[/snapback]

Thanx, for the diagram it was enough to get it working. Apparently LV 6.1 does not have the BDwin.Open property. But I made it work on an existing vi. Still as you said, of limited value at run time. I was thinking of a peak fit function we use as part of a larger program. Customers would like to define there own peak formulas. And I've avoided using Eval because there's too much data. Even a hard coded formula is slow sometimes. But the LV scripting in gereral is a neat tool.

Link to comment
  • 1 year later...

Hi!

I am just trying to adapt this VI to changing the content of a MathScript Node, but unfortunately I could not find out how to create such a object class constant. When I try to create a constant from the VI's input, I get a "Generic" and cannot even change it to "Formula" as given in the example, because it is not listed. Could anyone please tell me how to create such a constant!

And back to my original problem: Is it possible to change the MathScript code in a VI that is not yet running, but is supposed to run after the change? I think LV need to compile the node - can it do so while it is running?

Thanks a lot,

Christian

Link to comment

QUOTE(mdd100ai @ Jul 4 2007, 10:30 AM)

If you are using LabVIEW 8.2 then my http://forums.lavag.org/downloads-file87.html' target="_blank">Scripting Tools toolkit has a polymorphic vi that returns a class constant of every possible type. This doesn't actually help you that much because in LV 8.x the properties and methods for scripting are hidden and can't be revelaed with any fancy ini file key.

The Scripting Tools toolkit will create some nodes for you, but not a formula node (yet), but if you look at the Create Expression Node, you'll see that that is actually creating a formula node (and a mathscript node is a subclass of a formula). Alternatively, I'd reccomend the DataAct Class browser for those wanting to mess with LabVIEW scripting - I think it supports LV 7.x and upwards. It does cost $ if you want the version that can create property and method nodes.

In terms of using a scripted vi in a project - firstly you need to be aware that it will only work in the development environment (scripting is really only for NI for writing development tools...). If that is not a problem, then what you will want to do is have a vi that creates and scripts a new vi that has the formula node, and then executes the new vi using the vi-server methods, before closing all the references to the new vi, hence removing it from memory.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.