Program

Block Program

These instructions show how the program can be paused until an input reaches a transferred value. In contrast to pausing the program, no fixed time is waited here, but until an input changes state.

The waitfor(inputName, value) function waits for the transferred input until it reaches the transferred value.

  • 1 Parameter: Name of the input (e.g. "INPUT_1")
  • 2 Parameter: Value to be waited for (0 or 1)
waitfor("INPUT_1", 0);

Pause Program

The sleep(timeMillis) command has only one parameter, which specifies how long the programme should pause at this point. The time is specified in milliseconds. The code snippet in the example would therefore let the programme sleep for 1 second (1000 milliseconds).

sleep(1000);

Output elapsed program time

The elapsed program time is returned in seconds.

The command getRuntime() is used to output the elapsed program time. The command returns a float value with the elapsed program time in seconds.

var runtime = getRuntime();

show_info( runtime );