Jump to content
Sign in to follow this  
Porter

MuParser

Recommended Posts

In particular, how can LabVIEW interface with the DefineVar function:

http://beltoforion.de/article.php?a=muparser&hl=en&p=defining_variables

I see that the function expects a pointer to a variable from LabVIEW. MuParser stores this pointer internally and dereferences it in the Eval function. I doubt that the value that I passed along the wire into the DefineVar function will (reliably) remain at the same memory address by the time Eval is called. 

Share this post


Link to post
Share on other sites

Use DSNewPtr, which you can call through a Call Library Function Node with the library name set to "LabVIEW". See the LabVIEW help or posts on the NI forum about this function and the other memory manager functions. You then use MoveBlock (same idea) to copy data between LabVIEW and that pointer.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks ned! I hadn't come across this function yet. I'll have a look at it this weekend.

Share this post


Link to post
Share on other sites

Thanks again ned! DSNewPtr and MoveBlock did the trick. There is also a nice GetValueByPointer.xnode that really helps getting string values from pointers.

muParser seems to be about 3x faster than the expression parser provided with labview and it supports logical operators.

muParserDemo2.PNG

Share this post


Link to post
Share on other sites

Hello Porter,
I've been looking on this library for a while, but I wasn't able to make it work with labview. Would you share your code?

Zyga

Share this post


Link to post
Share on other sites

I will ask permission from my employer to share the code on LAVA. I'll keep you posted.

  • Like 1

Share this post


Link to post
Share on other sites

OK, If you will not be able to do so, it is not a big deal, at least I know that it is possible :)

Share this post


Link to post
Share on other sites

Join the conversation

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

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

Sign in to follow this  

×
×
  • Create New...

Important Information

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