LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why can't this VI become a SubVI?

Hi

 

This led chaser VI is required to be used multiple times but I cannot make it into a SubVI.

The led switches on to chases to the end & more to create a delay Then returns by switching them off.

 

It works as a VI but not as aSubVI.

 

Any ideas?

 

 

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

noneqwerty wrote:

It works as a VI but not as aSubVI.


I guess I have no idea what you mean by that. 😮

 

  • If you want to call it as a subVI and actually see something interesting, you might want to set the windows option to show the front panel when called and close it when done.
  • If you want to call it multiple times in parallel, you need to make it reentrant.

 

What's the purpose of the OK button? Seems pretty useless. 😉

Why is your shift register orange. Make it the right datatype (blue!).

You should initialize the boolean shift regsiter too.

Message Edited by altenbach on 05-29-2009 05:48 PM
0 Kudos
Message 2 of 4
(2,834 Views)

Hi

 

 The led chases to the right & back to the left when the OK button is pressed then stops.

Thats what I mean.

 

The switch is for simulation. I want to press a switch to trigger the leds.

 

Because I want to use this 4 times in the project simulation It is best to make it into a subVI. It fails as a subVI.

If I bring it into a new VI it fails to run.

 

Dont know why it changed to orange. What should I look for?

 

Cheers

0 Kudos
Message 3 of 4
(2,829 Views)

Well, it seems that you just started to learn programming in LabVIEW, so let's make a few things clear.

 

  • It seems you are using the "continuous run" button th run the VI. This is a debugging tool and no reasonable way to run a VI.
  • You button is set to latch action, so as soon as the subVI is called, it will finish. No way to press the button.
  • You know from the beginning how many iterations the loop will take, thus a FOR loop is the correct structure
  • Your wire is orange because you have a floating point number wired to it. The code demands an integer, so simply change the representation of your diagram constant.

 

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