Let’s cut to the chase and do an example. I’ve written a simple TP program below that performs a few basic functions like numeric register assignment, conditional evaluation, jumping to a label and linear motion. Next to the program, I’ve created a simple debugger which gives you some insight into how the program is running and what’s happening to the numeric register.
Click the Run button below to start the program. You can also Pause the program and Step through it one line at a time. Keep an eye on the debugger to the right where the controller is telling you what it’s doing in detail. (Note: the current line is highlighted in the source code)
|Program Source Code||Debug Log|
R = 0
In future articles about TP programming, I will embed controller runtimes like this one so you can actually modify and execute the code to see what it’s doing. Look out for something similar on KAREL in the future too.