MC_ReadDigitalOutput_BkPlcMc (from V3.0)

The function block determines the current state of a digital output of a cam controller.
Inputs
VAR_INPUT
Enable: BOOL;
OutputNumber: INT;
END_VAR
Name | Type | Description |
---|---|---|
Enable | BOOL | A rising edge at this input triggers an update of the state. |
OutputNumber | INT | The number of the output to be determined. |
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;
Value: BOOL;
END_VAR
Name | Type | Description |
---|---|---|
Valid | 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. |
Value | BOOL | The state of the digital output. |
Behavior of the function block
If Enable is TRUE, the function block checks 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 were carried out without problems, the state of the digital output is determined, and Valid is reported.
A falling edge at Enable clears all the pending output signals.