BakeoutController-Basic  0.1
A Controller for the Omicron vacuum chamber
Public Member Functions | List of all members
kernel.modbus.ModbusConnector Interface Reference
Inheritance diagram for kernel.modbus.ModbusConnector:
Inheritance graph
[legend]

Public Member Functions

ModbusPortConfiguration getPortConfiguration ()
 
void setPortConfiguration (ModbusPortConfiguration configuration)
 
Boolean isPortOpen ()
 
ModbusTransaction getTransactionForRequest (ModbusRequest request) throws WrappedModbusException, IllegalStateException
 
Float parseFloatFromResponse (ModbusMessage response) throws ClassCastException, IOException
 
String parseStringFromResponse (ModbusMessage response) throws ClassCastException, IOException
 
void close ()
 

Detailed Description

Contains methods for working with MODBUS over RS232

Definition at line 12 of file ModbusConnector.java.

Member Function Documentation

void kernel.modbus.ModbusConnector.close ( )

Close the connection

Implemented in kernel.modbus.ModBusConnectionManager.

ModbusPortConfiguration kernel.modbus.ModbusConnector.getPortConfiguration ( )
Returns
The current desired port configuration

Implemented in kernel.modbus.ModBusConnectionManager.

ModbusTransaction kernel.modbus.ModbusConnector.getTransactionForRequest ( ModbusRequest  request) throws WrappedModbusException, IllegalStateException
Parameters
requestThe request for which a transaction is required
Returns
The transaction that, when executed, will perform the desired request
Exceptions
WrappedModbusExceptionIf the transaction cannot be created due to a MODBUS error
IllegalStateExceptionIf the transaction cannot be created due to a condition not being met. For instance, this should be thrown if the transaction is attempted to be created without a valid connection

Implemented in kernel.modbus.ModBusConnectionManager.

Boolean kernel.modbus.ModbusConnector.isPortOpen ( )
Returns
True if the port managed by this connector, otherwise false.

Implemented in kernel.modbus.ModBusConnectionManager.

Float kernel.modbus.ModbusConnector.parseFloatFromResponse ( ModbusMessage  response) throws ClassCastException, IOException

With a response consisting of two 16-bit words, parse this response into an IEEE 754 single-precision floating-point number

Parameters
responseThe response received from the transaction
Returns
The data cast into a floating point number
Exceptions
ClassCastExceptionIf the ModbusMessage cannot be cast to a com.ghgande.j2mod.modbus.msg.ModbusResponse. This is a required step in order to get the response's output stream
IOExceptionIf the output stream from the response cannot be parsed into a float

Implemented in kernel.modbus.ModBusConnectionManager.

String kernel.modbus.ModbusConnector.parseStringFromResponse ( ModbusMessage  response) throws ClassCastException, IOException

Take a com.ghgande.j2mod.modbus.msg.ModbusResponse, retrieve a string from its data package, and return the string

Parameters
responseThe response from which a string is to be parsed
Returns
The response
Exceptions
ClassCastExceptionIf the argument of type ModbusMessage cannot be cast to a com.ghgande.j2mod.modbus.msg.ModbusResponse
IOExceptionIf a string cannot be retrieved from the response

Implemented in kernel.modbus.ModBusConnectionManager.

void kernel.modbus.ModbusConnector.setPortConfiguration ( ModbusPortConfiguration  configuration)
Parameters
configurationThe desired port configuration

Implemented in kernel.modbus.ModBusConnectionManager.


The documentation for this interface was generated from the following file:
Git Repo