LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from a file and creating a subvi

I have one big program that Reads form one Excel File and pass the information on to other parts of the program. I am trying to optimize the code and clean it up some by making subVIs.

 

My Problem:

When I create the subVI there isn't any input. When the program reads from the excel file the data is showing in an 2 Dimensional Array indicator. I need to re arrange the program so it can accept the data coming in and pass it thru the formulas to do the calculations then output the info on the 6 other indicators. This wasn't an issue while in the main program because there wasn't any need for inputs there were all on one program with Notifies to wait until the data is read and pass it to the other parts of the program. The problem is getting that data from the Main program to subvi's that doesn't have any input.

 

Any suggestions?

0 Kudos
Message 1 of 6
(2,518 Views)

Have you wired the 2D Array Control on the SubVI's Front Panel to the Connector Pane?

 

http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/building_connector_pane/


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 2 of 6
(2,515 Views)

Alex,

thanks for the quick reply!

 

Yes i have but when i place the subVI on a blank VI  and look at context help. It shows that 2 D array as an out even though its connected to the left side of the connector panel. when i try to use a local variable form the main program and wire it in it shows an error. Saying that  I am trying to wire 1 output into another output.

0 Kudos
Message 3 of 6
(2,513 Views)

And im guessing its because it was an indicator instead of a control is the reason for this. But i dont know of another way to get the data in from the file. If I turn it from an indicator to a control that will allow me to make it an input but it would cause the program to give another error because  that indicator was used to display the data from the excel file

0 Kudos
Message 4 of 6
(2,511 Views)

Can you share some of your code?  I'm having trouble understanding what your problem is.  Are you trying to give the option of supplying the information or reading from the Excel file?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(2,504 Views)

You're right, connecting an indicator to the CP always creates an output. But I don't see how data you read from an Excel file can be an input... Could you upload (parts of) your program?

 

 

0 Kudos
Message 6 of 6
(2,502 Views)