5. CONFIGURATION
fbPulsedCmd(
byCmdType:= 102,
byPulseTime:= DWORD_TO_BYTE(CmdReceive.sCommand.sOperateParameters.
sValue.sDoublePoint.sPulseConfig.dwOffDuration/10),
ptDbpVarAdr:= ADR(dbpIEC104),
stQuality:= IOQualities.QUALITY_NX2020[5],
byStatus=> byResult);
END_IF
ELSE
// Returns command not supported
byResult:= 1;
END_IF
COMMAND_TYPE.CANCEL:
// Returns command finished with success
// (controlled by IEC104 protocol)
byResult:= 7;
END_CASE
// Treats the pulsed command function result
// and generates the answer to the intercepted command
CASE byResult OF
1: // Invalid type of command
CmdReceive.eCommandResult:= COMMAND_RESULT.NOT_SUPPORTED;
CmdReceive.bDone:= TRUE;
2: // Invalid input parameters
CmdReceive.eCommandResult:= COMMAND_RESULT.INCONSISTENT_PARAMETERS;
CmdReceive.bDone:= TRUE;
3: // Parameter change in running
CmdReceive.eCommandResult:= COMMAND_RESULT.PARAMETER_CHANGE_IN_EXECUTION;
CmdReceive.bDone:= TRUE;
4: // Module did not answered the command(absent)
CmdReceive.eCommandResult:= COMMAND_RESULT.HARDWARE_ERROR;
CmdReceive.bDone:= TRUE;
5: // Command started and in running (does not returns nothing)
6: // Another command has been sent to this point and it is running
CmdReceive.eCommandResult:= COMMAND_RESULT.LOCKED_BY_OTHER_CLIENT;
CmdReceive.bDone:= TRUE;
7: // Command finished with success
CmdReceive.eCommandResult:= COMMAND_RESULT.SUCCESS;
CmdReceive.bDone:= TRUE;
END_CASE
END_IF
CmdReceive();
IF CmdReceive.bDone THEN
CmdReceive.bDone:= FALSE;
END_IF
As can be observed in the previous code, to help in the pulse generation in Nexto’s digital double outputs, it was created
202