This page shows the structure and organization of a processing command.
|
Command identification |
#include "DTDMOD.H" #include "DTD.H" #define COMMAND "MONITOR" #define ENTRY MONITOR_entry // Some boilerplate code here |
|
Main function |
int __stdcall ENTRY (PIB **plib)
{
void **argv;
int argc, received;
PIPE * in_pipe, out_pipe;
FIRB * pFirFilter;
argv = param_process (plib,
&argc, 3, 3,
T_PIPE_W, T_VAR_W, T_PIPE_W);
|
|
Activate runtime connections |
in_pipe = (PIPE *) argv[1]; limit = (VAR *) argv[2]; out_pipe = (PIPE *) argv[3]; pipe_open (in_pipe, P_READ); pipe_open (out_pipe, P_WRITE); |
|
Initialize |
pFirFilter = fir_init(pCoeffs,
iLength, iScale, iDecimate);
|
|
Runtime |
while (1)
{
pipe_value_get(in_pipe,
&pipe_value);
fir_request(
pFirFilter,
&(pipe_value._i16), 1);
// Your Processing Here...
pipe_value_put(out_pipe,
&pipe_value);
}
} // End main command body |
|
Your processing functions |
static void Special( VAR * pVar )
{
// Custom processing here!
}
|