Package com.tinkerforge
Class BrickletRS485
- java.lang.Object
-
- com.tinkerforge.DeviceBase
-
- com.tinkerforge.Device
-
- com.tinkerforge.BrickletRS485
-
public class BrickletRS485 extends Device
Communicates with RS485/Modbus devices with full- or half-duplex
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BrickletRS485.BufferConfig
class
BrickletRS485.BufferStatus
class
BrickletRS485.ErrorCount
static interface
BrickletRS485.ErrorCountListener
This listener is called if a new error occurs.static interface
BrickletRS485.FrameReadableListener
This listener is called if at least one frame of data is readable.class
BrickletRS485.ModbusCommonErrorCount
class
BrickletRS485.ModbusConfiguration
static interface
BrickletRS485.ModbusMasterReadCoilsResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to read coils.static interface
BrickletRS485.ModbusMasterReadCoilsResponseLowLevelListener
static interface
BrickletRS485.ModbusMasterReadDiscreteInputsResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to read discrete inputs.static interface
BrickletRS485.ModbusMasterReadDiscreteInputsResponseLowLevelListener
static interface
BrickletRS485.ModbusMasterReadHoldingRegistersResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to read holding registers.static interface
BrickletRS485.ModbusMasterReadHoldingRegistersResponseLowLevelListener
static interface
BrickletRS485.ModbusMasterReadInputRegistersResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to read input registers.static interface
BrickletRS485.ModbusMasterReadInputRegistersResponseLowLevelListener
static interface
BrickletRS485.ModbusMasterWriteMultipleCoilsResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to read coils.static interface
BrickletRS485.ModbusMasterWriteMultipleRegistersResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to write multiple registers.static interface
BrickletRS485.ModbusMasterWriteSingleCoilResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to write a single coil.static interface
BrickletRS485.ModbusMasterWriteSingleRegisterResponseListener
This listener is called only in Modbus master mode when the master receives a valid response of a request to write a single register.static interface
BrickletRS485.ModbusSlaveReadCoilsRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to read coils.static interface
BrickletRS485.ModbusSlaveReadDiscreteInputsRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to read discrete inputs.static interface
BrickletRS485.ModbusSlaveReadHoldingRegistersRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to read holding registers.static interface
BrickletRS485.ModbusSlaveReadInputRegistersRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to read input registers.static interface
BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to write multiple coils.static interface
BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestLowLevelListener
static interface
BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to write multiple holding registers.static interface
BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestLowLevelListener
static interface
BrickletRS485.ModbusSlaveWriteSingleCoilRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to write a single coil.static interface
BrickletRS485.ModbusSlaveWriteSingleRegisterRequestListener
This listener is called only in Modbus slave mode when the slave receives a valid request from a Modbus master to write a single holding register.static interface
BrickletRS485.ReadListener
This listener is called if new data is available.class
BrickletRS485.ReadLowLevel
static interface
BrickletRS485.ReadLowLevelListener
class
BrickletRS485.RS485Configuration
class
BrickletRS485.SPITFPErrorCount
-
Nested classes/interfaces inherited from class com.tinkerforge.Device
Device.Identity
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BrickletRS485(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addErrorCountListener(BrickletRS485.ErrorCountListener listener)
Adds a ErrorCount listener.void
addFrameReadableListener(BrickletRS485.FrameReadableListener listener)
Adds a FrameReadable listener.void
addModbusMasterReadCoilsResponseListener(BrickletRS485.ModbusMasterReadCoilsResponseListener listener)
Adds a ModbusMasterReadCoilsResponse listener.void
addModbusMasterReadCoilsResponseLowLevelListener(BrickletRS485.ModbusMasterReadCoilsResponseLowLevelListener listener)
Adds a ModbusMasterReadCoilsResponseLowLevel listener.void
addModbusMasterReadDiscreteInputsResponseListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseListener listener)
Adds a ModbusMasterReadDiscreteInputsResponse listener.void
addModbusMasterReadDiscreteInputsResponseLowLevelListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseLowLevelListener listener)
Adds a ModbusMasterReadDiscreteInputsResponseLowLevel listener.void
addModbusMasterReadHoldingRegistersResponseListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseListener listener)
Adds a ModbusMasterReadHoldingRegistersResponse listener.void
addModbusMasterReadHoldingRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseLowLevelListener listener)
Adds a ModbusMasterReadHoldingRegistersResponseLowLevel listener.void
addModbusMasterReadInputRegistersResponseListener(BrickletRS485.ModbusMasterReadInputRegistersResponseListener listener)
Adds a ModbusMasterReadInputRegistersResponse listener.void
addModbusMasterReadInputRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadInputRegistersResponseLowLevelListener listener)
Adds a ModbusMasterReadInputRegistersResponseLowLevel listener.void
addModbusMasterWriteMultipleCoilsResponseListener(BrickletRS485.ModbusMasterWriteMultipleCoilsResponseListener listener)
Adds a ModbusMasterWriteMultipleCoilsResponse listener.void
addModbusMasterWriteMultipleRegistersResponseListener(BrickletRS485.ModbusMasterWriteMultipleRegistersResponseListener listener)
Adds a ModbusMasterWriteMultipleRegistersResponse listener.void
addModbusMasterWriteSingleCoilResponseListener(BrickletRS485.ModbusMasterWriteSingleCoilResponseListener listener)
Adds a ModbusMasterWriteSingleCoilResponse listener.void
addModbusMasterWriteSingleRegisterResponseListener(BrickletRS485.ModbusMasterWriteSingleRegisterResponseListener listener)
Adds a ModbusMasterWriteSingleRegisterResponse listener.void
addModbusSlaveReadCoilsRequestListener(BrickletRS485.ModbusSlaveReadCoilsRequestListener listener)
Adds a ModbusSlaveReadCoilsRequest listener.void
addModbusSlaveReadDiscreteInputsRequestListener(BrickletRS485.ModbusSlaveReadDiscreteInputsRequestListener listener)
Adds a ModbusSlaveReadDiscreteInputsRequest listener.void
addModbusSlaveReadHoldingRegistersRequestListener(BrickletRS485.ModbusSlaveReadHoldingRegistersRequestListener listener)
Adds a ModbusSlaveReadHoldingRegistersRequest listener.void
addModbusSlaveReadInputRegistersRequestListener(BrickletRS485.ModbusSlaveReadInputRegistersRequestListener listener)
Adds a ModbusSlaveReadInputRegistersRequest listener.void
addModbusSlaveWriteMultipleCoilsRequestListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestListener listener)
Adds a ModbusSlaveWriteMultipleCoilsRequest listener.void
addModbusSlaveWriteMultipleCoilsRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestLowLevelListener listener)
Adds a ModbusSlaveWriteMultipleCoilsRequestLowLevel listener.void
addModbusSlaveWriteMultipleRegistersRequestListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestListener listener)
Adds a ModbusSlaveWriteMultipleRegistersRequest listener.void
addModbusSlaveWriteMultipleRegistersRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestLowLevelListener listener)
Adds a ModbusSlaveWriteMultipleRegistersRequestLowLevel listener.void
addModbusSlaveWriteSingleCoilRequestListener(BrickletRS485.ModbusSlaveWriteSingleCoilRequestListener listener)
Adds a ModbusSlaveWriteSingleCoilRequest listener.void
addModbusSlaveWriteSingleRegisterRequestListener(BrickletRS485.ModbusSlaveWriteSingleRegisterRequestListener listener)
Adds a ModbusSlaveWriteSingleRegisterRequest listener.void
addReadListener(BrickletRS485.ReadListener listener)
Adds a Read listener.void
addReadLowLevelListener(BrickletRS485.ReadLowLevelListener listener)
Adds a ReadLowLevel listener.void
disableErrorCountCallback()
Disables theBrickletRS485.ErrorCountListener
listener.void
disableReadCallback()
Disables theBrickletRS485.ReadListener
listener.void
enableErrorCountCallback()
Enables theBrickletRS485.ErrorCountListener
listener.void
enableReadCallback()
Enables theBrickletRS485.ReadListener
listener.int
getBootloaderMode()
Returns the current bootloader mode, seesetBootloaderMode(int)
.BrickletRS485.BufferConfig
getBufferConfig()
Returns the buffer configuration as set bysetBufferConfig(int, int)
.BrickletRS485.BufferStatus
getBufferStatus()
Returns the currently used bytes for the send and received buffer.int
getChipTemperature()
Returns the temperature as measured inside the microcontroller.int
getCommunicationLEDConfig()
Returns the configuration as set bysetCommunicationLEDConfig(int)
BrickletRS485.ErrorCount
getErrorCount()
Returns the current number of overrun and parity errors.int
getErrorLEDConfig()
Returns the configuration as set bysetErrorLEDConfig(int)
.int
getFrameReadableCallbackConfiguration()
Returns the listener configuration as set bysetFrameReadableCallbackConfiguration(int)
.Device.Identity
getIdentity()
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.BrickletRS485.ModbusCommonErrorCount
getModbusCommonErrorCount()
Returns the current number of errors occurred in Modbus mode.BrickletRS485.ModbusConfiguration
getModbusConfiguration()
Returns the configuration as set bysetModbusConfiguration(int, long)
.int
getMode()
Returns the configuration as set bysetMode(int)
.BrickletRS485.RS485Configuration
getRS485Configuration()
Returns the configuration as set bysetRS485Configuration(long, int, int, int, int)
.BrickletRS485.SPITFPErrorCount
getSPITFPErrorCount()
Returns the error count for the communication between Brick and Bricklet.int
getStatusLEDConfig()
Returns the configuration as set bysetStatusLEDConfig(int)
boolean
isErrorCountCallbackEnabled()
Returns *true* if theBrickletRS485.ErrorCountListener
listener is enabled, *false* otherwise.boolean
isReadCallbackEnabled()
Returns *true* if theBrickletRS485.ReadListener
listener is enabled, *false* otherwise.int
modbusMasterReadCoils(int slaveAddress, long startingAddress, int count)
In Modbus master mode this function can be used to read coils from a slave.int
modbusMasterReadDiscreteInputs(int slaveAddress, long startingAddress, int count)
In Modbus master mode this function can be used to read discrete inputs from a slave.int
modbusMasterReadHoldingRegisters(int slaveAddress, long startingAddress, int count)
In Modbus master mode this function can be used to read holding registers from a slave.int
modbusMasterReadInputRegisters(int slaveAddress, long startingAddress, int count)
In Modbus master mode this function can be used to read input registers from a slave.int
modbusMasterWriteMultipleCoils(int slaveAddress, long startingAddress, boolean[] coils)
In Modbus master mode this function can be used to write multiple coils of a slave.int
modbusMasterWriteMultipleCoilsLowLevel(int slaveAddress, long startingAddress, int coilsLength, int coilsChunkOffset, boolean[] coilsChunkData)
In Modbus master mode this function can be used to write multiple coils of a slave.int
modbusMasterWriteMultipleRegisters(int slaveAddress, long startingAddress, int[] registers)
In Modbus master mode this function can be used to write multiple registers of a slave.int
modbusMasterWriteMultipleRegistersLowLevel(int slaveAddress, long startingAddress, int registersLength, int registersChunkOffset, int[] registersChunkData)
In Modbus master mode this function can be used to write multiple registers of a slave.int
modbusMasterWriteSingleCoil(int slaveAddress, long coilAddress, boolean coilValue)
In Modbus master mode this function can be used to write a single coil of a slave.int
modbusMasterWriteSingleRegister(int slaveAddress, long registerAddress, int registerValue)
In Modbus master mode this function can be used to write a single holding register of a slave.void
modbusSlaveAnswerReadCoilsRequest(int requestID, boolean[] coils)
In Modbus slave mode this function can be used to answer a master request to read coils.void
modbusSlaveAnswerReadCoilsRequestLowLevel(int requestID, int coilsLength, int coilsChunkOffset, boolean[] coilsChunkData)
In Modbus slave mode this function can be used to answer a master request to read coils.void
modbusSlaveAnswerReadDiscreteInputsRequest(int requestID, boolean[] discreteInputs)
In Modbus slave mode this function can be used to answer a master request to read discrete inputs.void
modbusSlaveAnswerReadDiscreteInputsRequestLowLevel(int requestID, int discreteInputsLength, int discreteInputsChunkOffset, boolean[] discreteInputsChunkData)
In Modbus slave mode this function can be used to answer a master request to read discrete inputs.void
modbusSlaveAnswerReadHoldingRegistersRequest(int requestID, int[] holdingRegisters)
In Modbus slave mode this function can be used to answer a master request to read holding registers.void
modbusSlaveAnswerReadHoldingRegistersRequestLowLevel(int requestID, int holdingRegistersLength, int holdingRegistersChunkOffset, int[] holdingRegistersChunkData)
In Modbus slave mode this function can be used to answer a master request to read holding registers.void
modbusSlaveAnswerReadInputRegistersRequest(int requestID, int[] inputRegisters)
In Modbus slave mode this function can be used to answer a master request to read input registers.void
modbusSlaveAnswerReadInputRegistersRequestLowLevel(int requestID, int inputRegistersLength, int inputRegistersChunkOffset, int[] inputRegistersChunkData)
In Modbus slave mode this function can be used to answer a master request to read input registers.void
modbusSlaveAnswerWriteMultipleCoilsRequest(int requestID)
In Modbus slave mode this function can be used to answer a master request to write multiple coils.void
modbusSlaveAnswerWriteMultipleRegistersRequest(int requestID)
In Modbus slave mode this function can be used to answer a master request to write multiple registers.void
modbusSlaveAnswerWriteSingleCoilRequest(int requestID)
In Modbus slave mode this function can be used to answer a master request to write a single coil.void
modbusSlaveAnswerWriteSingleRegisterRequest(int requestID)
In Modbus slave mode this function can be used to answer a master request to write a single register.void
modbusSlaveReportException(int requestID, int exceptionCode)
In Modbus slave mode this function can be used to report a Modbus exception for a Modbus master request.char[]
read(int length)
Returns up to *length* characters from receive buffer.BrickletRS485.ReadLowLevel
readLowLevel(int length)
Returns up to *length* characters from receive buffer.long
readUID()
Returns the current UID as an integer.void
removeErrorCountListener(BrickletRS485.ErrorCountListener listener)
Removes a ErrorCount listener.void
removeFrameReadableListener(BrickletRS485.FrameReadableListener listener)
Removes a FrameReadable listener.void
removeModbusMasterReadCoilsResponseListener(BrickletRS485.ModbusMasterReadCoilsResponseListener listener)
Removes a ModbusMasterReadCoilsResponse listener.void
removeModbusMasterReadCoilsResponseLowLevelListener(BrickletRS485.ModbusMasterReadCoilsResponseLowLevelListener listener)
Removes a ModbusMasterReadCoilsResponseLowLevel listener.void
removeModbusMasterReadDiscreteInputsResponseListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseListener listener)
Removes a ModbusMasterReadDiscreteInputsResponse listener.void
removeModbusMasterReadDiscreteInputsResponseLowLevelListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseLowLevelListener listener)
Removes a ModbusMasterReadDiscreteInputsResponseLowLevel listener.void
removeModbusMasterReadHoldingRegistersResponseListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseListener listener)
Removes a ModbusMasterReadHoldingRegistersResponse listener.void
removeModbusMasterReadHoldingRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseLowLevelListener listener)
Removes a ModbusMasterReadHoldingRegistersResponseLowLevel listener.void
removeModbusMasterReadInputRegistersResponseListener(BrickletRS485.ModbusMasterReadInputRegistersResponseListener listener)
Removes a ModbusMasterReadInputRegistersResponse listener.void
removeModbusMasterReadInputRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadInputRegistersResponseLowLevelListener listener)
Removes a ModbusMasterReadInputRegistersResponseLowLevel listener.void
removeModbusMasterWriteMultipleCoilsResponseListener(BrickletRS485.ModbusMasterWriteMultipleCoilsResponseListener listener)
Removes a ModbusMasterWriteMultipleCoilsResponse listener.void
removeModbusMasterWriteMultipleRegistersResponseListener(BrickletRS485.ModbusMasterWriteMultipleRegistersResponseListener listener)
Removes a ModbusMasterWriteMultipleRegistersResponse listener.void
removeModbusMasterWriteSingleCoilResponseListener(BrickletRS485.ModbusMasterWriteSingleCoilResponseListener listener)
Removes a ModbusMasterWriteSingleCoilResponse listener.void
removeModbusMasterWriteSingleRegisterResponseListener(BrickletRS485.ModbusMasterWriteSingleRegisterResponseListener listener)
Removes a ModbusMasterWriteSingleRegisterResponse listener.void
removeModbusSlaveReadCoilsRequestListener(BrickletRS485.ModbusSlaveReadCoilsRequestListener listener)
Removes a ModbusSlaveReadCoilsRequest listener.void
removeModbusSlaveReadDiscreteInputsRequestListener(BrickletRS485.ModbusSlaveReadDiscreteInputsRequestListener listener)
Removes a ModbusSlaveReadDiscreteInputsRequest listener.void
removeModbusSlaveReadHoldingRegistersRequestListener(BrickletRS485.ModbusSlaveReadHoldingRegistersRequestListener listener)
Removes a ModbusSlaveReadHoldingRegistersRequest listener.void
removeModbusSlaveReadInputRegistersRequestListener(BrickletRS485.ModbusSlaveReadInputRegistersRequestListener listener)
Removes a ModbusSlaveReadInputRegistersRequest listener.void
removeModbusSlaveWriteMultipleCoilsRequestListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestListener listener)
Removes a ModbusSlaveWriteMultipleCoilsRequest listener.void
removeModbusSlaveWriteMultipleCoilsRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestLowLevelListener listener)
Removes a ModbusSlaveWriteMultipleCoilsRequestLowLevel listener.void
removeModbusSlaveWriteMultipleRegistersRequestListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestListener listener)
Removes a ModbusSlaveWriteMultipleRegistersRequest listener.void
removeModbusSlaveWriteMultipleRegistersRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestLowLevelListener listener)
Removes a ModbusSlaveWriteMultipleRegistersRequestLowLevel listener.void
removeModbusSlaveWriteSingleCoilRequestListener(BrickletRS485.ModbusSlaveWriteSingleCoilRequestListener listener)
Removes a ModbusSlaveWriteSingleCoilRequest listener.void
removeModbusSlaveWriteSingleRegisterRequestListener(BrickletRS485.ModbusSlaveWriteSingleRegisterRequestListener listener)
Removes a ModbusSlaveWriteSingleRegisterRequest listener.void
removeReadListener(BrickletRS485.ReadListener listener)
Removes a Read listener.void
removeReadLowLevelListener(BrickletRS485.ReadLowLevelListener listener)
Removes a ReadLowLevel listener.void
reset()
Calling this function will reset the Bricklet.int
setBootloaderMode(int mode)
Sets the bootloader mode and returns the status after the requested mode change was instigated.void
setBufferConfig(int sendBufferSize, int receiveBufferSize)
Sets the send and receive buffer size in byte.void
setCommunicationLEDConfig(int config)
Sets the communication LED configuration.void
setErrorLEDConfig(int config)
Sets the error LED configuration.void
setFrameReadableCallbackConfiguration(int frameSize)
Configures theBrickletRS485.FrameReadableListener
listener.void
setModbusConfiguration(int slaveAddress, long masterRequestTimeout)
Sets the configuration for the RS485 Modbus communication.void
setMode(int mode)
Sets the mode of the Bricklet in which it operates.void
setRS485Configuration(long baudrate, int parity, int stopbits, int wordlength, int duplex)
Sets the configuration for the RS485 communication.void
setStatusLEDConfig(int config)
Sets the status LED configuration.void
setWriteFirmwarePointer(long pointer)
Sets the firmware pointer forwriteFirmware(int[])
.int
write(char[] message)
Writes characters to the RS485 interface.int
writeFirmware(int[] data)
Writes 64 Bytes of firmware at the position as written bysetWriteFirmwarePointer(long)
before.int
writeLowLevel(int messageLength, int messageChunkOffset, char[] messageChunkData)
Writes characters to the RS485 interface.void
writeUID(long uid)
Writes a new UID into flash.-
Methods inherited from class com.tinkerforge.DeviceBase
getAPIVersion, getResponseExpected, setResponseExpected, setResponseExpectedAll
-
-
-
-
Field Detail
-
DEVICE_IDENTIFIER
public static final int DEVICE_IDENTIFIER
- See Also:
- Constant Field Values
-
DEVICE_DISPLAY_NAME
public static final java.lang.String DEVICE_DISPLAY_NAME
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_LOW_LEVEL
public static final byte FUNCTION_WRITE_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_READ_LOW_LEVEL
public static final byte FUNCTION_READ_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_ENABLE_READ_CALLBACK
public static final byte FUNCTION_ENABLE_READ_CALLBACK
- See Also:
- Constant Field Values
-
FUNCTION_DISABLE_READ_CALLBACK
public static final byte FUNCTION_DISABLE_READ_CALLBACK
- See Also:
- Constant Field Values
-
FUNCTION_IS_READ_CALLBACK_ENABLED
public static final byte FUNCTION_IS_READ_CALLBACK_ENABLED
- See Also:
- Constant Field Values
-
FUNCTION_SET_RS485_CONFIGURATION
public static final byte FUNCTION_SET_RS485_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_RS485_CONFIGURATION
public static final byte FUNCTION_GET_RS485_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_MODBUS_CONFIGURATION
public static final byte FUNCTION_SET_MODBUS_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_MODBUS_CONFIGURATION
public static final byte FUNCTION_GET_MODBUS_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_SET_MODE
public static final byte FUNCTION_SET_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_MODE
public static final byte FUNCTION_GET_MODE
- See Also:
- Constant Field Values
-
FUNCTION_SET_COMMUNICATION_LED_CONFIG
public static final byte FUNCTION_SET_COMMUNICATION_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_COMMUNICATION_LED_CONFIG
public static final byte FUNCTION_GET_COMMUNICATION_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_SET_ERROR_LED_CONFIG
public static final byte FUNCTION_SET_ERROR_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_ERROR_LED_CONFIG
public static final byte FUNCTION_GET_ERROR_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_SET_BUFFER_CONFIG
public static final byte FUNCTION_SET_BUFFER_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_BUFFER_CONFIG
public static final byte FUNCTION_GET_BUFFER_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_BUFFER_STATUS
public static final byte FUNCTION_GET_BUFFER_STATUS
- See Also:
- Constant Field Values
-
FUNCTION_ENABLE_ERROR_COUNT_CALLBACK
public static final byte FUNCTION_ENABLE_ERROR_COUNT_CALLBACK
- See Also:
- Constant Field Values
-
FUNCTION_DISABLE_ERROR_COUNT_CALLBACK
public static final byte FUNCTION_DISABLE_ERROR_COUNT_CALLBACK
- See Also:
- Constant Field Values
-
FUNCTION_IS_ERROR_COUNT_CALLBACK_ENABLED
public static final byte FUNCTION_IS_ERROR_COUNT_CALLBACK_ENABLED
- See Also:
- Constant Field Values
-
FUNCTION_GET_ERROR_COUNT
public static final byte FUNCTION_GET_ERROR_COUNT
- See Also:
- Constant Field Values
-
FUNCTION_GET_MODBUS_COMMON_ERROR_COUNT
public static final byte FUNCTION_GET_MODBUS_COMMON_ERROR_COUNT
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_REPORT_EXCEPTION
public static final byte FUNCTION_MODBUS_SLAVE_REPORT_EXCEPTION
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_READ_COILS_REQUEST_LOW_LEVEL
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_READ_COILS_REQUEST_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_READ_COILS
public static final byte FUNCTION_MODBUS_MASTER_READ_COILS
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_READ_HOLDING_REGISTERS_REQUEST_LOW_LEVEL
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_READ_HOLDING_REGISTERS_REQUEST_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_READ_HOLDING_REGISTERS
public static final byte FUNCTION_MODBUS_MASTER_READ_HOLDING_REGISTERS
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_SINGLE_COIL_REQUEST
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_SINGLE_COIL_REQUEST
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_WRITE_SINGLE_COIL
public static final byte FUNCTION_MODBUS_MASTER_WRITE_SINGLE_COIL
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_SINGLE_REGISTER_REQUEST
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_SINGLE_REGISTER_REQUEST
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_WRITE_SINGLE_REGISTER
public static final byte FUNCTION_MODBUS_MASTER_WRITE_SINGLE_REGISTER
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_MULTIPLE_COILS_REQUEST
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_MULTIPLE_COILS_REQUEST
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_WRITE_MULTIPLE_COILS_LOW_LEVEL
public static final byte FUNCTION_MODBUS_MASTER_WRITE_MULTIPLE_COILS_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_MULTIPLE_REGISTERS_REQUEST
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_WRITE_MULTIPLE_REGISTERS_REQUEST
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_WRITE_MULTIPLE_REGISTERS_LOW_LEVEL
public static final byte FUNCTION_MODBUS_MASTER_WRITE_MULTIPLE_REGISTERS_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_READ_DISCRETE_INPUTS_REQUEST_LOW_LEVEL
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_READ_DISCRETE_INPUTS_REQUEST_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_READ_DISCRETE_INPUTS
public static final byte FUNCTION_MODBUS_MASTER_READ_DISCRETE_INPUTS
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_SLAVE_ANSWER_READ_INPUT_REGISTERS_REQUEST_LOW_LEVEL
public static final byte FUNCTION_MODBUS_SLAVE_ANSWER_READ_INPUT_REGISTERS_REQUEST_LOW_LEVEL
- See Also:
- Constant Field Values
-
FUNCTION_MODBUS_MASTER_READ_INPUT_REGISTERS
public static final byte FUNCTION_MODBUS_MASTER_READ_INPUT_REGISTERS
- See Also:
- Constant Field Values
-
FUNCTION_SET_FRAME_READABLE_CALLBACK_CONFIGURATION
public static final byte FUNCTION_SET_FRAME_READABLE_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_FRAME_READABLE_CALLBACK_CONFIGURATION
public static final byte FUNCTION_GET_FRAME_READABLE_CALLBACK_CONFIGURATION
- See Also:
- Constant Field Values
-
FUNCTION_GET_SPITFP_ERROR_COUNT
public static final byte FUNCTION_GET_SPITFP_ERROR_COUNT
- See Also:
- Constant Field Values
-
FUNCTION_SET_BOOTLOADER_MODE
public static final byte FUNCTION_SET_BOOTLOADER_MODE
- See Also:
- Constant Field Values
-
FUNCTION_GET_BOOTLOADER_MODE
public static final byte FUNCTION_GET_BOOTLOADER_MODE
- See Also:
- Constant Field Values
-
FUNCTION_SET_WRITE_FIRMWARE_POINTER
public static final byte FUNCTION_SET_WRITE_FIRMWARE_POINTER
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_FIRMWARE
public static final byte FUNCTION_WRITE_FIRMWARE
- See Also:
- Constant Field Values
-
FUNCTION_SET_STATUS_LED_CONFIG
public static final byte FUNCTION_SET_STATUS_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_STATUS_LED_CONFIG
public static final byte FUNCTION_GET_STATUS_LED_CONFIG
- See Also:
- Constant Field Values
-
FUNCTION_GET_CHIP_TEMPERATURE
public static final byte FUNCTION_GET_CHIP_TEMPERATURE
- See Also:
- Constant Field Values
-
FUNCTION_RESET
public static final byte FUNCTION_RESET
- See Also:
- Constant Field Values
-
FUNCTION_WRITE_UID
public static final byte FUNCTION_WRITE_UID
- See Also:
- Constant Field Values
-
FUNCTION_READ_UID
public static final byte FUNCTION_READ_UID
- See Also:
- Constant Field Values
-
FUNCTION_GET_IDENTITY
public static final byte FUNCTION_GET_IDENTITY
- See Also:
- Constant Field Values
-
PARITY_NONE
public static final int PARITY_NONE
- See Also:
- Constant Field Values
-
PARITY_ODD
public static final int PARITY_ODD
- See Also:
- Constant Field Values
-
PARITY_EVEN
public static final int PARITY_EVEN
- See Also:
- Constant Field Values
-
STOPBITS_1
public static final int STOPBITS_1
- See Also:
- Constant Field Values
-
STOPBITS_2
public static final int STOPBITS_2
- See Also:
- Constant Field Values
-
WORDLENGTH_5
public static final int WORDLENGTH_5
- See Also:
- Constant Field Values
-
WORDLENGTH_6
public static final int WORDLENGTH_6
- See Also:
- Constant Field Values
-
WORDLENGTH_7
public static final int WORDLENGTH_7
- See Also:
- Constant Field Values
-
WORDLENGTH_8
public static final int WORDLENGTH_8
- See Also:
- Constant Field Values
-
DUPLEX_HALF
public static final int DUPLEX_HALF
- See Also:
- Constant Field Values
-
DUPLEX_FULL
public static final int DUPLEX_FULL
- See Also:
- Constant Field Values
-
MODE_RS485
public static final int MODE_RS485
- See Also:
- Constant Field Values
-
MODE_MODBUS_MASTER_RTU
public static final int MODE_MODBUS_MASTER_RTU
- See Also:
- Constant Field Values
-
MODE_MODBUS_SLAVE_RTU
public static final int MODE_MODBUS_SLAVE_RTU
- See Also:
- Constant Field Values
-
COMMUNICATION_LED_CONFIG_OFF
public static final int COMMUNICATION_LED_CONFIG_OFF
- See Also:
- Constant Field Values
-
COMMUNICATION_LED_CONFIG_ON
public static final int COMMUNICATION_LED_CONFIG_ON
- See Also:
- Constant Field Values
-
COMMUNICATION_LED_CONFIG_SHOW_HEARTBEAT
public static final int COMMUNICATION_LED_CONFIG_SHOW_HEARTBEAT
- See Also:
- Constant Field Values
-
COMMUNICATION_LED_CONFIG_SHOW_COMMUNICATION
public static final int COMMUNICATION_LED_CONFIG_SHOW_COMMUNICATION
- See Also:
- Constant Field Values
-
ERROR_LED_CONFIG_OFF
public static final int ERROR_LED_CONFIG_OFF
- See Also:
- Constant Field Values
-
ERROR_LED_CONFIG_ON
public static final int ERROR_LED_CONFIG_ON
- See Also:
- Constant Field Values
-
ERROR_LED_CONFIG_SHOW_HEARTBEAT
public static final int ERROR_LED_CONFIG_SHOW_HEARTBEAT
- See Also:
- Constant Field Values
-
ERROR_LED_CONFIG_SHOW_ERROR
public static final int ERROR_LED_CONFIG_SHOW_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_TIMEOUT
public static final int EXCEPTION_CODE_TIMEOUT
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_SUCCESS
public static final int EXCEPTION_CODE_SUCCESS
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_ILLEGAL_FUNCTION
public static final int EXCEPTION_CODE_ILLEGAL_FUNCTION
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_ILLEGAL_DATA_ADDRESS
public static final int EXCEPTION_CODE_ILLEGAL_DATA_ADDRESS
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_ILLEGAL_DATA_VALUE
public static final int EXCEPTION_CODE_ILLEGAL_DATA_VALUE
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_SLAVE_DEVICE_FAILURE
public static final int EXCEPTION_CODE_SLAVE_DEVICE_FAILURE
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_ACKNOWLEDGE
public static final int EXCEPTION_CODE_ACKNOWLEDGE
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_SLAVE_DEVICE_BUSY
public static final int EXCEPTION_CODE_SLAVE_DEVICE_BUSY
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_MEMORY_PARITY_ERROR
public static final int EXCEPTION_CODE_MEMORY_PARITY_ERROR
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_GATEWAY_PATH_UNAVAILABLE
public static final int EXCEPTION_CODE_GATEWAY_PATH_UNAVAILABLE
- See Also:
- Constant Field Values
-
EXCEPTION_CODE_GATEWAY_TARGET_DEVICE_FAILED_TO_RESPOND
public static final int EXCEPTION_CODE_GATEWAY_TARGET_DEVICE_FAILED_TO_RESPOND
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_BOOTLOADER
public static final int BOOTLOADER_MODE_BOOTLOADER
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE
public static final int BOOTLOADER_MODE_FIRMWARE
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_BOOTLOADER_WAIT_FOR_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
public static final int BOOTLOADER_MODE_FIRMWARE_WAIT_FOR_ERASE_AND_REBOOT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_OK
public static final int BOOTLOADER_STATUS_OK
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_INVALID_MODE
public static final int BOOTLOADER_STATUS_INVALID_MODE
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_NO_CHANGE
public static final int BOOTLOADER_STATUS_NO_CHANGE
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
public static final int BOOTLOADER_STATUS_ENTRY_FUNCTION_NOT_PRESENT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
public static final int BOOTLOADER_STATUS_DEVICE_IDENTIFIER_INCORRECT
- See Also:
- Constant Field Values
-
BOOTLOADER_STATUS_CRC_MISMATCH
public static final int BOOTLOADER_STATUS_CRC_MISMATCH
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_OFF
public static final int STATUS_LED_CONFIG_OFF
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_ON
public static final int STATUS_LED_CONFIG_ON
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_SHOW_HEARTBEAT
public static final int STATUS_LED_CONFIG_SHOW_HEARTBEAT
- See Also:
- Constant Field Values
-
STATUS_LED_CONFIG_SHOW_STATUS
public static final int STATUS_LED_CONFIG_SHOW_STATUS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BrickletRS485
public BrickletRS485(java.lang.String uid, IPConnection ipcon)
Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
-
-
Method Detail
-
writeLowLevel
public int writeLowLevel(int messageLength, int messageChunkOffset, char[] messageChunkData) throws TinkerforgeException
Writes characters to the RS485 interface. The characters can be binary data, ASCII or similar is not necessary. The return value is the number of characters that were written. SeesetRS485Configuration(long, int, int, int, int)
for configuration possibilities regarding baudrate, parity and so on.- Throws:
TinkerforgeException
-
readLowLevel
public BrickletRS485.ReadLowLevel readLowLevel(int length) throws TinkerforgeException
Returns up to *length* characters from receive buffer. Instead of polling with this function, you can also use callbacks. But note that this function will return available data only when the read listener is disabled. SeeenableReadCallback()
andBrickletRS485.ReadListener
listener.- Throws:
TinkerforgeException
-
enableReadCallback
public void enableReadCallback() throws TinkerforgeException
Enables theBrickletRS485.ReadListener
listener. This will disable theBrickletRS485.FrameReadableListener
listener. By default the listener is disabled.- Throws:
TinkerforgeException
-
disableReadCallback
public void disableReadCallback() throws TinkerforgeException
Disables theBrickletRS485.ReadListener
listener. By default the listener is disabled.- Throws:
TinkerforgeException
-
isReadCallbackEnabled
public boolean isReadCallbackEnabled() throws TinkerforgeException
Returns *true* if theBrickletRS485.ReadListener
listener is enabled, *false* otherwise.- Throws:
TinkerforgeException
-
setRS485Configuration
public void setRS485Configuration(long baudrate, int parity, int stopbits, int wordlength, int duplex) throws TinkerforgeException
Sets the configuration for the RS485 communication.- Throws:
TinkerforgeException
-
getRS485Configuration
public BrickletRS485.RS485Configuration getRS485Configuration() throws TinkerforgeException
Returns the configuration as set bysetRS485Configuration(long, int, int, int, int)
.- Throws:
TinkerforgeException
-
setModbusConfiguration
public void setModbusConfiguration(int slaveAddress, long masterRequestTimeout) throws TinkerforgeException
Sets the configuration for the RS485 Modbus communication. Available options: * Slave Address: Address to be used as the Modbus slave address in Modbus slave mode. Valid Modbus slave address range is 1 to 247. * Master Request Timeout: Specifies how long the master should wait for a response from a slave when in Modbus master mode.- Throws:
TinkerforgeException
-
getModbusConfiguration
public BrickletRS485.ModbusConfiguration getModbusConfiguration() throws TinkerforgeException
Returns the configuration as set bysetModbusConfiguration(int, long)
.- Throws:
TinkerforgeException
-
setMode
public void setMode(int mode) throws TinkerforgeException
Sets the mode of the Bricklet in which it operates. Available options are * RS485, * Modbus Master RTU and * Modbus Slave RTU.- Throws:
TinkerforgeException
-
getMode
public int getMode() throws TinkerforgeException
Returns the configuration as set bysetMode(int)
.- Throws:
TinkerforgeException
-
setCommunicationLEDConfig
public void setCommunicationLEDConfig(int config) throws TinkerforgeException
Sets the communication LED configuration. By default the LED shows RS485 communication traffic by flickering. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is off.- Throws:
TinkerforgeException
-
getCommunicationLEDConfig
public int getCommunicationLEDConfig() throws TinkerforgeException
Returns the configuration as set bysetCommunicationLEDConfig(int)
- Throws:
TinkerforgeException
-
setErrorLEDConfig
public void setErrorLEDConfig(int config) throws TinkerforgeException
Sets the error LED configuration. By default the error LED turns on if there is any error (seeBrickletRS485.ErrorCountListener
callback). If you call this function with the SHOW ERROR option again, the LED will turn off until the next error occurs. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is off.- Throws:
TinkerforgeException
-
getErrorLEDConfig
public int getErrorLEDConfig() throws TinkerforgeException
Returns the configuration as set bysetErrorLEDConfig(int)
.- Throws:
TinkerforgeException
-
setBufferConfig
public void setBufferConfig(int sendBufferSize, int receiveBufferSize) throws TinkerforgeException
Sets the send and receive buffer size in byte. In sum there is 10240 byte (10KiB) buffer available and the minimum buffer size is 1024 byte (1KiB) for both. The current buffer content is lost if this function is called. The send buffer holds data that was given bywrite(char[])
and could not be written yet. The receive buffer holds data that is received through RS485 but could not yet be send to the user, either byread(int)
or throughBrickletRS485.ReadListener
listener.- Throws:
TinkerforgeException
-
getBufferConfig
public BrickletRS485.BufferConfig getBufferConfig() throws TinkerforgeException
Returns the buffer configuration as set bysetBufferConfig(int, int)
.- Throws:
TinkerforgeException
-
getBufferStatus
public BrickletRS485.BufferStatus getBufferStatus() throws TinkerforgeException
Returns the currently used bytes for the send and received buffer. SeesetBufferConfig(int, int)
for buffer size configuration.- Throws:
TinkerforgeException
-
enableErrorCountCallback
public void enableErrorCountCallback() throws TinkerforgeException
Enables theBrickletRS485.ErrorCountListener
listener. By default the listener is disabled.- Throws:
TinkerforgeException
-
disableErrorCountCallback
public void disableErrorCountCallback() throws TinkerforgeException
Disables theBrickletRS485.ErrorCountListener
listener. By default the listener is disabled.- Throws:
TinkerforgeException
-
isErrorCountCallbackEnabled
public boolean isErrorCountCallbackEnabled() throws TinkerforgeException
Returns *true* if theBrickletRS485.ErrorCountListener
listener is enabled, *false* otherwise.- Throws:
TinkerforgeException
-
getErrorCount
public BrickletRS485.ErrorCount getErrorCount() throws TinkerforgeException
Returns the current number of overrun and parity errors.- Throws:
TinkerforgeException
-
getModbusCommonErrorCount
public BrickletRS485.ModbusCommonErrorCount getModbusCommonErrorCount() throws TinkerforgeException
Returns the current number of errors occurred in Modbus mode. * Timeout Error Count: Number of timeouts occurred. * Checksum Error Count: Number of failures due to Modbus frame CRC16 checksum mismatch. * Frame Too Big Error Count: Number of times frames were rejected because they exceeded maximum Modbus frame size which is 256 bytes. * Illegal Function Error Count: Number of errors when an unimplemented or illegal function is requested. This corresponds to Modbus exception code 1. * Illegal Data Address Error Count: Number of errors due to invalid data address. This corresponds to Modbus exception code 2. * Illegal Data Value Error Count: Number of errors due to invalid data value. This corresponds to Modbus exception code 3. * Slave Device Failure Error Count: Number of errors occurred on the slave device which were unrecoverable. This corresponds to Modbus exception code 4.- Throws:
TinkerforgeException
-
modbusSlaveReportException
public void modbusSlaveReportException(int requestID, int exceptionCode) throws TinkerforgeException
In Modbus slave mode this function can be used to report a Modbus exception for a Modbus master request. * Request ID: Request ID of the request received by the slave. * Exception Code: Modbus exception code to report to the Modbus master.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadCoilsRequestLowLevel
public void modbusSlaveAnswerReadCoilsRequestLowLevel(int requestID, int coilsLength, int coilsChunkOffset, boolean[] coilsChunkData) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read coils. * Request ID: Request ID of the corresponding request that is being answered. * Coils: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadCoilsRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
modbusMasterReadCoils
public int modbusMasterReadCoils(int slaveAddress, long startingAddress, int count) throws TinkerforgeException
In Modbus master mode this function can be used to read coils from a slave. This function creates a Modbus function code 1 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first coil to read. For backwards compatibility reasons this parameter is called Starting Address. It is not an address, but instead a coil number in the range of 1 to 65536. * Count: Number of coils to read. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterReadCoilsResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadHoldingRegistersRequestLowLevel
public void modbusSlaveAnswerReadHoldingRegistersRequestLowLevel(int requestID, int holdingRegistersLength, int holdingRegistersChunkOffset, int[] holdingRegistersChunkData) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read holding registers. * Request ID: Request ID of the corresponding request that is being answered. * Holding Registers: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadHoldingRegistersRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
modbusMasterReadHoldingRegisters
public int modbusMasterReadHoldingRegisters(int slaveAddress, long startingAddress, int count) throws TinkerforgeException
In Modbus master mode this function can be used to read holding registers from a slave. This function creates a Modbus function code 3 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first holding register to read. For backwards compatibility reasons this parameter is called Starting Address. It is not an address, but instead a holding register number in the range of 1 to 65536. The prefix digit 4 (for holding register) is implicit and must be omitted. * Count: Number of holding registers to read. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterReadHoldingRegistersResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerWriteSingleCoilRequest
public void modbusSlaveAnswerWriteSingleCoilRequest(int requestID) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to write a single coil. * Request ID: Request ID of the corresponding request that is being answered. This function must be called from theBrickletRS485.ModbusSlaveWriteSingleCoilRequestListener
listener with the Request ID as provided by the arguments of the listener.- Throws:
TinkerforgeException
-
modbusMasterWriteSingleCoil
public int modbusMasterWriteSingleCoil(int slaveAddress, long coilAddress, boolean coilValue) throws TinkerforgeException
In Modbus master mode this function can be used to write a single coil of a slave. This function creates a Modbus function code 5 request. * Slave Address: Address of the target Modbus slave. * Coil Address: Number of the coil to be written. For backwards compatibility reasons, this parameter is called Starting Address. It is not an address, but instead a coil number in the range of 1 to 65536. * Coil Value: Value to be written. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterWriteSingleCoilResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerWriteSingleRegisterRequest
public void modbusSlaveAnswerWriteSingleRegisterRequest(int requestID) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to write a single register. * Request ID: Request ID of the corresponding request that is being answered. This function must be called from theBrickletRS485.ModbusSlaveWriteSingleRegisterRequestListener
listener with the Request ID, Register Address and Register Value as provided by the arguments of the listener.- Throws:
TinkerforgeException
-
modbusMasterWriteSingleRegister
public int modbusMasterWriteSingleRegister(int slaveAddress, long registerAddress, int registerValue) throws TinkerforgeException
In Modbus master mode this function can be used to write a single holding register of a slave. This function creates a Modbus function code 6 request. * Slave Address: Address of the target Modbus slave. * Register Address: Number of the holding register to be written. For backwards compatibility reasons, this parameter is called Starting Address. It is not an address, but instead a holding register number in the range of 1 to 65536. The prefix digit 4 (for holding register) is implicit and must be omitted. * Register Value: Value to be written. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterWriteSingleRegisterResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerWriteMultipleCoilsRequest
public void modbusSlaveAnswerWriteMultipleCoilsRequest(int requestID) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to write multiple coils. * Request ID: Request ID of the corresponding request that is being answered. This function must be called from theBrickletRS485.ModbusSlaveWriteMultipleCoilsRequestListener
listener with the Request ID of the listener.- Throws:
TinkerforgeException
-
modbusMasterWriteMultipleCoilsLowLevel
public int modbusMasterWriteMultipleCoilsLowLevel(int slaveAddress, long startingAddress, int coilsLength, int coilsChunkOffset, boolean[] coilsChunkData) throws TinkerforgeException
In Modbus master mode this function can be used to write multiple coils of a slave. This function creates a Modbus function code 15 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first coil to write. For backwards compatibility reasons, this parameter is called Starting Address.It is not an address, but instead a coil number in the range of 1 to 65536. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterWriteMultipleCoilsResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerWriteMultipleRegistersRequest
public void modbusSlaveAnswerWriteMultipleRegistersRequest(int requestID) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to write multiple registers. * Request ID: Request ID of the corresponding request that is being answered. This function must be called from theBrickletRS485.ModbusSlaveWriteMultipleRegistersRequestListener
listener with the Request ID of the listener.- Throws:
TinkerforgeException
-
modbusMasterWriteMultipleRegistersLowLevel
public int modbusMasterWriteMultipleRegistersLowLevel(int slaveAddress, long startingAddress, int registersLength, int registersChunkOffset, int[] registersChunkData) throws TinkerforgeException
In Modbus master mode this function can be used to write multiple registers of a slave. This function creates a Modbus function code 16 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first holding register to write. For backwards compatibility reasons, this parameter is called Starting Address. It is not an address, but instead a holding register number in the range of 1 to 65536. The prefix digit 4 (for holding register) is implicit and must be omitted. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterWriteMultipleRegistersResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadDiscreteInputsRequestLowLevel
public void modbusSlaveAnswerReadDiscreteInputsRequestLowLevel(int requestID, int discreteInputsLength, int discreteInputsChunkOffset, boolean[] discreteInputsChunkData) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read discrete inputs. * Request ID: Request ID of the corresponding request that is being answered. * Discrete Inputs: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadDiscreteInputsRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
modbusMasterReadDiscreteInputs
public int modbusMasterReadDiscreteInputs(int slaveAddress, long startingAddress, int count) throws TinkerforgeException
In Modbus master mode this function can be used to read discrete inputs from a slave. This function creates a Modbus function code 2 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first discrete input to read. For backwards compatibility reasons, this parameter is called Starting Address. It is not an address, but instead a discrete input number in the range of 1 to 65536. The prefix digit 1 (for discrete input) is implicit and must be omitted. * Count: Number of discrete inputs to read. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterReadDiscreteInputsResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadInputRegistersRequestLowLevel
public void modbusSlaveAnswerReadInputRegistersRequestLowLevel(int requestID, int inputRegistersLength, int inputRegistersChunkOffset, int[] inputRegistersChunkData) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read input registers. * Request ID: Request ID of the corresponding request that is being answered. * Input Registers: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadInputRegistersRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
modbusMasterReadInputRegisters
public int modbusMasterReadInputRegisters(int slaveAddress, long startingAddress, int count) throws TinkerforgeException
In Modbus master mode this function can be used to read input registers from a slave. This function creates a Modbus function code 4 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first input register to read. For backwards compatibility reasons, this parameter is called Starting Address. It is not an address, but instead an input register number in the range of 1 to 65536. The prefix digit 3 (for input register) is implicit and must be omitted. * Count: Number of input registers to read. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterReadInputRegistersResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
setFrameReadableCallbackConfiguration
public void setFrameReadableCallbackConfiguration(int frameSize) throws TinkerforgeException
Configures theBrickletRS485.FrameReadableListener
listener. The frame size is the number of bytes, that have to be readable to trigger the listener. A frame size of 0 disables the listener. A frame size greater than 0 enables the listener and disables theBrickletRS485.ReadListener
listener. By default the listener is disabled. .. versionadded:: 2.0.5$nbsp;(Plugin)- Throws:
TinkerforgeException
-
getFrameReadableCallbackConfiguration
public int getFrameReadableCallbackConfiguration() throws TinkerforgeException
Returns the listener configuration as set bysetFrameReadableCallbackConfiguration(int)
. .. versionadded:: 2.0.5$nbsp;(Plugin)- Throws:
TinkerforgeException
-
getSPITFPErrorCount
public BrickletRS485.SPITFPErrorCount getSPITFPErrorCount() throws TinkerforgeException
Returns the error count for the communication between Brick and Bricklet. The errors are divided into * ACK checksum errors, * message checksum errors, * framing errors and * overflow errors. The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.- Throws:
TinkerforgeException
-
setBootloaderMode
public int setBootloaderMode(int mode) throws TinkerforgeException
Sets the bootloader mode and returns the status after the requested mode change was instigated. You can change from bootloader mode to firmware mode and vice versa. A change from bootloader mode to firmware mode will only take place if the entry function, device identifier and CRC are present and correct. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
getBootloaderMode
public int getBootloaderMode() throws TinkerforgeException
Returns the current bootloader mode, seesetBootloaderMode(int)
.- Throws:
TinkerforgeException
-
setWriteFirmwarePointer
public void setWriteFirmwarePointer(long pointer) throws TinkerforgeException
Sets the firmware pointer forwriteFirmware(int[])
. The pointer has to be increased by chunks of size 64. The data is written to flash every 4 chunks (which equals to one page of size 256). This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
writeFirmware
public int writeFirmware(int[] data) throws TinkerforgeException
Writes 64 Bytes of firmware at the position as written bysetWriteFirmwarePointer(long)
before. The firmware is written to flash every 4 chunks. You can only write firmware in bootloader mode. This function is used by Brick Viewer during flashing. It should not be necessary to call it in a normal user program.- Throws:
TinkerforgeException
-
setStatusLEDConfig
public void setStatusLEDConfig(int config) throws TinkerforgeException
Sets the status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.- Throws:
TinkerforgeException
-
getStatusLEDConfig
public int getStatusLEDConfig() throws TinkerforgeException
Returns the configuration as set bysetStatusLEDConfig(int)
- Throws:
TinkerforgeException
-
getChipTemperature
public int getChipTemperature() throws TinkerforgeException
Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature! The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.- Throws:
TinkerforgeException
-
reset
public void reset() throws TinkerforgeException
Calling this function will reset the Bricklet. All configurations will be lost. After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!- Throws:
TinkerforgeException
-
writeUID
public void writeUID(long uid) throws TinkerforgeException
Writes a new UID into flash. If you want to set a new UID you have to decode the Base58 encoded UID string into an integer first. We recommend that you use Brick Viewer to change the UID.- Throws:
TinkerforgeException
-
readUID
public long readUID() throws TinkerforgeException
Returns the current UID as an integer. Encode as Base58 to get the usual string version.- Throws:
TinkerforgeException
-
getIdentity
public Device.Identity getIdentity() throws TinkerforgeException
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|- Specified by:
getIdentity
in classDevice
- Throws:
TinkerforgeException
-
write
public int write(char[] message) throws TinkerforgeException
Writes characters to the RS485 interface. The characters can be binary data, ASCII or similar is not necessary. The return value is the number of characters that were written. SeesetRS485Configuration(long, int, int, int, int)
for configuration possibilities regarding baudrate, parity and so on.- Throws:
TinkerforgeException
-
read
public char[] read(int length) throws TinkerforgeException
Returns up to *length* characters from receive buffer. Instead of polling with this function, you can also use callbacks. But note that this function will return available data only when the read listener is disabled. SeeenableReadCallback()
andBrickletRS485.ReadListener
listener.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadCoilsRequest
public void modbusSlaveAnswerReadCoilsRequest(int requestID, boolean[] coils) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read coils. * Request ID: Request ID of the corresponding request that is being answered. * Coils: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadCoilsRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadHoldingRegistersRequest
public void modbusSlaveAnswerReadHoldingRegistersRequest(int requestID, int[] holdingRegisters) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read holding registers. * Request ID: Request ID of the corresponding request that is being answered. * Holding Registers: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadHoldingRegistersRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
modbusMasterWriteMultipleCoils
public int modbusMasterWriteMultipleCoils(int slaveAddress, long startingAddress, boolean[] coils) throws TinkerforgeException
In Modbus master mode this function can be used to write multiple coils of a slave. This function creates a Modbus function code 15 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first coil to write. For backwards compatibility reasons, this parameter is called Starting Address.It is not an address, but instead a coil number in the range of 1 to 65536. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterWriteMultipleCoilsResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusMasterWriteMultipleRegisters
public int modbusMasterWriteMultipleRegisters(int slaveAddress, long startingAddress, int[] registers) throws TinkerforgeException
In Modbus master mode this function can be used to write multiple registers of a slave. This function creates a Modbus function code 16 request. * Slave Address: Address of the target Modbus slave. * Starting Address: Number of the first holding register to write. For backwards compatibility reasons, this parameter is called Starting Address. It is not an address, but instead a holding register number in the range of 1 to 65536. The prefix digit 4 (for holding register) is implicit and must be omitted. Upon success the function will return a non-zero request ID which will represent the current request initiated by the Modbus master. In case of failure the returned request ID will be 0. When successful this function will also invoke theBrickletRS485.ModbusMasterWriteMultipleRegistersResponseListener
callback. In this listener the Request ID provided by the listener argument must be matched with the Request ID returned from this function to verify that the listener is indeed for a particular request.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadDiscreteInputsRequest
public void modbusSlaveAnswerReadDiscreteInputsRequest(int requestID, boolean[] discreteInputs) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read discrete inputs. * Request ID: Request ID of the corresponding request that is being answered. * Discrete Inputs: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadDiscreteInputsRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
modbusSlaveAnswerReadInputRegistersRequest
public void modbusSlaveAnswerReadInputRegistersRequest(int requestID, int[] inputRegisters) throws TinkerforgeException
In Modbus slave mode this function can be used to answer a master request to read input registers. * Request ID: Request ID of the corresponding request that is being answered. * Input Registers: Data that is to be sent to the Modbus master for the corresponding request. This function must be called from theBrickletRS485.ModbusSlaveReadInputRegistersRequestListener
listener with the Request ID as provided by the argument of the listener.- Throws:
TinkerforgeException
-
addReadLowLevelListener
public void addReadLowLevelListener(BrickletRS485.ReadLowLevelListener listener)
Adds a ReadLowLevel listener.
-
removeReadLowLevelListener
public void removeReadLowLevelListener(BrickletRS485.ReadLowLevelListener listener)
Removes a ReadLowLevel listener.
-
addErrorCountListener
public void addErrorCountListener(BrickletRS485.ErrorCountListener listener)
Adds a ErrorCount listener.
-
removeErrorCountListener
public void removeErrorCountListener(BrickletRS485.ErrorCountListener listener)
Removes a ErrorCount listener.
-
addModbusSlaveReadCoilsRequestListener
public void addModbusSlaveReadCoilsRequestListener(BrickletRS485.ModbusSlaveReadCoilsRequestListener listener)
Adds a ModbusSlaveReadCoilsRequest listener.
-
removeModbusSlaveReadCoilsRequestListener
public void removeModbusSlaveReadCoilsRequestListener(BrickletRS485.ModbusSlaveReadCoilsRequestListener listener)
Removes a ModbusSlaveReadCoilsRequest listener.
-
addModbusMasterReadCoilsResponseLowLevelListener
public void addModbusMasterReadCoilsResponseLowLevelListener(BrickletRS485.ModbusMasterReadCoilsResponseLowLevelListener listener)
Adds a ModbusMasterReadCoilsResponseLowLevel listener.
-
removeModbusMasterReadCoilsResponseLowLevelListener
public void removeModbusMasterReadCoilsResponseLowLevelListener(BrickletRS485.ModbusMasterReadCoilsResponseLowLevelListener listener)
Removes a ModbusMasterReadCoilsResponseLowLevel listener.
-
addModbusSlaveReadHoldingRegistersRequestListener
public void addModbusSlaveReadHoldingRegistersRequestListener(BrickletRS485.ModbusSlaveReadHoldingRegistersRequestListener listener)
Adds a ModbusSlaveReadHoldingRegistersRequest listener.
-
removeModbusSlaveReadHoldingRegistersRequestListener
public void removeModbusSlaveReadHoldingRegistersRequestListener(BrickletRS485.ModbusSlaveReadHoldingRegistersRequestListener listener)
Removes a ModbusSlaveReadHoldingRegistersRequest listener.
-
addModbusMasterReadHoldingRegistersResponseLowLevelListener
public void addModbusMasterReadHoldingRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseLowLevelListener listener)
Adds a ModbusMasterReadHoldingRegistersResponseLowLevel listener.
-
removeModbusMasterReadHoldingRegistersResponseLowLevelListener
public void removeModbusMasterReadHoldingRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseLowLevelListener listener)
Removes a ModbusMasterReadHoldingRegistersResponseLowLevel listener.
-
addModbusSlaveWriteSingleCoilRequestListener
public void addModbusSlaveWriteSingleCoilRequestListener(BrickletRS485.ModbusSlaveWriteSingleCoilRequestListener listener)
Adds a ModbusSlaveWriteSingleCoilRequest listener.
-
removeModbusSlaveWriteSingleCoilRequestListener
public void removeModbusSlaveWriteSingleCoilRequestListener(BrickletRS485.ModbusSlaveWriteSingleCoilRequestListener listener)
Removes a ModbusSlaveWriteSingleCoilRequest listener.
-
addModbusMasterWriteSingleCoilResponseListener
public void addModbusMasterWriteSingleCoilResponseListener(BrickletRS485.ModbusMasterWriteSingleCoilResponseListener listener)
Adds a ModbusMasterWriteSingleCoilResponse listener.
-
removeModbusMasterWriteSingleCoilResponseListener
public void removeModbusMasterWriteSingleCoilResponseListener(BrickletRS485.ModbusMasterWriteSingleCoilResponseListener listener)
Removes a ModbusMasterWriteSingleCoilResponse listener.
-
addModbusSlaveWriteSingleRegisterRequestListener
public void addModbusSlaveWriteSingleRegisterRequestListener(BrickletRS485.ModbusSlaveWriteSingleRegisterRequestListener listener)
Adds a ModbusSlaveWriteSingleRegisterRequest listener.
-
removeModbusSlaveWriteSingleRegisterRequestListener
public void removeModbusSlaveWriteSingleRegisterRequestListener(BrickletRS485.ModbusSlaveWriteSingleRegisterRequestListener listener)
Removes a ModbusSlaveWriteSingleRegisterRequest listener.
-
addModbusMasterWriteSingleRegisterResponseListener
public void addModbusMasterWriteSingleRegisterResponseListener(BrickletRS485.ModbusMasterWriteSingleRegisterResponseListener listener)
Adds a ModbusMasterWriteSingleRegisterResponse listener.
-
removeModbusMasterWriteSingleRegisterResponseListener
public void removeModbusMasterWriteSingleRegisterResponseListener(BrickletRS485.ModbusMasterWriteSingleRegisterResponseListener listener)
Removes a ModbusMasterWriteSingleRegisterResponse listener.
-
addModbusSlaveWriteMultipleCoilsRequestLowLevelListener
public void addModbusSlaveWriteMultipleCoilsRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestLowLevelListener listener)
Adds a ModbusSlaveWriteMultipleCoilsRequestLowLevel listener.
-
removeModbusSlaveWriteMultipleCoilsRequestLowLevelListener
public void removeModbusSlaveWriteMultipleCoilsRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestLowLevelListener listener)
Removes a ModbusSlaveWriteMultipleCoilsRequestLowLevel listener.
-
addModbusMasterWriteMultipleCoilsResponseListener
public void addModbusMasterWriteMultipleCoilsResponseListener(BrickletRS485.ModbusMasterWriteMultipleCoilsResponseListener listener)
Adds a ModbusMasterWriteMultipleCoilsResponse listener.
-
removeModbusMasterWriteMultipleCoilsResponseListener
public void removeModbusMasterWriteMultipleCoilsResponseListener(BrickletRS485.ModbusMasterWriteMultipleCoilsResponseListener listener)
Removes a ModbusMasterWriteMultipleCoilsResponse listener.
-
addModbusSlaveWriteMultipleRegistersRequestLowLevelListener
public void addModbusSlaveWriteMultipleRegistersRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestLowLevelListener listener)
Adds a ModbusSlaveWriteMultipleRegistersRequestLowLevel listener.
-
removeModbusSlaveWriteMultipleRegistersRequestLowLevelListener
public void removeModbusSlaveWriteMultipleRegistersRequestLowLevelListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestLowLevelListener listener)
Removes a ModbusSlaveWriteMultipleRegistersRequestLowLevel listener.
-
addModbusMasterWriteMultipleRegistersResponseListener
public void addModbusMasterWriteMultipleRegistersResponseListener(BrickletRS485.ModbusMasterWriteMultipleRegistersResponseListener listener)
Adds a ModbusMasterWriteMultipleRegistersResponse listener.
-
removeModbusMasterWriteMultipleRegistersResponseListener
public void removeModbusMasterWriteMultipleRegistersResponseListener(BrickletRS485.ModbusMasterWriteMultipleRegistersResponseListener listener)
Removes a ModbusMasterWriteMultipleRegistersResponse listener.
-
addModbusSlaveReadDiscreteInputsRequestListener
public void addModbusSlaveReadDiscreteInputsRequestListener(BrickletRS485.ModbusSlaveReadDiscreteInputsRequestListener listener)
Adds a ModbusSlaveReadDiscreteInputsRequest listener.
-
removeModbusSlaveReadDiscreteInputsRequestListener
public void removeModbusSlaveReadDiscreteInputsRequestListener(BrickletRS485.ModbusSlaveReadDiscreteInputsRequestListener listener)
Removes a ModbusSlaveReadDiscreteInputsRequest listener.
-
addModbusMasterReadDiscreteInputsResponseLowLevelListener
public void addModbusMasterReadDiscreteInputsResponseLowLevelListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseLowLevelListener listener)
Adds a ModbusMasterReadDiscreteInputsResponseLowLevel listener.
-
removeModbusMasterReadDiscreteInputsResponseLowLevelListener
public void removeModbusMasterReadDiscreteInputsResponseLowLevelListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseLowLevelListener listener)
Removes a ModbusMasterReadDiscreteInputsResponseLowLevel listener.
-
addModbusSlaveReadInputRegistersRequestListener
public void addModbusSlaveReadInputRegistersRequestListener(BrickletRS485.ModbusSlaveReadInputRegistersRequestListener listener)
Adds a ModbusSlaveReadInputRegistersRequest listener.
-
removeModbusSlaveReadInputRegistersRequestListener
public void removeModbusSlaveReadInputRegistersRequestListener(BrickletRS485.ModbusSlaveReadInputRegistersRequestListener listener)
Removes a ModbusSlaveReadInputRegistersRequest listener.
-
addModbusMasterReadInputRegistersResponseLowLevelListener
public void addModbusMasterReadInputRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadInputRegistersResponseLowLevelListener listener)
Adds a ModbusMasterReadInputRegistersResponseLowLevel listener.
-
removeModbusMasterReadInputRegistersResponseLowLevelListener
public void removeModbusMasterReadInputRegistersResponseLowLevelListener(BrickletRS485.ModbusMasterReadInputRegistersResponseLowLevelListener listener)
Removes a ModbusMasterReadInputRegistersResponseLowLevel listener.
-
addFrameReadableListener
public void addFrameReadableListener(BrickletRS485.FrameReadableListener listener)
Adds a FrameReadable listener.
-
removeFrameReadableListener
public void removeFrameReadableListener(BrickletRS485.FrameReadableListener listener)
Removes a FrameReadable listener.
-
addReadListener
public void addReadListener(BrickletRS485.ReadListener listener)
Adds a Read listener.
-
removeReadListener
public void removeReadListener(BrickletRS485.ReadListener listener)
Removes a Read listener.
-
addModbusMasterReadCoilsResponseListener
public void addModbusMasterReadCoilsResponseListener(BrickletRS485.ModbusMasterReadCoilsResponseListener listener)
Adds a ModbusMasterReadCoilsResponse listener.
-
removeModbusMasterReadCoilsResponseListener
public void removeModbusMasterReadCoilsResponseListener(BrickletRS485.ModbusMasterReadCoilsResponseListener listener)
Removes a ModbusMasterReadCoilsResponse listener.
-
addModbusMasterReadHoldingRegistersResponseListener
public void addModbusMasterReadHoldingRegistersResponseListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseListener listener)
Adds a ModbusMasterReadHoldingRegistersResponse listener.
-
removeModbusMasterReadHoldingRegistersResponseListener
public void removeModbusMasterReadHoldingRegistersResponseListener(BrickletRS485.ModbusMasterReadHoldingRegistersResponseListener listener)
Removes a ModbusMasterReadHoldingRegistersResponse listener.
-
addModbusSlaveWriteMultipleCoilsRequestListener
public void addModbusSlaveWriteMultipleCoilsRequestListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestListener listener)
Adds a ModbusSlaveWriteMultipleCoilsRequest listener.
-
removeModbusSlaveWriteMultipleCoilsRequestListener
public void removeModbusSlaveWriteMultipleCoilsRequestListener(BrickletRS485.ModbusSlaveWriteMultipleCoilsRequestListener listener)
Removes a ModbusSlaveWriteMultipleCoilsRequest listener.
-
addModbusSlaveWriteMultipleRegistersRequestListener
public void addModbusSlaveWriteMultipleRegistersRequestListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestListener listener)
Adds a ModbusSlaveWriteMultipleRegistersRequest listener.
-
removeModbusSlaveWriteMultipleRegistersRequestListener
public void removeModbusSlaveWriteMultipleRegistersRequestListener(BrickletRS485.ModbusSlaveWriteMultipleRegistersRequestListener listener)
Removes a ModbusSlaveWriteMultipleRegistersRequest listener.
-
addModbusMasterReadDiscreteInputsResponseListener
public void addModbusMasterReadDiscreteInputsResponseListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseListener listener)
Adds a ModbusMasterReadDiscreteInputsResponse listener.
-
removeModbusMasterReadDiscreteInputsResponseListener
public void removeModbusMasterReadDiscreteInputsResponseListener(BrickletRS485.ModbusMasterReadDiscreteInputsResponseListener listener)
Removes a ModbusMasterReadDiscreteInputsResponse listener.
-
addModbusMasterReadInputRegistersResponseListener
public void addModbusMasterReadInputRegistersResponseListener(BrickletRS485.ModbusMasterReadInputRegistersResponseListener listener)
Adds a ModbusMasterReadInputRegistersResponse listener.
-
removeModbusMasterReadInputRegistersResponseListener
public void removeModbusMasterReadInputRegistersResponseListener(BrickletRS485.ModbusMasterReadInputRegistersResponseListener listener)
Removes a ModbusMasterReadInputRegistersResponse listener.
-
-