LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

force VI not to settle running a sub-VI

Hello All,

I'm using LabVIEW 7.0 for my first project, I hope my question is not too stupid.

I need my system to move a motor in different positions with its sub-VI, acquire data from sensors in each position

with a for loop, all repeated within a bigger for loop to cover all positions. The problem is that when motor sub-VI is running, Vi settled down there and continue to run only that sub-VI, repeating the same command (move to the first position). I just add that I want to force motor to stay in that position until sensor acquired data and use a condition using i value on the smaller for loop for that purpouse.

Thanks in advance for any help. 

0 Kudos
Message 1 of 8
(3,056 Views)

Could you please post all the vi's and subvis.

 

Mathan

0 Kudos
Message 2 of 8
(3,053 Views)

find attached VI (totale cella...) and sub-VI (ESP... is the one settled). Thanks!

0 Kudos
Message 3 of 8
(3,035 Views)

Attachments are missing.

 

By what you are describing, it sounds like you want a State Machine Architecture with at least 2 key states:  Move machine, stop and read, executing back and forth.  On each Move machine, you feed a different position to it, possibly taken out of an array of positions.

0 Kudos
Message 4 of 8
(3,030 Views)

Right I've got a list of possible positions, actually coorresponding to laser lines, and I need extactily what you said, move - stop - read, calculate  and save - move to the next one, etc...

File now are attached in any case.

any help would be appreciate.

Thanks again.

0 Kudos
Message 5 of 8
(3,026 Views)
Well, of course the subVI continues to run. You've got a while loop in the subVI and the only way to stop the while loop is by clicking on the Stop button on the front panel of the subVI. You are not making the front panel visible so you have no way to stop the subVI. I'm not sure why you put the while loop in there anyway. You should pull out all of the initialize and close functions and put that in main. Then have a subVI that just does a read or write.
0 Kudos
Message 6 of 8
(3,013 Views)

As Dennis set, you have 2 subVI's called, one has a run forever while loop, the other requires a stop button to be pressed.  (Note, use Stop on True, then you don't need to NOT the boolean value coming out of the stop button.)

 

But you also have a big problem in the Total Cell VI.  You have a STOP sign function in your large while loop.  That function should probably never be used.  It is equivalent to hitting the abort button on your VI which brings the program to a crashing halt.  The code after the For loop would never run if that STOP sign function ever gets a True value.

0 Kudos
Message 7 of 8
(3,002 Views)
Everything is right now, thank you very much!
0 Kudos
Message 8 of 8
(2,933 Views)