LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i create a subvi

dear sir,
          I have come across regarding to create a subvi.I have attached simple code.I want to convert this into subvi.But when I insert this vi in my main vi there is no option for input and output terminal.I have done the procedure as given below.
 
1.I opened the  front panel,right click it and click the show connector.
2.Then I opened the pattern .
 
       How do i insert the color in this patters
          Pls explain how do i create a subvi with brief explanation.
         
0 Kudos
Message 1 of 7
(3,198 Views)
Just click on the desired connector in the connector pattern, then click on the desired control. The connection is made.
 
Repeat for the other connectors.
 
Of course your VI is a bit silly, because the FOR loop really has no purpose. Since the two numeric controls are outside the loop, the comparison outcome will never change and there is no reason to keep the loop running.
 
Also, any loop that just waits for a key press ("stop" in this case) needs a small wait statement. There is no need to keep it spinning millions of time per second.
0 Kudos
Message 2 of 7
(3,196 Views)
dear sir,
          how do i fill the color in the connector pattern . I select the desired conector pattern but no i/p and o/p provision is not indicated in my program .so pls clarify this doubt.
 
0 Kudos
Message 3 of 7
(3,177 Views)
Click the connector, then click the control/indicator that should be assigned to that connector.
I'd recommend going through some tutorials or help...
0 Kudos
Message 4 of 7
(3,170 Views)


@jayanthi wrote:
dear sir,
          how do i fill the color in the connector pattern . I select the desired conector pattern but no i/p and o/p provision is not indicated in my program .so pls clarify this doubt.
 



Hi Jayanthi,

U cannot "fill" the color in the connector pattern. It ll show the colour of the datatype when U link it as shown in the att pics.

First try to understand one thing. It is NOT a color-filling connector pattern, it is a connector pane that gets filled with different colors according to the different datatypes U select to wire to the Connector Pane.

There is an alternate way to create a sub-VI. LabVIEW itself will do this for U.

Select the part of the diagram U want to use as a sub-VI. Go to the Edit menu, U can see the Create SubVI option. Just select it, & this will create the correct SubVI for that part of the code U ve selected earlier, & come n sit in the diagram instead of the selected code.

Reply if U ve still got some doubts.

 

- Partha ( CLD until Oct 2027 🙂 )
Message 5 of 7
(3,159 Views)


@altenbach wrote:
Of course your VI is a bit silly, because the FOR loop really has no purpose.


Hi Altenbach,

There is NO FOR loop in the VI. Smiley Surprised

I think it is a WHILE loop FOR a short while in my system... ! Smiley Wink

Just for fun ! No offence, no defence. Smiley Very Happy

Hi Jayanthi,

3 more pics for how to use the Create SubVI menu option. It is simple.

Never ever forget to put a small delay inside the while loop. Else, it ll eat up all the CPU resource during execution.

- Partha ( CLD until Oct 2027 🙂 )
Download All
Message 6 of 7
(3,165 Views)
 

parthabe wrote: I think it is a WHILE loop FOR a short while in my system... ! Smiley Wink

Yup, I guess I was a bit tired. My post was way after midnight. 😉

 

In any case, assigning connectors is all in the LabVIEW Help. Click here:

 Assigning Terminals to Controls and Indicators.

0 Kudos
Message 7 of 7
(3,145 Views)