WRITE_CMD
(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).
This instruction is applied to an IODDT type variable associated with the TSX CSY 84 and TSX CSY 164 modules. For an independent axis, we will take the example of a variable called Serco_Channel of type T_CSY_IND. For a co-ordinated axis, we shall take the example of a variable called Serco_Channel_coord of type T_CSY_COORD.
Syntax of WRITE_CMD Instruction
WRITE_CMD (Sercos_Channel): writes the command information of the channel associated with the IODDT Sercos_Channel (co-ordinated axis).
WRITE_CMD (Sercos_Channel_coord) for the co-ordinated axis.
WRITE_CMD Interface
The command to be performed is defined in the ACTION_CMD word (%MWr.m.c.26) of the Sercos_Channel IODDT and the result of the command is available in the words described in the following table:
Standard symbol
Type
Access
Meaning
Address
ERROR_CMD
INT
RW
WRITE_CMD command write error
%MWr.m.c.19
RETURN_CMD_1
DINT
RW
Return 1 of the function
%MDr.m.c.20
RETURN_CMD_2
REAL
RW
Return 2 of the function
%MFr.m.c.22
RETURN_CMD_3
REAL
RW
Return 3 of the function
%MFr.m.c.24
ACTION_CMD
INT
RW
Action to be carried out
%MWr.m.c.26
PARAM_CMD_1
DINT
RW
Parameter 1
%MDr.m.c.27
PARAM_CMD_2
DINT
RW
Parameter 2
%MDr.m.c.29
PARAM_CMD_3
REAL
RW
Parameter 3
%MFr.m.c.31
PARAM_CMD_4
REAL
RW
Parameter 4
%MFr.m.c.33
WRITE_CMD interface in the case of a coordinated axis group
In the case of a coordinated axis group, the movement functions make it necessary to send 2 parameters per coordinated axis (position and speed). The IODDT associated with this axis is thus a little more sophisticated. The result of the command and the parameters are located in the following words of the Sercos_Channel_Coord IODDT:
Standard symbol
Type
Access
Meaning
Address
...
...
...
...
...
PARAM_CMD_1
DINT
RW
Parameter 1
%MDr.m.c.27
PARAM_CMD_2
DINT
RW
Parameter 2
%MDr.m.c.29
PARAM_CMD_3
REAL
RW
Parameter 3
%MFr.m.c.31
PARAM_CMD_4
REAL
RW
Parameter 4
%MFr.m.c.33
PARAM_CMD_5
REAL
RW
Parameter 5
%MFr.m.c.35
...
...
...
...
...
PARAM_CMD_18
REAL
RW
Parameter 18
%MFr.m.c.61
Monitoring the Exchange
The 2 following bits of the IODDT may be used to monitor the writing of command information in the module:
Standard symbol
Meaning
Bit
CMD_IN_PROGR
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.0.1
CMD_ERR
This bit is set to 1 if the parameters transmitted are out of range or erroneous.
%MWr.m.c.1.1