PLucas
Member
In all our programs written with Step 5 (come to think of it, all our programs. Full Stop!)we use 'temporary flags', these are flags that are used many times within the program just to carry over a result from one network to the other.....Well, you all know what 'temp' flags are, so I won't go on.
Anyway, I had to do a modification to our programs, this mod was to protect certain areas from having the automated cranes drop containers on them.
I wrote the logic in an FB and within the FB I used temporary flags, here's a snippet from the FB.....
It continues in that vain until the end of the block when I set an output which is used in the main program.
I put the logic on a crane and tested it at it's target areas and it worked exactly as I had hoped, but.....
on very intermittant occasions the protection activates in an incorrect place, the place it occurs is not a set place and it doesn't happen everytime, the mod has been on the cranes for over a week now and we have probably had maybe 1 mis-trigger a day.
I was think along the lines that the temporary flags in use are not totally working as I expect them to, maybe they are 'retaining' their state from other parts of the program and not being written over by the logic in the Function Block.
Has anyone else had a problem similar to this?
Suggestions on how to overcome this would be fine, but I used temporary flags in the FB as I am very limited to the number of flags left available in the program.
If anybody wants it I can post the whole function block including the call to it from the main program.
Paul
Anyway, I had to do a modification to our programs, this mod was to protect certain areas from having the automated cranes drop containers on them.
I wrote the logic in an FB and within the FB I used temporary flags, here's a snippet from the FB.....
L DD70 //load DD70 from DB11
L KG+3785000+05 //load constant 38570
>G //compare DD70 for greater than 38570
= TMPF1-0 //If compare is true set temporary flag 1.0
L KG+4050000+05 //Load constant 40500
L DD70 //load DD70 from DB11
>G //compare the constant for greater than DD70
= TMPF1-1 //if compare is true set temporary flag 1.1
A TMPF1-0
A TMPF1-1
= TMPF2-0
It continues in that vain until the end of the block when I set an output which is used in the main program.
I put the logic on a crane and tested it at it's target areas and it worked exactly as I had hoped, but.....
on very intermittant occasions the protection activates in an incorrect place, the place it occurs is not a set place and it doesn't happen everytime, the mod has been on the cranes for over a week now and we have probably had maybe 1 mis-trigger a day.
I was think along the lines that the temporary flags in use are not totally working as I expect them to, maybe they are 'retaining' their state from other parts of the program and not being written over by the logic in the Function Block.
Has anyone else had a problem similar to this?
Suggestions on how to overcome this would be fine, but I used temporary flags in the FB as I am very limited to the number of flags left available in the program.
If anybody wants it I can post the whole function block including the call to it from the main program.
Paul