PVS5120-Series Portable Samplers
49
The
ModbusMaster()
instruction has the following form:
ModbusMaster(
ResultCode, ComPort, BaudRate, ModbusAddr, Function,
Variable, Start, Length, Tries, TimeOut, [ModbusOption]
)
Where,
•
ResultCode
– The ResultCode parameter is a variable that holds the
results of the communication attempt.
•
ComPort
– The ComPort parameter specifies the communication port
and mode that are used for this instruction.
•
BaudRate
– Use 38400 bps
.
•
ModbusAddr
– Enter the Modbus® address set in
DevConfig
.
•
Function
– Enter the appropriate code (TABLE
) to define what
data is being sent to or received from the
ModbusSlave
. For
example, use function code 1 to see if the sampler is still running.
Use function code 3 to return the status values. Use function code 15
to set the start sample flags high.
TABLE 8-8. Modbus® Function Codes
Code
Name
Description
01
Read Coil/Port Status
Reads the On/Off status of discrete
output(s) in the ModbusSlave
03
Read Holding Registers
Reads the binary contents of holding
register(s) in the ModbusSlave
15
Force Multiple Coils/Ports
Forces multiple Coils/Ports in the
ModbusSlave to either On or Off
16
Write Multiple Registers
Writes values into a series of holding
registers in the ModbusSlave
•
Variable
– The
Variable
parameter is used to specify the variable
array that is used as the source of data to send, or the variable array
that is used as the destination for data received.
•
Start
– The
Start
parameter is used to specify the first number of the
register or coil that is acted upon with this instruction. TABLE
shows the descriptions of the registers and coils for the sampler.
When initiating a sample, enter 1 for this parameter. When collecting
all of the status values, enter 23 for this parameter.
•
Length
– The
Length
parameter is used to specify the number of
variables to act upon with this instruction. The
Length
for initiating a
sample is
1
. The
Length
for collecting status values is 4.
Summary of Contents for PVS5120 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 8: ......
Page 70: ...Appendix A Sample Transport Velocity A 2...
Page 78: ...Appendix B Example Programs B 8...
Page 86: ...Appendix C Monitoring Sampler Status via RS 485 C 8...
Page 96: ...Appendix G Generic Modbus Control G 4...
Page 100: ...Appendix H ISO5667 Conformity H 4...
Page 101: ......