04-02-2007 05:51 AM
04-02-2007 06:41 AM
There are many ways to pass data into a sub-vi. It depends on your application. If your sub-vi contains a while loop, you can pass data into the vi by wiring the input control to the left side arrow of the shift register. This will initialize the shift register so that the first iteration of your while loop, the shift register will contain the passed in value. When your while loop ends in the sub-vi and you are ready to return data, you can wire the right hand side arrow to an indicator outside the while loop and pass that data back to the calling vi. This is just one of literally hundreds(?) (Maybe close to a hundred!) ways that a shift register may be used to pass data in a sub-vi.
Tom
04-02-2007 08:05 AM
04-02-2007 08:06 AM - edited 04-02-2007 08:06 AM
메시지가 04-02-2007 08:09 AM에 labmaster에 의해 편집되었음
04-02-2007 09:16 AM
Yes. The easiest way is to select (highlight) all the code that you would like in the sub-vi. Then, select Edit --> create sub-vi from the pull down menu. This will place all the highlighted code into the sub-vi and create the proper controls and indicators on the new sub-vi's front panel. You will probably need to cleanup a little but it should work for you.
Tom