Temp
This commit is contained in:
@@ -225,7 +225,7 @@ _xRunSMAgain := FALSE;
|
||||
_iState := 40;
|
||||
END_IF
|
||||
|
||||
// Didnt receive command ack in time
|
||||
// Didn't receive command ack in time
|
||||
// So resend the command if max retries are not reached
|
||||
IF _tonReceiveTimeout.Q THEN
|
||||
_xEnableReceiveTimeout := FALSE;
|
||||
@@ -235,7 +235,7 @@ _xRunSMAgain := FALSE;
|
||||
IF _uiRetries > MAX_RETRIES THEN
|
||||
_iState := 90;
|
||||
ELSE
|
||||
// Retry by sendind command again
|
||||
// Retry by sending command again
|
||||
_iState := 20;
|
||||
END_IF
|
||||
END_IF
|
||||
@@ -368,6 +368,7 @@ _iCmdLength := LEN(sCmd);
|
||||
|
||||
// start sendind command state machine
|
||||
_xSendCmd := TRUE;
|
||||
_xBusy := TRUE;
|
||||
|
||||
M_SendCmd := TRUE;]]></ST>
|
||||
</Implementation>
|
||||
|
||||
@@ -12,10 +12,6 @@ VAR
|
||||
_udiPort : UDINT;
|
||||
|
||||
_fbProtocolHandler : FB_TFProtocol;
|
||||
|
||||
_xTest : BOOL;
|
||||
_xSendResult : BOOL;
|
||||
_sCmd : STRING := 'STAT-FEED:';
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
@@ -31,12 +27,6 @@ _fbProtocolHandler(
|
||||
xBusy=> ,
|
||||
xError=> );
|
||||
|
||||
IF _xTest THEN
|
||||
_xTest := FALSE;
|
||||
|
||||
_xSendResult := _fbProtocolHandler.M_SendCmd(sCmd := _sCmd);
|
||||
END_IF
|
||||
|
||||
// Call isa88 base state machine
|
||||
SUPER^();]]></ST>
|
||||
</Implementation>
|
||||
@@ -63,9 +53,44 @@ _stSMConfig.xStoppingDisabled := TRUE;
|
||||
|
||||
_stSMConfig.xCompletingDisabled := TRUE;
|
||||
_stSMConfig.xCompletedDisabled := TRUE;
|
||||
_stSMConfig.xHeldDisabled := TRUE;
|
||||
_stSMConfig.xSuspededDisabled := TRUE;
|
||||
|
||||
_stSMConfig.xAbortingDisabled := TRUE;]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
<Method Name="M_Resetting" Id="{d821c17b-c2d1-4267-b49d-1f82be218ca5}">
|
||||
<Declaration><![CDATA[METHOD PROTECTED M_Resetting
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[CASE _iSSM OF
|
||||
// Check state of connection
|
||||
0:
|
||||
IF _fbProtocolHandler.xConnected THEN
|
||||
_iSSM := 10;
|
||||
ELSE
|
||||
_eCmd := E_PackMLCmd.STOP;
|
||||
END_IF
|
||||
|
||||
// Send reset command
|
||||
10:
|
||||
IF _fbProtocolHandler.M_SendCmd('SYST-RESE') THEN
|
||||
_iSSM := 20;
|
||||
ELSE
|
||||
_eCmd := E_PackMLCmd.STOP;
|
||||
END_IF
|
||||
|
||||
// Wait for reset command to be finished
|
||||
20:
|
||||
IF (NOT _fbProtocolHandler.xBusy) AND (NOT _fbProtocolHandler.xError) THEN
|
||||
M_StateComplete();
|
||||
END_IF
|
||||
|
||||
IF _fbProtocolHandler.xError THEN
|
||||
_eCmd := E_PackMLCmd.STOP;
|
||||
END_IF
|
||||
END_CASE]]></ST>
|
||||
</Implementation>
|
||||
</Method>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user