LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI inside event structure wont run a second time.

Solved!
Go to solution

The idea of having the event structure with the abort button is if the user decides to stop the program while it is running.  What it does is Initialize all of the instruments, and then abort.  My problem is that while the main VI, Hall Effect Real is running, and the Hall measure button is pushed which triggers the case, it runs and executes the subVI, Hall Effect with While Loop Tester1.5.vi.  What it does not do is end automatically, but not end the main VI.  In other words, the subVI inside the event structure inside Hall Effect Real which is Hall Effect with While Loop Tester1.5.vi, is not stopping programmatically.  also I need to work on my user stop routine, but all I want it to do right now is end Hall Effect with While Loop Tester1.5.vi after it executes when called by Hall Effect Real so that I can trigger more user events.

0 Kudos
Message 11 of 24
(2,699 Views)

That's what we're saying. You can't end "Hall Effect with While Loop Tester1.5.vi" unless it ends itself or you adapt it to an advanced architecture (and even then it would need to be in a parallel loop). You need to make some big changes to your code and these changes really require a re-do.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 12 of 24
(2,692 Views)

Hi

 

So I am going to clarify what I am trying to do.  My program is trying to run a meausrement.  At the top Level, it is suppossed to take user inputs for current, and magnetic field inputs, and then when run, and the event to run the measurement (which is a boolean value change event ) is triggered, it pushes the current and magnetic field setpoints into the subVI inside the event structure, which is Hall Effect with While Loop Tester1.5.vi. 

 

Hall Effect with While Loop Tester1.5.vi  uses preliminary information that is also pushed into it along with the magnetic field and current setpoints to set up an Excel spreadsheet.  After that, the measurement begins, in which for every magnetic field setpoint, one measure ment is run, at different currents, for example if the current was setpoints were 1 and 2 amps, and the magnetic field setpoint was 8000, the measurement would be run 0nce for 8000 for magnetic field with 1 amp, and once more for 8000 with 2 amp current.  It then will run a resistivity measurement, all this time pushing the data to Excel where Excel will take the data and process it accordingly.

 

 

  Now my problem is not the user stops as of right now.  That seems like something for the future.  My main problem right now is that I was under the impression that when the Hall Effect Measurement boolean was triggered, the subVI would run, and execute properly, which it does, and then end without ending the main Vi, which would allow me to press the button in Hall Effect Real, and redo the measurement if I felt like it.  This is what is not occurring.

0 Kudos
Message 13 of 24
(2,688 Views)
Solution
Accepted by topic author fghfghgfhfhg

As you have been told, the subVI should not have a stop button or an event structure.

 

The sequence structure is not needed (except possibly for the next to last frame - and that can be eliminated by placing an error in control on the Initialize Instruments.vi.

 

The inner while loop should be replaced with a for loop. You do not need Array Size and i = length -1.

 

It is not obvious how you are moving data around. Wires are always the preferred method.

 

It is often better to separate the data acquisition (make Hall measurement) and data saving (save to Excel). Look at a Producer/Consumer architecture.

 

All of these suggestions are compatible with a prompt and orderly shutdown procedure.

 

Lynn

Message 14 of 24
(2,679 Views)

I am confused, because what I am trying to do is get Hall Effect with While Loop Tester1.5.vi. to end on its own, without ending Hall Effect Real, so that Hall Effect Real could trigger the event that caused Hall Effect with While Loop Tester1.5.vi. to run again.  The user stops will be worked on later, but what I can't seem to understand is why it is not ending itself when placed in the event structure.

0 Kudos
Message 15 of 24
(2,674 Views)
If Lynn's suggestions don't work, use the awesome LabVIEW debugging tools to figure out what's not stopping. Probe the hell out of all cases within your case structure. Use Highlight Execution to watch each section stop running. Just saying your VI won't end doesn't give us enough information, especially when you left out some VIs so we can't run it.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 16 of 24
(2,671 Views)

Yeah I am changing it up, removing the event structure in the subVI.  but the while loop has to stay, because that is part of my assignment.  But Thanks.

 

The reason that I have the data save within the measurement, is that I want the data to be saved while the measurement was working partly because that is also part of my assignment. 

0 Kudos
Message 17 of 24
(2,663 Views)

Here is the rest of the code.  It probably wont work anyways because many of the subVIs communicate with instruments, so that might be a problem when it comes to running it. 

 

On a side note, when subVIs are inside of an event structure, do they end on their own after they r done executing?

0 Kudos
Message 18 of 24
(2,660 Views)

sorry i forgot to attach code here is the rest of the subVIs.  But one problem is that some of the VIs, are VIs that I do not have access to do any sort of file sharing with.

0 Kudos
Message 19 of 24
(2,655 Views)

How would I get it to end itself?

0 Kudos
Message 20 of 24
(2,652 Views)