A Reminder of How the WRITE_CMD Instruction Works
(Original Document)
Reminder
This service allows a command to be sent to the motion controller.
WRITE_CMD: Explicit writing of command words in the module. This operation is carried out via internal words %MW, which contain the command to be carried out and its parameters (a motion control, for example).
Syntax of WRITE_CMD Instruction
WRITE_CMD %CHr.m.c: Write channel i command information for the module located in address xy (rack number, position in the rack).
Example: WRITE_CMD %CH0.3.1 (write channel 1 command information for the module located in position 3 of rack 0).
WRITE_CMD Interface
The command to be carried out is defined in word %MWr.m.c.26 and the result of the command is available in words %MWr.m.c.19 to %MWr.m.c.24.
Address
Type
Symbol
Meaning
%MWr.m.c.19
Word
ERROR_CMD
WRITE_CMD command write error
%MDr.m.c.20
Double word
RETURN_CMD_1
Return 1 of the function
%MFr.m.c.22
Floating point
RETURN_CMD_2
Return 2 of the function
%MFr.m.c.24
Floating point
RETURN_CMD_3
Return 3 of the function
%MWr.m.c.26
Word
ACTION_CMD
Action to be carried out
%MDr.m.c.27
Double word
PARAM_CMD_1
Parameter 1
%MDr.m.c.29
Double word
PARAM_CMD_2
Parameter 2
%MFr.m.c.31
Floating point
PARAM_CMD_3
Parameter 3
%MFr.m.c.33
Floating point
PARAM_CMD_4
Parameter 4
Monitoring the Exchange
The next 2 bits may be used to monitor the writing of command information in the module:
Bit
Meaning
%MWr.m.c.0:X1
This bit is set to 1 while the exchange is in progress. It is reset to 0 when the exchange has been completed.
%MWr.m.c.1:X1
This bit is set to 1 if the parameters transmitted are out of range or erroneous.