08-11-2015 12:44 PM
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.
08-11-2015 12:51 PM
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> ---'
08-11-2015 01:00 PM
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.
08-11-2015 01:01 PM
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
08-11-2015 01:03 PM
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.
08-11-2015 01:03 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-11-2015 01:10 PM
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.
08-11-2015 01:13 PM
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?
08-11-2015 01:16 PM
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.
08-11-2015 01:17 PM
How would I get it to end itself?