changed the field component, made some test and added some comments
This commit is contained in:
@@ -7,28 +7,16 @@ import ch.hevs.isi.field.FloatRegister;
|
||||
public class Field {
|
||||
public static void main(String[] args) {
|
||||
|
||||
//create an FieldConnector
|
||||
//reads the datapoint values and displays them in the consol
|
||||
FieldConnector.getMySelf().initialize("LocalHost", 1502,"src/main/resources/ModbusMap.csv");
|
||||
|
||||
//FloatRegister fRI = new FloatRegister("GRID_U_FLOAT",false,89);
|
||||
BooleanRegister bRI = new BooleanRegister("SOLAR_CONNECT_ST", false ,609);
|
||||
FieldConnector.getMySelf().startPeriodicalPolling();
|
||||
//create two datapoint to write a new value to them
|
||||
BooleanDataPoint solarPanel = new BooleanDataPoint("REMOTE_SOLAR_SW", true);
|
||||
FloatDataPoint remoteFactorySp = new FloatDataPoint("REMOTE_FACTORY_SP", true);
|
||||
|
||||
//FloatRegister fRO = new FloatRegister("REMOTE_FACTORY_SP",true,205);
|
||||
BooleanRegister bRO = new BooleanRegister("REMOTE_SOLAR_SW", true ,401);
|
||||
|
||||
/*
|
||||
fRO.fdp.setValue(0.8F);
|
||||
bRO.bdp.setValue(true);
|
||||
*/
|
||||
|
||||
while(true)
|
||||
{
|
||||
/*
|
||||
float value = fRI.dataPoint.getValue()*1000;
|
||||
System.out.println(value);
|
||||
*/
|
||||
/*
|
||||
System.out.println(bRI.bdp.getValue());
|
||||
*/
|
||||
}
|
||||
//write to values
|
||||
remoteFactorySp.setValue(0.74f);
|
||||
solarPanel.setValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user