WRITEMB2 ch, ID, addr, var, count  
Note : Applicable to all Nano-10, FMD Series, and F-series, but only to the legacy T100MD/MX PLC with firmware r44 or higher
Purpose

Automatically write the multiple words of 16-bit data to a MODBUS device using the MODBUS RTU/ASCII protocol. It is essentially the WRITEMODBUS command except multiple words can be sent.

ch - PLC COMM port number.
1-8 for MODBUS ASCII and 11-18 for MODBUS RTU (11 is com1, 12 is com2, etc)
ID - Device ID of the MODBUS slave device (1 to 255)
addr - Zero-offset address of the holding register in the MODBUS slave device starting from 0 (equals to 40001 in MODBUS Holding register).
var - The starting variable in the master whose data is to be sent out (may be a DM or any system variable)
count - number of variables to send (max. =16 in M+ PLC).
Comments The command automatically checks the response string received from the slave device for the correct slave address CRC16. Like READMODBUS command, the status of this operation can be checked by the user program by testing the STATUS(2) function.
Examples    WRITEMB2 13,5,101,DM[10],8
  The PLC will use MODBUS RTU protocol, via its Comm port #3, to write 8 words of data from DM[11] to DM[17] to the slave MODBUS device with ID = 05 and into it's register offset address 101 to 108 (in MODBUS term this refer to the #40102 to #40109 holding register) .
See Also READMB2, STATUS(2)

  backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual