started smartcontrol
This commit is contained in:
@@ -75,9 +75,9 @@ public class FieldConnector implements DataPointListener {
|
||||
* @param pathToFile path to the file of all modbus registers (C:/.../ModbusMap.csv)
|
||||
*/
|
||||
public void initialize(String host, int port, String pathToFile){
|
||||
ModbusAccessor.getMySelf().connect(host,port);
|
||||
createRegister(pathToFile);
|
||||
startPeriodicalPolling();
|
||||
ModbusAccessor.getMySelf().connect(host,port); //connect with Modbus
|
||||
createRegister(pathToFile); //read the csv file of the modbus registers
|
||||
startPeriodicalPolling(); //start periodical reading of the float values
|
||||
}
|
||||
private void pushToField(String label, String value){
|
||||
System.out.println("Field: " + label + " " + value);
|
||||
@@ -96,6 +96,6 @@ public class FieldConnector implements DataPointListener {
|
||||
public void startPeriodicalPolling(){
|
||||
Timer pollTimer = new Timer();
|
||||
PollTask pollTask = new PollTask();
|
||||
pollTimer.scheduleAtFixedRate(pollTask,0,100);
|
||||
pollTimer.scheduleAtFixedRate(pollTask,0,2000);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user