Data transfer via communication ports
781
Part III FP Instructions
PLC types:
Availability of F145F146_MODBUS_MASTER (see page 1321)
Variable Data
type
Function
Port Specifies the slave's COM port (1 or 2) via system variable:
SYS_COM1_PORT, SYS_COM2_PORT
SlaveAddress Address of the remote station (0–255).
FunctionCode* SYS_MODBUS_01_READ_COIL
SYS_MODBUS_02_READ_INPUT
SYS_MODBUS_03_READ_HOLDING_REGISTER
SYS_MODBUS_04_READ_INPUT_REGISTERS
SYS_MODBUS_05_FORCE_COIL
SYS_MODBUS_06_PRESET_REGISTER
SYS_MODBUS_15_FORCE_COILS
SYS_MODBUS_16_PRESET_REGISTERS
StartRegister Starting address (0–65535). The address type depends on the
command specified by FunctionCode*.
NumberOfRegisters*
ANY16
Number of transmission bits or words.
1–2040 for function codes 01, 02
2–2040 for function code 15
1–127 for function codes 03, 04
2–127 for function code 16
MasterData ANY The master data which is written to the slave.
For Relay T/C Register Constant
Port WX WY WR WL
DT LD FL -
Slave Address WX WY WR WL - - DT LD FL -
Function Code* - - - - - - - - - system
Start Register WX WY WR WL - - DT LD FL -
NumberOf Registers* - - - - - - - - - dec. or hex.
Master Data WX WY WR WL - - DT LD FL -
No. IEC
address
Set If
R9007 %MX0.900.7 permanently
R9008 %MX0.900.8 permanently
port 0 (global transmission) gets no response from COM1 or
COM2.
slave data or master data exceeds the available address range.
the communication mode (see page 712) is not set to
MEWTOCOL
-COM Master/Slave or Modbus RTU Master/Slave.
the COM port selected requires a communication cassette that
has not been installed.
22.5.1 Evaluation of IsF145146NotActive flag
In this section:
- Is145F146NotActive (see page 787)
Data types
Operands
Error flags