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: 

Creating a Sub VI

Hi

 

i'm having problems creating a sub vi. Its my first attempt and i'm struggling (like most things in Labview!).

 

I have a search function which i use in multiple places in a program. As you can see i need to repeat a search of an array in multiple lines.

 

I do not want to have lots of coding to trawl thorugh, just want to drop a sub vi and connect it up to the few inputs and out puts.

 

My problem is that i'm not sure how you creat some connections for some elements. (arrays for example). When i follow the tutorials they are too simple. A number input, add one, number output. This doesn't help me get to where i need to be.

 

I've included my vi that i want to be a sub vi and also a sample data set for running with. My vi called Array Search does exactly what i want it to do. You can see there is an obvious case structure that can be turned into a sub vi but i cant figure out the connections.

 

I have also inlcuded my attempt at the sub vi (search array) but i think i search function repeat which is not correct.

 

The vi works by searching for and ordering the serial numbers in the second column which are 50451 and 50445.

 

Can some one help me out please?

 

Thanks.

0 Kudos
Message 1 of 4
(2,476 Views)

I made that videao a while ago, does it helps you? I'm sorry there is no audio comment nor clear signs to indicate left and right clics but I'm sure you'll figure it out. Basically I create to VIs, one to calculate the mean and one to calculate the median of an array and I show how to edit the connector pane and the VI documentation. Hope this is the help you need.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 2 of 4
(2,471 Views)

Hi DelEngUK,

 

> My problem is that i'm not sure how you creat some connections for some elements. (arrays for example).

> When i follow the tutorials they are too simple. A number input, add one, number output.

> This doesn't help me get to where i need to be.

 

LabVIEW can create the connections for you.

 

  1. Select the code you want in your sub vi using your mouse.
  2. From the menu, select Edit >> Create SubVI

The Sub vi will be created with the correct connections.

 

steve

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 4
(2,465 Views)

OMG! Never knew you could do the create thing...how simple is that and how dim do i feel....

0 Kudos
Message 4 of 4
(2,458 Views)