
My guess is that it immediatly gets reset before arriving at:
Code: Select all
5749: ;- IF M6_SV && !DoingIndex_M && !DoingRotation_M
5750: ;- THEN (M6PD_PD)
...
5755: ;- IF M6PD_PD THEN SET DoingM6_M, SET SetRequestedBinPositionStage
...
5884: ;- IF (RequestedBinPosition_W == CarouselPosition_W) && DoingM6_M && IsSwingarmATC_M &&
5885: ;- !AtRequestedToolLocation_M THEN SET ATRequestedToolLocation_M
...

I tried once to trigger on doing_M6 but it never triggers. Very peculiar...
Hmm even more interesting, when I use PLC detective to check the line 5749 is true it actually triggers and sets it
Hmm on line 5885 it actually sets ATRequestedToolLocation_M

aha it seems to reset it all here:

Code: Select all
;- IF ((RequestedBinPosition_W == CarouselPosition_W) && DoingM6_M && (IsSwingarmATC_M ||
;- (AtPutbackLocation_M && AtRequestedToolLocation_M && ToolChangeComplete_M && !M6_SV &&
;- IsCarouselATC_M))) || SV_STOP
;- THEN RST RotateCarouselStage, RST CarouselEnable_O, RST SetCarouselDirectionStage,
;- RST RotateCarouselStage, RST SetRequestedBinPositionStage, RST DoingM6_M,
;- RST M6_SV, RST AtPutbackLocation_M, RST AtRequestedToolLocation_M,
;- RST ToolChangeComplete_M, PutBackPosition_W = CarouselPosition_W
Line#5881:

(unless I'm missing something I can't monitor SV_STOP)
Line#5889:

---
So I tested this in C with the measured values and it triggers correctly.
Code: Select all
#include <stdio.h>
int main(void) {
int RequestedBinPosition_W = 14;
int CarouselPosition_W = 14;
int DoingM6_M = 1;
int IsSwingarmATC_M = 1;
int AtPutbackLocation_M = 0;
int AtRequestedToolLocation_M = 1;
int ToolChangeComplete_M = 0;
int M6_SV = 1;
int IsCarouselATC_M = 0;
int SV_STOP = 0;
int test = 0;
if (
(
(RequestedBinPosition_W == CarouselPosition_W) &&
(DoingM6_M) &&
(
IsSwingarmATC_M ||
(
AtPutbackLocation_M &&
AtRequestedToolLocation_M &&
ToolChangeComplete_M &&
!M6_SV &&
IsCarouselATC_M
)
)
)
|| SV_STOP
) {
test = 1;
}
printf("test = %d\n", test);
return 0;
}
So it seems to work as intended. But than the generated M6 code for the swingarm is incorrect?
Based on this it would never be able to pass line 306 as it is already resets before it even gets to that line.