Difference: DocsSectionsLoopTick (2 vs. 3)

Revision 310 Jan 2012 - Main.MarjoleinVanDerWaal

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Looptick functions

Line: 12 to 12
  looptick2.png
Changed:
<
<
A looptick function always has the input arguments tick_count and abort_loop. The tick_count variable is automatically increased by one each time the looptick function is called. [abort_loop?].
>
>
A looptick function always has the input arguments tick_count and abort_loop. The tick_count variable is automatically increased by one each time the looptick function is called.
  A looptick function should always produce the output arguments stoploop and waittime. If stoploop is set to 1, the loop will be finalized. If stoploop is set to 0, the looptick function will be called again. The waittime variable specifies the time in seconds until the next looptick call. For example, if you want to have an interval of 200 ms between successive calls to the looptick function, you must set the waittime variable to 0.2.
Line: 37 to 37
  return end
Added:
>
>
In addition to tick_count, looptick functions have another input parameter: abort_loop. If an error occurs in BrainStream while a looptick function is running, BrainStream will set the abort_loop parameter to 1 the next time the looptick function is called. This call to the looptick function will be the last one. When it is finished, BrainStream will force the loop to end and close the client. Therefore, you can define actions for the abort_loop parameter to finalize your looptick function. For example, you may want to close or save objects which would otherwise be lost.
 

Specifying looptick functions in the Actions table

In order to specify a looptick function in the experiment definition table, you must add a column with header 'looptick'. In this column, one function can be specified. Defining a second looptick function for one marker will produce an error. In the client column, specify on which client the looptick function should run. If the function column defines functions as well, they will be executed prior to entering the loop.

 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback