The instruction WRITE_CMD is used for explicit writing in the module or the communication channel, or in the built-in interface of the associated command words.
For a Uni-Telway link, this instruction will mainly be used for communication with an external modem.
Example: switching from Uni-Telway mode to character mode for the dialing phase
The syntax of the instruction is as follows:
WRITE_CMD(IODDT_VAR1)
where IODDT_VAR1 is type T_COM_STS_GEN
Before executing a WRITE_CMD, test whether an exchange is currently underway using the language object %MWr.m.c.0. To do this, you must perform a READ_STS to read the word.
You then need to modify the value of the command language object in order to perform the required command. For a Uni-Telway link, the language object is the internal word %MWr.m.c.15.
Example: To switch from Uni-Telway mode to character mode, %MWr.m.c.15 is also set to 16#4000 (%MWr.m.c.15.14 = 1).
NOTE: A single command bit must then be switched from 0 to 1 before transmitting a WRITE_CMD.
Finally, a WRITE_CMD must be executed to acknowledge the command.