11-24-2014 03:35 AM
Hi,
I have a string for calculating force in a Daq operation, For ex: the string would like " AI0+0.0254*AI1". I have to create a calculation dynamically for this Daq operation. how to do it?
11-24-2014 04:26 AM
You could try using the Forumla Node
11-24-2014 04:32 AM
are you trying to say your formula is not constant and it may vary?
If only inputs are varying then using formula node is ok, but if the operators are going to vary then you will have to write a smart decoder which will identify formula and process as per "BODMAS" rule.
11-24-2014 04:37 AM
Hi,
yep, the equation varies according to the user definition, sometimes it might be AI0+AI1+AI2*0,005 some thign like this. So , how to do it. If anz exampels pls do post.
11-24-2014 04:44 AM - edited 11-24-2014 04:44 AM
I do not have example handy, the only thing I can suggest right now is, write a decoder which will follow BODMAS rule.
search for variables and operators associated with them and then process.
11-24-2014 04:49 AM
Other than Decoder, Is there anz other method solving this problem.
11-24-2014 04:55 AM
Try inserting the variables (AI0,AI1...) in one column of a CSV file and in other column insert formula required.
11-24-2014 06:36 AM
I've had success using LabPython. Here's an example I wrote a long time ago.
11-24-2014 07:22 AM
I've never used the LabPython but heard good things. Also for simple equestions you can use the formula evaluator VIs. They ship with LabVIEW, but it takes some reading into the documentation to know the format and what functions are supported. It is under Scripts and Formulas palette under Mathematics.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord