When the Pointer_Row changes its value it triggers an interrupt which should put some values on the IndirectColumnWithPointerRow variable, de problem is that the pogram main execution seems to be too fast no matter what I try, the event run but is not enough faster for giving the value to the main program, hence an error.
I've tried to stop the program with SysLibIECTask, also changing the priorities, also creating another task... but nothing of that solves the problem, and this is because I cannot change the instruction above since it's fundamental for something else to work...
Thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So you generate an interrupt on line 1 oke
then the interupt should do its job and update the database
after that you check the flags
correct?
So this checking should only be done when interupt is finished?
so just wait until interuptroutine is finished (put a flag as last line in your interupt.)
routinedone := set
in main write if routinedone is true then
stop interupt
check flags
routinedone :=reset;
start interupt
an interupt on this level is only checked after a pou ends.
even with very slow processor this will happen.
basic interupt knowledge.
i did it on the Z80 years ago.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
shooter hat geschrieben:
So you generate an interrupt on line 1 oke
then the interupt should do its job and update the database
after that you check the flags
correct?
So this checking should only be done when interupt is finished?
so just wait until interuptroutine is finished (put a flag as last line in your interupt.)
routinedone := set
in main write if routinedone is true then
stop interupt
check flags
routinedone :=reset;
start interupt
an interupt on this level is only checked after a pou ends.
even with very slow processor this will happen.
basic interupt knowledge.
i did it on the Z80 years ago.
The problem seems to be rather that codesys doesn't like to interrupt the main program, even when directly using flags the interrupt was too slow and gave incorrect values. I'm doing this with the PLCwinNT software PLC and it seems that it doesn't have a proper way to stop the main program, just like you say... you did that on z80s, I did dad too (and in later microcontrollers with complete success) but it doesn't work on PLCwinNT.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a program that does more or less this:
When the Pointer_Row changes its value it triggers an interrupt which should put some values on the IndirectColumnWithPointerRow variable, de problem is that the pogram main execution seems to be too fast no matter what I try, the event run but is not enough faster for giving the value to the main program, hence an error.
I've tried to stop the program with SysLibIECTask, also changing the priorities, also creating another task... but nothing of that solves the problem, and this is because I cannot change the instruction above since it's fundamental for something else to work...
Thanks in advance
So you generate an interrupt on line 1 oke
then the interupt should do its job and update the database
after that you check the flags
correct?
So this checking should only be done when interupt is finished?
so just wait until interuptroutine is finished (put a flag as last line in your interupt.)
routinedone := set
in main write if routinedone is true then
stop interupt
check flags
routinedone :=reset;
start interupt
an interupt on this level is only checked after a pou ends.
even with very slow processor this will happen.
basic interupt knowledge.
i did it on the Z80 years ago.
The problem seems to be rather that codesys doesn't like to interrupt the main program, even when directly using flags the interrupt was too slow and gave incorrect values. I'm doing this with the PLCwinNT software PLC and it seems that it doesn't have a proper way to stop the main program, just like you say... you did that on z80s, I did dad too (and in later microcontrollers with complete success) but it doesn't work on PLCwinNT.