LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read/Write From/To Binary/Text File

I have a labview program with  formulas in sub VI's. How do i go about changing those hard coded sub vi's formulas to putting them into a text file to make changes and updates easier to the formulas if needed with out stopping the program like you would do in text base coding like C++?

 

Thanks in advance!

0 Kudos
Message 1 of 17
(2,702 Views)

Hi E,

 


to make ... updates easier to the formulas if needed with out stopping the program like you would do in text base coding like C++


 

I don't think you can change any formula in a compiled C(++) program without stopping that program and recompile it...

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 17
(2,699 Views)

Your right. What i meant was how do you go about converting formulas from sub vis to text base formula that would make updates easier? Instead of rewiring the whole program for changes that needs to be made it is all read from a file that can be modified easier.

0 Kudos
Message 3 of 17
(2,693 Views)

You can use a formula node.  Sometimes big calculations get a little cumbersome in LabVIEW - that is when I use the formula node instead.  Generally I prefer to use the LabVIEW primitives, though.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 17
(2,678 Views)

Bill Thanks for your reply. I will try to find some example to follow.

0 Kudos
Message 5 of 17
(2,674 Views)
Message 6 of 17
(2,666 Views)

I don't think the formula node will accomplish what the OP wanted. In order to input equations/formulas from an external source at runtime you will need to implement a parser in your code that will evaluate the formula and execute it. Essentially you will be creating a calculator in your code. It is certianly doable but depending on how complex your formulas are it coude be a significant amount of work.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 7 of 17
(2,663 Views)

Another option, but not quite what you want, is to dynamically call your VIs that perform the forumulaic calculations. That way, if you want to change the formula used in the built executable, you only need to replace the dynamically called VI. This approach is a bit of work, but it makes no difference how easy or complex your formulas are to be.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 8 of 17
(2,657 Views)

aCe Thanks for the link!

0 Kudos
Message 9 of 17
(2,654 Views)

Thanks Mark

0 Kudos
Message 10 of 17
(2,652 Views)