LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to let code know if global vi is an indicator or control?

Solved!
Go to solution

Hi,  I'm trying to read the global variable name and value of each global vi that in a directory.  The vi type for all vi files is global vi. Some of the global vi's are control vi and some are indicator vi.  If I use property node and create method get_all, I can get the name and value depending on whether I set Controls to True I can get name and value for control VI and if I set Controls to False, I can get the name and value for indicator vi.  The following code illustrate how I currently implement it.  I'd like to be able to display (or read) the name and value into one indicator and not two indicators as shown.  Please let me know your suggestions.

 

Thank you.

 

Tito_DR_0-1667938335901.png

 

 

0 Kudos
Message 1 of 5
(1,410 Views)

Can you explain what you are trying to achieve with all this? How do you tell the difference between a vi and a global?

 

You could just concatenate the two arrays, right?

0 Kudos
Message 2 of 5
(1,391 Views)
Solution
Accepted by topic author Tito_DR

Thank you for your quick response.   

 

I have a few global variable vi's in a directory. The global variable vi's are either created as control global variable or indicator global variable.   My ultimate goal is to be able to read and write from/to a .csv file that contains the vi's name, global variable name.  

 

Your pointed me to right direction. and I am now getting the data for each vi by array concatination.  I also found this NI answer link that help. 

Concatenate Multiple Arrays in LabVIEW - NI

 

Thanks a lot for your help.  Considering this is my first post in this forum and I am new to LabVIEW,  this is experience is great!

 

Tito_DR_0-1667944079196.png

 

Here the new code:

0 Kudos
Message 3 of 5
(1,380 Views)

Why would it even matter if they are controls or indicators? 

0 Kudos
Message 4 of 5
(1,374 Views)

I was to planning use the result as condition whether to set True or False the input to Property node so I can display the name and value of global variable:  Concatenating the arrays makes that moot and there may be no need to know whether the vi is global is indicator or control:

 

Tito_DR_0-1667945756452.png

 

 

 

0 Kudos
Message 5 of 5
(1,364 Views)