From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel and LabVIEW Front Panel

Solved!
Go to solution

I have a CSV that contains a list of Booleans I need to add to my LabVIEW VI.  These Booleans must correspond to inputs and outputs of the LabVIEW VI, so it's not a matter of importing/exporting data to/from excel.  The LabVIEW VI needs to have inputs/outputs which match the Boolean names documented in the CSV file.  Is there any automated way to create a Boolean for each name in a CSV file for the LabVIEW Front Panel?  This could even be done using an array, but the important part is not having to type out 1000+ unique names.  Any help or references would be appreciated.

 

Thank you,

J

0 Kudos
Message 1 of 5
(1,161 Views)
Can you explain at a higher level what you are trying to do?
When you say inputs/outputs, I assume you mean controls and indicators that are connected on the connector pane. You only have a limited number of these (much less than 1000) so you would certainly need to use arrays or clusters. It is not too hard to create new controls using VI scripting, but it would be a nightmare to program with a cluster containing 1000 controls.
0 Kudos
Message 2 of 5
(1,144 Views)

You're looking at LabVIEW scripting, and you need to split the Excel data into subsets first of more sensible data...
maybe 2 sheets /files? one of inputs and one for outputs?
make the data in the columns the Boolean names and split the booleans into multiple columns so that each column represents a group of booleans you want to work with, Use scripting to make each column into a cluster of booleans, you can even add row0 as the Cluster name (Row1 in Excel).

Read the CSV into LabVIEW and convert to a 2D array of strings, process by columns and stop processing each column when you have an empty string.

(And as Gregory said, there is a limit to the number of controls, so bundle into clusters) - in clusters you can use cluster to array and back again to work on larger boolean datasets (if you want the names on converting back you will need to use the Variant palette on converting back to get the names)

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 3 of 5
(1,103 Views)

Yes the plan is to have 3 clusters: Inputs, Intermediates, and Outputs. Inside of those three clusters we will have additional clusters to sub divide all these signals into logical blocks because yes it would be a nightmare to handle otherwise. We are going to feed a dataset through the VI and have a PXIe chassis, loaded up with I/O, stimulate a device and read back the outputs, generating a report. Everything already works we are just trying to avoid manually entering in the signals to minimize the chances of errors from human hands.

0 Kudos
Message 4 of 5
(1,058 Views)
Solution
Accepted by topic author SJazzJAS

Yup been there, done that. VI scripting is your friend. and use clusters of Booleans that you can convert into arrays for readability on the BD so you can index/unbundle the data depending on the operations you want to perform without getting too confused as I said above. You'll find the VI scripting quite simple. Turning it on is an option in Tools>Options>VI Server. There are plenty of examples in the help to get you where you need.

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 5
(1,021 Views)