Step
|
Action
|
Details
|
---|---|---|
1
|
Preparing the communication port.
|
|
2
|
Master Modbus mode
|
|
3
|
Reseting the communication port.
|
|
Step
|
Action
|
Detail
|
---|---|---|
1
|
Test to determine whether any command is pending.
|
Before executing a WRITE_CMD, test whether an exchange is currently in progress using the EXCH_STS language object (%MWr.m.c.0). To refresh this word, use the READ_STS block.
|
2
|
Assign the command word.
|
You must next modify the value of the command language object in order to perform the required command. For a Modbus link, the object language is the internal word CONTROL (%MWr.m.c.24).
For example, to switch from Modbus mode to character mode, the bit 14 of the word %MWr.m.c.24 is set to 1.
Note: A single command bit must then be switched from 0 to 1 before transmitting the WRITE_CMD.
|
3
|
Send the command
|
Finally, a WRITE_CMD must be executed to acknowledge the command.
|