LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Handling in formula node

Hello All,
I am trying to open a file and write some data to a file within the formula node. A declaration like
file *in;
produces this error:
Formula Node:undefined variable.
Error on line 1 is marked by a '#' character: "file# *out;"

How does one do file I/O operations within the formula node?

Thanks,
KB
0 Kudos
Message 1 of 3
(2,761 Views)
Hello KB,

it seems you are trying to write a LabView program by
inserting C-code into a formula node... That's not the way it should be.

As far as I know there is no way to open a file inside the formula node. (It's a "formula" node!) So you have to open the file with LabView for reading and/or writing. Use your prefered subVi from the file palette. Perhaps you have to convert the data to a format suitable for your formula node (like string to U8-array).
In my experience it's better to use Labview-code instead of the formula node. In my programs a formula node was always slower than Labview code. So you should think about converting the C-style code to Labview.

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,761 Views)
Hello KB,

in the help file of LabView you will find a nice table of the whole syntax/commands of the formula node. Just use the context help on the formula node, then "click for more help", then "Formula Node syntax".

Best regards,
GerdW
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 3
(2,761 Views)