
The function block 'DrvModbusReadWrite23' reads and writes one or more parameters of the drive via DriveData connected to Modbus TCP / Modbus RTU communication blocks with Modbus function code FCT = 23. This function block internally calls DrvModbusWrite to execute ReadWrite job with FCT = 23, used along with the internal structure for Fct23, DrvModFct23Type.
The number of parameters to be read is specified at the input 'NvarRead'. The first address for read operation is specified at the input 'PrmNumRead'. The values of the data are stored in the PLC memory area, defined at the input 'DataRead'.
The number of parameters to be written is specified at the input 'NvarWrite'. The first address for write operation is specified at the input 'PrmNumWrite'. The values of the data that should be written must be stored in the PLC memory area, defined at the input 'DataWrite'.
To start a new ReadWrite job the input Execute must be set from FALSE to TRUE (edge sensitive). The Modbus job is started from the communication block DrvModbusTcp or DrvModbusRtu which is connected to the same DriveData variable. It uses the Modbus function code 23 (Read and write n words). The drive (Modbus device) to which the parameter is written is specified at the Communication Block.
The values in the PLC memory area are updated when the ReadWrite job was performed without error. The ReadWrite job has been performed without error if JobDone = TRUE and ModMastErrorAct = FALSE.
If the Modbus job was finished with an error, the output ModMastErrorAct is set for one cycle. The Error ID returned by the Modbus job is shown at the output ModMastErrorIDLast. The output ModMastErrorIDLast will show that last Error ID until the input Execute is set from TRUE to FALSE.
After termination of this job, even if it was not successful, a next ReadWrite job can once again only be started with a rising edge at 'Execute' input.
Drive parameters are only saved temporarily, if changed via fieldbus. To make these changes permanent in the drive the special parameter "PARAMETER SAVE" must be set.
Please see drive manuals for the parameter details.
For ACS380, ACS480, ACS580, ACH580, ACQ580, ACS880 and DCS880 – Par 96.07 = 1
For ACSM1, DCS800 and DCS550 – Par 16.06 = 1