LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing of #define in C++ for LabVIEW

In C++ we define our constant values or macros with this compiler preprocessor "#define".
What is in LabVIEW for replacing this subject?
 
fore example  in C++:
 
#define  Item_Value     3.345
#define  XY                   x*y
 
and ...
 
what instanse is suitable in labview for above macros?
In C++ I can easily change my definitions for example "#define Item_Value    6.517"  and it change in total of my program but In LabVIEW how I can do it?
 
thanks
0 Kudos
Message 1 of 4
(3,017 Views)
The closest thing is the conditional disable structure, which allows you to set a symbol in your project and use that to decide which piece of code will execute, but you can also easily do this by having a VI output the value or by using a global variable to output the value. Both will require you to create more files, though.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(3,006 Views)
hi

i did not understand how a conditional disable structure helps in thsi case!

using global vis is fair enough!!

kindly explain the usage of conditional disable structure!
0 Kudos
Message 3 of 4
(2,979 Views)

If I understand correctly, a conditional disable structure is more similar to #ifdef than to #define, but you can do something like this:

  1. Create the structure.
  2. Create as many frames in the structure as you like, one for each "value".
  3. Change the value in the project.

It's not the best solution for something like this, but it has some advantages. As mentioned, the static global variable or the subVI is closer in spirit to #define.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,969 Views)