08-03-2015 11:07 AM
Hello. Thank you everyone for your help, getting to this point. I asked for help to create a stop condition, while a For Loop is running. I was given many ideas and selected the one that used local variables. It works well however, if I am in the "Test in progress" state, in the first For Loop, and the "Stop" button is selected from the front panel, when it stops the Vi, it sends the value "5" to the second For Loop before going to the "End" state, which puts it to "0", then stops the Vi. What this Vi is doing is feeding 0-200VDC signal to an eddy current sensor, then it feeds 200-0VDC going the other direction. I have tried sequencing, putting in timers and a few other goofy things but I can not get the Vi to stop in the first For Loop, without the Vi performing the initial "5" to the second For Loop. Someone had mentioned using an event handler, in my previous post. I practiced for quite some time, trying to understand how to use an event handler but am not much the wiser. Any and all input would be greatly appreciated.
08-03-2015 01:21 PM
Do you want any help?
1. Did not include all of the VIs.
2. Gave us a password protected VI.
08-03-2015 01:24 PM
@crossrulz wrote:
Do you want any help?
1. Did not include all of the VIs.
2. Gave us a password protected VI.
1. Did not include all of the VIs. I will try again
2. Gave us a password protected VI. Oh no, sorry about that. It's "2015"
08-03-2015 01:37 PM
@ceilingwalker wrote:
@crossrulz wrote:
Do you want any help?
1. Did not include all of the VIs.
2. Gave us a password protected VI.
1. Did not include all of the VIs. I will try again
2. Gave us a password protected VI. Oh no, sorry about that. It's "2015"
I hope I did it right this time, with all the sub Vi's
08-03-2015 01:38 PM - edited 08-03-2015 01:39 PM
Why is the entire front panel locked down?
You are autoindexing way too many thing between the two FOR loops. If you don't want the second loop to run when the first one is ended prematurely with the stop button, put it in a case structure.
08-03-2015 01:43 PM
OK,
This is one of those times I will "Chime in" and, you might wish to duck... duck "Grey duck"
Yes, I have also used angle worms and made a hot-dish in a cassarole. Just making the text blue does not attach the files!
08-03-2015 01:45 PM
@altenbach wrote:
Why is the entire front panel locked down?
You are autoindexing way too many thing between the two FOR loops. If you don't want the second loop to run when the first one is ended prematurely with the stop button, put it in a case structure.
You are autoindexing way too many thing between the two FOR loops I was doing this to create a data dependency, at least that was my thought process behind it. As far as the physical channels and VISA refnums, I did it this way so I didn't create more controls for the front panel. Being my first project, I am very certain my logic is flawed, this is why I like posting here and getting feedback from
If you don't want the second loop to run when the first one is ended prematurely with the stop button, put it in a case structure I tried a Case structure for the second For Loop. I couldn't find a way to change conditions that didn't affect the Vi's overall performance.
08-03-2015 01:50 PM
@altenbach wrote:
Why is the entire front panel locked down?
You are autoindexing way too many thing between the two FOR loops. If you don't want the second loop to run when the first one is ended prematurely with the stop button, put it in a case structure.
Why is the entire front panel locked down? Sorry Sir, I missed this one on my previous response. I locked things down so they couldn't be edited. I thought that's what the lock function was for. When I would try to select certain entities to edit, it would also select background items I didn't want selected. Is this not the purpose of the Lock function?
08-03-2015 01:52 PM - edited 08-03-2015 01:54 PM
@ceilingwalker wrote:
You are autoindexing way too many thing between the two FOR loops I was doing this to create a data dependency, at least that was my thought process behind it. As far as the physical channels and VISA refnums, I did it this way so I didn't create more controls for the front panel. Being my first project, I am very certain my logic is flawed, this is why I like posting here and getting feedback from
You have many visa sessions that (hopefully) never change during the execution of the loops, so why woold you turn them into an array of 11 identical elements just to autoidex them out again at the next loop. Change the tunnels to no autoindexing and things would look cleaner. Why are these session controls inside the loop? Are you expect them to be changeable during loop execution or would that screw up the results?
Wounld't it be easier to simply create an up&down ramp once and use a single FOR loop, autoindexing on the ramp? You have way too much duplicate code!!!
If you don't want the second loop to run when the first one is ended prematurely with the stop button, put it in a case structure I tried a Case structure for the second For Loop. I couldn't find a way to change conditions that didn't affect the Vi's overall performance.
Then show us what you tried! That should be trivial to implement. Why would a case structure affect performance? Makes no sense!
08-03-2015 02:01 PM
@altenbach wrote:
@ceilingwalker wrote:
You are autoindexing way too many thing between the two FOR loops I was doing this to create a data dependency, at least that was my thought process behind it. As far as the physical channels and VISA refnums, I did it this way so I didn't create more controls for the front panel. Being my first project, I am very certain my logic is flawed, this is why I like posting here and getting feedback fromYou have many visa sessions that (hopefully) never change during the execution of the loops, so why woold you turn them into an array of 11 identical elements just to autoidex them out again at the next loop. Change the tunnels to no autoindexing and things would look cleaner. Why are these session controls inside the loop? Are you expect them to be changeable during loop execution or would that screw up the results?
Wounld't it be easier to simply create an up&down ramp once and use a single FOR loop, autoindexing on the ramp? You have way too much duplicate code!!!
If you don't want the second loop to run when the first one is ended prematurely with the stop button, put it in a case structure I tried a Case structure for the second For Loop. I couldn't find a way to change conditions that didn't affect the Vi's overall performance.
Then show us what you tried! That should be trivial to implement. Why would a case structure affect performance? Makes no sense!
Why would a case structure affect performance? Makes no sense! I used a boolean operator to change the state. When I used a false, it worked for that problem but shut down my Vi before the second For Loop.
Wounld't it be easier to simply create an up&down ramp once and use a single FOR loop, autoindexing on the ramp? You have way too much duplicate code!!! I tried using one For Loop to begin with but because I had to ramp up, then ramp down, I couldn't figure out how to use just one. I needed an Add function for the ramp up and a Subtract function for the ramp down.
Why are these session controls inside the loop? Are you expect them to be changeable during loop execution or would that screw up the results? No Sir, the values are not changed during operation. I did this because I wanted it to display the data on the front panel, during operation of the Vi. For display only.