Control Unit

Message to/from PLC

Description

Messages sent from the CNC to the PLC and others that are send from PLC to other members of the communication process, provided by the CNC, could be handled with this control unit.

The CNC can send a message to the PLC using #MSG PLC ["…"] or #MSG SYN PLC [“...”] (see [PROG]). The information which CNC command was used sending a message is included in the data of the control unit.

Control Unit 1: Data type

McControlMsgUnit, see description Control Unit with usage check

ST path

pMC[channel_idx]^.addr^.MsgMcControl_Data

Commanded, requested data

ST element

.CommandW

. RequestR

Data type

 

Access

PLC writes CommandW and reads RequestR

Usage check, commanded, requested data

ST element

.CommandSemaphorRw

. RequestSemaphorRw

Data type

BOOL

Value range

[TRUE, FALSE]

Access

commanded data

PLC can write data for commanding if flag CommandSemaphorRw is FALSE. Are all data written, PLC sets CommandSemaphorRw to TRUE.

CNC takes the commanded data if CommandSemaphorRw is TRUE and afterwards set it to FALSE.

requested data

The data a GUI wants to command could be written if RequestSemaphorRw is FALSE. If they are complete RequestSemaphorRw is set to TRUE.

PLC reads the data a GUI wants to command if RequestSemaphorRw is TRUE. After the PLC has taken the data the PLC sets RequestSemaphorRw to FALSE

Redirection

ST path

.EnableW