Hi,
I'm having the following problem:
my program consists out of 5# processes and 1 task:
ticktime = 8ms
task is called every 2 ticks
the task does some processing on adc samples. if a predefined threshold is found, i want to schedule directly to one of the processes( this process generates a telegram and sends it out to a plc).
my problem: i know that the priority of the processes equals the amount processisng time the schedular gives to the process.
On the other hand i read in the manual that i can call the schedule function to schedule to the task with the highes priority:
The process/task is suspended here and the control is passed to the scheduler. The scheduler now looks for the next process with the highest priority, and this process gets activated.
So to test it out, i created a new process, gave it the highest priority:
process testprocess($20, $20 : iData; 15,suspended);
begin
waitsema(testsema);
Serout4($10);
schedule;
end testprocess;
when reaching the threshold in the task, i increment the semaphore, and call the schedule function.
I would suspect that the schedular schedules directly to the testprocess, since it has the highest priority and is waiting on a semaphore (no process time spend yet).
But i notice other processes are being called before going to my testprocess..
Can you tell me something more about the way the scheudar works?
Or is there a better way to make sure the schedular schedules to the process i want (without suspending all the other processes :p)
Regards,
Flor
I'm having the following problem:
my program consists out of 5# processes and 1 task:
ticktime = 8ms
task is called every 2 ticks
the task does some processing on adc samples. if a predefined threshold is found, i want to schedule directly to one of the processes( this process generates a telegram and sends it out to a plc).
my problem: i know that the priority of the processes equals the amount processisng time the schedular gives to the process.
On the other hand i read in the manual that i can call the schedule function to schedule to the task with the highes priority:
The process/task is suspended here and the control is passed to the scheduler. The scheduler now looks for the next process with the highest priority, and this process gets activated.
So to test it out, i created a new process, gave it the highest priority:
process testprocess($20, $20 : iData; 15,suspended);
begin
waitsema(testsema);
Serout4($10);
schedule;
end testprocess;
when reaching the threshold in the task, i increment the semaphore, and call the schedule function.
I would suspect that the schedular schedules directly to the testprocess, since it has the highest priority and is waiting on a semaphore (no process time spend yet).
But i notice other processes are being called before going to my testprocess..
Can you tell me something more about the way the scheudar works?
Or is there a better way to make sure the schedular schedules to the process i want (without suspending all the other processes :p)
Regards,
Flor