Skip to content

Commit 261eb96

Browse files
Merge pull request #47 from Inxton/46-_BUG_coCognexVision_TcoDataman_v_5_x_x_Read_should_not_prodduce_error_when_data_were_not_read
[BUG]coCognexVision.TcoDataman_v_5_x_x Read should not prodduce error when data were not read
2 parents f2f72b9 + 10e9dd8 commit 261eb96

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

src/TcoCognexVision/src/XAE/XAE/TcoCognexVision/POUs/TcoDataman/v_5_x_x/Tasks/TcoDatamanRead_v_5_x_x.TcPOU

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,31 @@ END_VAR
8787
IF _progress = 6 THEN
8888
THIS^.inoResults.Length := THIS^.inoIoData.ResultData.ResultLength;
8989
THIS^.Messenger.OnCondition(_infoTimer.Q).Warning('<#Waiting for the ResultData copied!#>').Pin();
90-
IF Tc2_System.MEMCPY(srcAddr := ADR(THIS^.inoIoData.ResultData.ResultData) , destAddr:= ADR(THIS^.inoResults.Data) , n:= THIS^.inoResults.Length) > 0 AND
91-
Tc2_System.MEMSET(destAddr:= ADR(THIS^.inoResults.Data) + THIS^.inoResults.Length, fillByte:= 0 , n:= SIZEOF(THIS^.inoResults.Data) - THIS^.inoResults.Length)>0 THEN
90+
IF THIS^.inoIoData.ResultData.ResultCode.0=1 THEN // read successfull
91+
IF Tc2_System.MEMCPY(srcAddr := ADR(THIS^.inoIoData.ResultData.ResultData) , destAddr:= ADR(THIS^.inoResults.Data) , n:= THIS^.inoResults.Length) > 0 AND
92+
Tc2_System.MEMSET(destAddr:= ADR(THIS^.inoResults.Data) + THIS^.inoResults.Length, fillByte:= 0 , n:= SIZEOF(THIS^.inoResults.Data) - THIS^.inoResults.Length)>0 THEN
93+
CallTimers(FALSE);
94+
_progress := _progress + 1;
95+
END_IF;
96+
ELSIF THIS^.inoIoData.ResultData.ResultCode.0=0 THEN // read not successfull
97+
Tc2_System.MEMSET(destAddr:= ADR(THIS^.inoIoData) , fillByte:= 0 , n:= SIZEOF(THIS^.inoIoData));
9298
CallTimers(FALSE);
9399
_progress := _progress + 1;
100+
94101
END_IF
95102
END_IF
96103
97104
IF _progress = 7 THEN
98105
THIS^.inoIoData.AcquisitionControl.Trigger := FALSE;
99106
THIS^.inoIoData.ResultsControl.EnableResultBuffering := FALSE;
100107
THIS^.inoIoData.ResultsControl.ResultsAcknowledge := TRUE;
101-
THIS^.ThrowWhen(THIS^.inoIoData.ResultData.ResultCode=0 OR THIS^.inoIoData.ResultData.ResultLength=0);
108+
//THIS^.ThrowWhen(THIS^.inoIoData.ResultData.ResultCode=0 OR THIS^.inoIoData.ResultData.ResultLength=0);
102109
THIS^.DoneWhen(TRUE);
103110
_progress := 0;
104111
END_IF
105-
112+
THIS^.ThrowWhen(THIS^.inoIoData.AcquisitionStatus.MissedAcquisition );
113+
THIS^.ThrowWhen(THIS^.inoIoData.ResultsStatus.ErrorDetected);
114+
106115
CallTimers(TRUE);
107116
108117
THIS^.ThrowWhen(_errorTimer.Q);

0 commit comments

Comments
 (0)