12-27-2007 02:32 AM - edited 12-27-2007 02:33 AM
12-27-2007
03:13 AM
- last edited on
06-17-2025
06:49 PM
by
Content Cleaner
It seems you are just grabbing all your code followed by "create subVI". This is not the right way to do things.
You only have a few controls and indicators, so all you need to do is select a connector pattern and then assign the front panel objects to terminals.
Have a look at the LabVIEW help for details:
https://www.ni.com/docs/en-US/bundle/labview/page/selecting-a-connector-pane-pattern.html
(BTW, your VI has a lot of weird constructs, for example none of your FOR loops serve any purpose. Can you explain what they are supposed to do? Also you should refactor your "code worm" into a compact state machine that fits on one screen. This allows you to avoid these ugly STOP primitives. Use shift registers for the increment counters).
12-27-2007 03:43 AM
12-27-2007 03:47 AM
12-27-2007 03:51 AM
on top of Altenbach comments:
if you want to use the whole program as a subvi, you do not need to create a subvi. it is already as is a subvi. suffice is that you define your controls and indicators to be connectable from outside. to do so, right click on the icon (upper right side), and select "show connector". then right click on 'patterns" to choose the pattern you want. you will need in your case about 16 connectors. then, with the mouse, click on any case of the connector, and correlate it with a control/indic on your screen.
et voila! your vi can now be used as a sub in any other program.
yet, i would propose you to do a step by step approach: look at all the repetitive elements of your program, and assemble them by "create subvi". already your program will be more readable. then, try to get rid of the sequence structure (see Altenbach nugget), and redesign a little the prog to sit in a state machine.
good luck
12-27-2007 04:00 AM