取消
显示结果 
搜索替代 
您的意思是: 

Formula Operators

Hi, I'm using the Parse Formula Node.vi and Eval Parsed Formula Node.vi to evaluate just basic equations, but I'd like to use them to evaluate operators such as >, <, =, etc. I get an error when my formula includes any of those operators. Any suggestions? Thanks.
0 项奖励
1 条消息(共 7 条)
4,311 次查看
You cannot perform comparison operations with those VIs. For that you need to use the Formula Node. This is in the LabVIEW documentation.
0 项奖励
2 条消息(共 7 条)
4,303 次查看
I had a program where I wanted to have a user-input formula that would use complex numbers. Unfortunately the formula evaluation vis don't support complex numbers. So I modified them. I needed to insert a new function which I called "ii". I modified "Function Decomposition.vi" so that it would recognize "ii" as a function and asign it a number. Then I modified "Three Register Calculation.vi" to add a new case for my new function. And then there were a few more fixes to get it to work correctly that I can't remember right now.
0 项奖励
3 条消息(共 7 条)
4,290 次查看
Hmm. I don't think the Formula Node will let me have a variable formula for the user to enter.
0 项奖励
4 条消息(共 7 条)
4,278 次查看
As far as I know the formula node does NOT have inputs to change the formula itself. In my earlier post I was refering to "Advanced Forumla Parsing" functions (Analize->Mathematics->Formulas). The only use I have for these are for user input formulas or formulas that change. They seem to run fairly slowly. And I don't think they can do multiple line formulas.
0 项奖励
5 条消息(共 7 条)
4,274 次查看
Sima: I did not mean to imply that the Formula Node will allow you to create a user-defined formula. You can't. All I was saying is that comparison operations cannot be done with the VIs that you were trying to use, and this was in the LabVIEW documentation. The "Eval" functions in the Analyze->Mathematics->Formula section allow you to have variable formulas, but based on the documentation none of these VIs handle comparison functions. For what you're doing you will probably need to code up your own parser. Over the years I've seen various types of formula parsers, so perhaps if you did a web search you might be able to turn something up.

You didn't say how critical being able to do this is to your application. An alternate (though admittedly clumsy) solution may be to use the Matlab or Mathscript node. You can write out your function to a file and then have the Matlab/Mathscript node call the function. You can check the Matlab/Mathscript documentation on this, or just head over to the MathScript forum.


0 项奖励
6 条消息(共 7 条)
4,256 次查看
Thanks for the replies. I can't say it's a life or death situation, but it would be really really nice to have 🙂 It would make certain things easier.
0 项奖励
7 条消息(共 7 条)
4,250 次查看