|
ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Testing > Procedures > Writing a procedure using the procedure editor > Errors and warnings while writing a procedure > Error: Cannot use a 'Wait until' statement before the test has started Error: Cannot use a 'Wait until' statement before the test has started
DescriptionThis error is displayed in the list of errors and warnings at the bottom of the procedure editor when a procedure uses an invalid Wait until statement before the test starts, i.e. in the shaded section at the top of the procedure editor. This does not apply to a wait statement that is waiting for an I/O event, a Time elapsed event, or a Test is waiting to start event. These are the only events that can occur before the test starts. I/O events (for example, lever presses or new temperature sensor values) can occur before the test starts, and you may want to wait for these events in order to determine whether the apparatus is in the desired state to start the test - for example, wait until a temperature controller has reached the desired temperature. The Prevent test start and Allow test start actions can be used to prevent or allow the starting of the test if an I/O device is not yet ready. For more information on this, see Preventing a test from starting until an I/O device is ready. The Time elapsed event can be used before a test starts if you are waiting for something to change in order to start the test. For example, your test might rely on the value of a specific Field being set before the test can start. You can find out more details about this in the topic Preventing a test from starting until an I/O device is ready. The example here waits for an I/O event, but you can apply the same principle to check that the value of a field has been entered, for example. In this case, waiting for a Time elapsed event within the loop will simply ensure that the procedure runs more efficiently, and the time elapsed should be relatively short (usually less than a second or so). Note that the Test is waiting to start event will only happen if your protocol is set to start tests automatically. If it's not, then the procedure will just start running the code in the un-shaded area as soon as you click the
So it's possible that any test set-up performed by a procedure could run more than once for a given test; you'll need to bear this in mind if the procedure initialises any I/O, for example, as this may be done multiple times under some circumstances. If you've set up your protocol to auto-start tests, then you can wait for the Test is waiting to start event in the shaded section of the procedure, and then do your test's initialisation - this will mean that it will only be initialised when the user actually starts a test, and not at any other time (such as a change to the protocol settings, or the end of a previous test). See also:
© Copyright 2003-2026 Stoelting Co. All rights reserved ANY-maze help topic T0517 |