LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help with adding pause

I have been working on this VI for a couple of days now and I would like to add a pause in the Vi so that I do not have to sit there and wait for the time to flip a manual delay switch. I have tried every way that I know how to do this. But it seems that there is something funny with the dll or maybe it's just me. Any help would be greatly appreciated.

Labview 7.0 cpci510 daqcard



Joe.
"NOTHING IS EVER EASY"
Download All
0 Kudos
Message 1 of 7
(3,389 Views)
You posted 7+MB worth of code, and most of the several 100 VIs are plain vi.lib files included with LAbVIEW. I would recommend to uncheck "include vi.lib files" or just select "development distribution" when saving with options.

Could you tell us the name of the toplevel vi, I could not find it? I'd love to look at your problem, but at the moment it is like looking for a (nonmagnetic) needle in a haystack. 🙂

Thanks!
0 Kudos
Message 2 of 7
(3,389 Views)
sorry for posting so much code I did not realize it until I had already hit the submit button as to which one I actually grabbed.The name of the top level VI is Preliminary ACQ. Everything works correctly as is except for the pause. You will see where I tried to add it in with a notification to the user(ME). That did not pause the ACQ and just kept losing data. I then tried putting the two Start and stop VI's in the case structure so that it would stop all ACQ and then when I hit OK on the dialog would restsart. This seamed to work OK but would put 1 extra set of data on the wrong side. That would happen most of the time but sometime it would work right. (intermittently) which I cannot deal with. It is almost as if It is copying the wrong buffer or somethin
g. Thanks in advance for your help. Don't laugh at my (haystack), I mean my code It's still in progress and I'm still learning labview.

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 3 of 7
(3,389 Views)
I am not sure what you mean by pause. Do you want to pause the acquistion or do you want a message box to popup(and not stop the code)?
0 Kudos
Message 4 of 7
(3,389 Views)
The acquisition must stop long enough for me to set a delay switch then resume when I hit OK.For instance If I say I want to run ten loops the first five loops would run then pause long enough to let me flip the delay switch then continue with acquisition. (01234 flip 56789. this really should not be that difficult to do. I 'm going to keep trying but any hrlp would be greatly appreciated. thanks



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 7
(3,389 Views)
Adding a pause in a loop is quite trivial, here's one possibility:

(1) somewhere inside your main acquisition loop, add a small while loop containing a case statement.
(2) In the "true" case, add a 20ms wait.
(3) Create a "pause" button set to "switch when pressed".
(4) Place the pause button terminal inside that tiny loop, wired to the case structure and to the loop condition (set to "continue if true").

Result:
** If pause is not true, the loop does nothing. It just runs the empty case, then quits.
** Is Pause is "true", then it will continue to loop, checking every 20ms if the pause button is still pressed. Once it's released, the loop exits and data acquisition continues as before.
0 Kudos
Message 6 of 7
(3,389 Views)
let me explain what I mean by pause. the vi Should operate as follows.

user inserts # of loops. Vi starts acquisition then when the # of loop iterations +1 is = the # of loops/2 then stop all acquisition prompt user to let them know to flip the switch then start acquisition again where it left off.

(ie 01234 prompt for flip 56789). i think what i will have to do is set up two while loops to where one will run for the amount of loops/2 and the other will run the remainder. I will probably have to also check the buffer flag also. thanks for all the help though it is greatly appreciated.

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 7 of 7
(3,389 Views)