public class FieldConnector extends java.lang.Object implements DataPointListener
listeners| Modifier and Type | Method and Description |
|---|---|
static void |
createRegister(java.lang.String pathToFile)
read the csv-file of the ModbusMap
|
static FieldConnector |
getMySelf()
static method to create a singleton pattern of the class
checks if an instance of the class is already made
if not, it creates an instance of the class FieldConnector
|
void |
initialize(java.lang.String host,
int port,
java.lang.String pathToFile)
this method initialize the fieldConnector
it connects the ModbusAccessor, reads the csv-file of the ModbusMap
and starts the periodical polling of the modbus registers
|
void |
onNewValue(DataPoint dp) |
void |
startPeriodicalPolling()
method to start a periodical task
in our case it is the reading of the modbus registers
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubscribeUpdatepublic static FieldConnector getMySelf()
public static void createRegister(java.lang.String pathToFile)
pathToFile - path to the file of all modbus registers (C:/.../ModbusMap.csv)public void initialize(java.lang.String host,
int port,
java.lang.String pathToFile)
host - ip address of the serverport - port of the serverpathToFile - path to the file of all modbus registers (C:/.../ModbusMap.csv)public void onNewValue(DataPoint dp)
onNewValue in interface DataPointListenerpublic void startPeriodicalPolling()