Serial communications, Serial modbus communications, Supported function codes – Red Lion PAX2C User Manual
Page 41: Supported exception codes
41
USB
The USB programming port is primarily intended to be used to configure the
PAX2 with the Crimson programming software. It can also be used as a virtual
serial communications port following installation of the PAX2 USB drivers that
are supplied with the Crimson software. When the USB port is being used, i.e.
the USB cable is connected between PAX2 and PC, all serial communications
with the serial option card (if used) is disabled.
USB Cable type required: USB A to Mini-B (not supplied)
PAX2 CONFIGURATION USING CRIMSON AND USB
1. Install Crimson software.
2. Supply power to PAX2.
3. Insure USB Setup in USB Port Parameters is set to CNFG (factory default
setting).
4. Attach USB cable (USB A to Mini-B) between PC and PAX2.
5. Create a new file (File, New) or open an existing PAX2 database within
Crimson.
6. Configure Crimson Link options (Link, Options) to the PC port which the
USB cable is attached (in Step 4).
SERIAL MODBUS COMMUNICATIONS
Modbus Communications requires that the Serial Communications Type
Parameter (tYPE) be set to Modbus RTU (rtu) or Modbus ASCII (ASC).
PAX2 CONFIGURATION USING CRIMSON AND SERIAL
COMMUNICATIONS CARD
1. Install Crimson software.
2. Install RS232 or RS485 card and connect communications cable from PAX2
to PC.
3. Supply power to PAX2.
4. Configure serial parameters as Modbus RTU (rtu), 38,400 baud, address
247.
5. Create a new file (File, New) or open an existing PAX2 database within
Crimson.
6. Configure Crimson 2 Link options (Link, Options) to the serial port which the
communication cable is attached (in step 2).
SUPPORTED FUNCTION CODES
FC03: Read Holding Registers
1. Up to 64 registers can be requested at one time.
2. HEX <8000> is returned for non-used registers.
FC04: Read Input Registers
1. Up to 64 registers can be requested at one time.
2. Block starting point can not exceed register boundaries.
3. HEX <8000> is returned in registers beyond the boundaries.
4. Input registers are a mirror of Holding registers.
FC06: Preset Single Register
1. HEX <8001> is echoed back when attempting to write to a read only register.
2. If the write value exceeds the register limit (see Register Table), then that
register value changes to its high or low limit. It is also returned in the
response.
FC16: Preset Multiple Registers
1. No response is given with an attempt to write to more than 64 registers at a
time.
2. Block starting point cannot exceed the read and write boundaries (40001-
41711).
3. If a multiple write includes read only registers, then only the write registers
will change.
4. If the write value exceeds the register limit (see Register Table), then that
register value changes to its high or low limit.
FC08: Diagnostics
The following is sent upon FC08 request:
Module Address, 08 (FC code), 04 (byte count), “Total Comms” 2 byte count,
“Total Good Comms” 2 byte count, checksum of the string
“Total Comms” is the total number of messages received that were addressed
to the PAX2. “Total Good Comms” is the total messages received by the
PAX2 with good address, parity and checksum. Both counters are reset to
0 upon response to FC08 and at power-up.
FC17: Report Slave ID
The following is sent upon FC17 request:
RLC-PX2C ab<0100h><40h><40h><10h>
a = SP Card, “0”-No SP, “2” or “4” SP
b = Linear Card “0” = None, “1” = Yes
<0100> Software Version Number (1.00)
<20h>Max Register Reads (64)
<20h>Max Register Writes (64)
<10h> Number Guid/Scratch Pad Regs (16)
SUPPORTED EXCEPTION CODES
01: Illegal Function
Issued whenever the requested function is not implemented in the meter.
02: Illegal Data Address
Issued whenever an attempt is made to access a single register that does not
exist (outside the implemented space) or to access a block of registers that falls
completely outside the implemented space.
03: Illegal Data Value
Issued when an attempt is made to read or write more registers than the meter
can handle in one request.
07: Negative Acknowledge
Issued when a write to a register is attempted with an invalid string length.
serial COmmuniCaTiOns
The PAX2 supports serial communications using the optional serial communication cards or via the USB programming port located on the side of the unit. When
USB is being used (connected), the serial communication card is disabled. When using the standard RS232 and RS485 PAX option cards, the PAX2 supports both the
RLC protocol and also supports Modbus communications. The PAX Modbus option card should not be used with the PAX2, as the PAX2 internal Modbus protocol
supports complete unit configuration, and is much more responsive.