Problem
I originally posted this question which was apparently something that did not meet my customer spec. Hence I am redefining the problem:
To understand the problem a bit more, the timing diagram on the original post can be used. The delayer needs to be platform independent. To be precise, I run a job scheduler and apparently my current delayer is not going to be compatible with it. What I am stuck with is the "Independent" bit of the delayer. I have already knocked out a delayer in SIMULINK using Probe
(probes for Sampling Time) and Variable Integer Delay
blocks. However, during our acceptance phase we realised that the scheduler does not comply with such configuration and needs to be something more intrinsic and basic - something like a while loop running in C/C++ application.
Initial Solution
What I can think of a solution is the following:
Define a global and static time-slice variable called
tslc
. Basically, this is how often the scheduler runs. The unit could be in secondsDefine a function that has the following body:
void hold_for_secs(float* tslc, float* _delay, float* _tmr, char* _flag) { _delay[0] -= tslc[0]; if (_delay[0] < (float)(1e-5)) { _flag[0] = '1'; } else { _flag[0] = '0'; } }
Users please forgive my poor function-coding skilss, but I merely tried to come up with a solution. I would really appreciate if people help me out a little bit with suggestions here!
Computing Platform Windows 2000 server
Target computing platform An embedded system card - something similar to a modern graphics card or sound card that goes along one of the PCI slot. We do testing on a testbed and finally implement the solution on that embedded system card.