CO_MasterControlStatus
CO_MasterControlStatus monitors CANopen master status while Execute is TRUE. It can disable CANopen communication through DisableComm and send a Network Management (NMT) command on a rising edge of SendNMT.
Ladder Representation
Block Structure
| Variable Type | Name | Data Type | Description |
|---|---|---|---|
| VAR_INPUT | Execute | BOOL | Enables block execution. |
| VAR_INPUT | DisableComm | BOOL | Disables CANopen communication. |
| VAR_INPUT | SendNMT | BOOL | Triggers the sending of a network management command. |
| VAR_INPUT | NMTCommand | BYTE | Network management command code to send. |
| VAR_INPUT | NodeID | BYTE USINT | Slave address used by the block. |
| VAR_OUTPUT | Done | BOOL | Indicates that the block completed successfully. |
| VAR_OUTPUT | CommDisabled | BOOL | Indicates that communication is disabled. |
| VAR_OUTPUT | BusPowerOff | BOOL | Indicates a CAN interface power supply failure. |
| VAR_OUTPUT | BusOff | BOOL | Indicates a BusOff error in the CAN interface. |
| VAR_OUTPUT | NMTCmdFeedback | BOOL | Indicates that the master sent the NMT command. |
| VAR_OUTPUT | ErrorCtrlFailure | BOOL | Indicates a node guarding or heartbeat error. |
| VAR_OUTPUT | InitFailure | BOOL | Indicates an initialization error. |
| VAR_OUTPUT | InitFinished | BOOL | Indicates that the slave initialization procedure finished. |
Operation
While Execute is TRUE, the block updates its outputs according to the master status and the input requests. When Execute is FALSE, the inputs are ignored and the outputs are reset. Done is TRUE when Execute is TRUE and the block has completed execution.
When DisableComm is TRUE, CANopen communication is disabled and the master status counters and markers are reset.
A rising edge on SendNMT sends the NMT command selected in NMTCommand to the slave address configured in NodeID.
Each status output is TRUE when the CANopen master status matches the condition described by that output.
Execution Flowchart

Structured Text Example
The following Structured Text code shows a typical block execution.
VAR
DISABLE, SEND_COMM, STATUS_DISABLED, STATUS_POWEROFF,
STATUS_BUSOFF, STATUS_FB, STATUS_ERROR, STATUS_FAILURE,
STATUS_FINISHED: BOOL;
COMM, NODEID: BYTE;
END_VAR
DO1 := FB_CO_MasterControlStatus(
Execute:=DI1,
DisableComm:=DISABLE,
SendNMT:=SEND_COMM,
NMTCommand:=COMM,
NodeID:=NODEID,
CommDisabled=>STATUS_DISABLED,
BusPowerOff=>STATUS_POWEROFF,
BusOff=>STATUS_BUSOFF,
NMTCmdFeedback=>STATUS_FB,
ErrorCtrlFailure=>STATUS_ERROR,
InitFailure=>STATUS_FAILURE,
InitFinished=>STATUS_FINISHED);