This class realizes the Extended Lufkin Automation (ELAM) Modbus protocol. This proprietary Modbus extension allows adressing of up to 2295 slave units and the retrieval of up to 2500 registers for Modbus functions 3 and 4.
It's implementation is based on the specification "ELAM Extended Lufkin Automation Modbus Version 1.01" published by LUFKIN Automation. The ELAM multiple instruction requests extensions are not implemented.
|
Specialised Serial Port Management Functions |
| synchronized void | openProtocol (String portName, int baudRate, int dataBits, int stopBits, int parity) throws IOException, PortInUseException, UnsupportedCommOperationException |
| | Opens a Modbus serial port with specific port parameters.
|
Serial Port Management Functions |
| synchronized void | openProtocol (String portName, int baudRate) throws Exception, PortInUseException, UnsupportedCommOperationException |
| | Opens a Modbus serial port with default port parameters.
|
| synchronized void | closeProtocol () throws IOException |
| | Closes the serial port and releases any system resources associated with the port.
|
| boolean | isOpen () |
| | Returns whether the port is open or not.
|
Class 0 Modbus Functions |
| synchronized void | writeMultipleRegisters (int slaveAddr, int startRef, short[] regArr) throws IOException, BusProtocolException |
| | Modbus function 16 (10 hex), Preset Multiple Registers/Write Multiple Registers.
|
| synchronized void | writeMultipleRegisters (int slaveAddr, int startRef, int[] int32Arr) throws IOException, BusProtocolException |
| | Modbus function 16 (10 hex) for 32-bit int data types, Preset Multiple Registers/Write Multiple Registers with int data.
|
| synchronized void | writeMultipleRegisters (int slaveAddr, int startRef, float[] float32Arr) throws IOException, BusProtocolException |
| | Modbus function 16 (10 hex) for 32-bit float data types, Preset Multiple Registers/Write Multiple Registers with float data.
|
| synchronized void | readMultipleRegisters (int slaveAddr, int startRef, short[] regArr) throws IOException, BusProtocolException |
| | Modbus function 3 (03 hex), Read Holding Registers/Read Multiple Registers.
|
| synchronized void | readMultipleRegisters (int slaveAddr, int startRef, int[] int32Arr) throws IOException, BusProtocolException |
| | Modbus function 3 (03 hex) for 32-bit int data types, Read Holding Registers/Read Multiple Registers as int data.
|
| synchronized void | readMultipleRegisters (int slaveAddr, int startRef, float[] float32Arr) throws IOException, BusProtocolException |
| | Modbus function 3 (03 hex) for 32-bit float data types, Read Holding Registers/Read Multiple Registers as float data.
|
Class 1 Modbus Functions |
| synchronized void | readCoils (int slaveAddr, int startRef, boolean[] bitArr) throws IOException, BusProtocolException |
| | Modbus function 1 (01 hex), Read Coil Status/Read Coils.
|
| synchronized void | readInputDiscretes (int slaveAddr, int startRef, boolean[] bitArr) throws IOException, BusProtocolException |
| | Modbus function 2 (02 hex), Read Inputs Status/Read Input Discretes.
|
| synchronized void | readInputRegisters (int slaveAddr, int startRef, short[] regArr) throws IOException, BusProtocolException |
| | Modbus function 4 (04 hex), Read Input Registers.
|
| synchronized void | readInputRegisters (int slaveAddr, int startRef, int[] int32Arr) throws IOException, BusProtocolException |
| | Modbus function 4 (04 hex) for 32-bit int data types, Read Input Registers as int data.
|
| synchronized void | readInputRegisters (int slaveAddr, int startRef, float[] float32Arr) throws IOException, BusProtocolException |
| | Modbus function 4 (04 hex) for 32-bit float data types, Read Input Registers as float data.
|
| synchronized void | writeCoil (int slaveAddr, int bitAddr, boolean bitVal) throws IOException, BusProtocolException |
| | Modbus function 5 (05 hex), Force Single Coil/Write Coil.
|
| synchronized void | writeSingleRegister (int slaveAddr, int regAddr, short regVal) throws IOException, BusProtocolException |
| | Modbus function 6 (06 hex), Preset Single Register/Write Single Register.
|
| synchronized byte | readExceptionStatus (int slaveAddr) throws IOException, BusProtocolException |
| | Modbus function 7 (07 hex), Read Exception Status.
|
Class 2 Modbus Functions |
| synchronized void | forceMultipleCoils (int slaveAddr, int startRef, boolean[] bitArr) throws IOException, BusProtocolException |
| | Modbus function 15 (0F hex), Force Multiple Coils.
|
| synchronized void | maskWriteRegister (int slaveAddr, int regAddr, short andMask, short orMask) throws IOException, BusProtocolException |
| | Modbus function 22 (16 hex), Mask Write Register.
|
| synchronized void | readWriteRegisters (int slaveAddr, int readRef, short[] readArr, int writeRef, short[] writeArr) throws IOException, BusProtocolException |
| | Modbus function 23 (17 hex), Read/Write Registers.
|
Vendor Specific Modbus Function Codes |
| synchronized void | readHistoryLog (int slaveAddr, int channelNo, int resolution, short readArr[]) throws IOException, BusProtocolException |
| | Vendor Specific Modbus function 100 (64 hex), Read History Log.
|
Protocol Configuration |
| synchronized void | setTimeout (int timeOut) |
| | Configures time-out.
|
| int | getTimeout () |
| | Returns the operation time-out value.
|
| synchronized void | setPollDelay (int pollDelay) |
| | Configures poll delay.
|
| int | getPollDelay () |
| | Returns the poll delay time.
|
| synchronized void | setRetryCnt (int retryCnt) |
| | Configures the automatic retry setting.
|
| int | getRetryCnt () |
| | Returns the automatic retry count.
|
Transmission Statistic Functions |
| synchronized long | getTotalCounter () |
| | Returns how often a transmit/receive cycle has been executed.
|
|
synchronized void | resetTotalCounter () |
| | Resets total transmit/receive cycle counter.
|
| synchronized long | getSuccessCounter () |
| | Returns how often a transmit/receive cycle was successful.
|
|
synchronized void | resetSuccessCounter () |
| | Resets successful transmit/receive counter.
|
Slave Configuration |
| void | configureStandard32BitMode () |
| | Configures all slaves for Standard 32-bit Mode.
|
| synchronized void | configureStandard32BitMode (int slaveAddr) |
| | Configures a slave for Standard 32-bit Register Mode.
|
| void | configureSingleReg32BitMode () |
| | Configures all slaves for Single Register 32-bit Mode.
|
| synchronized void | configureSingleReg32BitMode (int slaveAddr) |
| | Configures all slaves for Single Register 32-bit Mode.
|
| void | configureCountFromOne () |
| | Configures the reference counting scheme to start with one for all slaves.
|
| synchronized void | configureCountFromOne (int slaveAddr) |
| | Configures a slave's reference counting scheme to start with one.
|
| void | configureCountFromZero () |
| | Configures the reference counting scheme to start with zero for all slaves.
|
| synchronized void | configureCountFromZero (int slaveAddr) |
| | Configures a slave's reference counting scheme to start with zero.
|
| void | configureLittleEndianInts () |
| | Disables word swapping for int data type functions for all slaves.
|
| synchronized void | configureLittleEndianInts (int slaveAddr) |
| | Disables word swapping for int data type functions on a per slave basis.
|
| void | configureBigEndianInts () |
| | Configures int data type functions to do a word swap for all slaves.
|
| synchronized void | configureBigEndianInts (int slaveAddr) |
| | Enables int data type functions to do a word swap on a per slave basis.
|
| void | configureLittleEndianFloats () |
| | Disables float data type functions to do a word swap for all slaves.
|
| synchronized void | configureLittleEndianFloats (int slaveAddr) |
| | Disables float data type functions to do a word swap on a per slave basis.
|
| void | configureSwappedFloats () |
| | Configures float data type functions to do a word swap for all slaves.
|
| synchronized void | configureSwappedFloats (int slaveAddr) |
| | Enables float data type functions to do a word swap on a per slave basis.
|
Public Member Functions |
|
| MbusElamMasterProtocol () |
| | Creates new instance.
|
Static Public Attributes |
|
final int | DATABITS_8 = SerialPort.DATABITS_8 |
| | 8 data bits
|
|
final int | STOPBITS_1 = SerialPort.STOPBITS_1 |
| | 1 stop bit
|
|
final int | STOPBITS_1_5 = SerialPort.STOPBITS_1_5 |
| | 1.5 stop bits
|
|
final int | STOPBITS_2 = SerialPort.STOPBITS_2 |
| | 2 stop bits
|
|
final int | PARITY_NONE = SerialPort.PARITY_NONE |
| | no parity
|
|
final int | PARITY_ODD = SerialPort.PARITY_ODD |
| | odd parity
|
|
final int | PARITY_EVEN = SerialPort.PARITY_EVEN |
| | even parity
|
|
final int | PARITY_MARK = SerialPort.PARITY_MARK |
| | mark parity
|
|
final int | PARITY_SPACE = SerialPort.PARITY_SPACE |
| | space parity
|