The current execution status of the program and its threads is displayed in the combined thread view/call stack window. Select Execute ▹ Thread View / Call Stack or click in the tool bar (see also Thread View / Call Stack). The upper half of the window lists all existing threads while the lower half displays the call stack of the selected thread. To illustrate the interaction with this window consider the following (silly) example.
for Index:= 1 to 5 by 1 par_start <ThreadIDs.at(Index - 1)> : wait_seconds(Index) endfor wait_seconds(2) stop()
After pressing F5, the program will start five subthreads, and eventually reach the stop instruction, leaving some subthreads still running while others will already have finished. The corresponding thread view is displayed in figure 8.4. Note that the unfinished threads are in a stopped state because of another thread (in this case caused by the stop instruction in the main thread).
The thread view lists the properties of all threads in a table. The status icon in the first column of each thread visualizes the current execution state. The currently selected thread (1) is marked by the arrow in the status icon and is also highlighted in bold text. The other five threads are the subthreads started from the main thread. To select another thread, double-click it in the thread view. This will also update the PC, the call stack, and the variables according to the selected thread. The active procedure of the selected thread will be displayed in the program window.
The meaning of the columns of the thread view is as follows:
| Column | Description |
| Thread ID | The unique number assigned to the thread when it is started. |
| State | The current execution state of the thread. |
| Run Mode | The mode that the thread was started in the last time. |
| Stop Mode | The reason for stopping the thread. |
| Caller | The position (procedure and line number) from where the thread was started. |
| References (hidden by default) | The number of references to this thread. |
Single-stepping over a program line containing a par_start will initialize the corresponding thread without actually starting it. To debug a specific thread, press F7 when the PC is on the corresponding par_start line. This will automatically make the new subthread the selected thread. If the PC is already past the invocation line, first select the thread in the thread view window. This will automatically display the correct procedure in the program window, with the PC on the first line if the thread was started by a procedure call. For threads started by an operator call like in the example above, the PC will be located on the corresponding call, and the rest of the program will be grayed out (see figure 8.5). The notification line (1) in the program window shows the thread ID of the selected subthread, and allows fast access to the thread view window (2). Clicking (3) switches back to the main thread.