R= #V09 # LEILING His Script protocol ID:OI2465693 # Related global variables verCode="09" sk=""# setkey sv=""# setvalue d0=""# paramdata0 y2=""# Modbus slave address y1=""# transmitdata f2=0.1 f3=0.1 f4=0.1 f5=0.1 t0="" t1="" t2="" t3="" t4="" t5="" t6="" crc16=0 vs=0 gkey="" str1="" i=0 dt=0 dt1=0 len=0 rev1=0 rev=0 cc="" gcmd="" i1=0 i2=0 i3=0 i4=0 i5=0 c1="" x="" p_offset=0 p_cnt=0 week1_1=0 week1_2=0 week1_3=0 week1_4=0 week1_5=0 week1_6=0 week1_7=0 week2_1=0 week2_2=0 week2_3=0 week2_4=0 week2_5=0 week2_6=0 week2_7=0 week3_1=0 week3_2=0 week3_3=0 week3_4=0 week3_5=0 week3_6=0 week3_7=0 week4_1=0 week4_2=0 week4_3=0 week4_4=0 week4_5=0 week4_6=0 week4_7=0 week5_1=0 week5_2=0 week5_3=0 week5_4=0 week5_5=0 week5_6=0 week5_7=0 week6_1=0 week6_2=0 week6_3=0 week6_4=0 week6_5=0 week6_6=0 week6_7=0 week7_1=0 week7_2=0 week7_3=0 week7_4=0 week7_5=0 week7_6=0 week7_7=0 week8_1=0 week8_2=0 week8_3=0 week8_4=0 week8_5=0 week8_6=0 week8_7=0 week9_1=0 week9_2=0 week9_3=0 week9_4=0 week9_5=0 week9_6=0 week9_7=0 week10_1=0 week10_2=0 week10_3=0 week10_4=0 week10_5=0 week10_6=0 week10_7=0 # getcmd table x1=[0x01,0x03,0x00,0x00,0x00,0x46,0xC4,0x38] x2=[0x01,0x04,0x01,0xC0,0x00,0x33,0xB1,0xDF] x3=[0x01,0x04,0x00,0x00,0x00,0x7D,0x30,0x2B] x4=[0x01,0x04,0x00,0x7E,0x00,0x1C,0x91,0xDB] x5=[0x01,0x04,0x00,0xFA,0x00,0x70,0xD1,0xDF] x6=[0x01,0x04,0x01,0x7B,0x00,0x34,0x80,0x38] x7=[0x01,0x03,0x00,0x58,0x00,0x01,0x05,0xD9] x8=[0x01,0x03,0x0B,0xB8,0x00,0x62,0x46,0x22] x9=[0x01,0x03,0x00,0xDA,0x00,0x09,0xA4,0x37] x10=[0x01,0x03,0x00,0xFB,0x00,0x1E,0xB4,0x33] x11=[0x01,0x03,0x01,0x4B,0x00,0x01,0xF5,0xE0] x12=[0x01,0x03,0x00,0xD3,0x00,0x03,0xF4,0x32] x13=[0x01,0x03,0x00,0x7D,0x00,0x16,0x54,0x1C] x14=[0x01,0x03,0x00,0x45,0x00,0x29,0x95,0xC1] x15=[0x01,0x03,0x00,0xBD,0x00,0x01,0x14,0x2E] x16=[0x01,0x04,0x00,0x20,0x00,0x03,0xB1,0xC1] x17=[0x01,0x04,0x00,0x21,0x00,0x03,0xE0,0x01] # Modbus function 0x06:set attribute y0=[0x01,0x06,0x00] # set sigal data FUNCTION gt1() A=1000 t0="" t0=y0.insertAt(2,y2) t1=t0.insertAt(5,y1) END FUNCTION add(type,num) IF(type==1) i1=INPUT.charAt(num) i2=INPUT.charAt(num+1) f3=((i1<<8)+i2)*0.1 END IF(type==2) i1=INPUT.charAt(num) i2=INPUT.charAt(num+1) f3=((i1<<8)+i2)*0.01 END IF(type==3) i1=INPUT.charAt(num) i2=INPUT.charAt(num+1) i3=INPUT.charAt(num+2) i4=INPUT.charAt(num+3) f5=((i1<<24)+(i2<<16)+(i3<<8)+i4)*0.1 END IF(type==4) i1=INPUT.charAt(num) i2=INPUT.charAt(num+1) i3=((i1<<8)+i2) END END FUNCTION add8(num) i=0 c1="" WHILE(i<16) i1=INPUT.charAt(num+i) i2=INPUT.charAt(num+i+1) i3=(i1<<8)+i2 c1=c1+i3.prtString()+" " i=i+2 END END FUNCTION enuma() IF(d0=="0") y1=[0x00] END IF(d0=="1") y1=[0x01] END IF(d0=="2") y1=[0x02] END IF(d0=="3") y1=[0x03] END IF(d0=="4") y1=[0x04] END IF(d0=="5") y1=[0x05] END IF(d0=="6") y1=[0x06] END IF(d0=="7") y1=[0x07] END IF(d0=="8") y1=[0x08] END IF(d0=="9") y1=[0x09] END IF(d0=="10") y1=[0x0A] END gt1() ydc() END # LSB Priority FUNCTION ydc() A=2000 t6="" len=t1.length() i=0 WHILE(i>22)&0x3F min=(time>>16)&0x3F t1=d1+hour.toString(0,0)+min.toString(0,0) ydc() END FUNCTION gdea() time_s="" i=0 time=0 date=0 date_s="" len=0 index=0 rev1=0 rev=0 year=0 mon=0 day=0 hour=0 min=0 sec=0 len=d0.length() index=d0.indexOf("-") date_s=d0.subString(0,index) len=date_s.length() WHILE(i>16)&0xFFFF year=year-2000 mon=(date>>8)&0xFF day=date&0xFF i=0 len=d0.length() time_s=d0.subString(index+1,len) len=time_s.length() WHILE(i>22)&0x3F min=(time>>16)&0x3F sec=(time>>10)&0x3F t1=d1+year.toString(1,0)+mon.toString(1,0)+day.toString(1,0)+hour.toString(1,0)+min.toString(1,0)+sec.toString(1,0) ydc() END FUNCTION gdt() i=0 dt=0 dt1=0 len=d0.length() IF END WHILE(i=0) dt1=dt1*10+dt END IF(dt<0) p_offset=len-i-1 END i=i+1 END IF(p_offset==2) IF(p_cnt==1) dt1=dt1/10 END END p_cnt=0 str1=dt1.toString(1,0) END FUNCTION gtm() a=hour<<22 b=min<<16 c=sec<<10 d=year<<16 e=mon<<8 f=day sls_d=d+e+f sls_t=a+b+c sls_y=sls_d.prtString() sls_z=sls_t.prtString() sls=sls_y+"-"+sls_z sf=sls END # check verCode RECV L checkversion SEND(L,returnversion,verCode) RETURN(FALSE) END # get cmd RECV L getcmd x=INPUT RETURN(FALSE) END # get data RECV L getdata A=100 IF(x==x1) # 00 00 A=1 i1=INPUT.charAt(7) i2=INPUT.charAt(8) i3=i1*256+i2 SEND(L,deviceType2,i3) c1=INPUT.subString(59,65) SEND(L,firmwareVersion,c1) c1=INPUT.subString(65,71) SEND(L,armFirmwareVersionName,c1) c1=INPUT.subString(71,79) SEND(L,dspSoftwareVersionName,c1) i1=INPUT.charAt(119) i2=INPUT.charAt(120) i3=i1*256+i2 SEND(L,modbusProtocolVersion,i3) add(3,129) SEND(L,ratedPower,f5) i1=INPUT.charAt(3) i2=INPUT.charAt(4) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,remoteSwitchOnOff,vs) i1=INPUT.charAt(133) i2=INPUT.charAt(134) i3=i1*256+i2 SEND(L,restoreFactorySettings,i3) year=(INPUT.charAt(45)<<8)+INPUT.charAt(46) mon=INPUT.charAt(48) day=INPUT.charAt(50) hour=INPUT.charAt(52) min=INPUT.charAt(54) sec=INPUT.charAt(56) gtm() SEND(L,timeSetting,sf) END IF(x==x2) # 01 C0 A=2 i1=INPUT.charAt(7) i2=INPUT.charAt(8) i3=i1*256+i2 SEND(L,uwParallelType,i3) c1=INPUT.subString(9,17) SEND(L,hostSerialNum,c1) add(3,3) SEND(L,udwParallelEpsPower,f5) i1=INPUT.charAt(17) i2=INPUT.charAt(18) i3=(i1<<8)+i2 SEND(L,ubParallelDeviceID,i3) add(3,19) SEND(L,udwParallelPVPower,f5) add(3,23) SEND(L,sdwParallelGridPower,f5) add(3,27) SEND(L,udwParallelLoadPower,f5) add(3,31) SEND(L,sdwParallelBatPower,f5) add(3,35) SEND(L,udwParallelSelfPower,f5) add(3,39) SEND(L,udwParallel_EPVToady,f5) add(3,43) SEND(L,udwParallel_ESelfToday,f5) add(3,47) SEND(L,udwParallel_ESelfTotal,f5) add(3,51) SEND(L,udwParallel_ELoadToday,f5) add(3,55) SEND(L,udwParallel_ELoadTotal,f5) add(3,59) SEND(L,Parallel_EPVtoGridToday,f5) add(3,63) SEND(L,udwParallel_EPVtoGridTotal,f5) add(3,67) SEND(L,udwParallel_EGridtoLoadToday,f5) add(3,71) SEND(L,udwParallel_ESelftoLoadToday,f5) add(3,75) SEND(L,udwParallel_ESelftoLoadTotal,f5) END IF(x==x3) # 00 00 A=3 i1=INPUT.charAt(3) i2=INPUT.charAt(4) i3=i1*256+i2 SEND(L,deviceOperatingStatusNext,i3) i1=INPUT.charAt(19) i2=INPUT.charAt(20) f3=((i1<<8)+i2)*0.1 SEND(L,busVoltage1,f3) i1=INPUT.charAt(23) i2=INPUT.charAt(24) f3=((i1<<8)+i2)*0.1 SEND(L,inv_Temp,f3) i1=INPUT.charAt(25) i2=INPUT.charAt(26) f3=((i1<<8)+i2)*0.1 SEND(L,boost_Temp,f3) i1=INPUT.charAt(27) i2=INPUT.charAt(28) f3=((i1<<8)+i2)*0.1 SEND(L,lccTemp,f3) i1=INPUT.charAt(29) i2=INPUT.charAt(30) f3=((i1<<8)+i2)*0.1 SEND(L,batTemp,f3) i1=INPUT.charAt(67) i2=INPUT.charAt(68) i3=i1*256+i2 SEND(L,invMainErrorCode,i3) i1=INPUT.charAt(69) i2=INPUT.charAt(70) i3=i1*256+i2 SEND(L,invMainWarnCode,i3) i1=INPUT.charAt(71) i2=INPUT.charAt(72) i3=i1*256+i2 SEND(L,invErrorSubCode,i3) i1=INPUT.charAt(73) i2=INPUT.charAt(74) i3=i1*256+i2 SEND(L,invWarnSubCode,i3) add8(221) SEND(L,dspDebugW,c1) add8(237) SEND(L,dspDebugSubW,c1) i1=INPUT.charAt(87) i2=INPUT.charAt(88) f3=((i1<<8)+i2)*0.1 SEND(L,vac_R,f3) i1=INPUT.charAt(89) i2=INPUT.charAt(90) f3=((i1<<8)+i2)*0.1 SEND(L,iac_R,f3) i1=INPUT.charAt(105) i2=INPUT.charAt(106) f3=((i1<<8)+i2)*0.01 SEND(L,gridFrequency,f3) i1=INPUT.charAt(111) i2=INPUT.charAt(112) f3=((i1<<8)+i2)*0.01 SEND(L,epsFre,f3) i1=INPUT.charAt(105) i2=INPUT.charAt(106) f3=((i1<<8)+i2)*0.01 SEND(L,rsGridFrequency,f3) i1=INPUT.charAt(87) i2=INPUT.charAt(88) f3=((i1<<8)+i2)*0.1 SEND(L,gridVoltage,f3) i1=INPUT.charAt(113) i2=INPUT.charAt(114) f3=((i1<<8)+i2)*0.1 SEND(L,epsVacR,f3) i1=INPUT.charAt(115) i2=INPUT.charAt(116) f3=((i1<<8)+i2)*0.1 SEND(L,epsIacR,f3) i1=INPUT.charAt(129) i2=INPUT.charAt(130) i3=i1*256+i2 SEND(L,pvNum,i3) i1=INPUT.charAt(131) i2=INPUT.charAt(132) f3=((i1<<8)+i2)*0.1 SEND(L,pv1Voltage,f3) i1=INPUT.charAt(133) i2=INPUT.charAt(134) f3=((i1<<8)+i2)*0.1 SEND(L,pv1InputCurrent,f3) i1=INPUT.charAt(135) i2=INPUT.charAt(136) f3=((i1<<8)+i2)*0.1 SEND(L,pv2Voltage,f3) i1=INPUT.charAt(137) i2=INPUT.charAt(138) f3=((i1<<8)+i2)*0.1 SEND(L,pv2InputCurrent,f3) i1=INPUT.charAt(139) i2=INPUT.charAt(140) f3=((i1<<8)+i2)*0.1 SEND(L,pv3Voltage,f3) i1=INPUT.charAt(141) i2=INPUT.charAt(142) f3=((i1<<8)+i2)*0.1 SEND(L,pv3InputCurrent,f3) i1=INPUT.charAt(143) i2=INPUT.charAt(144) f3=((i1<<8)+i2)*0.1 SEND(L,pv4Voltage,f3) i1=INPUT.charAt(145) i2=INPUT.charAt(146) f3=((i1<<8)+i2)*0.1 SEND(L,pv4InputCurrent,f3) i1=INPUT.charAt(217) i2=INPUT.charAt(218) i3=INPUT.charAt(219) i4=INPUT.charAt(220) f5=((i1<<24)+(i2<<16)+(i3<<8)+i4)*0.5 SEND(L,totalRunTimeDH,f5) END IF(x==x4) # 00 7E A=4 i1=INPUT.charAt(3) i2=INPUT.charAt(4) i3=(i1<<8)+i2 SEND(L,ykBatteryType,i3) i1=INPUT.charAt(29) i2=INPUT.charAt(30) i3=(i1<<8)+i2 SEND(L,soh,i3) i1=INPUT.charAt(7) i2=INPUT.charAt(8) i3=((i1<<8)+i2) SEND(L,batterySOC,i3) i1=INPUT.charAt(5) i2=INPUT.charAt(6) f3=((i1<<8)+i2)*0.1 SEND(L,batteryVoltage,f3) i1=INPUT.charAt(33) i2=INPUT.charAt(34) f3=((i1<<8)+i2)*0.01 SEND(L,batteryCurrent,i3) i1=INPUT.charAt(37) i2=INPUT.charAt(38) f3=((i1<<8)+i2)*0.1 SEND(L,bms_MaxChargeCurr,f3) i1=INPUT.charAt(39) i2=INPUT.charAt(40) f3=((i1<<8)+i2)*0.1 SEND(L,bms_MaxDischargeCurr,f3) i1=INPUT.charAt(35) i2=INPUT.charAt(36) f3=((i1<<8)+i2)*0.1 SEND(L,batteryTemperature,f3) i1=INPUT.charAt(41) i2=INPUT.charAt(42) f3=((i1<<8)+i2)*0.1 SEND(L,bms_GaugeRM,f3) END IF(x==x5) # 00 FA A=5 add(3,3) SEND(L,pvAllInputPower,f5) add(3,7) SEND(L,pv1InputPower,f5) add(3,11) SEND(L,pv2InputPower,f5) add(3,15) SEND(L,pv3InputPower,f5) add(3,19) SEND(L,pv4InputPower,f5) add(3,131) SEND(L,pactouserR,f5) add(3,135) SEND(L,pactouserS,f5) add(3,139) SEND(L,pactouserT,f5) add(3,143) SEND(L,pacToUserTotal,f5) add(3,178) SEND(L,pacToGridR,f5) add(3,151) SEND(L,pacToGridS,f5) add(3,155) SEND(L,pacToGridT,f5) add(3,159) SEND(L,pacToGridTotal,f5) add(3,163) f2=f5 SEND(L,pLocalLoadtotal,f5) add(3,167) SEND(L,offGridRPhaseOutputPower,f5) f5=f2-f5 SEND(L,gridSiteLoad,f5) add(3,171) SEND(L,offGridRPhaseActivePower,f5) i1=INPUT.charAt(191) i2=INPUT.charAt(192) i3=(i1<<8)+i2 SEND(L,ercentage,i3) add(3,201) f2=f5 SEND(L,dischargePower,f5) add(3,205) SEND(L,chargingPower,f5) IF(f2>0&&f5==0) f5=-f2 END IF(f2==0&&f5>0) f5=f5 ELSE f5=0 END SEND(L,totalBatteryChargeAndDischargePower,f5) END IF(x==x6) # 01 7B A=6 add(3,3) SEND(L,pvGeneratedEnergyOfDay,f5) add(3,7) SEND(L,pvGeneratedEnergy,f5) add(3,11) SEND(L,dailyChargingCapacity,f5) add(3,15) SEND(L,totalBatteryChargingEnergy,f5) add(3,19) SEND(L,dailyDischargingCapacity,f5) add(3,23) SEND(L,totalDischargingCapacity,f5) add(3,27) SEND(L,dailyExternalGridTiedInverterEnergy,f5) add(3,31) SEND(L,totalExternalGridTiedInverterEnergy,f5) add(3,59) SEND(L,dailyLoadConsumptionEnergy,f5) add(3,63) SEND(L,totalLoadConsumptionEnergy,f5) add(3,67) SEND(L,dailyGridFeedInEnergy,f5) add(3,71) SEND(L,totalGridFeedInEnergy,f5) add(3,75) SEND(L,electricityConsumptionOnTheInternet,f5) add(3,79) SEND(L,totalElectricityIntakeFromThePowerGrid,f5) add(3,83) SEND(L,dEpvToGridTodayEE,f5) add(3,87) SEND(L,dEpvToGridTotalEE,f5) add(3,91) SEND(L,dEGridToLoadTodayEE,f5) add(3,95) SEND(L,dEGridToLoadTotalEE,f5) add(3,99) SEND(L,dESelfToLoadTodayEE,f5) add(3,103) SEND(L,dESelfToLoadTotalEE,f5) END IF(x==x7) # 00 58 A=7 i1=INPUT.charAt(3) i2=INPUT.charAt(4) i3=((i1<<8)+i2) SEND(L,ctModeStatus,i3) END IF(x==x8) # 0B B8 A=8 i1=INPUT.charAt(3) i2=INPUT.charAt(4) i3=((i1<<8)+i2) SEND(L,systemOperatingMode,i3) i1=INPUT.charAt(5) i2=INPUT.charAt(6) i3=((i1<<8)+i2) SEND(L,pvEnergyPriority,i3) i1=INPUT.charAt(7) i2=INPUT.charAt(8) f3=((i1<<8)+i2)*0.01 SEND(L,maxGridFeedInPower,f3) i1=INPUT.charAt(9) i2=INPUT.charAt(10) i3=((i1<<8)+i2) SEND(L,maxGridFeedInPowerOffset,i3) i1=INPUT.charAt(11) i2=INPUT.charAt(12) i3=((i1<<8)+i2) SEND(L,capacityControl,i3) i1=INPUT.charAt(13) i2=INPUT.charAt(14) i3=((i1<<8)+i2) SEND(L,clearAllTimeSlots,i3) i1=INPUT.charAt(15) i2=INPUT.charAt(16) i3=((i1<<8)+i2) SEND(L,timeSlotQuantity,i3) year=0 mon=0 day=0 hour=INPUT.charAt(17) min=INPUT.charAt(18) sec=0 gtm() SEND(L,timeSlot1StartTimeslog,sf) hour=INPUT.charAt(19) min=INPUT.charAt(20) gtm() SEND(L,timeSlot1EndTimeslog,sf) i1=INPUT.charAt(21) i2=INPUT.charAt(22) i3=((i1<<8)+i2) bitishigh(i3,1) week1_1=vs SEND(L,timeSlot1MondaySwitch,vs) bitishigh(i3,2) week1_2=vs SEND(L,timeSlot1TuesdaySwitch,vs) bitishigh(i3,3) week1_3=vs SEND(L,timeSlot1WednesdaySwitch,vs) bitishigh(i3,4) week1_4=vs SEND(L,timeSlot1ThursdaySwitch,vs) bitishigh(i3,5) week1_5=vs SEND(L,timeSlot1FridaySwitch,vs) bitishigh(i3,6) week1_6=vs SEND(L,timeSlot1SaturdaySwitch,vs) bitishigh(i3,7) week1_7=vs SEND(L,timeSlot1SundaySwitch,vs) i1=INPUT.charAt(25) i2=INPUT.charAt(26) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot1AcChargingEnable,vs) i1=INPUT.charAt(27) i2=INPUT.charAt(28) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot1GeneratorChargingEnable,vs) i1=INPUT.charAt(29) i2=INPUT.charAt(30) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot1DischargePower,f3) i1=INPUT.charAt(31) i2=INPUT.charAt(32) i3=((i1<<8)+i2) SEND(L,timeSlot1BackupSoc,i3) i1=INPUT.charAt(33) i2=INPUT.charAt(34) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot1LeadAcidBackupVoltage,f3) i1=INPUT.charAt(35) i2=INPUT.charAt(36) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot1MaxPeakPower,f3) hour=INPUT.charAt(37) min=INPUT.charAt(38) gtm() SEND(L,timeSlot2StartTimeslog,sf) hour=INPUT.charAt(39) min=INPUT.charAt(40) gtm() SEND(L,timeSlot2EndTimeslog,sf) i1=INPUT.charAt(41) i2=INPUT.charAt(42) i3=((i1<<8)+i2) bitishigh(i3,1) week2_1=vs SEND(L,timeSlot2MondaySwitch,vs) bitishigh(i3,2) week2_2=vs SEND(L,timeSlot2TuesdaySwitch,vs) bitishigh(i3,3) week2_3=vs SEND(L,timeSlot2WednesdaySwitch,vs) bitishigh(i3,4) week2_4=vs SEND(L,timeSlot2ThursdaySwitch,vs) bitishigh(i3,5) week2_5=vs SEND(L,timeSlot2FridaySwitch,vs) bitishigh(i3,6) week2_6=vs SEND(L,timeSlot2SaturdaySwitch,vs) bitishigh(i3,7) week2_7=vs SEND(L,timeSlot2SundaySwitch,vs) i1=INPUT.charAt(45) i2=INPUT.charAt(46) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot2AcChargingEnable,vs) i1=INPUT.charAt(47) i2=INPUT.charAt(48) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot2GeneratorChargingEnable,vs) i1=INPUT.charAt(49) i2=INPUT.charAt(50) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot2DischargePower,f3) i1=INPUT.charAt(51) i2=INPUT.charAt(52) i3=((i1<<8)+i2) SEND(L,timeSlot2BackupSoc,i3) i1=INPUT.charAt(53) i2=INPUT.charAt(54) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot2LeadAcidBackupVoltage,f3) i1=INPUT.charAt(55) i2=INPUT.charAt(56) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot2MaxPeakPower,f3) hour=INPUT.charAt(57) min=INPUT.charAt(58) gtm() SEND(L,timeSlot3StartTimeslog,sf) hour=INPUT.charAt(59) min=INPUT.charAt(60) gtm() SEND(L,timeSlot3EndTimeslog,sf) i1=INPUT.charAt(61) i2=INPUT.charAt(62) i3=((i1<<8)+i2) bitishigh(i3,1) week3_1=vs SEND(L,timeSlot3MondaySwitch,vs) bitishigh(i3,2) week3_2=vs SEND(L,timeSlot3TuesdaySwitch,vs) bitishigh(i3,3) week3_3=vs SEND(L,timeSlot3WednesdaySwitch,vs) bitishigh(i3,4) week3_4=vs SEND(L,timeSlot3ThursdaySwitch,vs) bitishigh(i3,5) week3_5=vs SEND(L,timeSlot3FridaySwitch,vs) bitishigh(i3,6) week3_6=vs SEND(L,timeSlot3SaturdaySwitch,vs) bitishigh(i3,7) week3_7=vs SEND(L,timeSlot3SundaySwitch,vs) i1=INPUT.charAt(65) i2=INPUT.charAt(66) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot3AcChargingEnable,vs) i1=INPUT.charAt(67) i2=INPUT.charAt(68) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot3GeneratorChargingEnable,vs) i1=INPUT.charAt(69) i2=INPUT.charAt(70) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot3DischargePower,f3) i1=INPUT.charAt(71) i2=INPUT.charAt(72) i3=((i1<<8)+i2) SEND(L,timeSlot3BackupSoc,i3) i1=INPUT.charAt(73) i2=INPUT.charAt(74) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot3LeadAcidBackupVoltage,f3) i1=INPUT.charAt(75) i2=INPUT.charAt(76) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot3MaxPeakPower,f3) hour=INPUT.charAt(77) min=INPUT.charAt(78) gtm() SEND(L,timeSlot4StartTimeslog,sf) hour=INPUT.charAt(79) min=INPUT.charAt(80) gtm() SEND(L,timeSlot4EndTimeslog,sf) i1=INPUT.charAt(81) i2=INPUT.charAt(82) i3=((i1<<8)+i2) bitishigh(i3,1) week4_1=vs SEND(L,timeSlot4MondaySwitch,vs) bitishigh(i3,2) week4_2=vs SEND(L,timeSlot4TuesdaySwitch,vs) bitishigh(i3,3) week4_3=vs SEND(L,timeSlot4WednesdaySwitch,vs) bitishigh(i3,4) week4_4=vs SEND(L,timeSlot4ThursdaySwitch,vs) bitishigh(i3,5) week4_5=vs SEND(L,timeSlot4FridaySwitch,vs) bitishigh(i3,6) week4_6=vs SEND(L,timeSlot4SaturdaySwitch,vs) bitishigh(i3,7) week4_7=vs SEND(L,timeSlot4SundaySwitch,vs) i1=INPUT.charAt(85) i2=INPUT.charAt(86) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot4AcChargingEnable,vs) i1=INPUT.charAt(87) i2=INPUT.charAt(88) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot4GeneratorChargingEnable,vs) i1=INPUT.charAt(89) i2=INPUT.charAt(90) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot4DischargePower,f3) i1=INPUT.charAt(91) i2=INPUT.charAt(92) i3=((i1<<8)+i2) SEND(L,timeSlot4BackupSoc,i3) i1=INPUT.charAt(93) i2=INPUT.charAt(94) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot4LeadAcidBackupVoltage,f3) i1=INPUT.charAt(95) i2=INPUT.charAt(96) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot4MaxPeakPower,f3) hour=INPUT.charAt(97) min=INPUT.charAt(98) gtm() SEND(L,timeSlot5StartTimeslog,sf) hour=INPUT.charAt(99) min=INPUT.charAt(100) gtm() SEND(L,timeSlot5EndTimeslog,sf) i1=INPUT.charAt(101) i2=INPUT.charAt(102) i3=((i1<<8)+i2) bitishigh(i3,1) week5_1=vs SEND(L,timeSlot5MondaySwitch,vs) bitishigh(i3,2) week5_2=vs SEND(L,timeSlot5TuesdaySwitch,vs) bitishigh(i3,3) week5_3=vs SEND(L,timeSlot5WednesdaySwitch,vs) bitishigh(i3,4) week5_4=vs SEND(L,timeSlot5ThursdaySwitch,vs) bitishigh(i3,5) week5_5=vs SEND(L,timeSlot5FridaySwitch,vs) bitishigh(i3,6) week5_6=vs SEND(L,timeSlot5SaturdaySwitch,vs) bitishigh(i3,7) week5_7=vs SEND(L,timeSlot5SundaySwitch,vs) i1=INPUT.charAt(105) i2=INPUT.charAt(106) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot5AcChargingEnable,vs) i1=INPUT.charAt(107) i2=INPUT.charAt(108) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot5GeneratorChargingEnable,vs) i1=INPUT.charAt(109) i2=INPUT.charAt(110) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot5DischargePower,f3) i1=INPUT.charAt(111) i2=INPUT.charAt(112) i3=((i1<<8)+i2) SEND(L,timeSlot5BackupSoc,i3) i1=INPUT.charAt(113) i2=INPUT.charAt(114) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot5LeadAcidBackupVoltage,f3) i1=INPUT.charAt(115) i2=INPUT.charAt(116) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot5MaxPeakPower,f3) hour=INPUT.charAt(117) min=INPUT.charAt(118) gtm() SEND(L,timeSlot6StartTimeslog,sf) hour=INPUT.charAt(119) min=INPUT.charAt(120) gtm() SEND(L,timeSlot6EndTimeslog,sf) i1=INPUT.charAt(121) i2=INPUT.charAt(122) i3=((i1<<8)+i2) bitishigh(i3,1) week6_1=vs SEND(L,timeSlot6MondaySwitch,vs) bitishigh(i3,2) week6_2=vs SEND(L,timeSlot6TuesdaySwitch,vs) bitishigh(i3,3) week6_3=vs SEND(L,timeSlot6WednesdaySwitch,vs) bitishigh(i3,4) week6_4=vs SEND(L,timeSlot6ThursdaySwitch,vs) bitishigh(i3,5) week6_5=vs SEND(L,timeSlot6FridaySwitch,vs) bitishigh(i3,6) week6_6=vs SEND(L,timeSlot6SaturdaySwitch,vs) bitishigh(i3,7) week6_7=vs SEND(L,timeSlot6SundaySwitch,vs) i1=INPUT.charAt(125) i2=INPUT.charAt(126) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot6AcChargingEnable,vs) i1=INPUT.charAt(127) i2=INPUT.charAt(128) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot6GeneratorChargingEnable,vs) i1=INPUT.charAt(129) i2=INPUT.charAt(130) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot6DischargePower,f3) i1=INPUT.charAt(131) i2=INPUT.charAt(132) i3=((i1<<8)+i2) SEND(L,timeSlot6BackupSoc,i3) i1=INPUT.charAt(133) i2=INPUT.charAt(134) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot6LeadAcidBackupVoltage,f3) i1=INPUT.charAt(135) i2=INPUT.charAt(136) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot6MaxPeakPower,f3) hour=INPUT.charAt(137) min=INPUT.charAt(138) gtm() SEND(L,timeSlot7StartTimeslog,sf) hour=INPUT.charAt(139) min=INPUT.charAt(140) gtm() SEND(L,timeSlot7EndTimeslog,sf) i1=INPUT.charAt(141) i2=INPUT.charAt(142) i3=((i1<<8)+i2) bitishigh(i3,1) week7_1=vs SEND(L,timeSlot7MondaySwitch,vs) bitishigh(i3,2) week7_2=vs SEND(L,timeSlot7TuesdaySwitch,vs) bitishigh(i3,3) week7_3=vs SEND(L,timeSlot7WednesdaySwitch,vs) bitishigh(i3,4) week7_4=vs SEND(L,timeSlot7ThursdaySwitch,vs) bitishigh(i3,5) week7_5=vs SEND(L,timeSlot7FridaySwitch,vs) bitishigh(i3,6) week7_6=vs SEND(L,timeSlot7SaturdaySwitch,vs) bitishigh(i3,7) week7_7=vs SEND(L,timeSlot7SundaySwitch,vs) i1=INPUT.charAt(145) i2=INPUT.charAt(146) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot7AcChargingEnable,vs) i1=INPUT.charAt(147) i2=INPUT.charAt(148) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot7GeneratorChargingEnable,vs) i1=INPUT.charAt(149) i2=INPUT.charAt(150) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot7DischargePower,f3) i1=INPUT.charAt(151) i2=INPUT.charAt(152) i3=((i1<<8)+i2) SEND(L,timeSlot7BackupSoc,i3) i1=INPUT.charAt(153) i2=INPUT.charAt(154) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot7LeadAcidBackupVoltage,f3) i1=INPUT.charAt(155) i2=INPUT.charAt(156) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot7MaxPeakPower,f3) hour=INPUT.charAt(157) min=INPUT.charAt(158) gtm() SEND(L,timeSlot8StartTimeslog,sf) hour=INPUT.charAt(159) min=INPUT.charAt(160) gtm() SEND(L,timeSlot8EndTimeslog,sf) i1=INPUT.charAt(161) i2=INPUT.charAt(162) i3=((i1<<8)+i2) bitishigh(i3,1) week8_1=vs SEND(L,timeSlot8MondaySwitch,vs) bitishigh(i3,2) week8_2=vs SEND(L,timeSlot8TuesdaySwitch,vs) bitishigh(i3,3) week8_3=vs SEND(L,timeSlot8WednesdaySwitch,vs) bitishigh(i3,4) week8_4=vs SEND(L,timeSlot8ThursdaySwitch,vs) bitishigh(i3,5) week8_5=vs SEND(L,timeSlot8FridaySwitch,vs) bitishigh(i3,6) week8_6=vs SEND(L,timeSlot8SaturdaySwitch,vs) bitishigh(i3,7) week8_7=vs SEND(L,timeSlot8SundaySwitch,vs) i1=INPUT.charAt(165) i2=INPUT.charAt(166) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot8AcChargingEnable,vs) i1=INPUT.charAt(167) i2=INPUT.charAt(168) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot8GeneratorChargingEnable,vs) i1=INPUT.charAt(169) i2=INPUT.charAt(170) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot8DischargePower,f3) i1=INPUT.charAt(171) i2=INPUT.charAt(172) i3=((i1<<8)+i2) SEND(L,timeSlot8BackupSoc,i3) i1=INPUT.charAt(173) i2=INPUT.charAt(174) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot8LeadAcidBackupVoltage,f3) i1=INPUT.charAt(175) i2=INPUT.charAt(176) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot8MaxPeakPower,f3) hour=INPUT.charAt(177) min=INPUT.charAt(178) gtm() SEND(L,timeSlot9StartTimeslog,sf) hour=INPUT.charAt(179) min=INPUT.charAt(180) gtm() SEND(L,timeSlot9EndTimeslog,sf) i1=INPUT.charAt(181) i2=INPUT.charAt(182) i3=((i1<<8)+i2) bitishigh(i3,1) week9_1=vs SEND(L,timeSlot9MondaySwitch,vs) bitishigh(i3,2) week9_2=vs SEND(L,timeSlot9TuesdaySwitch,vs) bitishigh(i3,3) week9_3=vs SEND(L,timeSlot9WednesdaySwitch,vs) bitishigh(i3,4) week9_4=vs SEND(L,timeSlot9ThursdaySwitch,vs) bitishigh(i3,5) week9_5=vs SEND(L,timeSlot9FridaySwitch,vs) bitishigh(i3,6) week9_6=vs SEND(L,timeSlot9SaturdaySwitch,vs) bitishigh(i3,7) week9_7=vs SEND(L,timeSlot9SundaySwitch,vs) i1=INPUT.charAt(185) i2=INPUT.charAt(186) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot9AcChargingEnable,vs) i1=INPUT.charAt(187) i2=INPUT.charAt(188) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot9GeneratorChargingEnable,vs) i1=INPUT.charAt(189) i2=INPUT.charAt(190) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot9DischargePower,f3) i1=INPUT.charAt(191) i2=INPUT.charAt(192) i3=((i1<<8)+i2) SEND(L,timeSlot9BackupSoc,i3) i1=INPUT.charAt(193) i2=INPUT.charAt(194) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot9LeadAcidBackupVoltage,f3) i1=INPUT.charAt(195) i2=INPUT.charAt(196) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot9MaxPeakPower,f3) hour=INPUT.charAt(197) min=INPUT.charAt(198) gtm() SEND(L,timeSlot10StartTimeslog,sf) hour=INPUT.charAt(199) min=INPUT.charAt(200) gtm() SEND(L,timeSlot10EndTimeslog,sf) i1=INPUT.charAt(201) i2=INPUT.charAt(202) i3=((i1<<8)+i2) bitishigh(i3,1) week10_1=vs SEND(L,timeSlot10MondaySwitch,vs) bitishigh(i3,2) week10_2=vs SEND(L,timeSlot10TuesdaySwitch,vs) bitishigh(i3,3) week10_3=vs SEND(L,timeSlot10WednesdaySwitch,vs) bitishigh(i3,4) week10_4=vs SEND(L,timeSlot10ThursdaySwitch,vs) bitishigh(i3,5) week10_5=vs SEND(L,timeSlot10FridaySwitch,vs) bitishigh(i3,6) week10_6=vs SEND(L,timeSlot10SaturdaySwitch,vs) bitishigh(i3,7) week10_7=vs SEND(L,timeSlot10SundaySwitch,vs) i1=INPUT.charAt(205) i2=INPUT.charAt(206) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot10AcChargingEnable,vs) i1=INPUT.charAt(207) i2=INPUT.charAt(208) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,timeSlot10GeneratorChargingEnable,vs) i1=INPUT.charAt(209) i2=INPUT.charAt(210) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot10DischargePower,f3) i1=INPUT.charAt(211) i2=INPUT.charAt(212) i3=((i1<<8)+i2) SEND(L,timeSlot10BackupSoc,i3) i1=INPUT.charAt(213) i2=INPUT.charAt(214) f3=((i1<<8)+i2)*0.1 SEND(L,timeSlot10LeadAcidBackupVoltage,f3) i1=INPUT.charAt(215) i2=INPUT.charAt(216) f3=((i1<<8)+i2)*0.01 SEND(L,timeSlot10MaxPeakPower,f3) END IF(x==x9) # 00 DA A=9 i1=INPUT.charAt(3) i2=INPUT.charAt(4) IF(i2==0) vs=0 END IF(i2==1) vs=1 END IF(i2==2) vs=2 END IF(i2==3) vs=3 END IF(i2==4) vs=4 END IF(i2==5) vs=5 END IF(i2==6) vs=6 END SEND(L,generatorPortFunctionSelect,vs) i1=INPUT.charAt(5) i2=INPUT.charAt(6) f3=((i1<<8)+i2)*0.1 SEND(L,generatorChargingCurrentLimit,f3) i1=INPUT.charAt(7) i2=INPUT.charAt(8) i3=((i1<<8)+i2)*10 SEND(L,generatorInputRatedPower,i3) i1=INPUT.charAt(9) i2=INPUT.charAt(10) i3=((i1<<8)+i2) SEND(L,lithiumStartSoc,i3) i1=INPUT.charAt(11) i2=INPUT.charAt(12) f3=((i1<<8)+i2)*0.1 SEND(L,leadAcidStartVoltage,f3) i1=INPUT.charAt(13) i2=INPUT.charAt(14) i3=((i1<<8)+i2) SEND(L,lithiumStopSoc,i3) i1=INPUT.charAt(15) i2=INPUT.charAt(16) f3=((i1<<8)+i2)*0.1 SEND(L,leadAcidStopVoltage,f3) i1=INPUT.charAt(17) i2=INPUT.charAt(18) i3=((i1<<8)+i2)*10 SEND(L,pvStartSmartLoadMinPower,i3) END IF(x==x10) # 00 FB A=10 i1=INPUT.charAt(3) i2=INPUT.charAt(4) f3=((i1<<8)+i2)*0.1 SEND(L,lowGridVoltageProtectionStage1,f3) i1=INPUT.charAt(5) i2=INPUT.charAt(6) f3=((i1<<8)+i2)*0.1 SEND(L,highGridVoltageProtectionStage1,f3) i1=INPUT.charAt(7) i2=INPUT.charAt(8) f3=((i1<<8)+i2)*0.01 SEND(L,lowGridFrequencyProtectionStage1,f3) i1=INPUT.charAt(9) i2=INPUT.charAt(10) f3=((i1<<8)+i2)*0.01 SEND(L,highGridFrequencyProtectionStage1,f3) i1=INPUT.charAt(11) i2=INPUT.charAt(12) f3=((i1<<8)+i2)*0.1 SEND(L,lowGridVoltageProtectionStage2,f3) i1=INPUT.charAt(13) i2=INPUT.charAt(14) f3=((i1<<8)+i2)*0.1 SEND(L,highGridVoltageProtectionStage2,f3) i1=INPUT.charAt(15) i2=INPUT.charAt(16) f3=((i1<<8)+i2)*0.01 SEND(L,lowGridFrequencyProtectionStage2,f3) i1=INPUT.charAt(17) i2=INPUT.charAt(18) f3=((i1<<8)+i2)*0.01 SEND(L,highGridFrequencyProtectionStage2,f3) i1=INPUT.charAt(19) i2=INPUT.charAt(20) f3=((i1<<8)+i2)*0.1 SEND(L,lowGridVoltageProtectionStage3,f3) i1=INPUT.charAt(21) i2=INPUT.charAt(22) f3=((i1<<8)+i2)*0.1 SEND(L,highGridVoltageProtectionStage3,f3) i1=INPUT.charAt(23) i2=INPUT.charAt(24) f3=((i1<<8)+i2)*0.01 SEND(L,lowGridFrequencyProtectionStage3,f3) i1=INPUT.charAt(25) i2=INPUT.charAt(26) f3=((i1<<8)+i2)*0.01 SEND(L,highGridFrequencyProtectionStage3,f3) i1=INPUT.charAt(27) i2=INPUT.charAt(28) i3=((i1<<8)+i2)*20 SEND(L,lowGridVoltageStage1ProtectionTime,i3) i1=INPUT.charAt(29) i2=INPUT.charAt(30) i3=((i1<<8)+i2)*20 SEND(L,highGridVoltageStage1ProtectionTime,i3) i1=INPUT.charAt(31) i2=INPUT.charAt(32) i3=((i1<<8)+i2)*20 SEND(L,lowGridFrequencyStage1ProtectionTime,i3) i1=INPUT.charAt(33) i2=INPUT.charAt(34) i3=((i1<<8)+i2)*20 SEND(L,highGridFrequencyStage1ProtectionTime,i3) i1=INPUT.charAt(35) i2=INPUT.charAt(36) i3=((i1<<8)+i2)*20 SEND(L,lowGridVoltageStage2ProtectionTime,i3) i1=INPUT.charAt(37) i2=INPUT.charAt(38) i3=((i1<<8)+i2)*20 SEND(L,highGridVoltageStage2ProtectionTime,i3) i1=INPUT.charAt(39) i2=INPUT.charAt(40) i3=((i1<<8)+i2)*20 SEND(L,lowGridFrequencyStage2ProtectionTime,i3) i1=INPUT.charAt(41) i2=INPUT.charAt(42) i3=((i1<<8)+i2)*20 SEND(L,highGridFrequencyStage2ProtectionTime,i3) i1=INPUT.charAt(43) i2=INPUT.charAt(44) i3=((i1<<8)+i2)*20 SEND(L,lowGridVoltageStage3ProtectionTime,i3) i1=INPUT.charAt(45) i2=INPUT.charAt(46) i3=((i1<<8)+i2)*20 SEND(L,highGridVoltageStage3ProtectionTime,i3) i1=INPUT.charAt(47) i2=INPUT.charAt(48) i3=((i1<<8)+i2)*20 SEND(L,lowGridFrequencyStage3ProtectionTime,i3) i1=INPUT.charAt(49) i2=INPUT.charAt(50) i3=((i1<<8)+i2)*20 SEND(L,highGridFrequencyStage3ProtectionTime,i3) i1=INPUT.charAt(51) i2=INPUT.charAt(52) f3=((i1<<8)+i2)*0.1 SEND(L,tenMinuteVoltageProtection,f3) i1=INPUT.charAt(55) i2=INPUT.charAt(56) i3=((i1<<8)+i2) SEND(L,gridConnectionTime,i3) i1=INPUT.charAt(57) i2=INPUT.charAt(58) i3=((i1<<8)+i2) SEND(L,reconnectionTime,i3) i1=INPUT.charAt(59) i2=INPUT.charAt(60) f3=((i1<<8)+i2)*0.1 SEND(L,loadRampRate,f3) i1=INPUT.charAt(61) i2=INPUT.charAt(62) f3=((i1<<8)+i2)*0.1 SEND(L,restartLoadRampRate,f3) END IF(x==x11) # 01 4B A=11 i1=INPUT.charAt(3) i2=INPUT.charAt(4) IF(i2==0) vs=0 END IF(i2==1) vs=1 END IF(i2==2) vs=0 END IF(i2==3) vs=3 END IF(i2==4) vs=4 END IF(i2==5) vs=5 END IF(i2==6) vs=6 END IF(i2==7) vs=7 END IF(i2==8) vs=8 END IF(i2==9) vs=9 END IF(i2==10) vs=10 END SEND(L,setPFFunctionMode,vs) END IF(x==x12) # 00 D3 A=12 i1=INPUT.charAt(3) i2=INPUT.charAt(4) IF(i2==0) vs=0 END IF(i2==1) vs=1 END IF(i2==2) vs=0 END IF(i2==3) vs=3 END IF(i2==4) vs=4 END SEND(L,nParallelModeSet,vs) i1=INPUT.charAt(5) i2=INPUT.charAt(6) i3=((i1<<8)+i2) SEND(L,parallelCanCommAdd,i3) i1=INPUT.charAt(7) i2=INPUT.charAt(8) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,ubParallelDeviveType,vs) END IF(x==x13) #00 7D A=13 i1=INPUT.charAt(3) i2=INPUT.charAt(4) IF(i2==0) vs=0 END IF(i2==1) vs=1 END IF(i2==2) vs=0 END IF(i2==3) vs=3 END IF(i2==4) vs=4 END IF(i2==5) vs=5 END SEND(L,batteryTypeChoose,vs) i1=INPUT.charAt(11) i2=INPUT.charAt(12) f3=((i1<<8)+i2)*0.01 SEND(L,ccCurrent,f3) i1=INPUT.charAt(13) i2=INPUT.charAt(14) f3=((i1<<8)+i2)*0.1 SEND(L,lvVoltage,f3) i1=INPUT.charAt(15) i2=INPUT.charAt(16) f3=((i1<<8)+i2)*0.1 SEND(L,cvVoltage,f3) i1=INPUT.charAt(27) i2=INPUT.charAt(28) i3=((i1<<8)+i2) SEND(L,chargingPowerSet,i3) i1=INPUT.charAt(29) i2=INPUT.charAt(30) i3=((i1<<8)+i2) SEND(L,dischargingPowerSet,i3) i1=INPUT.charAt(31) i2=INPUT.charAt(32) i3=((i1<<8)+i2) SEND(L,chargingCutoffSoc,i3) i1=INPUT.charAt(33) i2=INPUT.charAt(34) i3=((i1<<8)+i2) SEND(L,gridTiedDischargeCutoffSoc,i3) i1=INPUT.charAt(35) i2=INPUT.charAt(36) i3=((i1<<8)+i2) SEND(L,offGridDischargeCutoffSoc,i3) i1=INPUT.charAt(43) i2=INPUT.charAt(44) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,acChargingEnable,vs) END IF(x==x14) # 00 45 i1=INPUT.charAt(3) i2=INPUT.charAt(4) i3=((i1<<8)+i2)-1 SEND(L,safetyCertificationNumber,i3) i1=INPUT.charAt(15) i2=INPUT.charAt(16) i3=((i1<<8)+i2) SEND(L,maxReactivePowerPercentage,i3) i1=INPUT.charAt(17) i2=INPUT.charAt(18) i3=((i1<<8)+i2) f3=(i3-10000)*0.0001 SEND(L,inverterPowerFactor1000,f3) i1=INPUT.charAt(19) i2=INPUT.charAt(20) IF(i2==0) vs=0 END IF(i2==1) vs=1 END IF(i2==2) vs=0 END SEND(L,mpptModee,vs) i1=INPUT.charAt(27) i2=INPUT.charAt(28) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,lvrtHvrtEnable,vs) i1=INPUT.charAt(67) i2=INPUT.charAt(68) f3=((i1<<8)+i2)*0.1 SEND(L,gridLowVoltageConnectionLimit,f3) i1=INPUT.charAt(69) i2=INPUT.charAt(70) f3=((i1<<8)+i2)*0.1 SEND(L,gridHighVoltageConnectionLimit,f3) i1=INPUT.charAt(71) i2=INPUT.charAt(72) f3=((i1<<8)+i2)*0.01 SEND(L,gridLowFrequencyConnectionLimit,f3) i1=INPUT.charAt(77) i2=INPUT.charAt(78) IF(i2==0) vs=0 END IF(i2==1) vs=1 END IF(i2==2) vs=2 END IF(i2==3) vs=3 END IF(i2==4) vs=4 END SEND(L,optionalOffGridRatedVoltage,vs) i1=INPUT.charAt(79) i2=INPUT.charAt(80) IF(i2==0) vs=0 END IF(i2==1) vs=1 END SEND(L,optionalOffGridRatedFrequency,vs) i1=INPUT.charAt(13) i2=INPUT.charAt(14) i3=((i1<<8)+i2) SEND(L,maxActivePowerPercentage,i3) i1=INPUT.charAt(41) i2=INPUT.charAt(42) i3=((i1<<8)+i2) IF(i3==3) i3=2 END SEND(L,ctMode,i3) i1=INPUT.charAt(43) i2=INPUT.charAt(44) IF(i2==0) vs=0 END IF(i2==1) vs=1 END IF(i3==1) vs=1 END SEND(L,preventReverseFlowEnable,vs) i1=INPUT.charAt(45) i2=INPUT.charAt(46) i3=((i1<<8)+i2) SEND(L,antiIslandingPowerLimitR,i3) i1=INPUT.charAt(53) i2=INPUT.charAt(54) i3=((i1<<8)+i2) SEND(L,antiIslandingFailTime,i3) i1=INPUT.charAt(55) i2=INPUT.charAt(56) i3=((i1<<8)+i2) SEND(L,antiIslandingFailActivePowerPercentageR,i3) i1=INPUT.charAt(81) i2=INPUT.charAt(82) i3=((i1<<8)+i2) SEND(L,offGridEnable,i3) i1=INPUT.charAt(83) i2=INPUT.charAt(84) i3=((i1<<8)+i2) SEND(L,bypassModeEnable,i3) END IF(x==x15) # 00 BD i1=INPUT.charAt(3) i2=INPUT.charAt(4) f3=((i1<<8)+i2)*0.1 SEND(L,acChargingCurrentLimit,f3) END IF(x==x16) #00 20 i0=INPUT.charAt(3)+INPUT.charAt(4)+INPUT.charAt(7)+INPUT.charAt(8) IF(i0==0) SEND(L,AlarmStatus,"0") ELSE SEND(L,AlarmStatus,"1") END END IF(x==x17) #00 21 i0=INPUT.charAt(3)+INPUT.charAt(4)+INPUT.charAt(7)+INPUT.charAt(8) IF(i0==0) SEND(L,AlarmStatus,"0") ELSE SEND(L,AlarmStatus,"1") END END A=200 RETURN(FALSE) END RECV L getkey gkey=INPUT IF(gkey=="wifistatus") SEND(L,wifistatus,"WiFiStatus") END IF(gkey=="blestatus") SEND(L,blestatus,"BLEStatus") END RETURN(FALSE) END # check cmd RECV L checkcmd cc="0" gcmd=INPUT IF(gcmd==x1||gcmd==x2||gcmd==x3||gcmd==x4||gcmd==x5||gcmd==x6||gcmd==x7) cc="1" END SEND(L,returncmd,cc) RETURN(FALSE) END # set item RECV L setkey sk=INPUT RETURN(FALSE) END RECV L setvalue A=300 # EMS Timeslot Setting 1 A=11 IF(sk=="timeSlotQuantity") A=11 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xBE] t1=t0.insertAt(4,str1) ydc() END A=12 IF(sk=="timeSlot1StartTimeslog") A=12 d0=INPUT d1=[0x01,0x06,0x0B,0xBF] gde() END A=13 IF(sk=="timeSlot1EndTimeslog") A=13 d0=INPUT d1=[0x01,0x06,0x0B,0xC0] gde() END A=14 IF(sk=="timeSlot1MondaySwitch") A=141 d0=INPUT gdt() week1_1=dt1 week1send(); END IF(sk=="timeSlot1TuesdaySwitch") A=142 d0=INPUT gdt() week1_2=dt1 week1send(); END IF(sk=="timeSlot1WednesdaySwitch") A=143 d0=INPUT gdt() week1_3=dt1 week1send(); END IF(sk=="timeSlot1ThursdaySwitch") A=144 d0=INPUT gdt() week1_4=dt1 week1send(); END IF(sk=="timeSlot1FridaySwitch") A=145 d0=INPUT gdt() week1_5=dt1 week1send(); END IF(sk=="timeSlot1SaturdaySwitch") A=146 d0=INPUT gdt() week1_6=dt1 week1send(); END IF(sk=="timeSlot1SundaySwitch") A=147 d0=INPUT gdt() week1_7=dt1 week1send(); END A=15 IF(sk=="timeSlot1AcChargingEnable") A=15 y2=[0x0B,0xC3] d0=INPUT enuma() END A=16 IF(sk=="timeSlot1GeneratorChargingEnable") A=16 y2=[0x0B,0xC4] d0=INPUT enuma() END A=17 IF(sk=="timeSlot1DischargePower") A=17 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xC5] t1=t0.insertAt(4,str1) ydc() END A=18 IF(sk=="timeSlot1BackupSoc") A=18 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xC6] t1=t0.insertAt(4,str1) ydc() END A=19 IF(sk=="timeSlot1LeadAcidBackupVoltage") A=19 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0B,0xC7] t1=t0.insertAt(4,str1) ydc() END A=110 IF(sk=="timeSlot1MaxPeakPower") A=110 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xC8] t1=t0.insertAt(4,str1) ydc() END A=111 IF(sk=="timeSlot2StartTimeslog") A=111 d0=INPUT d1=[0x01,0x06,0x0B,0xC9] gde() END A=112 IF(sk=="timeSlot2EndTimeslog") A=112 d0=INPUT d1=[0x01,0x06,0x0B,0xCA] gde() END A=113 IF(sk=="timeSlot2MondaySwitch") A=1131 d0=INPUT gdt() week2_1=dt1 week2send(); END IF(sk=="timeSlot2TuesdaySwitch") A=1132 d0=INPUT gdt() week2_2=dt1 week2send(); END IF(sk=="timeSlot2WednesdaySwitch") A=1133 d0=INPUT gdt() week2_3=dt1 week2send(); END IF(sk=="timeSlot2ThursdaySwitch") A=1134 d0=INPUT gdt() week2_4=dt1 week2send(); END IF(sk=="timeSlot2FridaySwitch") A=1135 d0=INPUT gdt() week2_5=dt1 week2send(); END IF(sk=="timeSlot2SaturdaySwitch") A=1136 d0=INPUT gdt() week2_6=dt1 week2send(); END IF(sk=="timeSlot2SundaySwitch") A=1137 d0=INPUT gdt() week2_7=dt1 week2send(); END A=114 IF(sk=="timeSlot2AcChargingEnable") A=114 y2=[0x0B,0xCD] d0=INPUT enuma() END A=115 IF(sk=="timeSlot2GeneratorChargingEnable") A=115 y2=[0x0B,0xCE] d0=INPUT enuma() END A=116 IF(sk=="timeSlot2DischargePower") A=116 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xCF] t1=t0.insertAt(4,str1) ydc() END A=117 IF(sk=="timeSlot2BackupSoc") A=117 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xD0] t1=t0.insertAt(4,str1) ydc() END A=118 IF(sk=="timeSlot2LeadAcidBackupVoltage") A=118 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0B,0xD1] t1=t0.insertAt(4,str1) ydc() END A=119 IF(sk=="timeSlot2MaxPeakPower") A=119 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xD2] t1=t0.insertAt(4,str1) ydc() END A=120 IF(sk=="timeSlot3StartTimeslog") A=120 d0=INPUT d1=[0x01,0x06,0x0B,0xD3] gde() END A=121 IF(sk=="timeSlot3EndTimeslog") A=121 d0=INPUT d1=[0x01,0x06,0x0B,0xD4] gde() END A=122 IF(sk=="timeSlot3MondaySwitch") A=1221 d0=INPUT gdt() week3_1=dt1 week3send(); END IF(sk=="timeSlot3TuesdaySwitch") A=1222 d0=INPUT gdt() week3_2=dt1 week3send(); END IF(sk=="timeSlot3WednesdaySwitch") A=1223 d0=INPUT gdt() week3_3=dt1 week3send(); END IF(sk=="timeSlot3ThursdaySwitch") A=1224 d0=INPUT gdt() week3_4=dt1 week3send(); END IF(sk=="timeSlot3FridaySwitch") A=1225 d0=INPUT gdt() week3_5=dt1 week3send(); END IF(sk=="timeSlot3SaturdaySwitch") A=1226 d0=INPUT gdt() week3_6=dt1 week3send(); END IF(sk=="timeSlot3SundaySwitch") A=1227 d0=INPUT gdt() week3_7=dt1 week3send(); END A=123 IF(sk=="timeSlot3AcChargingEnable") A=123 y2=[0x0B,0xD7] d0=INPUT enuma() gt1() ydc() END A=124 IF(sk=="timeSlot3GeneratorChargingEnable") A=124 y2=[0x0B,0xD8] d0=INPUT enuma() END A=125 IF(sk=="timeSlot3DischargePower") A=125 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xD9] t1=t0.insertAt(4,str1) ydc() END A=126 IF(sk=="timeSlot3BackupSoc") A=126 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xDA] t1=t0.insertAt(4,str1) ydc() END A=127 IF(sk=="timeSlot3LeadAcidBackupVoltage") A=127 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0B,0xDB] t1=t0.insertAt(4,str1) ydc() END A=128 IF(sk=="timeSlot3MaxPeakPower") A=128 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xDC] t1=t0.insertAt(4,str1) ydc() END A=129 IF(sk=="timeSlot4StartTimeslog") A=129 d0=INPUT d1=[0x01,0x06,0x0B,0xDD] gde() END A=130 IF(sk=="timeSlot4EndTimeslog") A=130 d0=INPUT d1=[0x01,0x06,0x0B,0xDE] gde() END A=131 IF(sk=="timeSlot4MondaySwitch") A=1311 d0=INPUT gdt() week4_1=dt1 week4send(); END IF(sk=="timeSlot4TuesdaySwitch") A=1312 d0=INPUT gdt() week4_2=dt1 week4send(); END IF(sk=="timeSlot4WednesdaySwitch") A=1313 d0=INPUT gdt() week4_3=dt1 week4send(); END IF(sk=="timeSlot4ThursdaySwitch") A=1314 d0=INPUT gdt() week4_4=dt1 week4send(); END IF(sk=="timeSlot4FridaySwitch") A=1315 d0=INPUT gdt() week4_5=dt1 week4send(); END IF(sk=="timeSlot4SaturdaySwitch") A=1316 d0=INPUT gdt() week4_6=dt1 week4send(); END IF(sk=="timeSlot4SundaySwitch") A=1317 d0=INPUT gdt() week4_7=dt1 week4send(); END A=132 IF(sk=="timeSlot4AcChargingEnable") A=132 y2=[0x0B,0xE1] d0=INPUT enuma() END A=133 IF(sk=="timeSlot4GeneratorChargingEnable") A=133 y2=[0x0B,0xE2] d0=INPUT enuma() END A=134 IF(sk=="timeSlot4DischargePower") A=134 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xE3] t1=t0.insertAt(4,str1) ydc() END A=135 IF(sk=="timeSlot4BackupSoc") A=135 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xE4] t1=t0.insertAt(4,str1) ydc() END A=136 IF(sk=="timeSlot4LeadAcidBackupVoltage") A=136 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0B,0xE5] t1=t0.insertAt(4,str1) ydc() END A=137 IF(sk=="timeSlot4MaxPeakPower") A=137 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xE6] t1=t0.insertAt(4,str1) ydc() END A=138 IF(sk=="timeSlot5StartTimeslog") A=138 d0=INPUT d1=[0x01,0x06,0x0B,0xE7] gde() END A=139 IF(sk=="timeSlot5EndTimeslog") A=139 d0=INPUT d1=[0x01,0x06,0x0B,0xE8] gde() END A=140 IF(sk=="timeSlot5MondaySwitch") A=1401 d0=INPUT gdt() week5_1=dt1 week5send(); END IF(sk=="timeSlot5TuesdaySwitch") A=1402 d0=INPUT gdt() week5_2=dt1 week5send(); END IF(sk=="timeSlot5WednesdaySwitch") A=1403 d0=INPUT gdt() week5_3=dt1 week5send(); END IF(sk=="timeSlot5ThursdaySwitch") A=1404 d0=INPUT gdt() week5_4=dt1 week5send(); END IF(sk=="timeSlot5FridaySwitch") A=1405 d0=INPUT gdt() week5_5=dt1 week5send(); END IF(sk=="timeSlot5SaturdaySwitch") A=1406 d0=INPUT gdt() week5_6=dt1 week5send(); END IF(sk=="timeSlot5SundaySwitch") A=1407 d0=INPUT gdt() week5_7=dt1 week5send(); END A=141 IF(sk=="timeSlot5AcChargingEnable") A=141 y2=[0x0B,0xEB] d0=INPUT enuma() END A=142 IF(sk=="timeSlot5GeneratorChargingEnable") A=142 y2=[0x0B,0xEC] d0=INPUT enuma() END A=143 IF(sk=="timeSlot5DischargePower") A=143 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xED] t1=t0.insertAt(4,str1) ydc() END A=144 IF(sk=="timeSlot5BackupSoc") A=144 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xEE] t1=t0.insertAt(4,str1) ydc() END A=145 IF(sk=="timeSlot5LeadAcidBackupVoltage") A=145 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0B,0xEF] t1=t0.insertAt(4,str1) ydc() END A=146 IF(sk=="timeSlot5MaxPeakPower") A=146 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xF0] t1=t0.insertAt(4,str1) ydc() END A=147 IF(sk=="timeSlot6StartTimeslog") A=147 d0=INPUT d1=[0x01,0x06,0x0B,0xF1] gde() END A=148 IF(sk=="timeSlot6EndTimeslog") A=148 d0=INPUT d1=[0x01,0x06,0x0B,0xF2] gde() END A=149 IF(sk=="timeSlot6MondaySwitch") A=1491 d0=INPUT gdt() week6_1=dt1 week6send(); END IF(sk=="timeSlot6TuesdaySwitch") A=1492 d0=INPUT gdt() week6_2=dt1 week6send(); END IF(sk=="timeSlot6WednesdaySwitch") A=1493 d0=INPUT gdt() week6_3=dt1 week6send(); END IF(sk=="timeSlot6ThursdaySwitch") A=1494 d0=INPUT gdt() week6_4=dt1 week6send(); END IF(sk=="timeSlot6FridaySwitch") A=1495 d0=INPUT gdt() week6_5=dt1 week6send(); END IF(sk=="timeSlot6SaturdaySwitch") A=1496 d0=INPUT gdt() week6_6=dt1 week6send(); END IF(sk=="timeSlot6SundaySwitch") A=1497 d0=INPUT gdt() week6_7=dt1 week6send(); END A=150 IF(sk=="timeSlot6AcChargingEnable") A=150 y2=[0x0B,0xF5] d0=INPUT enuma() END A=151 IF(sk=="timeSlot6GeneratorChargingEnable") A=151 y2=[0x0B,0xF6] d0=INPUT enuma() END A=152 IF(sk=="timeSlot6DischargePower") A=152 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xF7] t1=t0.insertAt(4,str1) ydc() END A=153 IF(sk=="timeSlot6BackupSoc") A=153 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xF8] t1=t0.insertAt(4,str1) ydc() END A=154 IF(sk=="timeSlot6LeadAcidBackupVoltage") A=154 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0B,0xF9] t1=t0.insertAt(4,str1) ydc() END A=155 IF(sk=="timeSlot6MaxPeakPower") A=155 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xFA] t1=t0.insertAt(4,str1) ydc() END A=156 IF(sk=="timeSlot7StartTimeslog") A=156 d0=INPUT d1=[0x01,0x06,0x0B,0xFB] gde() END A=157 IF(sk=="timeSlot7EndTimeslog") A=157 d0=INPUT d1=[0x01,0x06,0x0B,0xFC] gde() END A=158 IF(sk=="timeSlot7MondaySwitch") A=141 d0=INPUT gdt() week7_1=dt1 week7send(); END IF(sk=="timeSlot7TuesdaySwitch") A=142 d0=INPUT gdt() week7_2=dt1 week7send(); END IF(sk=="timeSlot7WednesdaySwitch") A=143 d0=INPUT gdt() week7_3=dt1 week7send(); END IF(sk=="timeSlot7ThursdaySwitch") A=144 d0=INPUT gdt() week7_4=dt1 week7send(); END IF(sk=="timeSlot7FridaySwitch") A=145 d0=INPUT gdt() week7_5=dt1 week7send(); END IF(sk=="timeSlot7SaturdaySwitch") A=146 d0=INPUT gdt() week7_6=dt1 week7send(); END IF(sk=="timeSlot7SundaySwitch") A=147 d0=INPUT gdt() week7_7=dt1 week7send(); END A=159 IF(sk=="timeSlot7AcChargingEnable") A=150 y2=[0x0B,0xFF] d0=INPUT enuma() END A=160 IF(sk=="timeSlot7GeneratorChargingEnable") A=160 y2=[0x0C,0x00] d0=INPUT enuma() END A=161 IF(sk=="timeSlot7DischargePower") A=161 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x01] t1=t0.insertAt(4,str1) ydc() END A=162 IF(sk=="timeSlot7BackupSoc") A=162 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x02] t1=t0.insertAt(4,str1) ydc() END A=163 IF(sk=="timeSlot7LeadAcidBackupVoltage") A=163 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0C,0x03] t1=t0.insertAt(4,str1) ydc() END A=164 IF(sk=="timeSlot7MaxPeakPower") A=164 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x04] t1=t0.insertAt(4,str1) ydc() END A=165 IF(sk=="timeSlot8StartTimeslog") A=165 d0=INPUT d1=[0x01,0x06,0x0C,0x05] gde() END A=166 IF(sk=="timeSlot8EndTimeslog") A=166 d0=INPUT d1=[0x01,0x06,0x0C,0x06] gde() END A=167 IF(sk=="timeSlot8MondaySwitch") A=141 d0=INPUT gdt() week8_1=dt1 week8send(); END IF(sk=="timeSlot8TuesdaySwitch") A=142 d0=INPUT gdt() week8_2=dt1 week8send(); END IF(sk=="timeSlot8WednesdaySwitch") A=143 d0=INPUT gdt() week8_3=dt1 week8send(); END IF(sk=="timeSlot8ThursdaySwitch") A=144 d0=INPUT gdt() week8_4=dt1 week8send(); END IF(sk=="timeSlot8FridaySwitch") A=145 d0=INPUT gdt() week8_5=dt1 week8send(); END IF(sk=="timeSlot8SaturdaySwitch") A=146 d0=INPUT gdt() week8_6=dt1 week8send(); END IF(sk=="timeSlot8SundaySwitch") A=147 d0=INPUT gdt() week8_7=dt1 week8send(); END A=168 IF(sk=="timeSlot8AcChargingEnable") A=168 y2=[0x0C,0x09] d0=INPUT enuma() END A=169 IF(sk=="timeSlot8GeneratorChargingEnable") A=169 y2=[0x0C,0x0A] d0=INPUT enuma() END A=170 IF(sk=="timeSlot8DischargePower") A=170 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x0B] t1=t0.insertAt(4,str1) ydc() END A=171 IF(sk=="timeSlot8BackupSoc") A=171 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x0C] t1=t0.insertAt(4,str1) ydc() END A=172 IF(sk=="timeSlot8LeadAcidBackupVoltage") A=172 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0C,0x0D] t1=t0.insertAt(4,str1) ydc() END A=173 IF(sk=="timeSlot8MaxPeakPower") A=173 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x0E] t1=t0.insertAt(4,str1) ydc() END A=174 IF(sk=="timeSlot9StartTimeslog") A=174 d0=INPUT d1=[0x01,0x06,0x0C,0x0F] gde() END A=175 IF(sk=="timeSlot9EndTimeslog") A=175 d0=INPUT d1=[0x01,0x06,0x0C,0x10] gde() END A=176 IF(sk=="timeSlot9MondaySwitch") A=141 d0=INPUT gdt() week9_1=dt1 week9send(); END IF(sk=="timeSlot9TuesdaySwitch") A=142 d0=INPUT gdt() week9_2=dt1 week9send(); END IF(sk=="timeSlot9WednesdaySwitch") A=143 d0=INPUT gdt() week9_3=dt1 week9send(); END IF(sk=="timeSlot9ThursdaySwitch") A=144 d0=INPUT gdt() week9_4=dt1 week9send(); END IF(sk=="timeSlot9FridaySwitch") A=145 d0=INPUT gdt() week9_5=dt1 week9send(); END IF(sk=="timeSlot9SaturdaySwitch") A=146 d0=INPUT gdt() week9_6=dt1 week9send(); END IF(sk=="timeSlot9SundaySwitch") A=147 d0=INPUT gdt() week9_7=dt1 week9send(); END A=177 IF(sk=="timeSlot9AcChargingEnable") A=177 y2=[0x0C,0x13] d0=INPUT enuma() END A=178 IF(sk=="timeSlot9GeneratorChargingEnable") A=178 y2=[0x0C,0x14] d0=INPUT enuma() END A=179 IF(sk=="timeSlot9DischargePower") A=181 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x15] t1=t0.insertAt(4,str1) ydc() END A=180 IF(sk=="timeSlot9BackupSoc") A=182 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x16] t1=t0.insertAt(4,str1) ydc() END A=181 IF(sk=="timeSlot9LeadAcidBackupVoltage") A=183 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0C,0x17] t1=t0.insertAt(4,str1) ydc() END A=182 IF(sk=="timeSlot9MaxPeakPower") A=184 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x18] t1=t0.insertAt(4,str1) ydc() END A=183 IF(sk=="timeSlot10StartTimeslog") A=185 d0=INPUT d1=[0x01,0x06,0x0C,0x19] gde() END A=184 IF(sk=="timeSlot10EndTimeslog") A=186 d0=INPUT d1=[0x01,0x06,0x0C,0x1A] gde() END A=185 IF(sk=="timeSlot10MondaySwitch") A=141 d0=INPUT gdt() week10_1=dt1 week10send(); END IF(sk=="timeSlot10TuesdaySwitch") A=142 d0=INPUT gdt() week10_2=dt1 week10send(); END IF(sk=="timeSlot10WednesdaySwitch") A=143 d0=INPUT gdt() week10_3=dt1 week10send(); END IF(sk=="timeSlot10ThursdaySwitch") A=144 d0=INPUT gdt() week10_4=dt1 week10send(); END IF(sk=="timeSlot10FridaySwitch") A=145 d0=INPUT gdt() week10_5=dt1 week10send(); END IF(sk=="timeSlot10SaturdaySwitch") A=146 d0=INPUT gdt() week10_6=dt1 week10send(); END IF(sk=="timeSlot10SundaySwitch") A=147 d0=INPUT gdt() week10_7=dt1 week10send(); END A=186 IF(sk=="timeSlot10AcChargingEnable") A=188 y2=[0x0C,0x1D] d0=INPUT enuma() END A=187 IF(sk=="timeSlot10GeneratorChargingEnable") A=188 y2=[0x0C,0x1E] d0=INPUT enuma() END A=188 IF(sk=="timeSlot10DischargePower") A=189 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x1F] t1=t0.insertAt(4,str1) ydc() END A=189 IF(sk=="timeSlot10BackupSoc") A=190 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x20] t1=t0.insertAt(4,str1) ydc() END A=190 IF(sk=="timeSlot10LeadAcidBackupVoltage") A=191 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x0C,0x21] t1=t0.insertAt(4,str1) ydc() END A=191 IF(sk=="timeSlot10MaxPeakPower") A=192 d0=INPUT gdt() t0=[0x01,0x06,0x0C,0x12] t1=t0.insertAt(4,str1) ydc() END # EMS Setting 2 IF(sk=="systemOperatingMode") A=21 y2=[0x0B,0xB8] d0=INPUT enuma() END IF(sk=="pvEnergyPriority") A=22 y2=[0x0B,0XB9] d0=INPUT enuma() END IF(sk=="maxGridFeedInPower") A=23 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xBA] t1=t0.insertAt(4,str1) ydc() END IF(sk=="maxGridFeedInPowerOffset") A=24 d0=INPUT gdt() t0=[0x01,0x06,0x0B,0xBB] t1=t0.insertAt(4,str1) ydc() END IF(sk=="capacityControl") A=25 y2=[0x0B,0xBC] d0=INPUT enuma() END IF(sk=="clearAllTimeSlots") A=25 y2=[0x0B,0xBD] d0=INPUT y1=[0x01] gt1() ydc() END # Diesek Generator Setting 3 A=31 IF(sk=="generatorPortFunctionSelect") A=31 y2=[0x00,0xDA] d0=INPUT enuma() END A=32 IF(sk=="generatorChargingCurrentLimit") A=32 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0xDB] t1=t0.insertAt(4,str1) ydc() END A=33 IF(sk=="generatorInputRatedPower") A=33 d0=INPUT gdt() dt1=dt1/10 str1=dt1.toString(1,0) t0=[0x01,0x06,0x00,0xDC] t1=t0.insertAt(4,str1) ydc() END A=34 IF(sk=="lithiumStartSoc") A=34 d0=INPUT gdt() t0=[0x01,0x06,0x00,0xDD] t1=t0.insertAt(4,str1) ydc() END A=35 IF(sk=="leadAcidStartVoltage") A=35 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0xDE] t1=t0.insertAt(4,str1) ydc() END A=36 IF(sk=="lithiumStopSoc") A=36 d0=INPUT gdt() t0=[0x01,0x06,0x00,0xDF] t1=t0.insertAt(4,str1) ydc() END A=37 IF(sk=="leadAcidStopVoltage") A=37 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0xE0] t1=t0.insertAt(4,str1) ydc() END A=38 IF(sk=="pvStartSmartLoadMinPower") A=38 d0=INPUT gdt() dt1=dt1/10 str1=dt1.toString(1,0) t0=[0x01,0x06,0x00,0xE1] t1=t0.insertAt(4,str1) ydc() END # Safe Ruler Setting 4 A=41 IF(sk=="lowGridVoltageProtectionStage1") A=41 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0xFB] t1=t0.insertAt(4,str1) ydc() END A=42 IF(sk=="highGridVoltageProtectionStage1") A=42 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0xFC] t1=t0.insertAt(4,str1) ydc() END A=43 IF(sk=="lowGridFrequencyProtectionStage1") A=43 d0=INPUT gdt() t0=[0x01,0x06,0x00,0xFD] t1=t0.insertAt(4,str1) ydc() END A=44 IF(sk=="highGridFrequencyProtectionStage1") A=44 d0=INPUT gdt() t0=[0x01,0x06,0x00,0xFE] t1=t0.insertAt(4,str1) ydc() END A=45 IF(sk=="lowGridVoltageProtectionStage2") A=45 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0xFF] t1=t0.insertAt(4,str1) ydc() END A=46 IF(sk=="highGridVoltageProtectionStage2") A=46 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x01,0x00] t1=t0.insertAt(4,str1) ydc() END A=47 IF(sk=="lowGridFrequencyProtectionStage2") A=47 d0=INPUT gdt() t0=[0x01,0x06,0x01,0x01] t1=t0.insertAt(4,str1) ydc() END A=48 IF(sk=="highGridFrequencyProtectionStage2") A=48 d0=INPUT gdt() t0=[0x01,0x06,0x01,0x02] t1=t0.insertAt(4,str1) ydc() END A=49 IF(sk=="lowGridVoltageProtectionStage3") A=49 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x01,0x03] t1=t0.insertAt(4,str1) ydc() END A=410 IF(sk=="highGridVoltageProtectionStage3") A=410 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x01,0x04] t1=t0.insertAt(4,str1) ydc() END A=411 IF(sk=="lowGridFrequencyProtectionStage3") A=411 d0=INPUT gdt() t0=[0x01,0x06,0x01,0x05] t1=t0.insertAt(4,str1) ydc() END A=412 IF(sk=="highGridFrequencyProtectionStage3") A=412 d0=INPUT gdt() t0=[0x01,0x06,0x01,0x06] t1=t0.insertAt(4,str1) ydc() END A=413 IF(sk=="lowGridVoltageStage1ProtectionTime") A=413 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x07] t1=t0.insertAt(4,str1) ydc() END A=414 IF(sk=="highGridVoltageStage1ProtectionTime") A=414 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x08] t1=t0.insertAt(4,str1) ydc() END A=415 IF(sk=="lowGridFrequencyStage1ProtectionTime") A=415 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x09] t1=t0.insertAt(4,str1) ydc() END A=416 IF(sk=="highGridFrequencyStage1ProtectionTime") A=416 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x0A] t1=t0.insertAt(4,str1) ydc() END A=417 IF(sk=="lowGridVoltageStage2ProtectionTime") A=417 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x0B] t1=t0.insertAt(4,str1) ydc() END A=418 IF(sk=="highGridVoltageStage2ProtectionTime") A=418 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x0C] t1=t0.insertAt(4,str1) ydc() END A=419 IF(sk=="lowGridFrequencyStage2ProtectionTime") A=419 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x0D] t1=t0.insertAt(4,str1) ydc() END A=420 IF(sk=="highGridFrequencyStage2ProtectionTime") A=420 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x0E] t1=t0.insertAt(4,str1) ydc() END A=421 IF(sk=="lowGridVoltageStage3ProtectionTime") A=421 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x0F] t1=t0.insertAt(4,str1) ydc() END A=422 IF(sk=="highGridVoltageStage3ProtectionTime") A=422 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x10] t1=t0.insertAt(4,str1) ydc() END A=423 IF(sk=="lowGridFrequencyStage3ProtectionTime") A=423 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x11] t1=t0.insertAt(4,str1) ydc() END A=424 IF(sk=="highGridFrequencyStage3ProtectionTime") A=424 d0=INPUT gdt() dt1=dt1/20 str1=dt1.toString(1,0) t0=[0x01,0x06,0x01,0x12] t1=t0.insertAt(4,str1) ydc() END A=425 IF(sk=="tenMinuteVoltageProtection") A=425 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x01,0x13] t1=t0.insertAt(4,str1) ydc() END A=426 IF(sk=="gridConnectionTime") A=426 d0=INPUT gdt() t0=[0x01,0x06,0x01,0x15] t1=t0.insertAt(4,str1) ydc() END A=427 IF(sk=="reconnectionTime") A=427 d0=INPUT gdt() t0=[0x01,0x06,0x01,0x16] t1=t0.insertAt(4,str1) ydc() END A=428 IF(sk=="loadRampRate") A=428 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x01,0x17] t1=t0.insertAt(4,str1) ydc() END A=429 IF(sk=="restartLoadRampRate") A=429 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x01,0x18] t1=t0.insertAt(4,str1) ydc() END A=430 IF(sk=="setPFFunctionMode") A=430 y2=[0x01,0x4B] d0=INPUT enuma() END # Parallel Setting 5 IF(sk=="nParallelModeSet") A=51 y2=[0x00,0xD3] d0=INPUT enuma() END IF(sk=="parallelCanCommAdd") A=52 d0=INPUT gdt() t0=[0x01,0x06,0x00,0xD4] t1=t0.insertAt(4,str1) ydc() END IF(sk=="ubParallelDeviveType") A=53 d0=INPUT y2=[0x00,0xD5] enuma() END # Battery Setting 6 IF(sk=="batteryTypeChoose") A=61 d0=INPUT y2=[0x00,0x7D] enuma() END IF(sk=="ccCurrent") A=62 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x81] t1=t0.insertAt(4,str1) ydc() END IF(sk=="lvVoltage") A=63 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0x82] t1=t0.insertAt(4,str1) ydc() END IF(sk=="cvVoltage") A=64 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0x83] t1=t0.insertAt(4,str1) ydc() END IF(sk=="chargingPowerSet") A=65 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x89] t1=t0.insertAt(4,str1) ydc() END IF(sk=="dischargingPowerSet") A=66 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x8A] t1=t0.insertAt(4,str1) ydc() END IF(sk=="chargingCutoffSoc") A=67 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x8B] t1=t0.insertAt(4,str1) ydc() END IF(sk=="gridTiedDischargeCutoffSoc") A=68 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x8C] t1=t0.insertAt(4,str1) ydc() END IF(sk=="offGridDischargeCutoffSoc") A=69 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x8D] t1=t0.insertAt(4,str1) ydc() END IF(sk=="acChargingCurrentLimit") A=610 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0xBD] t1=t0.insertAt(4,str1) ydc() END # System Message Setting 7 IF(sk=="timeSetting") A=71 d0=INPUT d1=[0x01,0x10,0x00,0x15,0x00,0x06,0x0C] gdea() END IF(sk=="safetyCertificationNumber") A=72 d0=INPUT gdt() dt1=dt1+1 str1=dt1.toString(1,0) t0=[0x01,0x06,0x00,0x45] t1=t0.insertAt(4,str1) ydc() END A=73 IF(sk=="maxReactivePowerPercentage") A=73 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x4B] t1=t0.insertAt(4,str1) ydc() END A=74 IF(sk=="inverterPowerFactor1000") A=74 d0=INPUT gdt() dt1=dt1*10000 dt1=dt1/100+10000 str1=dt1.toString(1,0) t0=[0x01,0x06,0x00,0x4C] t1=t0.insertAt(4,str1) ydc() END A=75 IF(sk=="mpptModee") A=75 y2=[0x00,0x4D] d0=INPUT enuma() END A=76 IF(sk=="lvrtHvrtEnable") A=76 y2=[0x00,0x51] d0=INPUT enuma() END A=77 IF(sk=="gridLowVoltageConnectionLimit") A=77 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0x65] t1=t0.insertAt(4,str1) ydc() END A=78 IF(sk=="gridHighVoltageConnectionLimit") A=78 d0=INPUT p_cnt=1 gdt() t0=[0x01,0x06,0x00,0x66] t1=t0.insertAt(4,str1) ydc() END A=79 IF(sk=="gridLowFrequencyConnectionLimit") A=79 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x67] t1=t0.insertAt(4,str1) ydc() END A=710 IF(sk=="optionalOffGridRatedVoltage") A=710 y2=[0x00,0x6A] d0=INPUT enuma() END A=711 IF(sk=="optionalOffGridRatedFrequency") A=711 y2=[0x00,0x6B] d0=INPUT enuma() END # Regular Setting 8 A=81 IF(sk=="remoteSwitchOnOff") A=81 y2=[0x00,0x00] d0=INPUT enuma() END A=82 IF(sk=="restoreFactorySettings") A=82 y2=[0x00,0x41] d0=INPUT y1=[0xA0] gt1() ydc() END A=83 IF(sk=="maxActivePowerPercentage") A=83 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x4A] t1=t0.insertAt(4,str1) ydc() END A=84 IF(sk=="ctMode") A=84 d0=INPUT gdt() IF(dt1==2) dt1=dt1+1 END str1=dt1.toString(1,0) t0=[0x01,0x06,0x00,0x58] t1=t0.insertAt(4,str1) ydc() END A=85 IF(sk=="preventReverseFlowEnable") A=85 y2=[0x00,0x59] d0=INPUT enuma() END A=86 IF(sk=="antiIslandingPowerLimitR") A=86 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x5A] t1=t0.insertAt(4,str1) ydc() END A=87 IF(sk=="antiIslandingFailTime") A=87 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x5E] t1=t0.insertAt(4,str1) ydc() END A=88 IF(sk=="antiIslandingFailActivePowerPercentageR") A=88 d0=INPUT gdt() t0=[0x01,0x06,0x00,0x5F] t1=t0.insertAt(4,str1) ydc() END A=89 IF(sk=="offGridEnable") A=89 y2=[0x00,0x6C] d0=INPUT enuma() END A=810 IF(sk=="bypassModeEnable") A=810 y2=[0x00,0x6D] d0=INPUT enuma() END A=811 IF(sk=="acChargingEnable") A=811 y2=[0x00,0x91] d0=INPUT enuma() END A=400 RETURN (FALSE) END