MC_WriteDigitalOutput_BkPlcMc (from V3.0)
The function block determines the state of a digital output of a cam controller.
Inputs
VAR_INPUT
Execute: BOOL;
OutputNumber: INT;
Value: BOOL;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | A rising edge at this input triggers an update of the state. |
OutputNumber | INT | The number of the output to be determined. |
Value | BOOL | The state of the digital output. |
Inputs/outputs
VAR_INOUT
Output: OUTPUT_REF_BkPlcMc;
END_VAR
Name | Type | Description |
---|---|---|
Output | OUTPUT_REF_BkPlcMc | Here, the address of a variable of type OUTPUT_REF_BkPlcMc should be transferred. |
Outputs
VAR_OUTPUT
Done: BOOL;
Busy: BOOL;
Error: BOOL;
ErrorID: UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | This indicates successful determination of the state. |
Busy | BOOL | This output is TRUE while the command is being processed. |
Error | BOOL | The occurrence of an error is indicated here. |
ErrorID | UDINT | An encoded indication of the cause of the error is provided here. |
Behavior of the function block
A rising edge at Execute causes the function block to check the transferred parameters. During this process, a problem may be detected and reported:
- If the value of OutputNumber is not within the permissible range [0..31], the response is Error with ErrorID:=dwTcHydErrCdIllegalOutputNumber.
If these checks could be performed without problems, the state of the digital output is defined according to the value of Value, and Done is reported.
A falling edge at Execute clears all the pending output signals.