master
erzhongxmu 2022-10-22 17:45:13 +08:00
parent 570de63645
commit 81f90d1e9a
1 changed files with 12 additions and 1 deletions

View File

@ -243,15 +243,26 @@ public class WmsPlcController extends BaseController {
} }
} }
else if(split[0].equals("float")){ else if(split[0].equals("float")){
Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
System.out.println("runfloat"+Math.abs(runfloat));
siemensS7Net.Write(defaultAddress,runfloat);
}
else if(split[0].equals("-float")){
Float runfloat = Float.parseFloat(split[2]) * stepNumrun; Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
System.out.println("runfloat"+runfloat); System.out.println("runfloat"+runfloat);
siemensS7Net.Write(defaultAddress,runfloat); siemensS7Net.Write(defaultAddress,runfloat);
} }
else if(split[0].equals("int")){ else if(split[0].equals("int")){
Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
Float abs = Math.abs(runfloat);
int runint = abs.intValue();
System.out.println("runint"+runint);
siemensS7Net.Write(defaultAddress,runint);
}
else if(split[0].equals("-int")){
Float runfloat = Float.parseFloat(split[2]) * stepNumrun; Float runfloat = Float.parseFloat(split[2]) * stepNumrun;
int runint = runfloat.intValue(); int runint = runfloat.intValue();
System.out.println("runint"+runint); System.out.println("runint"+runint);
siemensS7Net.Write(defaultAddress,runint); siemensS7Net.Write(defaultAddress,runint);
} }
} }