LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a problem about SubVi Run

When you click Hardware Button (red area ) in Main.vi,

SubVi is running. But SubVi doesn't work. Why?

 

I upload this picture!

 

plz help me

0 Kudos
Message 1 of 12
(316 Views)

Sorry, I upload pictures

0 Kudos
Message 2 of 12
(301 Views)

The pictures are absolutely no help to me.  Attach your VI.

 

Bob Schor

0 Kudos
Message 3 of 12
(275 Views)

I'm sorry. I can't show you this because it's company work.
I think if you press the button on the main.vi,

the subvi will be in infinite loop.

So I can't do anything about both Mainvi and Subvi.

Can you tell by watching Subvi only?

0 Kudos
Message 4 of 12
(203 Views)

We can't watch anything because there is nothing to watch.  Just some pictures that barely show sections of code.

 

If you can't attach the actual VI's, create some simple VI's that show your basic concept.  In the process of doing that, you may even figure out on your own what is going on.

 

The fact you say the subVI is in an infinite loop worries me.

0 Kudos
Message 5 of 12
(194 Views)
Highlighted

aa.PNG and aaaaa.PNG are Main.vi 

 

Thank you your help

0 Kudos
Message 6 of 12
(192 Views)

.png's aren't VI's.  They are pictures.

 

Your workTargetSelect.vi is a VI.  But it is only 1 VI.  It doesn't have any subVI's in it.

 

In that VI, use block diagram cleanup.  It is hard to tell which way wires are runnign.

Also, Index Array is resizable.  You can stretch the bottom border downwards to get multiple inputs.  Instead of dozens of Index Arrays, you might be able to use just one or two.

Also, Those Concatenate strings are rather complicated.  If you used Format Into String, you could put all those string constants into the Format String and only need the dozen wires or so for the data.  You won't have to wire up all those quotes and labels like ""Tag No. ="

 

So if the VI you attached is actually the subVI, since you have 2 infinite while loops in there, how will that subVI ever end so that it allows execution to go back to the main VI? 

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
Learn LabVIEW

 

Why does the upper while loop run infinitely fast waiting for the search button to be pressed?  Why is it in a loop?  None of the inputs ever change.  Shouldn't it just run once when the subVI starts?

 

What do you do with the outputs of this VI besides writing them to a text file?

 

It seems this VI should be just 1 or even no while loops.  And it if is a while loop, you should have a "Close" button on it so that it will end the loop and return control back to the main VI.

0 Kudos
Message 7 of 12
(170 Views)

I haven't made a Close yet.Don't you have to use infinite loop because you don't know when the search button is pressed?

I want to run by clicking the button on main.vi. and i thought Subvi = workTargetselect.vi I'm sorry if I made you misunderstand, I'm still immature in the labview.

0 Kudos
Message 8 of 12
(162 Views)

and Nothing works in this situation.

0 Kudos
Message 9 of 12
(161 Views)

 


@adavb wrote:

I haven't made a Close yet.Don't you have to use infinite loop because you don't know when the search button is pressed?

I want to run by clicking the button on main.vi. and i thought Subvi = workTargetselect.vi I'm sorry if I made you misunderstand, I'm still immature in the labview.


Put the search button in the event structure.

 

Why do you need a search button at all?  Why wouldn't it just do the search as soon as the subVI starts?

 


@adavb wrote:

and Nothing works in this situation.


What situation?

 

Please take the tutorials.

Then when you are ready to start coding your project, but before you actually start coding it, sit down with a pencil and paper and draw out a flowchart of how you want to your program to work.

 

0 Kudos
Message 10 of 12
(139 Views)