TPT User's Guide - PikeTec
TPT User's Guide - PikeTec
TPT User's Guide - PikeTec
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>TPT</strong> <strong>User's</strong> <strong>Guide</strong> Page 51<br />
tpt_vmapi_runCycle<br />
This function runs a single time-step of the <strong>TPT</strong> virtual machine with given inputs and outputs.<br />
This function need to be called in a loop together with the system under test function call.<br />
tpt_vmapi_closeExecution<br />
This function terminates the <strong>TPT</strong> runtime environment execution. It closes all open files and<br />
releases allocated memory.<br />
9.4.2 Executable platform configuration<br />
Assume for example the lights control example is implemented as C-function that returns the<br />
“headlight” as function of “light_switch” and “light_intensity”. In order to create<br />
a test-frame for this a test-frame needs to be programmed and compiled that calls periodically<br />
the <strong>TPT</strong> virtual machine and the function “getHeadlightValue”.<br />
Templates for the executable platform generation are available and can be found in the lights<br />
control example.<br />
Figure 35: Executable platform configuration<br />
For the Executable platform configuration please specify the working directory<br />
(tpt.exeplatform.workdir) from where the command/function is executed. The<br />
command itself consists of the executable function test-frame and parameters for the input-<br />
<strong>TPT</strong>-file (tpt.scenario.tvmfile) and the output file (tpt.scenario.tptbinfile). In<br />
the example the executable function is lights_control_testframe.exe in the working directory.<br />
The parameter tpt.scenario.tvmfile, tpt.scenario.tptbinfile and<br />
tpt.exeplatform.workdir are pre-defined variables used in <strong>TPT</strong> (see section 15.10:<br />
Environment variables). Also the sampling time, the maximum timeout-time and the history<br />
must be specified.<br />
9.4.3 Test Source Code with the Exe-Platform<br />
Before we begin to prepare, compile and test a given system’s source code using <strong>TPT</strong> and the<br />
Exe-Platform, we have to ensure, that some prerequisites are met.