From b6bb923b6ec6dda7bf26818077cbb6bf47a798ea Mon Sep 17 00:00:00 2001 From: liuhanqing Date: Wed, 10 Dec 2025 10:02:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=9D=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 30 + 465wcs-master.iml | 21 + FT465-WCS.iml | 12 + WCS.iml | 24 + images/0.jpg | Bin 0 -> 15249 bytes images/1.gif | Bin 0 -> 1634 bytes images/11.gif | Bin 0 -> 1706 bytes images/12.gif | Bin 0 -> 361 bytes images/a.gif | Bin 0 -> 1227 bytes images/calendar.jpg | Bin 0 -> 1644 bytes images/excel.gif | Bin 0 -> 142 bytes images/his.gif | Bin 0 -> 370 bytes images/login.gif | Bin 0 -> 7688 bytes images/mar.gif | Bin 0 -> 180 bytes images/now.gif | Bin 0 -> 202 bytes images/tr.gif | Bin 0 -> 3485 bytes images/任务查询.gif | Bin 0 -> 1270 bytes images/作业查询.gif | Bin 0 -> 1272 bytes images/堆垛机.gif | Bin 0 -> 1272 bytes images/�车.gif | Bin 0 -> 1049 bytes images/红.gif | Bin 0 -> 499 bytes images/红22.gif | Bin 0 -> 390 bytes images/红22.jpg | Bin 0 -> 32436 bytes images/红23.gif | Bin 0 -> 403 bytes images/红25.gif | Bin 0 -> 431 bytes images/绿.gif | Bin 0 -> 515 bytes images/绿23.gif | Bin 0 -> 404 bytes images/绿23.jpg | Bin 0 -> 30728 bytes images/绿24.gif | Bin 0 -> 417 bytes images/绿25.gif | Bin 0 -> 434 bytes images/设备监控.gif | Bin 0 -> 1240 bytes images/调度�作.gif | Bin 0 -> 1271 bytes images/调度日志.gif | Bin 0 -> 1261 bytes images/黄.gif | Bin 0 -> 529 bytes images/黄25.gif | Bin 0 -> 445 bytes images/黄25.jpg | Bin 0 -> 25692 bytes src/META-INF/MANIFEST.MF | 3 + .../dss/ats/customs/abb/common/Constant.java | 18 + .../customs/abb/entity/BasFaultRecord.hbm.xml | 43 + .../customs/abb/entity/BasFaultRecord.java | 87 + .../customs/abb/entity/BasRollerBed.hbm.xml | 22 + .../ats/customs/abb/entity/BasRollerBed.java | 94 + .../ats/customs/abb/entity/DDJ_Device.java | 54 + .../ats/customs/abb/entity/DDJ_Device_2.java | 52 + .../wms/dss/ats/customs/abb/entity/End.java | 27 + .../customs/abb/entity/ExceptionInfo.hbm.xml | 27 + .../ats/customs/abb/entity/ExceptionInfo.java | 63 + .../dss/ats/customs/abb/entity/MsgDdj.hbm.xml | 55 + .../dss/ats/customs/abb/entity/MsgDdj.java | 139 + .../ats/customs/abb/entity/MsgRkSsj.hbm.xml | 37 + .../dss/ats/customs/abb/entity/MsgRkSsj.java | 85 + .../ats/customs/abb/entity/MsgXdkSsj.hbm.xml | 47 + .../dss/ats/customs/abb/entity/MsgXdkSsj.java | 112 + .../ats/customs/abb/entity/MydoJob.hbm.xml | 119 + .../dss/ats/customs/abb/entity/MydoJob.java | 332 + .../ats/customs/abb/entity/SSJ_Device.java | 53 + .../dss/ats/customs/abb/entity/SendData.java | 39 + .../customs/abb/entity/StoredParameters.java | 37 + .../customs/abb/entity/TaskPriority.hbm.xml | 18 + .../ats/customs/abb/entity/TaskPriority.java | 31 + .../customs/abb/entity/WcsPortState.hbm.xml | 28 + .../ats/customs/abb/entity/WcsPortState.java | 58 + .../entity/WmsDeviceExecutionQueue.hbm.xml | 78 + .../abb/entity/WmsDeviceExecutionQueue.java | 243 + .../dss/ats/customs/abb/entity/end.hbm.xml | 15 + .../ats/customs/abb/form/ABBMainFrame.java | 25 + .../ats/customs/abb/form/StartCorrespond.java | 154 + .../ats/customs/abb/form/StopCorrespond.java | 146 + .../wms/dss/ats/customs/abb/plc/HslRead.java | 105 + .../ats/customs/abb/plc/IsoTcpClientDDJ1.java | 182 + .../ats/customs/abb/plc/IsoTcpClientDDJ2.java | 183 + .../ats/customs/abb/plc/IsoTcpClientSSJ.java | 789 ++ .../customs/abb/plc/PLCCorrespondService.java | 44 + .../dss/ats/customs/abb/plc/ReadPLCDDJ1.java | 35 + .../dss/ats/customs/abb/plc/ReadPLCDDJ2.java | 37 + .../dss/ats/customs/abb/plc/ReadPLCSSJ.java | 73 + src/com/wms/dss/ats/customs/abb/plc/备注.txt | 1 + .../abb/schedule/ABBThreadSchedule.java | 82 + .../ats/customs/abb/schedule/AGVThread.java | 106 + .../customs/abb/schedule/BoxSsjThread.java | 306 + .../customs/abb/schedule/ControlThread.java | 287 + .../ats/customs/abb/schedule/DDJThread.java | 376 + .../ats/customs/abb/schedule/DDJThread2.java | 643 ++ .../dss/ats/customs/abb/schedule/DbGet.java | 286 + .../abb/schedule/ExceptionUploadThread.java | 264 + .../abb/schedule/InOutStockSsjThread.java | 420 + .../abb/schedule/RoadwaySsjThread.java | 348 + .../abb/schedule/TransferSsjThread.java | 204 + .../dss/ats/customs/abb/utils/AGV_GET.java | 218 + .../customs/abb/utils/AllocatePropUtils.java | 526 + .../customs/abb/utils/HttpClientUtility.java | 196 + .../ats/customs/abb/utils/HttpConnection.java | 85 + .../dss/ats/customs/abb/utils/ParseUtil.java | 600 ++ .../customs/abb/utils/ProcedureResult.java | 51 + .../customs/abb/utils/QueryDbDataUtils.java | 618 ++ .../ats/customs/abb/utils/RequestUrls.java | 19 + .../customs/abb/utils/SnowflakeIdWorker.java | 193 + .../wms/dss/ats/customs/abb/utils/Tools.java | 513 + .../wms/dss/ats/customs/abb/utils/UtilId.java | 13 + src/log4j.properties | 41 + src/org/libnodave/Nodave.java | 589 ++ src/org/libnodave/PDU.java | 520 + src/org/libnodave/PLCinterface.java | 108 + src/org/libnodave/Result.java | 35 + src/org/libnodave/ResultSet.java | 47 + src/org/libnodave/S7Connection.java | 590 ++ src/org/libnodave/TCPConnection.java | 108 + src/org/libnodave/tests/PlcTcpClient.java | 83 + src/org/libnodave/tests/TestISOTCP2.java | 269 + src/org/s7/standard/ynuo/PlcBus.java | 39 + src/org/s7/standard/ynuo/PlcInterface.java | 9 + .../standard/ynuo/ReadAreaPlcInterface.java | 486 + .../s7/standard/ynuo/ReadDotPlcInterface.java | 49 + .../ynuo/ReadPlcDBAnalyServer101.java | 248 + .../ynuo/ReadPlcDBAnalyServer102.java | 247 + .../ynuo/ReadPlcDBAnalyServer103.java | 76 + .../ynuo/ReadPlcDBAnalyServer104.java | 425 + .../ynuo/ReadPlcDBAnalyServer171.java | 3054 ++++++ .../standard/ynuo/WriteDotPlcInterface.java | 155 + .../standard/ynuo/client/IsoTcpClient100.java | 776 ++ .../standard/ynuo/client/IsoTcpClient101.java | 804 ++ .../standard/ynuo/client/IsoTcpClient102.java | 860 ++ .../standard/ynuo/client/IsoTcpClient103.java | 371 + .../standard/ynuo/client/IsoTcpClient104.java | 1371 +++ .../standard/ynuo/client/IsoTcpClient171.java | 9204 +++++++++++++++++ wmsdssconfig/abb/actionRelation.xml | 9 + wmsdssconfig/abb/carcommand31.dat | Bin 0 -> 5 bytes wmsdssconfig/abb/cranecommand1.dat | Bin 0 -> 5 bytes wmsdssconfig/abb/cranecommand2.dat | Bin 0 -> 5 bytes wmsdssconfig/abb/exectask1.dat | Bin 0 -> 84 bytes wmsdssconfig/abb/exectask2.dat | Bin 0 -> 84 bytes wmsdssconfig/abb/hibernate.cfg.xml | 34 + wmsdssconfig/abb/opcItemconfig.xml | 442 + wmsdssconfig/abb/ssxcommand1.dat | Bin 0 -> 5 bytes wmsdssconfig/abb/ssxcommand2.dat | Bin 0 -> 84 bytes wmsdssconfig/abb/ssxcommandLC1.dat | Bin 0 -> 5 bytes wmsdssconfig/abb/wmsdssconfig.xml | 255 + wmsdssconfig/abb/wmsdssconfig_1.xml | 255 + wmsdssconfig/dssconfig.properties | 4 + 139 files changed, 31794 insertions(+) create mode 100644 .gitignore create mode 100644 465wcs-master.iml create mode 100644 FT465-WCS.iml create mode 100644 WCS.iml create mode 100644 images/0.jpg create mode 100644 images/1.gif create mode 100644 images/11.gif create mode 100644 images/12.gif create mode 100644 images/a.gif create mode 100644 images/calendar.jpg create mode 100644 images/excel.gif create mode 100644 images/his.gif create mode 100644 images/login.gif create mode 100644 images/mar.gif create mode 100644 images/now.gif create mode 100644 images/tr.gif create mode 100644 images/任务查询.gif create mode 100644 images/作业查询.gif create mode 100644 images/堆垛机.gif create mode 100644 images/�车.gif create mode 100644 images/红.gif create mode 100644 images/红22.gif create mode 100644 images/红22.jpg create mode 100644 images/红23.gif create mode 100644 images/红25.gif create mode 100644 images/绿.gif create mode 100644 images/绿23.gif create mode 100644 images/绿23.jpg create mode 100644 images/绿24.gif create mode 100644 images/绿25.gif create mode 100644 images/设备监控.gif create mode 100644 images/调度�作.gif create mode 100644 images/调度日志.gif create mode 100644 images/黄.gif create mode 100644 images/黄25.gif create mode 100644 images/黄25.jpg create mode 100644 src/META-INF/MANIFEST.MF create mode 100644 src/com/wms/dss/ats/customs/abb/common/Constant.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/BasFaultRecord.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/BasFaultRecord.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/DDJ_Device.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/DDJ_Device_2.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/End.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MsgDdj.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MsgDdj.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MydoJob.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/MydoJob.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/SSJ_Device.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/SendData.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/StoredParameters.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/TaskPriority.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/TaskPriority.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/WcsPortState.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/WcsPortState.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.java create mode 100644 src/com/wms/dss/ats/customs/abb/entity/end.hbm.xml create mode 100644 src/com/wms/dss/ats/customs/abb/form/ABBMainFrame.java create mode 100644 src/com/wms/dss/ats/customs/abb/form/StartCorrespond.java create mode 100644 src/com/wms/dss/ats/customs/abb/form/StopCorrespond.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/HslRead.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ1.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ2.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientSSJ.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/PLCCorrespondService.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ1.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ2.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/ReadPLCSSJ.java create mode 100644 src/com/wms/dss/ats/customs/abb/plc/备注.txt create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/ABBThreadSchedule.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/AGVThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/BoxSsjThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/ControlThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/DDJThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/DDJThread2.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/DbGet.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/ExceptionUploadThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/InOutStockSsjThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/RoadwaySsjThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/schedule/TransferSsjThread.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/AGV_GET.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/AllocatePropUtils.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/HttpClientUtility.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/HttpConnection.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/ParseUtil.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/ProcedureResult.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/QueryDbDataUtils.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/RequestUrls.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/SnowflakeIdWorker.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/Tools.java create mode 100644 src/com/wms/dss/ats/customs/abb/utils/UtilId.java create mode 100644 src/log4j.properties create mode 100644 src/org/libnodave/Nodave.java create mode 100644 src/org/libnodave/PDU.java create mode 100644 src/org/libnodave/PLCinterface.java create mode 100644 src/org/libnodave/Result.java create mode 100644 src/org/libnodave/ResultSet.java create mode 100644 src/org/libnodave/S7Connection.java create mode 100644 src/org/libnodave/TCPConnection.java create mode 100644 src/org/libnodave/tests/PlcTcpClient.java create mode 100644 src/org/libnodave/tests/TestISOTCP2.java create mode 100644 src/org/s7/standard/ynuo/PlcBus.java create mode 100644 src/org/s7/standard/ynuo/PlcInterface.java create mode 100644 src/org/s7/standard/ynuo/ReadAreaPlcInterface.java create mode 100644 src/org/s7/standard/ynuo/ReadDotPlcInterface.java create mode 100644 src/org/s7/standard/ynuo/ReadPlcDBAnalyServer101.java create mode 100644 src/org/s7/standard/ynuo/ReadPlcDBAnalyServer102.java create mode 100644 src/org/s7/standard/ynuo/ReadPlcDBAnalyServer103.java create mode 100644 src/org/s7/standard/ynuo/ReadPlcDBAnalyServer104.java create mode 100644 src/org/s7/standard/ynuo/ReadPlcDBAnalyServer171.java create mode 100644 src/org/s7/standard/ynuo/WriteDotPlcInterface.java create mode 100644 src/org/s7/standard/ynuo/client/IsoTcpClient100.java create mode 100644 src/org/s7/standard/ynuo/client/IsoTcpClient101.java create mode 100644 src/org/s7/standard/ynuo/client/IsoTcpClient102.java create mode 100644 src/org/s7/standard/ynuo/client/IsoTcpClient103.java create mode 100644 src/org/s7/standard/ynuo/client/IsoTcpClient104.java create mode 100644 src/org/s7/standard/ynuo/client/IsoTcpClient171.java create mode 100644 wmsdssconfig/abb/actionRelation.xml create mode 100644 wmsdssconfig/abb/carcommand31.dat create mode 100644 wmsdssconfig/abb/cranecommand1.dat create mode 100644 wmsdssconfig/abb/cranecommand2.dat create mode 100644 wmsdssconfig/abb/exectask1.dat create mode 100644 wmsdssconfig/abb/exectask2.dat create mode 100644 wmsdssconfig/abb/hibernate.cfg.xml create mode 100644 wmsdssconfig/abb/opcItemconfig.xml create mode 100644 wmsdssconfig/abb/ssxcommand1.dat create mode 100644 wmsdssconfig/abb/ssxcommand2.dat create mode 100644 wmsdssconfig/abb/ssxcommandLC1.dat create mode 100644 wmsdssconfig/abb/wmsdssconfig.xml create mode 100644 wmsdssconfig/abb/wmsdssconfig_1.xml create mode 100644 wmsdssconfig/dssconfig.properties diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d491011 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.nar +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# idea +/.idea/ +**/target/ +**/out/ + +/log/ diff --git a/465wcs-master.iml b/465wcs-master.iml new file mode 100644 index 0000000..edf826c --- /dev/null +++ b/465wcs-master.iml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/FT465-WCS.iml b/FT465-WCS.iml new file mode 100644 index 0000000..fb8e866 --- /dev/null +++ b/FT465-WCS.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/WCS.iml b/WCS.iml new file mode 100644 index 0000000..011fdee --- /dev/null +++ b/WCS.iml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/images/0.jpg b/images/0.jpg new file mode 100644 index 0000000000000000000000000000000000000000..da49dc92bcd45aad6b412dbb7a86f84e0766646c GIT binary patch literal 15249 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 N()jR0QJCP#{{S0^!ae{1 literal 0 HcmV?d00001 diff --git a/images/1.gif b/images/1.gif new file mode 100644 index 0000000000000000000000000000000000000000..5dda50808c09e71dc83b231b3f34dda88e095722 GIT binary patch literal 1634 zcmb7@`&-h70*Aj-R0u&pLqs$b6G5jScI4toE?z**`{r_Hn3q|rCWfWS8iJrEc)!Fk zpJQT~*O8L$nXM8v(~BGuHluectDJe|vxYL<%D4j0|_c9oPkc z-QC@nKW*>4-dXzplF?!`o6XN(Z*Bc=Yx$?;5zC0lY#O!W`q}ka!{(^z@rr5Lq)cuj_6MC`URZx3yJYR`vAt z&=-P>zG&^e)~g&W6A!m&uXc#^&C<_XPTy#v8EM)!ZE;UiUSC6vwpM;kR{ig4jYjiv zXVt}j)n{L=C}^#uj!+fNRaNzB;T1(mqby*^zq-1%L0x~QS*cd354T*9s3lUBoYYTB zX_jO(eD+a|R4rF470NtyNq%KMsgsmccTS=xNvoEKOD`m-&&VVtXFn@CDJ{&9pGzzg z5ib)9iVLDEP8Syz@7L@nHWA}WPo6J0Pi)%n)kF};PnmIFV~=N^0tRso@{I@1E<9`N%mTJ_(!c5+9x5k?yfK z(}@!o&xnuaM+pu_$2z5=(1-U5cmf`m=N#+o5#k~~PB zo_+`toPZ}le86@D@IIG)hGO(~vDDbAb`%o@T1G4wP$)uC?LCEx+%&JW{E!J{nHZC#W z0)`=Fg}oyVk&E<2qb^&=U3#?NF3j4V)h%{;tWZ565wL!nx*uA|4xoLd$oHSC?46U> z^|ie3XWR}-K#-`!b`UalNngvLP?Y4Hn^@5=a}g>GvmD`;zka_4NBcxJXt*}B2r03< zPyfwZ-H5013xyp0^m#r^d3F}H85N+uc7Sa!#M#hO@Nf*j-tgK~g;oYgp`FpY6 zAKpHFfUvvdR(E9d?kkY@op>u7XO$m{k6#E!K?veEqZetdA^#CDr$7mS>m5nEH6%`- z80}q`oXB_k)G4uCUh89+qOJ-JR#+21Gx8l--u%~&w5Oi-e(i;Gkyz1AMwTaER%g%b zU(zWKEM&cA6P~A8E8$(zOruYuS7HP@y(1w4ThIW3P@d1Wk2!uLOu7i1Ezi6P>(|j@ z@abuzV&=dT z(?ntLfLn+O-wk8C967Gf+++9BX;#U2_B%(`{X~jVAP(hHmFO4!qA2>Jlw;-bOp-Z~ z67*s&mKxW_<_E8BqAq%a%21X5^KJ7F@IE04F{~Rn;;i+5hw7so{zx60Va&Z4hz?qc zPpUc~@0jJ0wLY} zc4}#BF)uYYHaSH^NGmHZ85tWRBP1jxE)*3SCOc<9TaP0xK{`iZLs4!sJWmK&)CpJJ3R&L?QOpZm=L=in2}`>ST;mN} z;SO5e4q4d{U*!;8;0;Nv3qX_;QoIsPvKV6B8D-=eVAc{mei+~Y1gJ%g*TZ-$0CLPF2v z)VbB}{mTUbSQU`=vilhn6#fqM-x zA7FQCgOrNSQSVV+IK`@KA;;&MyZi?rDe{v7DKv8B}PX zs4mnjQ%x;)^pS}stS;iJrH3T{(uW(iRI>~F5K^Gr34m0TTkGkOL8A03(ez+n_^09H9u} zaVUGl@jxEIZ1asY%E%&b5)jegCLZ{JgRwTT6!1U;4LlHmF2ZQD%{buTqs{{rbkKu9 zGE7{CFxHSGPB!?IvrYsA6p&6e+hpSnIMyIj00vPcv4TJ<;J||tYUF~CG~#%p&pEFQ zP^&lGh@($F$HY5A2RMv}Es$PASb;__%7haQHsP!zcR1pRGmSF6Kybm{K=?h-3qTm5 zL>98-qD?-^)G`1o%2e|VFtI#!3Q8n5rPOJfB-@i(+j}@@c{tSl0*8hyf|CP)AAaKtVY}2&a|6{NAA^8LW2LL|+EC2ui01yBU000Jtz@KpV^N>iycDXX!=s>F&Y9I31ks892^rIEHW}9f;=mRJtY(a zHy1hv4m>Xm7(*5kGcyO493ciBp-Mj@6%`i>C=gn%B0eQK7a3Y_LjXHCCn`~{KM17- HNkITRSSPOg literal 0 HcmV?d00001 diff --git a/images/a.gif b/images/a.gif new file mode 100644 index 0000000000000000000000000000000000000000..a6e3b775777d3dc949508425be5c904647887ab4 GIT binary patch literal 1227 zcmdUuc~9C006>3bh&YdU&QZ;r*DAVhX3-2=H^HMtwm90fY2D_5Q-aPJjjXe-YZW|b zHBRs(u?h+zcp(*Qqj-VRDk^mboP^n_DUu0!f3TF2d3Pt|l36ID7L#+8W zzM*fy0Q-JU*wJY)7(U0bf8reKbUOdLx`NixY_TEwj#!~LIbST#qDg+pmY7cdy+y2+ zNF)nKMkbS~TH0-sYamf$*DCfKl>5m=G7f)qSUN!++HtwkEFYWe*MU_dJA3*Q3}q)O zMi5LLZ(jsS^Z{i0+N46&-1+jicI~~ky-UQWvA?kGccjS0N;VEUO%wV=^S z2cO&E`!w3!hYueYj~pP=R4%A$+1jb$#AtDIy1Z|3X8TQ4@y4-!e^#|b7xYt_U*W1Z zYis#W=8Y{aEf0F%%p9K;^=@KgSVX2Gwon|++#MR%W;Uzx#5&7>8f-d`J7E|cQTI=7 z|5;Y&d}H`AcVKnTNbUvGx=!UIGpp;n*UB~Sq{XIg&5+7qe_KH$GQT6XgceUIl?!WU zpgmp*f}mcnH=Uj^6=1R4G`M4|eXgHh+CBi!vcww-5bRn3#p>fYawnJDO5zLrgoa%`T+l1+)ttB0ALXK^j*Qb zCjdAIP%T`s!ez84%)!@+X#PQ=nWc5YYkMm*XrL1rA+pV2aoo>$qecUB6*XQ6N5Y1W z1+4&^;IXPaNBS^$8#E!RwPbShrDDeQ0>3H~y|X^_l-8sOMEDq#9)hL~zhweUZ_qg-p|tmlGp4 z09ln)t{>X*t-Ff(&6iE-0&RT>#GxaNo+2VpFGMg6O7f&KvDv>KG*9WDhF_Z z*^*&Mvy%*SE8KF%9F6WcHR>BvN{PYvG!;l){Ym>%G+OEMIXH~P!WT6z3&ZU`{Bc%p zSyU~el-RL_6r_i85aaRnG#)U+-htL2)7CLLaK{<~7vl#7AZC8|la&aDGCm0nT>cNa Cr!{o| literal 0 HcmV?d00001 diff --git a/images/calendar.jpg b/images/calendar.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4baf8c5156d0fa18bfa65538e3cbfb8524d1fdcc GIT binary patch literal 1644 zcmbu+c`(~)7zglQB#uxe>S~rM>Pj0&qlhbmmWtI~SA-TDN*#k0S5||mZBfT+mFm)^ zO2j!DSIf8)v{70OO4*Xw)-g(=jOk8jY$;E+q9 zVd1fH@d=5fpOSvQdM!O8^LkePt%AbaMR$HJzF$#EsiIcb)HXG@w6;Bb)ZWogXABGu zJ$}M`!5W{Kd^t7!ip^R0L&l%oC3a#|l$8|BVb3M7t6D<3mu>+n9&{*wJS zSla)ReS!VsdIcN+gG8SPh5;C056Q3LR_sf+^Ik4wFw_IKllJa+8LFzeMLa({^ELy#*t;kv{G6j8RvZzf;?V+v^pzR2h zKU_4QhMO=hg3rnr)IYsg{{`|9T+ zlG$2;~76obI(Us~Y6<7>1AxnLYbX0*5SNBuBTl>FqueA}8ylQoy2S zvGqC4YQbu!um!c}sN&J(Hn6gt|WcQ4jtx8dYCMrSfNR!h6BWYX%qjhNhm2dY?< zr;^#ELaybH6~0ux7RG>`Q8Xe~f1uiFod}Ogm%t|?Ht=MeZh^n9=SmRkDV3pegN)dt2GBL+gaF%!hxx^{QD%;>-RqrbX1SOx zu#4yX_HB1v^1OO9zI1dB*V83GH5*~BY<_#gX?qwmOIP%l$@K0IIb06Z$aao z(LH{%T`^~=C;dGA2t3avYhcYN#0>XwqKxi}VtnrstHTO#sdcdSZ767ZMw#*(s)WfX zdM~m#Pj_cHDAfgmi*f%#2|XzE2cp0hk&7kGo-X%SS|S)s;H$B@=pmJntwM|UwVk7` zueFi=Y;NK28uhGgJfdJ(KZwROT~KA#+uTiQ9){XS@5E+#Tt%K!$Thv6wAi0FmB$%M z>o$%kgQsWOO{ZKs1)5N$WSf#wgtxw8#k#i10EP%PF+ literal 0 HcmV?d00001 diff --git a/images/his.gif b/images/his.gif new file mode 100644 index 0000000000000000000000000000000000000000..5499d98b4fa324ed06fbfd6cd7ec4a008bce98bf GIT binary patch literal 370 zcmZ?wbhEHb#9{ay{>;J85 z?;X?pzIN&Jy_(ndYW`n3=l{%^->3B4TdH_&sl>5468BoFk4+KS+QM2X$*6sg60HyO$qYq0U?GKFQ*nSh88D=VoS?3W8)xAO)o`7Cq>2o z|Nk?P1r&d>u!=C~GU$MGgZ#w6)_)*O`-z}bzjO%8B2G?cjb!%;Yiwq9b*NpP#UvNX zp>n8WfejPWL+QGZ00mRVi3y9fBzD}IVDLd$R8v}0DNBrljfayfU#W$KO@>plo2OBs zrA|gjU52MeQ&Ce{R6tBdTuol3S4(%XjIcbTi1_q%PU76GjLf`^iaXp`*%|q!YrDH? Ss7h!moIK^GsdLhi!5RQAOLi{+ literal 0 HcmV?d00001 diff --git a/images/login.gif b/images/login.gif new file mode 100644 index 0000000000000000000000000000000000000000..7cf798ce0432b44e070b2d3fcd1a880506625b4d GIT binary patch literal 7688 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 literal 0 HcmV?d00001 diff --git a/images/tr.gif b/images/tr.gif new file mode 100644 index 0000000000000000000000000000000000000000..3fd6c20a8ba2db3c4a0fcadf9c1d8a5986d01b5b GIT binary patch literal 3485 zcma)-`#;nF`^V?F4Vxu2D$&W_r9uZP)#mM#)LTVKDO4lx4&og}YI81;cZ$hrIW;*n zry9y}X3SyEL>gnxOwQY0uh(bq?_cn}ZrAO8d;ajaez>mZ#tnx;4ObV5_kI z0)n8C-_Y;^G%SR8Lg?2#^m7hMsuLwKMagxd6s9P(UX;cXQ5!_*4WbOTD6>(N)g;Pp z66Z9FX&lj~7I9vSxS&n^nJX@Amy~o$Q(W0E`M?%sb3`ATML8|v+*Wa3n>e2<{@gC1 zcSz{%;=&GbahIf6DweWKT-+)C(k&_N5`XQHeCd`_T-GaL^oYxQB^7;=@?P<`e#y5! z@%JB+ssTyOAW%IZsrv~qe**PG0P7dfGz>KJLCy%k9Rtgx`aW^hprmdHsOJIfVX%P* zG>(AmVJQI)A8Z)~oB2S?D9|a^;E!pLHxETKM&4BLIZ}ZDY#oyl z=$rsM#-#+hC&BJXpmz%Fn+6AGp_sCf*X1MsR`BD#@!x*uQ>sQ2t4H70NXbvE;-}P( zrq+#SumqV6f+Ftpx8C`xeqm+beD@UCKLhqmiU#MPfmv{99vYklMi!v>Dt?l*ggHvB zA1nMJNoS2^u?5+Uf{#t(Ih^s_=7~?7@%)yFg4W4G?liq^irzL^+%a9+IaAUx{k3cM zOXm!ud$zo1?pxn{)em9q-~#jKZ#HkK;n!l*@Nx@(rFmqzZEUq&u+}lY)-|!-Jt-QP zlQtsmoe~YqN`48Y{|@jLprLty{~Id#34CfEZyJ}5T3A2yyMIPJ{2MABl9c|Ee32$k z!Wag=@qw}tpn?y48wD!IfGPn{GY-^F0IW%{eiCS$1{LlkD|jZsy^;}LDJu8U>ZgE) zX|Q1$Xq*Ar(?Ihq*fa}r=D?PDuyr2f&Vy}2uzdmSTmah^fcD>D=WnoU5$s+9dzYb} zC9rQ9`mq8vFM@q5P|Fh7whXl{fvrmbcNOYbg?iVZ&NZlOU213O|9t)bg5J8k3=Fma zGx$&a-%h{~5R8+hg`n}OLlib<8_~Rn3Bi~Rvf8w%*Y#1@gG4iLo@&Eu-BXI%r{84e z#^ElO@3Du)a}o?)(3I1~*=Li=e30y%gC9w0cyg1rZ3(SC!zOOeyZXFqX&>z~Y~Q^k zesaupR`dEpDd7JYif3Ww_ zO-|}rfBdY;nA0$3d1#xrkV>@yy4g(eaO_ zd+B$gpoIKQ{`afDcfx_7EI`9(ZXil)$Ejz5qLt6DwB&BQl8zU=9R8e5SjFDzx|40` zc>ZBe?4Q~xjvb+U92p(g_|YaL7n78Pq=4{!f1)*ay1Q9!uyj3dsjAhR+q+pZ3 z0J;*EXI8nY6U#cPul2~;Ou;!_ZePu*q;2pvKH>I*?Z@cH(p*V-59d5%jjroG8i0a`?x`;OXHTNAAe-VWuI zhRHNt%F)Y8Bz}5jia(TRQHQZsS*XLyyDijX;WbRwmIpHy4V#tq^1u8d4uoRPVq_H5 zC(-ALiF2#~{>v4lY4Z09?N17H)rTLQ3uT^PHoW$RB&R0OP%)OSPQia z)<2h2oy5YB9w&bwgo(PLQnc~R-6&(m**q164HK0r2Q}vBPA}#kQP%f#PdrSy<@Z7a zz0&3qJ}X?dGdg@cF5(%I{*UVMnd-;<*j3#!ew_9G^)bq7b)6vDU#GO!H40UPxgDZB z)ihQ4lbB~DFqw~qkF?}^ROw{4TN2M=88VHU207Og_Q=Jcm;LF{(8P2_pf8?Spryf)t_e~@8Y!1Br1_C4fTe-LR z&W;s>qv@O8*_^yZOZu7ad!Y3Y!s%&l8sPWQKvtdVdFVXLaO-Vk*NTa<^JJ%|hJ&mr^}m zaagElA8mBugL!dgS`7NXQCJozd!vSGyfnT_fjDU}xF17}IWnz-V`CI|8%N4kvHF(0|tTika+aLW;b zVL(p?RrBlG;a6dQUCl7KopkN(cC|8n{8IVVq0FMM$8?w;t5?r}Bk7Rdb$3^JY&8sN zqst|0FHzwrnz`J2a`>?&c`Z`{GW138Ml;{{SQnWiyC#Eej}#_hN`@80i z*Z+7SEBjHoXV7mwZp$e0lpjyY_=IMS?2Nr?Tr!I{^2 zIh(LG7md8h&-cImpt^Op(jjW|sUoVv7Q|jS2`i^X(I8ptUPs61pHL#U!_64ZebuJM z_wpSaZ@6#NI4A%4aeWuDJmA-sK!x}1x=r!x>ezS043)cfFnJ9sUSW?RxzTE+D89u& z;RxqStI}b4i>-u<2_lD_{aqhW-Cmck3cKknUa9q4!bT(we-^rL9Jp&XoplUnYagBK zLJZzKIJ$CK7MOfjC^YXS{1vKF7E~k38k)fCFRJ{W8UQzmF~Rv{V1X7`=cm*jTAWH@h9JXrVIy0r}X?E(`-6d z`%mVsi~#2>)NvliRk0YZ!z01XT$^>gt0~=2iK_l

Y^b;mdsG>snXiWi@FF7aqPM zuQ{tLoKT!rWZ7Dr33doh?n*yh!wwxvoheX$7ANvlY}2s9a;`kF4@(KH65{^UMj;N% znV+4ykaVo;hSeiV=b*qSu&-t3Nh7~gu`VrBPufg-jHnPz7LD(SG++5_l7n?sj$aC_ zK^4`diwcU5p-X1Uw(1WT!o&t7<2Qw*`v*ueJhX{i<-R$ewD(YDQ zCcAs3;L+hTWDItBXl@to(wNu|<+Ru<3L1HyXmX(m<>aNH$XBC~TzwB8XE1?jyZk(= z!M2{-7cFVV)PG6$^?Celt1GhRbF(o~k^vlK^0mCqj(9MN!Q7i_fH2J+%C*f9{S`D7 zSQFK=IpZJzy(u8{~f%V}|6 zpEOP-03H@Qw7C>3>cQB3;EFhtG(}MS}1sh^RcAJJ6IE5U+1#f1MC+Q((Z1hYl`Xn~g z+%$C7KGf=Q=&TTJ%LuhasGeI3wa12?n?SeV5!bxKoG4+=jIe7o#p`Qfu88oz>55*4 z;Y82yyRqS3Y(*DtxC>X&8xe8eFycNQ;rBS=fl$%M5bgtmKNLoU*(3fjjC>?5dyI&T zjC|n=_vc2w44@*S=!jR~d2AB&`rkngF;Bs%g* zEIgSG58xudxGJaGN2LjoUolD_U`pR`O6ho|OhctwCnct*Qnt4eJ5q@jtCYio=Luis dVxk!&<$U|-d|gBz4)Iy2RESY-#b98^{|86bSrz~Q literal 0 HcmV?d00001 diff --git a/images/任务查询.gif b/images/任务查询.gif new file mode 100644 index 0000000000000000000000000000000000000000..7650c710a8d995c3958281948b3ecea3e414d735 GIT binary patch literal 1270 zcmWlYjZ>3#0LO=MYJ`M|ui+V9rIyGvK#(H99Ri|GO;5=b>?*<2H1G{OP7nzZ9grfO zsb_GCMkoSD@+JZr?--21=9q&qwrA^k#-3-}^YVLszhC(I3%=jG&u3F?bVz8DkHkm9 zO5T8{VR;whuv4}vD=AP83?O5tEoK660%9R!p?M1r7=T5r8POns8OjNHED8{C&|Arwi}`BrN2VonZy6)s2m4 zM*Gz!gVAKPP)>j;J7aKQ7C?%20Eiqs7&RDq5wZek?(7i|<{`2RqEi4YL>$Hfgd700 z(+M%=cz)bqATgp5WHI6~WFc^3FlIKg7>EdxHp+oGg0gaepZ>#R!RDMITvn6AObHY% z(j4Zjv{f~t0wQp+E+aD`V4h^Gy0KB^Sf7cQw9%y5skL%Chym%Cm^2$)*kpHD$0u|m z6hu7zz((1u0=7&~b^#?sEXUJ8WLVI9>-IH{rvOx8Jb|$ZV*+FAlP47z+Yn+9;t9fp z5QI>KqD3>1f`mRSsxdTRIBC?LA81+IUB6M?mknL*nD5TcN^_2;z2T`&9jc%0L4bEu<4u)Tl|rGp&AykW5N zGiB{A=d1JVe;wnE+sTdu*UJM_y+;_e;#FJbU}Hwj1BHF^`SZpPuVdioPM0mG+T3%owhm*ge+#>z_X?(%wJb zclT`l{p%b#jzmEexZ4R!9;V0sw&&v;Uw=|{G_)>r_pAHarlyTGRR z$fZc&NWx^d67_{Sf`b|A>SCv*Lhk86hG!to{#N;t+8y*zqe%NNj2W{a=q4jp6l~W zPOHA`w@j|z7SNzS=n=x3qoNly`5v3?2~W3e325#}%6UIs{$5wO@3G7mi#h2Bk?$tQ zZ@jYdRL!#sK3hDK6mPG~eVMaFz9>=Rl{68xHQ>6u(A_&sDQ)rI^ttyluZWStIdf$( ztMa}K5+&Jlq7w(7ztiELDf3AvJEvIF?kkOSUz(OUW2Sfhqbxr&SKa2dK0jhxsL|bB G681lQ98^gF literal 0 HcmV?d00001 diff --git a/images/作业查询.gif b/images/作业查询.gif new file mode 100644 index 0000000000000000000000000000000000000000..b05180324001ae4567d7c30800aa1addd02551dc GIT binary patch literal 1272 zcmV&MO9N%UneIi+1cZEc6;~t`H+#Fr>n@eyw-Ytj?U26>Fe@} zmb-w5oh>s#&DP{;Z+BdNsceR&n5n&QcY$q>wMJWVLuigdV1HYLtck48Zj!Njp1rKk z>N!YKb9sHW$I?1jX=#$GhmVp~Y;l04tjgQn!q?d+I5?rXx#a%-?*IRsq@?uz{&976 z`Tzg@|Ns8~|2kGxK37)8+1S|V=RR6kvA(@KR8U)ecRNf;;QRJPc5FLPOp?mGmb|f` z$-3(I@o}Dr#_HK%X=J?F$hEq+*xlOE)Y3*%O1iPxjxw);`+06Uzd-!c3M_8^XsqGy)3+{Ka7Dz|NQE>s%gr!RlT*9 zp__v8>c*Ipe*XLJ{rmHIYBJu$VDZ&$Bw2lvuOJ2z1Y^!vzJiW zy?FK4jm))up@2Qu!kpmKywk01X;wIncToG;q50ml-^r+LX=8tMWx}Y3{`2O_v6k}V z(#*xZn1O2c@$7I+F43un>d39sxTpU1@n=^~%EiKcWm)_6^0tF)@YKh|hHduAxA*Jj z;-`|@qma0jiQUl5Qcq5&XjiIuYSo;J&v|6il!UROo}5K8y>(@lYGXh+H~R7Lz>CUC2 zcaJ~-CR~;*VZw=*6cnk}#iLg$7qx5h3T&WZWQYzQPRs>J@oJqrcB5`(yHzfMgb+n$ z$gtr=oToI<;<(Fq4V*f3`~+}t5u^u>9ZXD^uwrP_xP0->of9B0oR1+sc;vY8!Jh#! z3gB&b1Xms2rsB%$P)^r!blw>z+=iRvmkSgGlYavLJT#OVMqoTKv01QDr{m( zC9e#_3^L6$(ZnH#d~(PEn2=-710J|=LLa8+5=}J7V4Lj1r;Kma?hy1r%r literal 0 HcmV?d00001 diff --git a/images/堆垛机.gif b/images/堆垛机.gif new file mode 100644 index 0000000000000000000000000000000000000000..b57fad21319a02149758568b35c1b3f447b7021b GIT binary patch literal 1272 zcmVrO+Za8DK0ZHG;wBsDkd;LK0+iTEHN=Z9wagxAuAUjEhj23ASW>+ zD>fS-Cm=9HFgZjNF;OW$R~;%j8z(g#DK{oBIS(yN6ERN_A~PpUawbG#8ZJT}Ge{yf zOFUnLE<{>UaF9!7e<3O}CM`4~C@w5BIw>tN4@P(lH(eA$Z5K;?6+B-NFijamZ51+1 z5hpwqE=CtHND?A36(uw&M`R~MT{Bj98Y($1NMR^BNe3D#C0>vcE=3tPQ5P{r6e&9r zB{dc%Gc8MG8Ywm?JWU-aF(xfD8a!1UKwBU_RV`L^6C^PxNn;WqD=tV}8YnXp9VIG2 zQLM4G6(}_?Ph}P)E+RBR8740sCM+f~IWRm#H$FoVBQ7C0M;$RfIaOvOF*-0*Xel~G z8zn1ETVoO>FDpDnA}=;9IY1&TF+@m80Tv)MMNB0zHZVLv9Vjd%H999ZJVaJoB`q&S zPEavDKO-wEBP}eYtg2&XUu9=uXK7)Vn1-^jqPVoA(Z{H|wWM2FQ?jk0y0W3Vv7dW- zc+JJO!Md%EiGa4OoWr@P$-b_>w57MRt+}k6(8agQz_Z1+rOv{&y|Sjy!?u2RZ`{?* zv7wRD#kj?}t<1o*z_h8&!M3`urQFcP+tSLcn~kobnAgg`=GxHG%EPmync&pRn~8kR z#J+%SV~%rYuz6>DP(*H8ReDoPR!BvUWL(BOD8xZ8LLwb>KR1$CPn20vh*L{-P)dh% zalAe*nK34>IxUqlCPOhVIx;b!G%A)hEqW{_i#9K7DHZ^P~C7@$rRW~+$W@U0bJ54DmLM0_M zD=S7qLjV8&A^8LW00930EC2ui02BZe000R806Pf;_{lUuiCS4-R$kF@JNpxF;A4JS<@rTihd>@gkZOA+<^m@64k&0C5<2* zcfzy)M?!!Fa@)K$n|DSM95Pb;c(EdfP7Mww7(gI5t=lT2@BupC i7y&~ei#Xs91r&5pk24cYkk17pd;kImB8X5zKma?@xzSbt literal 0 HcmV?d00001 diff --git a/images/å°�车.gif b/images/å°�车.gif new file mode 100644 index 0000000000000000000000000000000000000000..f14f92b85171a231e1f493c40189567e0abb2784 GIT binary patch literal 1049 zcmZ?wbhEHb6k!ly_|5#$_wTO|ncu&@{`vX&_t*E+I_tlG zdiV3|r|+LX{QLd$&84H?UqAi%@$IjVZJLYDzdO9^&7qyI4(&>gium#5 z!3kTni$S*MV?6I>hTg8vd(vC;bmNK-2Y0^Nx9#=*?Qak7etu~8hs)=#x#+fQ$)2*; zIq#@<#ntexr|DHU<8z)SC*6%Ndz)SKHb3TOa@O1OYPj>w#K33Sk$2O>ALmA&ObB|E z8+#!&>~U$z!?M)d&E@ynsvb;eezkhxhhqm`pE&&f+{t@~_I-N%@Pe)OWqZAA4*J(! z46isDU3WJ*>0ofv)9jM7$t4$)lTOCBJuI$yS={ijyzX!ND8%Vju+x=5hl_zucOpEl zM|wWaj6M(_aN8z%S?r}@KLpFv7 z989-5n%>MzIGY;tWYfBrdv?4&xcB9;!yj(lcz5f@%ah07T|9qfLhtKM8{VBh{q4=0 zA3uHoV-_64qXfb&LXt-=>nm9-L z)R!|8gPXaV_(Gm+VPHOVfL%YuDMR29<3R}x<2gGF)jHc7wV8ajay@kJmP*`{ar4o0 zehEY8OD_a&H?sCB*uOAnQf56Zt`nQ`CEyB&kffu-B7@9FX?=67%YLQoe6;wKvcn{! zvlk|}cTLqSyyuX)Iql*+k68w9Jq{ko>{Ruea;5T+8}EFFW<5m#i-rS?jod;D1e=Zv ePWPNEBT&LA*rduRqw+*W!qJh@--wxs!5RSW0;in- literal 0 HcmV?d00001 diff --git a/images/红.gif b/images/红.gif new file mode 100644 index 0000000000000000000000000000000000000000..1a992ae23774278d2608c3898e9c05c916660acd GIT binary patch literal 499 zcmZ?wbhEHblw*)%xXJ(m|AByk=|3a$e=FFM@Xa4{H`~QDh8iTPh z!_1k+X=%nYXQuuCfAjzUXFwTCBgU*`<2h4P{{J|ZlWdfoY&>^z%G^oGyJl<83*_8a zps_Vy_y4A>xk*Or1GqK>a2-oiJDH+(JXP&`jphFi&vRZ}mt6SX8}Wa)lK803_d$d2 zyS~_eGudB?LjRRTe~Iw?XJ7z2<^SKmK&Jp5lm=u2orwVyf3h$#Fjz9^fMh^^Vqp7! zU`~Mtk3_%QqN0;IR`b1O`q2c73E-bRxIih5}GYAH&d6N z(@DHo(1THE<*FiPZZjvPVn!}^we6+6Yzr3~>wBmlF4bjUs8J;5ekSv5xyi!f<%~D# zm_^Nmi?5j8uanu$bm!XHn$-E0GR5*QYIRu`e#vY*Tz3B3&)wz=4)ZEnuq`Tn*ucTs z`rbig<3WDe1I=C;M;bZa@rbHPMjfzr(YQ02T_$YGn-dEUuTwXZ$=FFM@Xa4{H`~QDh8iTPh z!_1k+X=%nYXQuuCfAjzUXFwTCBgU*`<2h4P{{J|ZlWdfoY&>^z%G^oGyJl<83*_8a zps_Vy_y4A>xk*Or1GqK>a2-oiJDH+(JXP&`jphFi&vRZ}mt6SX8}Wa)lK803_d$d2 zyS~_eGudB?LjRRTe~Iw?XJ7z2<^SKmK&Jp5lm=u2orwVyf3h$#Fjz9^fMh^^VqjZ* zU`~Msk3{d0B}FGw9!V^|#?hRuX1L*C!Zz6iu4^&bZhFP(x?Gnx>ux`5JV{7dTiB1q zqO!nq*(pN-x2kGUMknzUL3bg6mTEI6r4)C@{yet!6rpL;3q;L?Q^e-ZOO=_(G<#Vt zvnYq9Op5%nG}iV_Tho}$oh){x>AB=@Wma%8NnXQj;w5>iDqqxxU;9X&@d{rKa}k+j RW?dQnL{Cu>$uLI-YXDFaltKUi literal 0 HcmV?d00001 diff --git a/images/红22.jpg b/images/红22.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5b476940f0f7c7689775dee2162be942c9408e45 GIT binary patch literal 32436 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 KpVAs(XZjzp!+y5_ literal 0 HcmV?d00001 diff --git a/images/红23.gif b/images/红23.gif new file mode 100644 index 0000000000000000000000000000000000000000..67e92d640a39366592de081dd2c3dada2646db42 GIT binary patch literal 403 zcmZ?wbhEHb6lV};xXJ(m|AByk=|3a$e=FFM@Xa4{H`~QDh8iTPh z!_1k+X=%nYXQuuCfAjzUXFwTCBgU*`<2h4P{{J|ZlWdfoY&>^z%G^oGyJl<83*_8a zps_Vy_y4A>xk*Or1GqK>a2-oiJDH+(JXP&`jphFi&vRZ}mt6SX8}Wa)lK803_d$d2 zyS~_eGudB?LjRRTe~Iw?XJ7z2<^SKmK&Jp5lm=u2orwVyf3h$#Fjz9^fMh^^Vqn{F zU`~Msk3|2GB}FH59!V&NX15$Poh)%9!C-bF`;0@T*I&&#dq=GG<-lf zFzvD4p%R>CDBvbkT_eiqBpxg1E+o*FVdkV1>&`eaotdpu(OBPIeP#xGXROeS#RZ~f z!m(m2SEb2JW?H@}k6Dz%QYKb@Q#xzszJs&Ooh*)}>$&6|V^(l6N!`J0;w5>t?YyWD gzxMg_amHJGIm|_5t}^S&@F#nU3X4dFJ2F@U0A~)I2mk;8 literal 0 HcmV?d00001 diff --git a/images/红25.gif b/images/红25.gif new file mode 100644 index 0000000000000000000000000000000000000000..0906e98efa144b4f8cb2dad01f1d8b1bf68df8ba GIT binary patch literal 431 zcmZ?wbhEHblw^=(xXJ(m|AByk=|3a$e=FFM@Xa4{H`~QDh8iTPh z!_1k+X=%nYXQuuCfAjzUXFwTCBgU*`<2h4P{{J|ZlWdfoY&>^z%G^oGyJl<83*_8a zps_Vy_y4A>xk*Or1GqK>a2-oiJDH+(JXP&`jphFi&vRZ}mt6SX8}Wa)lK803_d$d2 zyS~_eGudB?LjRRTe~Iw?XJ7z2<^SKmK&Jp5lm=u2orwVyf3h$#Fjz9^fMh^^VqiOS zU`~Msk3>J?qN0;IR_zw-$xE_&4J_^ib4pjFZ+5H*xbaLwcSDqJUf?{{k5znf8%%uq z=lF(Co~D^C;4V~K%Hiphz``QbBG8t^&*>zdAm|}9p)G;i%tSxARlg*r;#-UO0V1k+tH=o2Aos|ZSPHno5 H3=Gx)|AeIf literal 0 HcmV?d00001 diff --git a/images/绿.gif b/images/绿.gif new file mode 100644 index 0000000000000000000000000000000000000000..48d618bf2467d47d0b7177061783b580d49d6612 GIT binary patch literal 515 zcmZ?wbhEHblw*)%xXJ(m|Ns9#GxJQ^%$W>n#tbu!8O|6R|4(E1Z_MzYf#D1T!%PN- zGzR1U#>PPLnZ{}V(~Q%MXa1j=HZ$$a|1ByRfN|6o$rbh}+Mywqr1wRZLnVU9>C_X7oIqMwZ z?lfl?Q$`P~n#tbu!8O|6R|4(E1Z_MzYf#D1T!%PN- zGzR1U#>PPLnZ{}V(~Q%MXa1j=HZ$$a|1ND)TO|II|@6 zDV@`JbThza28*kiRIG^Fu@lpHavkzrKaaDpzfcRK zh(H@BpG=_)CvOj~|7Q-oTf6c5a8OBEMg@zgQqIw}+zO@v5ZDVLaU2e$TlT!>%X_3o3qk M>!BbQ=Ez_T0GW_<&j0`b literal 0 HcmV?d00001 diff --git a/images/绿23.jpg b/images/绿23.jpg new file mode 100644 index 0000000000000000000000000000000000000000..251bf554973c4dd44d21504c7bd13ba75d9a1821 GIT binary patch literal 30728 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 z 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 OPxjq{=C9pgW$;gAsXNO6 literal 0 HcmV?d00001 diff --git a/images/绿24.gif b/images/绿24.gif new file mode 100644 index 0000000000000000000000000000000000000000..4e1bd232aea9db746a9e67cae167180d60788323 GIT binary patch literal 417 zcmZ?wbhEHblwgoxxXJ(m|Ns9#GxJQ^%$W>n#tbu!8O|6R|4(E1Z_MzYf#D1T!%PN- zGzR1U#>PPLnZ{}V(~Q%MXa1j=HZ$$a|1k^(n6C0xTZ2Pi}AJ<%;V$|R957fAT$zWPJ7voU Z#kVesio*PYKfZo*lXs}tA;iL94FGKPct!vK literal 0 HcmV?d00001 diff --git a/images/绿25.gif b/images/绿25.gif new file mode 100644 index 0000000000000000000000000000000000000000..ddadb26eab225f1f635ce5c2aea2475ec4657d8a GIT binary patch literal 434 zcmZ?wbhEHblw^=(xXJ(m|Ns9#GxJQ^%$W>n#tbu!8O|6R|4(E1Z_MzYf#D1T!%PN- zGzR1U#>PPLnZ{}V(~Q%MXa1j=HZ$$a|1FOvG<~@4YGazUAizAB+4BhqxTSREdv9>KTZgKh;a4Cp8+=(ebLWHriv%Vpa z$5}W~sEbiVfVVf0Po_*JVKSq%(9B@2IgHF=yj?Svln5#-@NlwsuUoo7aWk(dcyH literal 0 HcmV?d00001 diff --git a/images/设备监控.gif b/images/设备监控.gif new file mode 100644 index 0000000000000000000000000000000000000000..9af5a6de0461199fdf1bbf48d1e7625d7811c7be GIT binary patch literal 1240 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 literal 0 HcmV?d00001 diff --git a/images/调度日志.gif b/images/调度日志.gif new file mode 100644 index 0000000000000000000000000000000000000000..55d1a76e09d662b1d05d3cbf1098ebac0da883db GIT binary patch literal 1261 zcmVV4@&Eh(`Stnp@$=Km)%^JV$Hd66 zt+Ds=`sCx~IygPv+~WQG|2{lN>gn?E@bc{J?##^1#mLe1_W5gXd7!7S@$~oj`uz6! z`&VCMY;JG-{{Qp!_U`iY)!W?h`1$nx{_FGfid=gZ{Jx9s87x_LI+l~3%eX4?@95<8id4RIQt;o{uc)Qeyt98|Sm976?~inFY-_ZoqTRy1 zt)igbIU&`hpVFnE;gycT9~IKW!o>#w+87eQ3kUq|?cUYZNJT~d_V)Pl^2)}>^6~MD zii-F5_y7O@A^8LW00930EC2ui02BZe000R80J~NDMG%)kO`lYO0tE~kwo}v2onr<` zk~2hk)`*E?DW4@mmi!P3hAtkxW|3NqKw(5l6eTB4F!>V3${%>~=C#A+2*?da`SS76 zN5X{@GdXxLSWvHBxL>-SOj$EQf&+Ugpmg!~LWhM0;-D4#wN3?=KnxPR`_raP09omN zXpu81nzvZlSYYu}K!LS6FG8eIb74l3Jfg0JizTUoiV!7K(4bNTf*LaTSio5%Dq1*B zlH`qG(hr7*08hwdz(7GCBQU~@-QBhii4r=ztPLRW?G2t0Ao$ryCY#flG(?P)a|aK> z0&{1)R5?Rgam5!M2;swmJ!G*(0N@<6%q}~yP{R^+1mQvnHgI4E9B>SRLJl4r zGmRoQ#GuC>mz-e2iyK5R2pc&NaYG-WKx4=aI5-i&k4p?u#w9;;fdv|U+|h_Jk?aCN zB85<*4JCL8qRo|kki(8Tj%-4WC%)v83M{bP@=7Y3pmGZ=sN~`cGLLvtOfRdHLdq<) XutG~Md9u<;DW;IpNhYHZ6A%D9)~^K3 literal 0 HcmV?d00001 diff --git a/images/黄.gif b/images/黄.gif new file mode 100644 index 0000000000000000000000000000000000000000..8ac7847f9a2498836a1c756702f12f3482e62b5a GIT binary patch literal 529 zcmZ?wbhEHblw*)%xXJ(m|NsA=nKm;mZRX6GXU?4Yf9C)HzyJR)x~RA74#S=Q%J2V2 zz5mbf8-$qt{{<>$`2CyV^Jj+l?-|aVVc4~cVdhMRh6aX`5{9%i24iEO0;d1}S^ocL z`~P3y|9^@5_Z9BkQU3qm^8bI=rAu{}EYV%GNN?s$Tw)S4ote~VI&817OrgE7i`Y0Hjs5J8AJhUT()oJ~0+b>?LqO5NJ zuaD98Q|D=@Xed+h)f5rnFOiqmnABOC>#Z$TrljkxKW(};E2FcxjNl}F{rS2JGXzAn z*_h!FX53ibrRps$H?x^y}yh{oq4HviL!^rnQ~EV=90@ZCx44zCp$0F&PWiw@l`{GHG#a92kj2pQoi;A+SNi9#CFj-Gj zLS({{!@?3QJZf#WD_{AKcsWbg$a+cXDBdO0|34= B-bw%f literal 0 HcmV?d00001 diff --git a/images/黄25.gif b/images/黄25.gif new file mode 100644 index 0000000000000000000000000000000000000000..eaa46ea8b7b5e8b368fb931569f98382d02e3dce GIT binary patch literal 445 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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/entity/BasFaultRecord.java b/src/com/wms/dss/ats/customs/abb/entity/BasFaultRecord.java new file mode 100644 index 0000000..cb9866d --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/BasFaultRecord.java @@ -0,0 +1,87 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class BasFaultRecord { + private String id; + private String deviceId; + private String deviceName; + + private String deviceType; + private String taskNo; + private String jobId; + private String fault; + private String startTime; + private String finishTime; + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; + } + + public String getTaskNo() { + return taskNo; + } + + public void setTaskNo(String taskNo) { + this.taskNo = taskNo; + } + + public String getJobId() { + return jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getFault() { + return fault; + } + + public void setFault(String fault) { + this.fault = fault; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getFinishTime() { + return finishTime; + } + + public void setFinishTime(String finishTime) { + this.finishTime = finishTime; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.hbm.xml new file mode 100644 index 0000000..d938492 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.hbm.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.java b/src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.java new file mode 100644 index 0000000..bca4a21 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/BasRollerBed.java @@ -0,0 +1,94 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class BasRollerBed { + + private String equCode; + + private Integer equStatus; + + private String yp; + + private String yl; + + private String yc; + + private String standby1; + + private String standby2; + + private String standby3; + + private String standby4; + + public String getEquCode() { + return equCode; + } + + public void setEquCode(String equCode) { + this.equCode = equCode; + } + + public Integer getEquStatus() { + return equStatus; + } + + public void setEquStatus(Integer equStatus) { + this.equStatus = equStatus; + } + + public String getYp() { + return yp; + } + + public void setYp(String yp) { + this.yp = yp; + } + + public String getYl() { + return yl; + } + + public void setYl(String yl) { + this.yl = yl; + } + + public String getYc() { + return yc; + } + + public void setYc(String yc) { + this.yc = yc; + } + + public String getStandby1() { + return standby1; + } + + public void setStandby1(String standby1) { + this.standby1 = standby1; + } + + public String getStandby2() { + return standby2; + } + + public void setStandby2(String standby2) { + this.standby2 = standby2; + } + + public String getStandby3() { + return standby3; + } + + public void setStandby3(String standby3) { + this.standby3 = standby3; + } + + public String getStandby4() { + return standby4; + } + + public void setStandby4(String standby4) { + this.standby4 = standby4; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/DDJ_Device.java b/src/com/wms/dss/ats/customs/abb/entity/DDJ_Device.java new file mode 100644 index 0000000..087cb61 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/DDJ_Device.java @@ -0,0 +1,54 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class DDJ_Device { + + public byte btId;// DDjid + public String dtype;// ÀàÐÍ + public String dName; + + public int CZFS;// ²Ù×÷·½Ê½0δ֪1δѡÔñ2ÊÖ¶¯3°ë×Ô¶¯4µ¥»ú×Ô¶¯5Áª»ú + public int SBZT;// É豸״̬0´ý»ú1ÕýÔÚÖ´ÐÐ2 ÆäËû±àºÅ¼û¹ÊÕÏ´úÂë±í + public long ZXRWH;// ÕýÔÚÖ´ÐÐÈÎÎñºÅ + public int HCZT;// »õ²æ×´Ì¬0ÎÞ»õ1Óлõ + public int ZXJD;// Ö´Ðн׶Î1È¡»õÐÐ×ß2È¡»õ3·Å»õÐÐ×ß4·Å»õ5Íê³É + public int DQP;// µ±Ç°ÅÅ + public int DQL;// µ±Ç°ÁÐ + public int DQC;// µ±Ç°²ã + public int MBPH;// Ä¿±êÅÅ + public int MBLH;// Ä¿±êÁÐ + public int MBCH;// Ä¿±ê²ã + public int YXXF;// ÔÊÐíÏ·¢1ÔÊÐí + public int XTXH; + public String trayCode; + + public DDJ_Device() { + super(); + } + + public DDJ_Device(byte btId, String dtype) { + super(); + this.btId = btId; + this.dtype = dtype; + } + + @Override + public String toString() { + return "DDJDevice{" + + "btId=" + btId + + ", dtype='" + dtype + '\'' + + ", CZFS=" + CZFS + + ", SBZT=" + SBZT + + ", ZXRWH=" + ZXRWH + + ", HCZT=" + HCZT + + ", ZXJD=" + ZXJD + + ", DQP=" + DQP + + ", DQL=" + DQL + + ", DQC=" + DQC + + ", MBPH=" + MBPH + + ", MBLH=" + MBLH + + ", MBCH=" + MBCH + + ", YXXF=" + YXXF + + ", trayCode=" + trayCode + + '}'; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/DDJ_Device_2.java b/src/com/wms/dss/ats/customs/abb/entity/DDJ_Device_2.java new file mode 100644 index 0000000..e82fc63 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/DDJ_Device_2.java @@ -0,0 +1,52 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class DDJ_Device_2 { + + public int YXXF_2; + public byte btId;// DDjid + public String dtype;// ÀàÐÍ + public String dName; + + public int CZFS;// ²Ù×÷·½Ê½0δ֪1δѡÔñ2ÊÖ¶¯3°ë×Ô¶¯4µ¥»ú×Ô¶¯5Áª»ú + public int SBZT;// É豸״̬0´ý»ú1ÕýÔÚÖ´ÐÐ2 ÆäËû±àºÅ¼û¹ÊÕÏ´úÂë±í + public long ZXRWH_1;// ÕýÔÚÖ´ÐÐÈÎÎñºÅ + public int HCZT;// »õ²æ×´Ì¬0ÎÞ»õ1Óлõ + public int ZXJD;// Ö´Ðн׶Î1È¡»õÐÐ×ß2È¡»õ3·Å»õÐÐ×ß4·Å»õ5Íê³É + public int DQP;// µ±Ç°ÅÅ + public int DQL;// µ±Ç°ÁÐ + public int DQC;// µ±Ç°²ã + public int MBPH;// Ä¿±êÅÅ + public int MBLH;// Ä¿±êÁÐ + public int MBCH;// Ä¿±ê²ã + public int YXXF;// ÔÊÐíÏ·¢1ÔÊÐí + public long ZXRWH_2;// ÕýÔÚÖ´ÐÐÈÎÎñºÅ + public int ZXJD_2;// Ö´Ðн׶Î1È¡»õÐÐ×ß2È¡»õ3·Å»õÐÐ×ß4·Å»õ5Íê³É + public int XTXH; + public String trayCode; + + public DDJ_Device_2() { + super(); + } + + public DDJ_Device_2(byte btId, String dtype) { + super(); + this.btId = btId; + this.dtype = dtype; + } + + @Override + public String toString() { + return "DDJ_Device_2{" + + "btId=" + btId + + ", dtype='" + dtype + '\'' + + ", dName='" + dName + '\'' + + ", CZFS=" + CZFS + + ", SBZT=" + SBZT + + ", ZXRWH_1=" + ZXRWH_1 + + ", ZXRWH_2=" + ZXRWH_2 + + ", ZXJD_2=" + ZXJD_2 + + ", XTXH=" + XTXH + + ", trayCode='" + trayCode + '\'' + + '}'; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/End.java b/src/com/wms/dss/ats/customs/abb/entity/End.java new file mode 100644 index 0000000..4dbcd34 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/End.java @@ -0,0 +1,27 @@ +package com.wms.dss.ats.customs.abb.entity; + +import java.util.Date; + +public class End { + + public Date finishTime; + + private Integer id; + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Date getFinishTime() { + return finishTime; + } + + public void setFinishTime(Date finishTime) { + this.finishTime = finishTime; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.hbm.xml new file mode 100644 index 0000000..1ed1e4e --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.hbm.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.java b/src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.java new file mode 100644 index 0000000..8d8e734 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/ExceptionInfo.java @@ -0,0 +1,63 @@ +package com.wms.dss.ats.customs.abb.entity; + + + +import java.util.Date; + + +public class ExceptionInfo { + private Integer taskNo; + private String trayCode; + private String exceptionId; + private Date createTime; + private String sendCompleted; + private String ssjNo; + + public String getSsjNo() { + return ssjNo; + } + + public void setSsjNo(String ssjNo) { + this.ssjNo = ssjNo; + } + + public Integer getTaskNo() { + return taskNo; + } + + public void setTaskNo(Integer taskNo) { + this.taskNo = taskNo; + } + + public String getTrayCode() { + return trayCode; + } + + public void setTrayCode(String trayCode) { + this.trayCode = trayCode; + } + + public String getExceptionId() { + return exceptionId; + } + + public void setExceptionId(String exceptionId) { + this.exceptionId = exceptionId; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getSendCompleted() { + return sendCompleted; + } + + public void setSendCompleted(String sendCompleted) { + this.sendCompleted = sendCompleted; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/MsgDdj.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/MsgDdj.hbm.xml new file mode 100644 index 0000000..42e14f5 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MsgDdj.hbm.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/entity/MsgDdj.java b/src/com/wms/dss/ats/customs/abb/entity/MsgDdj.java new file mode 100644 index 0000000..3cc79d7 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MsgDdj.java @@ -0,0 +1,139 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class MsgDdj { + private int id; + private String name; + private int rwh; + private int jdbz; + private int sbzt; + private int czfs; + private int yxxf; + private int yp; + private int yl; + private int yc; + private int mbp; + private int mbl; + private int mbc; + private int xtxh; + private int dqxd; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getRwh() { + return rwh; + } + + public void setRwh(int rwh) { + this.rwh = rwh; + } + + public int getJdbz() { + return jdbz; + } + + public void setJdbz(int jdbz) { + this.jdbz = jdbz; + } + + public int getSbzt() { + return sbzt; + } + + public void setSbzt(int sbzt) { + this.sbzt = sbzt; + } + + public int getCzfs() { + return czfs; + } + + public void setCzfs(int czfs) { + this.czfs = czfs; + } + + public int getYxxf() { + return yxxf; + } + + public void setYxxf(int yxxf) { + this.yxxf = yxxf; + } + + public int getYp() { + return yp; + } + + public void setYp(int yp) { + this.yp = yp; + } + + public int getYl() { + return yl; + } + + public void setYl(int yl) { + this.yl = yl; + } + + public int getYc() { + return yc; + } + + public void setYc(int yc) { + this.yc = yc; + } + + public int getMbp() { + return mbp; + } + + public void setMbp(int mbp) { + this.mbp = mbp; + } + + public int getMbl() { + return mbl; + } + + public void setMbl(int mbl) { + this.mbl = mbl; + } + + public int getMbc() { + return mbc; + } + + public void setMbc(int mbc) { + this.mbc = mbc; + } + + public int getXtxh() { + return xtxh; + } + + public void setXtxh(int xtxh) { + this.xtxh = xtxh; + } + + public int getDqxd() { + return dqxd; + } + + public void setDqxd(int dqxd) { + this.dqxd = dqxd; + } +} \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.hbm.xml new file mode 100644 index 0000000..b928c5e --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.hbm.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.java b/src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.java new file mode 100644 index 0000000..d32a3c6 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MsgRkSsj.java @@ -0,0 +1,85 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class MsgRkSsj { + private String id; + private String name; + private String rwh; + private String height; + private String ckkx; + private String rkqq; + private String bjxx; + private String tpjc; + private String ljxh; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRwh() { + return rwh; + } + + public void setRwh(String rwh) { + this.rwh = rwh; + } + + public String getHeight() { + return height; + } + + public void setHeight(String height) { + this.height = height; + } + + public String getCkkx() { + return ckkx; + } + + public void setCkkx(String ckkx) { + this.ckkx = ckkx; + } + + public String getRkqq() { + return rkqq; + } + + public void setRkqq(String rkqq) { + this.rkqq = rkqq; + } + + public String getBjxx() { + return bjxx; + } + + public void setBjxx(String bjxx) { + this.bjxx = bjxx; + } + + public String getTpjc() { + return tpjc; + } + + public void setTpjc(String tpjc) { + this.tpjc = tpjc; + } + + public String getLjxh() { + return ljxh; + } + + public void setLjxh(String ljxh) { + this.ljxh = ljxh; + } +} \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.hbm.xml new file mode 100644 index 0000000..fee340c --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.hbm.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.java b/src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.java new file mode 100644 index 0000000..4d494f3 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MsgXdkSsj.java @@ -0,0 +1,112 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class MsgXdkSsj { + private String id; + private String location; + private String name; + private String ckkx; + private String ckdw; + private String ckrwh; + private String rkdw; + private String rkkx; + private String rkrwh; + private String floor; + private String platoon; + private String column; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getLocation() { + return location; + } + + public void setLocation(String location) { + this.location = location; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCkkx() { + return ckkx; + } + + public void setCkkx(String ckkx) { + this.ckkx = ckkx; + } + + public String getCkdw() { + return ckdw; + } + + public void setCkdw(String ckdw) { + this.ckdw = ckdw; + } + + public String getCkrwh() { + return ckrwh; + } + + public void setCkrwh(String ckrwh) { + this.ckrwh = ckrwh; + } + + public String getRkdw() { + return rkdw; + } + + public void setRkdw(String rkdw) { + this.rkdw = rkdw; + } + + public String getRkkx() { + return rkkx; + } + + public void setRkkx(String rkkx) { + this.rkkx = rkkx; + } + + public String getRkrwh() { + return rkrwh; + } + + public void setRkrwh(String rkrwh) { + this.rkrwh = rkrwh; + } + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } + + public String getPlatoon() { + return platoon; + } + + public void setPlatoon(String platoon) { + this.platoon = platoon; + } + + public String getColumn() { + return column; + } + + public void setColumn(String column) { + this.column = column; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/MydoJob.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/MydoJob.hbm.xml new file mode 100644 index 0000000..f7bb553 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MydoJob.hbm.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/entity/MydoJob.java b/src/com/wms/dss/ats/customs/abb/entity/MydoJob.java new file mode 100644 index 0000000..3014d3a --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/MydoJob.java @@ -0,0 +1,332 @@ +package com.wms.dss.ats.customs.abb.entity; + +import java.sql.Timestamp; + +public class MydoJob { + private String job_id; + private String status; + private String on_line_type; + private String task_no; + private String supplier_id; + private String customer_id; + private String department_id; + private String tray_code; + private String roadway_id; + private String cargo_space_id; + private String target_roadway_id; + private String target_cargo_space_id; + private String line_id; + private String workshop_id; + private Integer priority; + private String execution_phase; + private String in_or_out; + private String create_time; + private String start_time; + private String finish_time; + private String entrance_id; + private String Exit_id; + private String class_now_name; + private String class_workshop_name; + private String classgroup_number; + private String class_workshop_date_time; + private String class_id; + private String class_now_date_time; + private String warehouse_id; + private String out_id; + private Integer site_id; + private String car_number; + private String fault_flag; + private String Dev_id; + private String stock_source; + private String floor; + + + public String getJob_id() { + return job_id; + } + + public void setJob_id(String job_id) { + this.job_id = job_id; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getOn_line_type() { + return on_line_type; + } + + public void setOn_line_type(String on_line_type) { + this.on_line_type = on_line_type; + } + + public String getTask_no() { + return task_no; + } + + public void setTask_no(String task_no) { + this.task_no = task_no; + } + + public String getSupplier_id() { + return supplier_id; + } + + public void setSupplier_id(String supplier_id) { + this.supplier_id = supplier_id; + } + + public String getCustomer_id() { + return customer_id; + } + + public void setCustomer_id(String customer_id) { + this.customer_id = customer_id; + } + + public String getDepartment_id() { + return department_id; + } + + public void setDepartment_id(String department_id) { + this.department_id = department_id; + } + + public String getTray_code() { + return tray_code; + } + + public void setTray_code(String tray_code) { + this.tray_code = tray_code; + } + + public String getRoadway_id() { + return roadway_id; + } + + public void setRoadway_id(String roadway_id) { + this.roadway_id = roadway_id; + } + + public String getCargo_space_id() { + return cargo_space_id; + } + + public void setCargo_space_id(String cargo_space_id) { + this.cargo_space_id = cargo_space_id; + } + + public String getTarget_roadway_id() { + return target_roadway_id; + } + + public void setTarget_roadway_id(String target_roadway_id) { + this.target_roadway_id = target_roadway_id; + } + + public String getTarget_cargo_space_id() { + return target_cargo_space_id; + } + + public void setTarget_cargo_space_id(String target_cargo_space_id) { + this.target_cargo_space_id = target_cargo_space_id; + } + + public String getLine_id() { + return line_id; + } + + public void setLine_id(String line_id) { + this.line_id = line_id; + } + + public String getWorkshop_id() { + return workshop_id; + } + + public void setWorkshop_id(String workshop_id) { + this.workshop_id = workshop_id; + } + + public Integer getPriority() { + return priority; + } + + public void setPriority(Integer priority) { + this.priority = priority; + } + + public String getExecution_phase() { + return execution_phase; + } + + public void setExecution_phase(String execution_phase) { + this.execution_phase = execution_phase; + } + + public String getIn_or_out() { + return in_or_out; + } + + public void setIn_or_out(String in_or_out) { + this.in_or_out = in_or_out; + } + + public String getCreate_time() { + return create_time; + } + + public void setCreate_time(String create_time) { + this.create_time = create_time; + } + + public String getStart_time() { + return start_time; + } + + public void setStart_time(String start_time) { + this.start_time = start_time; + } + + public String getFinish_time() { + return finish_time; + } + + public void setFinish_time(String finish_time) { + this.finish_time = finish_time; + } + + public String getEntrance_id() { + return entrance_id; + } + + public void setEntrance_id(String entrance_id) { + this.entrance_id = entrance_id; + } + + public String getExit_id() { + return Exit_id; + } + + public void setExit_id(String exit_id) { + Exit_id = exit_id; + } + + public String getClass_now_name() { + return class_now_name; + } + + public void setClass_now_name(String class_now_name) { + this.class_now_name = class_now_name; + } + + public String getClass_workshop_name() { + return class_workshop_name; + } + + public void setClass_workshop_name(String class_workshop_name) { + this.class_workshop_name = class_workshop_name; + } + + public String getClassgroup_number() { + return classgroup_number; + } + + public void setClassgroup_number(String classgroup_number) { + this.classgroup_number = classgroup_number; + } + + public String getClass_workshop_date_time() { + return class_workshop_date_time; + } + + public void setClass_workshop_date_time(String class_workshop_date_time) { + this.class_workshop_date_time = class_workshop_date_time; + } + + public String getClass_id() { + return class_id; + } + + public void setClass_id(String class_id) { + this.class_id = class_id; + } + + public String getClass_now_date_time() { + return class_now_date_time; + } + + public void setClass_now_date_time(String class_now_date_time) { + this.class_now_date_time = class_now_date_time; + } + + public String getWarehouse_id() { + return warehouse_id; + } + + public void setWarehouse_id(String warehouse_id) { + this.warehouse_id = warehouse_id; + } + + public String getOut_id() { + return out_id; + } + + public void setOut_id(String out_id) { + this.out_id = out_id; + } + + public Integer getSite_id() { + return site_id; + } + + public void setSite_id(Integer site_id) { + this.site_id = site_id; + } + + public String getCar_number() { + return car_number; + } + + public void setCar_number(String car_number) { + this.car_number = car_number; + } + + public String getFault_flag() { + return fault_flag; + } + + public void setFault_flag(String fault_flag) { + this.fault_flag = fault_flag; + } + + public String getDev_id() { + return Dev_id; + } + + public void setDev_id(String dev_id) { + Dev_id = dev_id; + } + + public String getStock_source() { + return stock_source; + } + + public void setStock_source(String stock_source) { + this.stock_source = stock_source; + } + + + public String getFloor() { + return floor; + } + + public void setFloor(String floor) { + this.floor = floor; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/SSJ_Device.java b/src/com/wms/dss/ats/customs/abb/entity/SSJ_Device.java new file mode 100644 index 0000000..183f934 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/SSJ_Device.java @@ -0,0 +1,53 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class SSJ_Device { + + public int CKDW ; + public int CKKX ; + public int SSZT; + //1-Õý³£ 2-Òì³£ + public int RKQQ; + public int RKGD; + public byte btId;// DDjid + public String dtype;// ÀàÐÍ + public String ssjNo; + + public int BH; + + public int DW;// µ½Î» + + public int ZT;//1SÊÖ¶¯ 2-×Ô¶¯ 3-±¨¾¯ + + public int KX;// ¿ÕÏÐ + + public int QQ;//ÇëÇó + + + public long RWH;// ÈÎÎñºÅ + public String writeDB; //Ï·¢µØÖ· + public String trayCode;//ÁÏÏäÂë + public int height;//¸ß¶È + //0Õý³£ 1ÍâÐÎÒì³£ 2ÖØÁ¿Òì³£ 3·Å»õλÖÃÓлõ 4È¡»õλÖÃÎÞ»õ 5ɨ²»µ½Âë + public int exceptionId; + + //ÁϼÜÐźŠ0δÂú 1Âú + public int LJXH; + //ÊÕµ½ÈÎÎñºÅ + public int BY1; + //ÊÕµ½agv·Å»õÍê³É + public int BY2; + + + + public SSJ_Device() { + super(); + } + + public SSJ_Device(byte btId, String dtype) { + super(); + this.btId = btId; + this.dtype = dtype; + } + + +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/SendData.java b/src/com/wms/dss/ats/customs/abb/entity/SendData.java new file mode 100644 index 0000000..02446b9 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/SendData.java @@ -0,0 +1,39 @@ +package com.wms.dss.ats.customs.abb.entity; + +/** + * ·¢ËÍÊý¾ÝµÄʵÌåÀà + * @num ³¤¶È + * @num2 Öµ + */ +public class SendData { + private static final int DINT = 4; + private static final int INT = 2; + private int num; + private int num2; + + public SendData(int num, int num2) { + this.num = num; + this.num2 = num2; + } + + public SendData(int num, String num2) { + this.num = num; + this.num2 = Integer.parseInt(num2); + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public int getNum2() { + return num2; + } + + public void setNum2(int num2) { + this.num2 = num2; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/StoredParameters.java b/src/com/wms/dss/ats/customs/abb/entity/StoredParameters.java new file mode 100644 index 0000000..46f6af0 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/StoredParameters.java @@ -0,0 +1,37 @@ +package com.wms.dss.ats.customs.abb.entity; + +/** + * ´æ´¢¹ý³ÌµÄʵÌåÀà + * @num µÚ¼¸¸ö²ÎÊý + * @num2 ²ÎÊý¶ÔÓ¦µÄÖµ + */ +public class StoredParameters { + private int num; + private String parameter; + + public StoredParameters(int num, String num2) { + this.num = num; + this.parameter = num2; + } + + public StoredParameters(int num, int permitIssuedBy) { + this.num = num; + this.parameter = String.valueOf(permitIssuedBy); + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public String getParameter() { + return parameter; + } + + public void setParameter(String parameter) { + this.parameter = parameter; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/TaskPriority.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/TaskPriority.hbm.xml new file mode 100644 index 0000000..714d463 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/TaskPriority.hbm.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/entity/TaskPriority.java b/src/com/wms/dss/ats/customs/abb/entity/TaskPriority.java new file mode 100644 index 0000000..c3cb4cc --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/TaskPriority.java @@ -0,0 +1,31 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class TaskPriority { + private int id; + private String priority; + private String type; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/WcsPortState.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/WcsPortState.hbm.xml new file mode 100644 index 0000000..461c41f --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/WcsPortState.hbm.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/entity/WcsPortState.java b/src/com/wms/dss/ats/customs/abb/entity/WcsPortState.java new file mode 100644 index 0000000..39fee1e --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/WcsPortState.java @@ -0,0 +1,58 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class WcsPortState { + private String portName; + private Integer occupationState; + private String description; + private String spare1; + private String spare2; + private String spare3; + + public String getSpare3() { + return spare3; + } + + public void setSpare3(String spare3) { + this.spare3 = spare3; + } + + public String getPortName() { + return portName; + } + + public void setPortName(String portName) { + this.portName = portName; + } + + public Integer getOccupationState() { + return occupationState; + } + + public void setOccupationState(Integer occupationState) { + this.occupationState = occupationState; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getSpare1() { + return spare1; + } + + public void setSpare1(String spare1) { + this.spare1 = spare1; + } + + public String getSpare2() { + return spare2; + } + + public void setSpare2(String spare2) { + this.spare2 = spare2; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.hbm.xml new file mode 100644 index 0000000..8fcc273 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.hbm.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.java b/src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.java new file mode 100644 index 0000000..2b58d1d --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/WmsDeviceExecutionQueue.java @@ -0,0 +1,243 @@ +package com.wms.dss.ats.customs.abb.entity; + +public class WmsDeviceExecutionQueue { + + private int id; //Ö÷¼ü±êʶ + private String Rwh; //ÈÎÎñºÅ + private String DevName; //É豸Ãû³Æ + private int DevId; //É豸ºÅ + private int rwzt; //ÈÎÎñ״̬ + private int yph; //¶Ñ¶â»úÔ´ÅÅ + private int ylh; //¶Ñ¶â»úÔ´ÁÐ + private int ych; //¶Ñ¶â»úÔ´²ã + private int mbph; //¶Ñ¶â»úÄ¿±êÅÅ + private int mblh; //¶Ñ¶â»úÄ¿±êÁÐ + private int mbch; //¶Ñ¶â»úÄ¿±ê²ã + private int xcykh; //С³µÔ´¿ÚºÅ + private int xcmbkh; //С³µÄ¿±ê¿ÚºÅ + private String xdh; //ÈÎÎñÏïµÀºÅ + private String sbzxxdh; //É豸ִÐÐÏïµÀºÅ + private int xczlgs; //С³µÖ¸Áî¸ñʽ + private int ddjzlgs; //¶Ñ¶â»úÖ¸Áî¸ñʽ + private String ddjxf; //¶Ñ¶â»úÏ·¢ + private int rwlx; //ÈÎÎñÀàÐÍ + private int ddjzxkh; //¶Ñ¶â»úÖ´ÐпںŠ+ private String scsj; //Éú³Éʱ¼ä + private String xfsj; //Ï·¢Ê±¼ä + private String jssj; //½áÊøÊ±¼ä + private String tray_code; + private Integer space_height; + private Integer tray_size; + + public WmsDeviceExecutionQueue() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getRwh() { + return Rwh; + } + + public void setRwh(String rwh) { + Rwh = rwh; + } + + public String getDevName() { + return DevName; + } + + public void setDevName(String devName) { + DevName = devName; + } + + public int getDevId() { + return DevId; + } + + public void setDevId(int devId) { + DevId = devId; + } + + public int getRwzt() { + return rwzt; + } + + public void setRwzt(int rwzt) { + this.rwzt = rwzt; + } + + public int getYph() { + return yph; + } + + public void setYph(int yph) { + this.yph = yph; + } + + public int getYlh() { + return ylh; + } + + public void setYlh(int ylh) { + this.ylh = ylh; + } + + public int getYch() { + return ych; + } + + public void setYch(int ych) { + this.ych = ych; + } + + public int getMbph() { + return mbph; + } + + public void setMbph(int mbph) { + this.mbph = mbph; + } + + public int getMblh() { + return mblh; + } + + public void setMblh(int mblh) { + this.mblh = mblh; + } + + public int getMbch() { + return mbch; + } + + public void setMbch(int mbch) { + this.mbch = mbch; + } + + public int getXcykh() { + return xcykh; + } + + public void setXcykh(int xcykh) { + this.xcykh = xcykh; + } + + public int getXcmbkh() { + return xcmbkh; + } + + public void setXcmbkh(int xcmbkh) { + this.xcmbkh = xcmbkh; + } + + public String getXdh() { + return xdh; + } + + public void setXdh(String xdh) { + this.xdh = xdh; + } + + public String getSbzxxdh() { + return sbzxxdh; + } + + public void setSbzxxdh(String sbzxxdh) { + this.sbzxxdh = sbzxxdh; + } + + public int getXczlgs() { + return xczlgs; + } + + public void setXczlgs(int xczlgs) { + this.xczlgs = xczlgs; + } + + public int getDdjzlgs() { + return ddjzlgs; + } + + public void setDdjzlgs(int ddjzlgs) { + this.ddjzlgs = ddjzlgs; + } + + public String getDdjxf() { + return ddjxf; + } + + public void setDdjxf(String ddjxf) { + this.ddjxf = ddjxf; + } + + public int getRwlx() { + return rwlx; + } + + public void setRwlx(int rwlx) { + this.rwlx = rwlx; + } + + public int getDdjzxkh() { + return ddjzxkh; + } + + public void setDdjzxkh(int ddjzxkh) { + this.ddjzxkh = ddjzxkh; + } + + public String getScsj() { + return scsj; + } + + public void setScsj(String scsj) { + this.scsj = scsj; + } + + public String getXfsj() { + return xfsj; + } + + public void setXfsj(String xfsj) { + this.xfsj = xfsj; + } + + public String getJssj() { + return jssj; + } + + public void setJssj(String jssj) { + this.jssj = jssj; + } + + public String getTray_code() { + return tray_code; + } + + public void setTray_code(String tray_code) { + this.tray_code = tray_code; + } + + public Integer getSpace_height() { + return space_height; + } + + public void setSpace_height(Integer space_height) { + this.space_height = space_height; + } + + public Integer getTray_size() { + return tray_size; + } + + public void setTray_size(Integer tray_size) { + this.tray_size = tray_size; + } +} + diff --git a/src/com/wms/dss/ats/customs/abb/entity/end.hbm.xml b/src/com/wms/dss/ats/customs/abb/entity/end.hbm.xml new file mode 100644 index 0000000..13de765 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/entity/end.hbm.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/form/ABBMainFrame.java b/src/com/wms/dss/ats/customs/abb/form/ABBMainFrame.java new file mode 100644 index 0000000..0ea2e67 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/form/ABBMainFrame.java @@ -0,0 +1,25 @@ +package com.wms.dss.ats.customs.abb.form; + +import com.wms.dss.common.server.form.ServerMainFrame; + +/** + * ÃèÊö: ÏÃÃÅABBÉ豸ͨÐŵ÷¶Èϵͳ + * @author + * @since WMS 3.0 + */ +public class ABBMainFrame extends ServerMainFrame { + + public ABBMainFrame() throws Exception { + super(); + } + public static void main(String[] arg) + { + try{ + new ABBMainFrame(); + } + catch(Exception ex){ + ex.printStackTrace(); + System.exit(-1); + } + } +} diff --git a/src/com/wms/dss/ats/customs/abb/form/StartCorrespond.java b/src/com/wms/dss/ats/customs/abb/form/StartCorrespond.java new file mode 100644 index 0000000..cfcc0f4 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/form/StartCorrespond.java @@ -0,0 +1,154 @@ +package com.wms.dss.ats.customs.abb.form; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextArea; + +import com.wms.dss.common.server.config.DSSMenu; +import com.wms.dss.common.server.config.DSSMenuItem; +import com.wms.dss.common.server.form.FormObject; +import com.wms.dss.common.server.schedule.ThreadSchedule; + +/** + * ÃèÊö: Æô¶¯É豸ͨÐÅ + * @author hug 2013-4-12 + * @since WMS 3.0 + */ +public class StartCorrespond extends FormObject{ + protected JFrame gcf; + protected DSSMenuItem opMenuItem; + + public StartCorrespond() + {} + @Override + public void init(DSSMenuItem menuItem) { + gcf = new JFrame("¡ï¡ïÆô¶¯É豸ͨÐÅ¡ï¡ï"); + ImageIcon img = new ImageIcon("images\\a.gif"); + opMenuItem = menuItem; + + JPanel jPanel1 = new JPanel(); + JPanel jPanel2 = new JPanel(); + JPanel jPanel3 = new JPanel(); + JPanel jPanel4 = new JPanel(); + JPanel jPanel5 = new JPanel(); + + JTextArea jTextArea = new JTextArea(1,1); + Font ft = new Font("ËÎÌå",Font.BOLD,18); + //JLabel l1 = new JLabel(""); + + JButton jbtn1 = new JButton("ÊÇ"); + JButton jbtn2 = new JButton("·ñ"); + + gcf.getContentPane().add("North",jPanel1); + gcf.getContentPane().add("South",jPanel2); + gcf.getContentPane().add("East",jPanel3); + gcf.getContentPane().add("West",jPanel4); + gcf.getContentPane().add("Center",jPanel5); + + jPanel1.setBackground(new Color(240,248,255)); + jPanel2.setBackground(new Color(240,248,255)); + jPanel3.setBackground(new Color(240,248,255)); + jPanel4.setBackground(new Color(240,248,255)); + jPanel5.setBackground(new Color(240,248,255)); + + jPanel5.setBorder(BorderFactory.createLineBorder(new Color(43,166,197),1)); + + jTextArea.setText("ÊÇ ·ñ Æô ¶¯ Éè ±¸ ͨ ÐÅ ?"); + jTextArea.setForeground(Color.blue); + jTextArea.setFont(ft); + jPanel5.setLayout(new FlowLayout(FlowLayout.CENTER,25,20)); + jPanel5.add(jTextArea); + + jPanel5.add(jbtn1); + jPanel5.add(jbtn2); + + jbtn1.addActionListener(new JButtonH("ok")); + jbtn2.addActionListener(new JButtonH("exit")); + gcf.addWindowListener(new windows()); + + double w = Toolkit.getDefaultToolkit().getScreenSize().getWidth(); + double h = Toolkit.getDefaultToolkit().getScreenSize().getHeight(); + + gcf.setSize(300,200); + gcf.setIconImage(img.getImage()); + gcf.setLocation((int)((w-330)/2)+20,(int)((h-240)/2)); + gcf.setResizable(false); + gcf.setVisible(true); + } + public class JButtonH implements ActionListener{ + private String btnName; + public JButtonH(String bName) + { + this.btnName = bName; + } + public void actionPerformed(ActionEvent e) + { + if(btnName.equals("exit")) + { + exitSch(); + }if(btnName.equals("ok")) + { try{ + startSch(); + } + catch(Exception ex){ + ex.printStackTrace(); + } + + }else + { + parentJFrame.setEnabled(true); + gcf.setVisible(false); + } + } + + public void exitSch(){ + parentJFrame.setEnabled(true); + gcf.setVisible(false); + } + + /** + * ¹¦ÄÜ:Æô¶¯É豸ͨÐÅ + * + */ + public void startSch() throws Exception + { + parentJFrame.setEnabled(true); + gcf.setVisible(false); + + //²Ëµ¥×´Ì¬ÏÔʾ + opMenuItem.jmenuItem.setEnabled(false); + DSSMenu tempMenu = opMenuItem.getDssMenu(); //»ñµÃ²Ëµ¥ + String secondMenuKey = (String)tempMenu.lsSecondMenuKey.get(2);//µÚ¶þ¸ö²Ëµ¥µÄµÚ¶þ¸ö²Ëµ¥Ïî + DSSMenuItem tempMenuItem = (DSSMenuItem)tempMenu.hsSecondMenu.get(secondMenuKey); + tempMenuItem.jmenuItem.setEnabled(true); + + ThreadSchedule threadSch = (ThreadSchedule)Class.forName(opMenuItem.menu11ThreadClass).newInstance(); + threadSch.setHashtable(m_serverMainFrame.m_hsSysParam); + //Ïß³ÌÖ´ÐÐ + threadSch.threadExec(); + tempMenuItem.threadSch = threadSch; + } + } + + + public class windows extends WindowAdapter + { + public void windowClosing(WindowEvent e) + { + parentJFrame.setEnabled(true); + } + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/form/StopCorrespond.java b/src/com/wms/dss/ats/customs/abb/form/StopCorrespond.java new file mode 100644 index 0000000..0a43066 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/form/StopCorrespond.java @@ -0,0 +1,146 @@ +package com.wms.dss.ats.customs.abb.form; + +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextArea; + +import com.wms.dss.common.server.config.DSSMenu; +import com.wms.dss.common.server.config.DSSMenuItem; +import com.wms.dss.common.server.form.FormObject; + +/** + * ÃèÊö: Í£Ö¹É豸ͨÐÅ + * @author hug 2013-4-15 + * @since WMS 3.0 + */ +public class StopCorrespond extends FormObject{ + protected JFrame gcf; + protected DSSMenuItem opMenuItem; + public StopCorrespond() + {} + @Override + public void init(DSSMenuItem menuItem) { + + gcf = new JFrame("¡ï¡ïÍ£Ö¹É豸ͨÐÅ¡ï¡ï"); + ImageIcon img = new ImageIcon("images\\a.gif"); + opMenuItem = menuItem; + + JPanel JPanel1 = new JPanel(); + JPanel JPanel2 = new JPanel(); + JPanel JPanel3 = new JPanel(); + JPanel JPanel4 = new JPanel(); + JPanel JPanel5 = new JPanel(); + + JTextArea jta = new JTextArea(1,1); + Font ft = new Font("ËÎÌå",Font.BOLD,18); + + //JLabel l1 = new JLabel(""); + JButton jbtn1 = new JButton("ÊÇ"); + JButton jbtn2 = new JButton("·ñ"); + + gcf.getContentPane().add("North",JPanel1); + gcf.getContentPane().add("South",JPanel2); + gcf.getContentPane().add("East",JPanel3); + gcf.getContentPane().add("West",JPanel4); + gcf.getContentPane().add("Center",JPanel5); + + JPanel1.setBackground(new Color(240,248,255)); + JPanel2.setBackground(new Color(240,248,255)); + JPanel3.setBackground(new Color(240,248,255)); + JPanel4.setBackground(new Color(240,248,255)); + JPanel5.setBackground(new Color(240,248,255)); + + JPanel5.setBorder(BorderFactory.createLineBorder(new Color(43,166,197),1)); + + jta.setText("ÊÇ ·ñ Í£ Ö¹ Éè ±¸ ͨ ÐÅ ?"); + jta.setForeground(Color.blue); + jta.setFont(ft); + JPanel5.setLayout(new FlowLayout(FlowLayout.CENTER,25,20)); + JPanel5.add(jta); + + JPanel5.add(jbtn1); + JPanel5.add(jbtn2); + + jbtn1.addActionListener(new JButtonH("ok")); + jbtn2.addActionListener(new JButtonH("exit")); + gcf.addWindowListener(new windows()); + + double w = Toolkit.getDefaultToolkit().getScreenSize().getWidth(); + double h = Toolkit.getDefaultToolkit().getScreenSize().getHeight(); + + gcf.setSize(300,200); + gcf.setIconImage(img.getImage()); + gcf.setLocation((int)((w-330)/2)+20,(int)((h-240)/2)); + gcf.setResizable(false); + gcf.setVisible(true); + } + public class JButtonH implements ActionListener + { + private String btnName; + + public JButtonH(String bName) + { + this.btnName = bName; + } + + public void actionPerformed(ActionEvent e) + { + if(btnName.equals("exit")) + { + cancelStop(); + }if(btnName.equals("ok")) + { + stopSch(); + }else + { + parentJFrame.setEnabled(true); + gcf.setVisible(false); + } + } + + public void cancelStop(){ + parentJFrame.setEnabled(true); + gcf.setVisible(false); + } + + /** + * ¹¦ÄÜ:Í£Ö¹É豸ͨÐÅ + * + */ + public void stopSch() + { + parentJFrame.setEnabled(true); + gcf.setVisible(false); + + //²Ëµ¥×´Ì¬´¦Àí + opMenuItem.jmenuItem.setEnabled(false); + DSSMenu tempMenu = opMenuItem.getDssMenu();//»ñµÃ²Ëµ¥ + String secondMenuKey = (String)tempMenu.lsSecondMenuKey.get(0); + DSSMenuItem tempMenuItem = (DSSMenuItem)tempMenu.hsSecondMenu.get(secondMenuKey); + tempMenuItem.jmenuItem.setEnabled(true); + + opMenuItem.threadSch.stopAll(true); + opMenuItem.threadSch = null; + } + } + public class windows extends WindowAdapter + { + public void windowClosing(WindowEvent e) + { + parentJFrame.setEnabled(true); + } + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/HslRead.java b/src/com/wms/dss/ats/customs/abb/plc/HslRead.java new file mode 100644 index 0000000..abb63fc --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/HslRead.java @@ -0,0 +1,105 @@ +package com.wms.dss.ats.customs.abb.plc; + +import HslCommunication.BasicFramework.SoftBasic; +import HslCommunication.Core.Net.IReadWriteNet; +import HslCommunication.Core.Types.OperateResult; +import HslCommunication.Core.Types.OperateResultExOne; + +import javax.swing.*; +import java.awt.*; +import java.text.SimpleDateFormat; +import java.util.Date; + +public class HslRead { + + private static SimpleDateFormat dateFormat = new SimpleDateFormat("[HH:mm:ss] "); + + /** + * ½«½á¹ûÐÅÏ¢ÏÔʾ³öÀ´£¬ÔÚ½çÃæÀï½øÐÐÏÔʾ + * @param result µÈ´ýÏÔʾµÄ½á¹ûÐÅÏ¢ + * @param x + * @param address ¶ÁÈ¡µÄµØÖ·Êý¾Ý + * @param textBox ÏÔʾ½á¹ûµÄÎı¾¿ò + * @param scrollPane Ö§³Ö¹ö¶¯ÌõµÄ¿Ø¼þ + * @param ÀàÐͶÔÏó + * @return + * @return + * @return + * @return + * @return + */ + public static T ReadResultRender(OperateResultExOne result ) { + + T x = null ; + if (result.IsSuccess) { + if (result.Content.getClass().isArray()) { + + } else { + x= (T) result.Content; + } + } else { + + JOptionPane.showMessageDialog( + null, + dateFormat.format(new Date()) + "] Read Failed\r\nReason:" + result.ToMessageShowString(), + "Result", + JOptionPane.WARNING_MESSAGE); + } + return x; + } + + public static int WriteResultRender(OperateResult result, String address ) { //void + int x=0; + if (result.IsSuccess) { +// JOptionPane.showMessageDialog( +// null, +// dateFormat.format(new Date()) + "[" + address + "] Write Success", +// "Result", +// JOptionPane.PLAIN_MESSAGE); + x=1; + } else { +// JOptionPane.showMessageDialog( +// null, +// dateFormat.format(new Date()) + "[" + address + "] Write Failed\r\nReason:" + result.ToMessageShowString(), +// "Result", +// JOptionPane.WARNING_MESSAGE); + x=2; + } + return x; + } + + public static void BulkReadRenderResult(IReadWriteNet readWrite, JTextField addTextBox, JTextField lengthTextBox, JTextArea resultTextBox ) { + try { + OperateResultExOne read = readWrite.Read(addTextBox.getText(), Short.parseShort(lengthTextBox.getText())); + if (read.IsSuccess) { + resultTextBox.setText("Result£º" + SoftBasic.ByteToHexString(read.Content)); + } else { + JOptionPane.showMessageDialog(null, "Read Failed£º" + read.ToMessageShowString(), "Result", JOptionPane.WARNING_MESSAGE); + } + } catch (Exception ex) { + JOptionPane.showMessageDialog(null, "Read Failed£º" + ex.getMessage(), "Result", JOptionPane.ERROR_MESSAGE); + } + } + + public static void SetPanelEnabled(JPanel panel, boolean enable) { + Component[] components = panel.getComponents(); + + //System.out.println("Component Length:" + components.length); + for (Component component : components) { + if (component instanceof JPanel) { + SetPanelEnabled((JPanel) component, enable); + } else { + component.setEnabled(enable); + } + } + + } + + public static String IpAddressInputWrong = "IpAddress input wrong"; + public static String PortInputWrong = "Port input wrong"; + public static String SlotInputWrong = "Slot input wrong"; + public static String BaudRateInputWrong = "Baud rate input wrong"; + public static String DataBitsInputWrong = "Data bit input wrong"; + public static String StopBitInputWrong = "Stop bit input wrong"; + +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ1.java b/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ1.java new file mode 100644 index 0000000..a644441 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ1.java @@ -0,0 +1,182 @@ +package com.wms.dss.ats.customs.abb.plc; + +import HslCommunication.BasicFramework.SoftBasic; +import HslCommunication.Core.Net.IReadWriteNet; +import HslCommunication.Core.Types.OperateResult; +import HslCommunication.Core.Types.OperateResultExOne; +import HslCommunication.Profinet.Siemens.SiemensPLCS; +import HslCommunication.Profinet.Siemens.SiemensS7Net; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.ricosoft.common.logger.Logger; +import com.wms.dss.ats.customs.abb.entity.DDJ_Device; +import com.wms.dss.ats.customs.abb.utils.ParseUtil; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; + +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.util.HashMap; +import java.util.Hashtable; + +public class IsoTcpClientDDJ1 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + public SiemensS7Net siemensS7Net = null; + public static IReadWriteNet readWriteNet = null; + public boolean success = false; + public HashMap hsDDJParam = null; + public HashMap hsSSJParam = null; + public EntityDAO m_dao; + + @SuppressWarnings("unchecked") + public IsoTcpClientDDJ1(Hashtable hsComParam, Hashtable hsSysParam, EntityDAO m_dao) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + this.hsDDJParam = (HashMap) this.hsComParam.get("hsDDJMap1"); + + this.strIp = (String) hsComParam.get("strIpddj"); + this.iPort = (Integer) hsComParam.get("iPortddj"); + this.slot = (Integer) hsComParam.get("slotddj"); + this.m_dao = m_dao; + } + + void ConnectServer() { + siemensS7Net = new SiemensS7Net(SiemensPLCS.S1500); + try { + siemensS7Net.setIpAddress(this.strIp); + siemensS7Net.setPort(this.iPort); + siemensS7Net.setRack((byte) Integer.parseInt("0")); + siemensS7Net.setSlot((byte) this.slot); + + OperateResult connect = siemensS7Net.ConnectServer(); + if (connect.IsSuccess) { + setIsConnect(true); + readWriteNet = siemensS7Net; + } else { + + } + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (success != true) { + success = bflag; + } + } + + public boolean IsConnect() { + if (success == true) { + return success; + } + return false; + } + + void closeServer() { + if (readWriteNet != null) { + OperateResult connectclose = siemensS7Net.ConnectClose(); + } + setIsConnect(false); + } + + void reConnect() { + closeServer(); + ConnectServer(); + Logger.info("ÖØÆô¶Ñ¶â»ú1"); + } + + @Override + public void run() { + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + //Logger.info("--------------------Ïß³Ì--------¶ÁÈ¡¶Ñ¶â»ú1ÐÅÏ¢-----------¿ªÊ¼---------------------"); + if (IsConnect()) { + String address = "0", ddj_id = "0"; + ddj_id = "ddj-1"; + address = "DB60.0"; + + DDJ_Device ddj = (DDJ_Device) hsDDJParam.get(ddj_id); + ddj.dName = "1ºÅ¶Ñ¶â»ú"; + ddj.CZFS = 0; //תΪ16½øÖƵÄÕûÐÍ + ddj.SBZT = 0; + ddj.ZXRWH = 0; + ddj.HCZT = 0; + ddj.ZXJD = 0; + ddj.DQP = 0; + ddj.DQL = 0; + ddj.DQC = 0; + ddj.MBPH = 0; + ddj.MBLH = 0; + ddj.MBCH = 0; + ddj.YXXF = 0; + ddj.XTXH = 0; + OperateResultExOne read1 = readWriteNet.Read(address, Short.parseShort("38"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx = "0"; + if (read1.IsSuccess) { + ddsx = SoftBasic.ByteToHexString(read1.Content); + }// ±äÁ¿.Substring(²ÎÊý1,²ÎÊý2); ÕûÐÍ4¸ö×Ö½Ú ³¤ÕûÐÍ8¸ö×Ö½Ú + + + + ddj.CZFS = ParseUtil.optInt(0, ddsx);//Integer.parseInt(ddsx.substring(0, 4), 16); + ddj.SBZT = ParseUtil.optInt(2, ddsx);//Integer.parseInt(ddsx.substring(4, 8), 16); + ddj.ZXRWH = ParseUtil.optDInt(4, ddsx);//Long.parseLong(ddsx.substring(48, 64), 16); + ddj.HCZT = ParseUtil.optInt(8, ddsx);//Integer.parseInt(ddsx.substring(8, 12), 16); + ddj.ZXJD = ParseUtil.optInt(10, ddsx);//Integer.parseInt(ddsx.substring(12, 16), 16); + ddj.DQP = ParseUtil.optInt(12, ddsx);//Integer.parseInt(ddsx.substring(16, 20), 16); + ddj.DQL = ParseUtil.optInt(14, ddsx);//Integer.parseInt(ddsx.substring(20, 24), 16); + ddj.DQC = ParseUtil.optInt(16, ddsx);//Integer.parseInt(ddsx.substring(24, 28), 16); + ddj.MBPH = ParseUtil.optInt(18, ddsx);//Integer.parseInt(ddsx.substring(28, 32), 16); + ddj.MBLH = ParseUtil.optInt(20, ddsx);//Integer.parseInt(ddsx.substring(32, 36), 16); + ddj.MBCH = ParseUtil.optInt(22, ddsx);//Integer.parseInt(ddsx.substring(36, 40), 16); + ddj.YXXF = ParseUtil.optInt(24, ddsx);//Integer.parseInt(ddsx.substring(40, 44), 16); + ddj.XTXH = ParseUtil.optInt(26, ddsx);//Integer.parseInt(ddsx.substring(44, 48), 16); + //ddj.trayCode = ParseUtil.optString(30, ddsx);//Long.parseLong(ddsx.substring(48, 64), 16); + + //m_dao.updateSql("update IpErrorMsg set msg='PLC:"+strIp+" Á¬½ÓÕý³£' where ip='"+strIp+"' and msg !='"+strIp+" Á¬½ÓÕý³£'"); + Thread.sleep(800); + } else { + //m_dao.updateSql("update IpErrorMsg set msg='PLC:"+strIp+" Á¬½Ó³¬Ê±' where ip='"+strIp+"' and msg !='"+strIp+" Á¬½Ó³¬Ê±'"); + reConnect(); + } + } catch (Exception ex) { + ex.printStackTrace(); + Logger.info("------catch--------------Ïß³Ì--------¶ÁÈ¡¶Ñ¶â»ú1ÐÅÏ¢-----------½áÊø0--------------------"); + reConnect(); + } + // ÿ´ÎÑ­»·´ò¿ª¹Ø±ÕÁ´½Ó + //reConnect(); + } + closeServer(); + } + + /// ¶Ñ¶â»úÈÎÎñÏ·¢ + public static int WritetoDDJ(String address, byte[] tsak) { + int a = 0; + if (readWriteNet != null) { + a = HslRead.WriteResultRender(readWriteNet.Write(address, tsak), address); + } + return a; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ2.java b/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ2.java new file mode 100644 index 0000000..478413e --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientDDJ2.java @@ -0,0 +1,183 @@ +package com.wms.dss.ats.customs.abb.plc; + +import HslCommunication.BasicFramework.SoftBasic; +import HslCommunication.Core.Net.IReadWriteNet; +import HslCommunication.Core.Types.OperateResult; +import HslCommunication.Core.Types.OperateResultExOne; +import HslCommunication.Profinet.Siemens.SiemensPLCS; +import HslCommunication.Profinet.Siemens.SiemensS7Net; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.ricosoft.common.logger.Logger; +import com.wms.dss.ats.customs.abb.entity.DDJ_Device; +import com.wms.dss.ats.customs.abb.entity.DDJ_Device_2; +import com.wms.dss.ats.customs.abb.utils.ParseUtil; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; + +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.util.HashMap; +import java.util.Hashtable; + +public class IsoTcpClientDDJ2 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + public SiemensS7Net siemensS7Net = null; + public static IReadWriteNet readWriteNet = null; + public boolean success = false; + public HashMap hsDDJParam = null; + public HashMap hsSSJParam = null; + public EntityDAO m_dao; + + @SuppressWarnings("unchecked") + public IsoTcpClientDDJ2(Hashtable hsComParam, Hashtable hsSysParam, EntityDAO m_dao) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + this.hsDDJParam = (HashMap) this.hsComParam.get("hsDDJMap2"); + + this.strIp = (String) hsComParam.get("strIpddj"); + this.iPort = (Integer) hsComParam.get("iPortddj"); + this.slot = (Integer) hsComParam.get("slotddj"); + this.m_dao = m_dao; + } + + void ConnectServer() { + siemensS7Net = new SiemensS7Net(SiemensPLCS.S1500); + try { + siemensS7Net.setIpAddress(this.strIp); + siemensS7Net.setPort(this.iPort); + siemensS7Net.setRack((byte) Integer.parseInt("0")); + siemensS7Net.setSlot((byte) this.slot); + + OperateResult connect = siemensS7Net.ConnectServer(); + if (connect.IsSuccess) { + setIsConnect(true); + readWriteNet = siemensS7Net; + } else { + + } + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (success != true) { + success = bflag; + } + } + + public boolean IsConnect() { + if (success == true) { + return success; + } + return false; + } + + void closeServer() { + if (readWriteNet != null) { + OperateResult connectclose = siemensS7Net.ConnectClose(); + } + setIsConnect(false); + } + + void reConnect() { + closeServer(); + ConnectServer(); + Logger.info("ÖØÆô¶Ñ¶â»ú2"); + } + + @Override + public void run() { + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + //Logger.info("--------------------Ïß³Ì--------¶ÁÈ¡¶Ñ¶â»ú1ÐÅÏ¢-----------¿ªÊ¼---------------------"); + if (IsConnect()) { + String address = "0", ddj_id = "0"; + ddj_id = "ddj-2"; + address = "DB4.0"; + + DDJ_Device_2 ddj = (DDJ_Device_2) hsDDJParam.get(ddj_id); + ddj.dName = "2ºÅ¶Ñ¶â»ú"; + ddj.CZFS = 0; //תΪ16½øÖƵÄÕûÐÍ + ddj.SBZT = 0; + ddj.ZXRWH_1 = 0; + ddj.HCZT = 0; + ddj.ZXJD = 0; + ddj.DQP= 0; + ddj.DQL = 0; + ddj.DQC = 0; + ddj.MBPH = 0; + ddj.MBLH = 0; + ddj.MBCH = 0; + ddj.YXXF = 0; + ddj.ZXRWH_2 = 0; + ddj.ZXJD_2 = 0; + ddj.XTXH = 0; + OperateResultExOne read1 = readWriteNet.Read(address, Short.parseShort("60"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx = "0"; + if (read1.IsSuccess) { + ddsx = SoftBasic.ByteToHexString(read1.Content); + }// ±äÁ¿.Substring(²ÎÊý1,²ÎÊý2); ÕûÐÍ4¸ö×Ö½Ú ³¤ÕûÐÍ8¸ö×Ö½Ú + ddj.CZFS = ParseUtil.optInt(0, ddsx);//Integer.parseInt(ddsx.substring(0, 4), 16); + ddj.SBZT = ParseUtil.optInt(2, ddsx);//Integer.parseInt(ddsx.substring(4, 8), 16); + ddj.ZXRWH_1 = ParseUtil.optDInt(4, ddsx);//Long.parseLong(ddsx.substring(48, 64), 16); + ddj.ZXRWH_2 = ParseUtil.optDInt(8, ddsx);//Long.parseLong(ddsx.substring(48, 64), 16); + ddj.HCZT = ParseUtil.optInt(12, ddsx);//Integer.parseInt(ddsx.substring(8, 12), 16); + ddj.ZXJD = ParseUtil.optInt(14, ddsx);//Integer.parseInt(ddsx.substring(12, 16), 16); + ddj.ZXJD_2 = ParseUtil.optInt(16, ddsx);//Integer.parseInt(ddsx.substring(12, 16), 16); + ddj.DQP = ParseUtil.optInt(18, ddsx);//Integer.parseInt(ddsx.substring(16, 20), 16); + ddj.DQL = ParseUtil.optInt(20, ddsx);//Integer.parseInt(ddsx.substring(20, 24), 16); + ddj.DQC = ParseUtil.optInt(22, ddsx);//Integer.parseInt(ddsx.substring(24, 28), 16); + ddj.MBPH = ParseUtil.optInt(24, ddsx);//Integer.parseInt(ddsx.substring(28, 32), 16); + ddj.MBLH = ParseUtil.optInt(26, ddsx);//Integer.parseInt(ddsx.substring(32, 36), 16); + ddj.MBCH = ParseUtil.optInt(28, ddsx);//Integer.parseInt(ddsx.substring(36, 40), 16); + ddj.YXXF = ParseUtil.optInt(32, ddsx);//Integer.parseInt(ddsx.substring(40, 44), 16); + ddj.YXXF_2 = ParseUtil.optInt(32, ddsx);//Integer.parseInt(ddsx.substring(40, 44), 16); + ddj.XTXH = ParseUtil.optInt(38, ddsx);//Integer.parseInt(ddsx.substring(44, 48), 16); + //m_dao.updateSql("update IpErrorMsg set msg='PLC:"+strIp+" Á¬½ÓÕý³£' where ip='"+strIp+"' and msg !='"+strIp+" Á¬½ÓÕý³£'"); + Thread.sleep(800); + } else { + //m_dao.updateSql("update IpErrorMsg set msg='PLC:"+strIp+" Á¬½Ó³¬Ê±' where ip='"+strIp+"' and msg !='"+strIp+" Á¬½Ó³¬Ê±'"); + reConnect(); + } + } catch (Exception ex) { + Logger.info("------catch--------------Ïß³Ì--------¶ÁÈ¡¶Ñ¶â»ú1ÐÅÏ¢-----------ʧ°Üex{}--------------------",ex); + reConnect(); + } + // ÿ´ÎÑ­»·´ò¿ª¹Ø±ÕÁ´½Ó + //reConnect(); + } + closeServer(); + } + + ///¶Ñ¶â»úÈÎÎñÏ·¢ + public static int WritetoDDJ(String address, byte[] task) { + int a = 0; + if (readWriteNet != null) { + a = HslRead.WriteResultRender(readWriteNet.Write(address, task), address); + + } + return a; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientSSJ.java b/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientSSJ.java new file mode 100644 index 0000000..74bb7dc --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/IsoTcpClientSSJ.java @@ -0,0 +1,789 @@ +package com.wms.dss.ats.customs.abb.plc; + +import HslCommunication.BasicFramework.SoftBasic; +import HslCommunication.Core.Net.IReadWriteNet; +import HslCommunication.Core.Types.OperateResult; +import HslCommunication.Core.Types.OperateResultExOne; +import HslCommunication.Profinet.Siemens.SiemensPLCS; +import HslCommunication.Profinet.Siemens.SiemensS7Net; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.util.StrUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.ricosoft.common.logger.Logger; +import com.wms.dss.ats.customs.abb.entity.SSJ_Device; +import com.wms.dss.ats.customs.abb.utils.ParseUtil; +import com.wms.dss.ats.customs.abb.utils.Tools; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; + +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.util.*; + +public class IsoTcpClientSSJ extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + + + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + public SiemensS7Net siemensS7Net = null; + public static IReadWriteNet readWriteNet = null; + public boolean success = false; + public HashMap hsSSJParam = null; + public EntityDAO m_dao; + + @SuppressWarnings("unchecked") + public IsoTcpClientSSJ(Hashtable hsComParam, Hashtable hsSysParam, EntityDAO m_dao) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + + this.hsSSJParam = (HashMap) this.hsComParam.get("hsSSJMap"); + this.strIp = (String) hsComParam.get("strIpddj"); + this.iPort = (Integer) hsComParam.get("iPortddj"); + this.slot = (Integer) hsComParam.get("slotddj"); + this.m_dao = m_dao; + + } + + void ConnectServer() { + siemensS7Net = new SiemensS7Net(SiemensPLCS.S1500); + try { + siemensS7Net.setIpAddress(this.strIp); + siemensS7Net.setPort(this.iPort); + siemensS7Net.setRack((byte) Integer.parseInt("0")); + siemensS7Net.setSlot((byte) this.slot); + + OperateResult connect = siemensS7Net.ConnectServer(); + if (connect.IsSuccess) { + setIsConnect(true); + readWriteNet = siemensS7Net; + //Logger.info("q"); + } else { +// JOptionPane.showMessageDialog( +// null, +// "Connect Failed:" + connect.ToMessageShowString(), +// "Result", +// JOptionPane.WARNING_MESSAGE); + } + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + + } + + public void setIsConnect(boolean bflag) { + if (success != true) { + success = bflag; + } + } + + public boolean IsConnect() { + if (success == true) { + return success; + } + return false; + } + + void closeServer() { + if (readWriteNet != null) { + OperateResult connectclose = siemensS7Net.ConnectClose(); + } + setIsConnect(false); + + } + + void reConnect() { + closeServer(); + ConnectServer(); + Logger.info("ÖØÆôÊäËÍ»ú"); + } + + @Override + public void run() { + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + //Logger.info("--------------------Ïß³Ì--------¶ÁÈ¡·¢»õÇøÊäËÍ»úÐÅÏ¢-----------¿ªÊ¼---------------------"); + if (IsConnect()) { + + //Logger.info("ÊäËÍ»úÐÅÏ¢¶ÁÈ¡¿ªÊ¼"); + //Èë¿âÊäËÍ»ú + for (int i = 1; i <= 10; i++) { + String prefix = "inStockSsj-"; + String ssj_id = prefix + i, ssjNo = "", address = "",writeDB = ""; + //һ¥ÍÐÅÌÈë¿â¿Ú COMPLETED + if (i == 1) { + address = "DB510.0"; + //writeDB = "DB502.0"; + ssjNo = "L1009"; + } + //һ¥ÁÏÏäÈë¿â¿Ú + if (i == 2) { + address = "DB510.72"; + //writeDB = "DB502.30"; + ssjNo = "G1011-7"; + } + //һ¥ÍÐÅ̳ö¿â¿Ú COMPLETED + if (i == 3) { + address = "DB510.54"; + // writeDB = "DB502.60"; + ssjNo = "L1004"; + } + //һ¥ÁÏÏä³ö¿â¿Ú + if (i == 4) { + address = "DB510.90"; + //writeDB = "DB502.90"; + ssjNo = "G1012-5"; + } + //¶þÂ¥²à±ßÍÐÅÌÈë³ö¿â¿Ú COMPLETED + if (i == 5) { + address = "DB510.234"; + //writeDB = "DB502.120"; + ssjNo = "G2050"; + } + //¶þÂ¥²à±ßÍÐÅÌÈë³ö¿â¿Ú COMPLETED + if (i == 6) { + address = "DB510.252"; + //writeDB = "DB502.150"; + ssjNo = "G2051"; + } + //¶þÂ¥ÁÏÏäÈë³ö¿â¿Ú + if (i == 7) { + address = "DB510.396"; + //writeDB = "DB502.180"; + ssjNo = "G2049"; + } + //¶þÂ¥²à±ßÍÐÅÌÈë³ö¿â¿Ú COMPLETED + if (i == 8) { + address = "DB510.144"; + //writeDB = "DB502.210"; + ssjNo = "G2003"; + } + //¶þÂ¥²à±ßÍÐÅÌÈë³ö¿â¿Ú COMPLETED + if (i == 9) { + address = "DB510.162"; + //writeDB = "DB502.240"; + ssjNo = "G2006"; + } + //¶þÂ¥²à±ßÍÐÅÌÈë³ö¿â¿Ú COMPLETED + if (i == 10) { + address = "DB510.180"; + //writeDB = "DB502.270"; + ssjNo = "G2007"; + } + + + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + ssj.ssjNo = ssjNo; + ssj.BH= 0; + ssj.ZT = 0; + ssj.KX = 0; + ssj.DW = 0; + ssj.QQ=0; + ssj.RWH = 0; + ssj.writeDB = writeDB; + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("18"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.BH = ParseUtil.optInt(0,ddsx1); + ssj.ZT = ParseUtil.optInt(2,ddsx1); + if (i==8){ + SSJ_Device ssj1 = (SSJ_Device) hsSSJParam.get("G2002-1"); + OperateResultExOne read21 = readWriteNet.Read("DB510.560", Short.parseShort("2"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx11 = SoftBasic.ByteToHexString(read21.Content); + ssj1.KX = ParseUtil.optInt(0,ddsx11); + int kx = ParseUtil.optInt(4, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + if (ssj1.KX==1 && kx==1){ + ssj.KX = 1; + }else { + ssj.KX = 0; + } + }else { + ssj.KX = ParseUtil.optInt(4,ddsx1); + } + + ssj.DW = ParseUtil.optInt(6,ddsx1); + ssj.QQ=ParseUtil.optInt(8,ddsx1); + ssj.RWH = ParseUtil.optDInt(10,ddsx1); + } + } + + //ÏïµÀ¿ÚÊäËÍ»ú + for (int i = 1; i <= 14; i++) { + String prefix = "roadwaySsj-"; + String ssj_id = prefix + i, ssjNo = "", address = "",writeDB = ""; + //һ¥ÍÐÅ̳ö¿âÏïµÀ¿Ú COMPLETED + if (i == 1) { + address = "DB510.36"; + ssjNo = "L1001"; + // writeDB = "DB502.300"; + } + //һ¥ÍÐÅÌÈë¿âÏïµÀ¿Ú COMPLETED + if (i == 2) { + address = "DB510.18"; + ssjNo = "L1006"; + //writeDB = "DB502.330"; + } + //һ¥ÁÏÏäÈë¿âÏïµÀ¿Ú COMPLETED + if (i == 3) { + address = "DB510.108"; + ssjNo = "G1011-1-1"; + //writeDB = "DB502.360"; + } + //һ¥ÁÏÏäÈë¿âÏïµÀ¿Ú + if (i == 11) { + address = "DB510.520"; + ssjNo = "G1011-1-2"; + //writeDB = "DB502.810"; + } + //һ¥ÁÏÏä³ö¿âÏïµÀ¿Ú COMPLETED + if (i == 4) { + address = "DB510.126"; + ssjNo = "G1012-1-1"; + //writeDB = "DB502.390"; + } + //һ¥ÁÏÏä³ö¿âÏïµÀ¿Ú + if (i == 12) { + address = "DB501.840"; + ssjNo = "G1012-1-2"; + //writeDB = "DB502.840"; + } + //¶þÂ¥ÍÐÅ̳ö¿âÏïµÀ¿Ú COMPLETED + if (i == 5) { + address = "DB510.198"; + ssjNo = "L2001"; + //writeDB = "DB502.420"; + } + //¶þÂ¥ÍÐÅÌÈë¿âÏïµÀ¿Ú COMPLETED + if (i == 6) { + address = "DB510.216"; + ssjNo = "L2014"; + //writeDB = "DB502.450"; + } + //¶þÂ¥ÁÏÏä³ö¿âÏïµÀ¿Ú + if (i == 7) { + address = "DB510.270"; + ssjNo = "G2015-1-1"; + //writeDB = "DB502.480"; + } + //¶þÂ¥ÁÏÏä³ö¿âÏïµÀ¿Ú ÎÞÓà + if (i == 13) { + address = "DB501.870"; + ssjNo = "G2015-1-2"; + //writeDB = "DB502.870"; + } + //¶þÂ¥ÁÏÏäÈë¿âÏïµÀ¿Ú + if (i == 8) { + address = "DB510.288"; + ssjNo = "G2016-1-1"; + //writeDB = "DB502.510"; + } + //¶þÂ¥ÁÏÏäÈë¿âÏïµÀ¿Ú + if (i == 14) { + address = "DB510.538"; + ssjNo = "G2016-1-2"; + //writeDB = "DB502.900"; + } + //¶þÂ¥ÍÐÅ̲à±ßÈë³ö¿âÏïµÀ¿Ú COMPLETED + if (i == 9) { + address = "DB510.234"; + ssjNo = "G2050-2"; + //writeDB = "DB502.540"; + } + //¶þÂ¥ÍÐÅ̲à±ßÈë³ö¿âÏïµÀ¿Ú COMPLETED + if (i == 10) { + address = "DB510.252"; + ssjNo = "G2051-2"; + //writeDB = "DB502.570"; + } + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + ssj.ssjNo = ssjNo; + ssj.BH= 0; + ssj.ZT = 0; + ssj.KX = 0; + ssj.DW = 0; + ssj.QQ=0; + ssj.RWH = 0; + ssj.writeDB = writeDB; + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("18"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.BH = ParseUtil.optInt(0,ddsx1); + ssj.ZT = ParseUtil.optInt(2,ddsx1); + ssj.KX = ParseUtil.optInt(4,ddsx1); + ssj.DW = ParseUtil.optInt(6,ddsx1); + ssj.QQ=ParseUtil.optInt(8,ddsx1); + ssj.RWH = ParseUtil.optDInt(10,ddsx1); + } + } + + //ÇëÇóÁÏÏäÊäËÍ»úÐźŠ+ for (int i = 1; i <= 5; i++) { + String prefix = "boxSsj-"; + String ssj_id = prefix + i, ssjNo = "", address = "",writeDB = ""; + //¶þÂ¥ÇëÇóÁÏÏäÈ¥Ïò + if (i == 1) { + address = "DB510.306"; + writeDB = "DB511.12"; + ssjNo = "G2019"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥Ïò + if (i == 2) { + address = "DB510.342"; + writeDB = "DB511.36"; + ssjNo = "G2032"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥Ïò + if (i == 3) { + address = "DB510.360"; + writeDB = "DB511.48"; + ssjNo = "G2034"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥Ïò + if (i == 4) { + address = "DB510.414"; + writeDB = "DB511.84"; + ssjNo = "G2043"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥Ïò + if (i == 5) { + address = "DB510.432"; + writeDB = "DB511.96"; + ssjNo = "G2028"; + } + + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + ssj.ssjNo = ssjNo; + ssj.BH= 0; + ssj.ZT = 0; + ssj.KX = 0; + ssj.DW = 0; + ssj.QQ=0; + ssj.RWH = 0; + ssj.writeDB = writeDB; + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("18"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.BH = ParseUtil.optInt(0,ddsx1); + ssj.ZT = ParseUtil.optInt(2,ddsx1); + ssj.KX = ParseUtil.optInt(4,ddsx1); + ssj.DW = ParseUtil.optInt(6,ddsx1); + ssj.QQ=ParseUtil.optInt(8,ddsx1); + ssj.RWH = ParseUtil.optDInt(10,ddsx1); + ssj.BY1 = ParseUtil.optInt(14,ddsx1); + ssj.BY2 = ParseUtil.optInt(16,ddsx1); + } + } + //ÇëÇóÁÏÏäÊäËÍ»úÐźŠÁÏÏäÂëÐÅÏ¢ + for (int i = 1; i <= 5; i++) { + String prefix = "boxSsj-"; + String ssj_id = prefix + i, address = ""; + //¶þÂ¥ÇëÇóÁÏÏäÈ¥ÏòG2019 + if (i == 1) { + address = "DB510.450"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥ÏòG2032 + if (i == 2) { + address = "DB510.464"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥ÏòG2034 + if (i == 3) { + address = "DB510.478"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥ÏòG2043 + if (i == 4) { + address = "DB510.492"; + } + //¶þÂ¥ÇëÇóÁÏÏäÈ¥ÏòG2028 + if (i == 5) { + address = "DB510.506"; + } + + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("14"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.trayCode = ParseUtil.optString(2,ddsx1); + if ("000000000000".equals(ssj.trayCode)){ + ssj.trayCode=null; + }else if ("111111111111".equals(ssj.trayCode) && ssj.DW==1){ + ssj.trayCode =null; + ssj.exceptionId = 7; + }else { + ssj.exceptionId = 0; + } + } + } + + //×ªÒÆÍÐÅÌÊäËÍ»ú + for (int i = 1; i <= 1; i++) { + String prefix = "transferSsj-"; + String ssj_id = prefix + i, ssjNo = "", address = "",writeDB = ""; + if (i == 1) { + //¶þÂ¥ÍÐÅÌ×ªÒÆSSJ COMPLETED + address = "DB510.198"; + writeDB = "DB511.0"; + ssjNo = "L2001"; + } + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + ssj.ssjNo = ssjNo; + ssj.BH= 0; + ssj.ZT = 0; + ssj.KX = 0; + ssj.DW = 0; + ssj.QQ=0; + ssj.RWH = 0; + ssj.writeDB = writeDB; + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("18"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.BH = ParseUtil.optInt(0,ddsx1); + ssj.ZT = ParseUtil.optInt(2,ddsx1); + ssj.KX = ParseUtil.optInt(4,ddsx1); + ssj.DW = ParseUtil.optInt(6,ddsx1); + ssj.QQ=ParseUtil.optInt(8,ddsx1); + ssj.RWH = ParseUtil.optDInt(10,ddsx1); + } + } + + //ÁϼÜÐźŠ+ for (int i = 1; i <= 2; i++) { + String prefix = "rack-"; + String ssj_id = prefix + i, address = "", ssjNo = "",writeDB = ""; + if (i == 1) { + address = "DB510.574"; + writeDB = "DB502.800"; + ssjNo = "ZJ001"; + } + if (i == 2) { + address = "DB510.576"; + writeDB = "DB502.805"; + ssjNo = "ZJ002"; + } + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + ssj.writeDB = writeDB; + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("2"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.ssjNo = ssjNo; + ssj.LJXH = ParseUtil.optInt(0, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + } + } + + for (int i = 1; i <= 8; i++) { + String prefix = "smSsj-"; + String ssj_id = prefix + i, address = "", ssjNo = "",writeDB = ""; + String trayCodeReadAddress = null; + if (i == 1) { + //һ¥ÍÐÅÌɨÂëSsj COMPLETED + address = "DB501.0"; + writeDB = "DB502.0"; + ssjNo = "L1009"; + trayCodeReadAddress = "DB510.592"; + } + if (i == 2) { + //һ¥ÁÏÏäɨÂëSsj COMPLETED + address = "DB501.34"; + writeDB = "DB502.16"; + ssjNo = "G1011-7"; + trayCodeReadAddress = "DB510.578"; + } + if (i == 3){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.0"; + writeDB = "DB504.0"; + ssjNo = "G2003"; + trayCodeReadAddress = "DB510.606"; + } + if (i == 4){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.34"; + writeDB = "DB504.16"; + ssjNo = "G2006"; + trayCodeReadAddress = "DB503.34"; + } + if (i == 5){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.68"; + writeDB = "DB504.32"; + ssjNo = "G2007"; + trayCodeReadAddress = "DB503.68"; + } + if (i == 6){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.102"; + writeDB = "DB504.48"; + ssjNo = "G2050"; + trayCodeReadAddress = "DB510.634"; + } + if (i == 7){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.136"; + writeDB = "DB504.64"; + ssjNo = "G2051"; + trayCodeReadAddress = "DB510.648"; + } + if (i == 8){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB512.0"; + writeDB = "DB512.34"; + ssjNo = "G2049"; + trayCodeReadAddress = "DB510.620"; + } + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + ssj.writeDB = writeDB; + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("34"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.ssjNo = ssjNo; + ssj.CKDW = ParseUtil.optInt(0, ddsx1); + //(int) Long.parseLong(ddsx1.substring(0, 4), 16); + ssj.CKKX = ParseUtil.optInt(2, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + ssj.RWH = ParseUtil.optDInt(4, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + ssj.SSZT = ParseUtil.optInt(8, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + ssj.RKQQ = ParseUtil.optInt(10, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + ssj.RKGD = ParseUtil.optInt(12, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + if (ssj.RKGD == 1){ + ssj.height=0; + }else if (ssj.RKGD == 2){ + ssj.height = 1; + }else if (ssj.RKGD == 3){ + ssj.height = 2; + }else { + ssj.height = -1; + } + + //ssj.trayCode = ParseUtil.optString(16, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + ssj.exceptionId = ParseUtil.optInt(28, ddsx1);//(int) Long.parseLong(ddsx1.substring(0, 4), 16); + /*if (ssj.exceptionId == 7){ + ssj.trayCode = null; + }*/ + ssj.BY1 = ParseUtil.optInt(30, ddsx1); + ssj.BY2 = ParseUtil.optInt(32, ddsx1); + OperateResultExOne read = readWriteNet.Read(trayCodeReadAddress, Short.parseShort("14")); + String trayXx = "0"; + if (read.IsSuccess){ + trayXx = SoftBasic.ByteToHexString(read.Content); + String trayCode = ParseUtil.optString(2, trayXx); + if ("000000000000".equals(trayCode)){ + ssj.trayCode=null; + }else if ("111111111111".equals(trayCode)){ + ssj.trayCode =null; + }else { + if (ssjNo.equals("G2006")|| ssjNo.equals("G2007")){ + ssj.trayCode =null; + + }else { + ssj.trayCode = trayCode; + + } + + } + } + } + } + + /*for (int i = 1; i <= 8; i++) { + String prefix = "smSsj-"; + String ssj_id = prefix + i, address = "", ssjNo = "",writeDB = ""; + if (i == 1) { + //һ¥ÍÐÅÌɨÂëSsj COMPLETED + address = "DB501.0"; + + } + if (i == 2) { + //һ¥ÁÏÏäɨÂëSsj COMPLETED + address = "DB501.34"; + + } + if (i == 3){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.0"; + + } + if (i == 4){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.34"; + + } + if (i == 5){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.68"; + + } + if (i == 6){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.102"; + + } + if (i == 7){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.136"; + + } + if (i == 8){ + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB512.0"; + + } + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("34")); + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + String trayCode = ParseUtil.optString(16, ddsx1); + if ("000000000000".equals(trayCode)){ + ssj.trayCode=null; + }else if ("111111111111".equals(trayCode)){ + ssj.trayCode =null; + }else { + ssj.trayCode = trayCode; + } + } + }*/ + + for (int i = 1; i <= 2; i++) { + String prefix = "jxSsj-"; + String ssj_id = prefix + i, ssjNo = "", address = "",writeDB = ""; + //һ¥ÍÐÅ̳ö¿âÏïµÀ¿Ú COMPLETED + if (i == 1) { + address = "DB510.324"; + ssjNo = "G2026"; + // writeDB = "DB502.300"; + } + //һ¥ÍÐÅÌÈë¿âÏïµÀ¿Ú COMPLETED + if (i == 2) { + address = "DB510.378"; + ssjNo = "G2041"; + //writeDB = "DB502.330"; + } + SSJ_Device ssj = (SSJ_Device) hsSSJParam.get(ssj_id); + ssj.ssjNo = ssjNo; + ssj.BH= 0; + ssj.ZT = 0; + ssj.KX = 0; + ssj.DW = 0; + ssj.QQ=0; + ssj.RWH = 0; + ssj.writeDB = writeDB; + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("18"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + ssj.BH = ParseUtil.optInt(0,ddsx1); + ssj.ZT = ParseUtil.optInt(2,ddsx1); + ssj.KX = ParseUtil.optInt(4,ddsx1); + ssj.DW = ParseUtil.optInt(6,ddsx1); + ssj.QQ=ParseUtil.optInt(8,ddsx1); + ssj.RWH = ParseUtil.optDInt(10,ddsx1); + } + } + + + + + //m_dao.updateSql("update IpErrorMsg set msg='PLC:" + strIp + " Á¬½ÓÕý³£' where ip='" + strIp + "' and msg !='" + strIp + " Á¬½ÓÕý³£'"); + Thread.sleep(800); + } else { + // m_dao.updateSql("update IpErrorMsg set msg='PLC:" + strIp + " Á¬½Ó³¬Ê±' where ip='" + strIp + "' and msg !='" + strIp + " Á¬½Ó³¬Ê±'"); + reConnect(); + } + //Logger.info("--------------------Ïß³Ì--------¶ÁÈ¡PLCÐÅÏ¢-----------½áÊø---------------------"); + //Thread.sleep(800); + } catch (Exception ex) { + //Logger.info("------catch--------------Ïß³Ì--------¶ÁÈ¡PLCÐÅÏ¢-----------½áÊø0--------------------"); + Logger.error("------catch--------------Ïß³Ì--------¶ÁÈ¡PLCÐÅÏ¢-----------ʧ°Üe{}--------------------",ex); + reConnect(); + } + } + closeServer(); + } + + /// ÊäËÍ»úÈÎÎñÏ·¢ + public static int WritetoSSJ(String address, byte[] tsak) { + int a = 0; + if (readWriteNet != null) { + a = HslRead.WriteResultRender(readWriteNet.Write(address, tsak), address); + } + return a; + } + + //¶ÁÈ¡ÈÎÎñÊÇ·ñÏ·¢ + public static SSJ_Device readSsjRwh(String ssjNo) { + String address = ""; + String writeDB = ""; + switch (ssjNo) { + case "L1009": + //һ¥ÍÐÅÌɨÂëSsj COMPLETED + address = "DB510.0"; + break; + case "G1011-7": + //һ¥ÁÏÏäɨÂëSsj COMPLETED + address = "DB510.72"; + break; + case "G2003": + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB510.556"; + break; + case "G2006": + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.34"; + break; + case "G2007": + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB503.68"; + break; + case "G2032": + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB510.342"; + break; + case "G2043": + //¶þÂ¥ÍÐÅÌɨÂëÊäËÍ»ú COMPLETED + address = "DB510.414"; + break; + default: + return new SSJ_Device(); + } + String taskNo = ""; + SSJ_Device ssj = new SSJ_Device(); + OperateResultExOne read2 = readWriteNet.Read(address, Short.parseShort("18"));//readWriteNet.Read(µØÖ·£¬ShortµÄ¶ÁÈ¡µØÖ·³¤¶È) + String ddsx1 = "0"; + if (read2.IsSuccess) { + ddsx1 = SoftBasic.ByteToHexString(read2.Content); + //ssj.BH = ParseUtil.optInt(0,ddsx1); + //ssj.ZT = ParseUtil.optInt(2,ddsx1); + //ssj.KX = ParseUtil.optInt(4,ddsx1); + //ssj.DW = ParseUtil.optInt(6,ddsx1); + //ssj.QQ=ParseUtil.optInt(8,ddsx1); + ssj.RWH = ParseUtil.optDInt(10,ddsx1); + } + return ssj; + + } + + +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/PLCCorrespondService.java b/src/com/wms/dss/ats/customs/abb/plc/PLCCorrespondService.java new file mode 100644 index 0000000..b7e7d02 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/PLCCorrespondService.java @@ -0,0 +1,44 @@ +package com.wms.dss.ats.customs.abb.plc; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.common.server.schedule.ThreadSchedule; + +import java.util.HashMap; +import java.util.Hashtable; + + +/** + * ÃèÊö: É豸ͨÐÅ·þÎñ + * + * @author zhu 2020-3-20 + * @since WCS 3.0 + */ +public class PLCCorrespondService extends ThreadSchedule { + + + @Override + public void stopAll(boolean bVal) { + //¹Ø±Õ + m_hsSysParam.put("bStopFlag", "true"); + } + + @Override + public void threadExec() { + // Ö´ÐÐÉ豸ͨÐÅÏß³Ì + startcomm(m_hsSysParam); + } + + public static void initDevice(HashMap hsDDJMap) { // + + } + + public void startcomm(Hashtable m_hsSysParam) { + m_hsSysParam.put("bStopFlag", "false"); + EntityDAO m_dao = (EntityDAO) m_hsSysParam.get("dao"); + + ReadPLCSSJ.read(m_hsSysParam,m_dao); + ReadPLCDDJ1.read(m_hsSysParam,m_dao); + ReadPLCDDJ2.read(m_hsSysParam,m_dao); + + } +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ1.java b/src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ1.java new file mode 100644 index 0000000..37a51ca --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ1.java @@ -0,0 +1,35 @@ +package com.wms.dss.ats.customs.abb.plc; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.DDJ_Device; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Hashtable; + +public class ReadPLCDDJ1 { + + public static void read(Hashtable m_hsSysParam,EntityDAO m_dao) { + Hashtable hsComParam = new Hashtable(); + + HashMap hsDDJMap = new HashMap(); + + String strIp = "192.168.56.11";///DDJ plc¶ÔÓ¦ipµØÖ· + String strPort = "102"; + String strSLot = "1"; + hsComParam.put("strIpddj", strIp); + hsComParam.put("iPortddj", Integer.parseInt(strPort)); + hsComParam.put("slotddj", Integer.parseInt(strSLot)); + + + //¶Ñ¶â»ú + DDJ_Device ddj = new DDJ_Device((byte)1, "ddj"); + hsDDJMap.put(ddj.dtype + "-" + ddj.btId, ddj); + + hsComParam.put("hsDDJMap1", hsDDJMap); + m_hsSysParam.put("hsComParamDDJ1", hsComParam); + // PLCͨѶ¿Í»§¶Ë + IsoTcpClientDDJ1 tp = new IsoTcpClientDDJ1(hsComParam, m_hsSysParam,m_dao); + tp.start(); + } +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ2.java b/src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ2.java new file mode 100644 index 0000000..c8fe8a2 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/ReadPLCDDJ2.java @@ -0,0 +1,37 @@ +package com.wms.dss.ats.customs.abb.plc; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.DDJ_Device; +import com.wms.dss.ats.customs.abb.entity.DDJ_Device_2; +import com.wms.dss.ats.customs.abb.entity.SSJ_Device; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Hashtable; + +public class ReadPLCDDJ2 { + + public static void read(Hashtable m_hsSysParam,EntityDAO m_dao) { + Hashtable hsComParam = new Hashtable(); + + HashMap hsDDJMap = new HashMap(); + + String strIp = "192.168.56.21";///DDJ plc¶ÔÓ¦ipµØÖ· + String strPort = "102"; + String strSLot = "1"; + hsComParam.put("strIpddj", strIp); + hsComParam.put("iPortddj", Integer.parseInt(strPort)); + hsComParam.put("slotddj", Integer.parseInt(strSLot)); + + + //¶Ñ¶â»ú + DDJ_Device_2 ddj = new DDJ_Device_2((byte)2, "ddj"); + hsDDJMap.put(ddj.dtype + "-" + ddj.btId, ddj); + + hsComParam.put("hsDDJMap2", hsDDJMap); + m_hsSysParam.put("hsComParamDDJ2", hsComParam); + // PLCͨѶ¿Í»§¶Ë + IsoTcpClientDDJ2 tp = new IsoTcpClientDDJ2(hsComParam, m_hsSysParam,m_dao); + tp.start(); + } +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/ReadPLCSSJ.java b/src/com/wms/dss/ats/customs/abb/plc/ReadPLCSSJ.java new file mode 100644 index 0000000..c2cd27b --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/ReadPLCSSJ.java @@ -0,0 +1,73 @@ +package com.wms.dss.ats.customs.abb.plc; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.DDJ_Device; +import com.wms.dss.ats.customs.abb.entity.SSJ_Device; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Hashtable; + +public class ReadPLCSSJ { + + public static void read(Hashtable m_hsSysParam,EntityDAO m_dao) { + Hashtable hsComParam = new Hashtable(); + HashMap hsSSJMap = new HashMap(); + + String strIp = "192.168.56.41";///DDJ plc¶ÔÓ¦ipµØÖ· + String strPort = "102"; + String strSLot = "1"; + hsComParam.put("strIpddj", strIp); + hsComParam.put("iPortddj", Integer.parseInt(strPort)); + hsComParam.put("slotddj", Integer.parseInt(strSLot)); + + //Èë¿âÊäËÍ»ú + for(int i = 1; i <= 10; i++){ + SSJ_Device ssj = new SSJ_Device((byte)i, "inStockSsj"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + } + //ÏïµÀ¿ÚÊäËÍ»ú + for(int i = 1; i <= 14; i++){ + SSJ_Device ssj = new SSJ_Device((byte)i, "roadwaySsj"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + } + + //×ªÒÆÊäËÍ»ú + for(int i = 1; i <= 1; i++){ + SSJ_Device ssj = new SSJ_Device((byte)i, "transferSsj"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + } + + //ÇëÇóÁÏÏäÊäËÍ»ú + for(int i = 1; i <= 5; i++){ + SSJ_Device ssj = new SSJ_Device((byte)i, "boxSsj"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + } + + //ÁÏÏä¼ðѡλ + for(int i = 1; i <= 2; i++){ + SSJ_Device ssj = new SSJ_Device((byte)i, "jxSsj"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + } + + //ÁϼÜÐźŠ+ for(int i = 1; i <= 2; i++){ + SSJ_Device ssj = new SSJ_Device((byte)i, "rack"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + } + for(int i = 1; i <= 10; i++){ + SSJ_Device ssj = new SSJ_Device((byte)i, "smSsj"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + } + + SSJ_Device ssj = new SSJ_Device((byte)1, "G2002"); + hsSSJMap.put(ssj.dtype + "-" + ssj.btId, ssj); + + hsComParam.put("hsSSJMap", hsSSJMap); + m_hsSysParam.put("hsComParamSSJ", hsComParam); + // PLCͨѶ¿Í»§¶Ë + IsoTcpClientSSJ ssjTp = new IsoTcpClientSSJ(hsComParam, m_hsSysParam,m_dao); + ssjTp.start(); + + } +} diff --git a/src/com/wms/dss/ats/customs/abb/plc/备注.txt b/src/com/wms/dss/ats/customs/abb/plc/备注.txt new file mode 100644 index 0000000..fa6f9a1 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/plc/备注.txt @@ -0,0 +1 @@ +ÓëPLCͨÐÅ,¶ÁÈ¡PLC±äÁ¿,±£´æÔÚÊý¾Ý¿âÖÐ \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/schedule/ABBThreadSchedule.java b/src/com/wms/dss/ats/customs/abb/schedule/ABBThreadSchedule.java new file mode 100644 index 0000000..9951d44 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/ABBThreadSchedule.java @@ -0,0 +1,82 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import com.ricosoft.common.logger.Logger; +import com.wms.dss.common.server.schedule.ThreadSchedule; + +/** + * ÃèÊö: µ÷¶È×ÜÏß³Ì + * + * @since WMS 3.1 ZGWµÚÒ»´ÎÌá½» + */ +public class ABBThreadSchedule extends ThreadSchedule { + + protected DDJThread ddjThread = null; + protected DDJThread2 ddjThread2 = null; + protected BoxSsjThread boxSsjThread= null; + protected InOutStockSsjThread inOutStockSsjThread= null; + protected RoadwaySsjThread roadwaySsjThread= null; + protected TransferSsjThread transferSsjThread= null; + protected AGVThread agvThread = null; +// protected OCRThread ocrThread = null; + protected ExceptionUploadThread exceptionUploadThread= null; + protected ControlThread controlThread = null; + @Override + public void stopAll(boolean bVal) { + m_hsSysParam.put("bDStopFlag", "true"); + //crane1.setStop(bVal); + } + + @Override + public void threadExec() { + m_hsSysParam.put("bDStopFlag", "false"); + try { + //³öÈë¿â¿ÚÊäËÍ»ú + inOutStockSsjThread = new InOutStockSsjThread( m_hsSysParam); + inOutStockSsjThread.setName("³öÈë¿â¿ÚÊäËÍ»ú"); + inOutStockSsjThread.start(); + Thread.sleep(400); + //Òì³£Éϱ¨ µ÷ÕûÉϱ¨¼ä¸ôʱ¼ä£¬·ÀֹƵ·±Éϱ¨ÊäËÍ»úÒì³£ + exceptionUploadThread = new ExceptionUploadThread( m_hsSysParam); + exceptionUploadThread.setName("Òì³£Éϱ¨"); + exceptionUploadThread.start(); + Thread.sleep(400); + + //ÏïµÀ¿ÚÊäËÍ»ú + roadwaySsjThread = new RoadwaySsjThread( m_hsSysParam); + roadwaySsjThread.setName("ÏïµÀ¿ÚÊäËÍ»ú"); + roadwaySsjThread.start(); + Thread.sleep(400); + //¶Ñ¶â»ú1 + ddjThread = new DDJThread( m_hsSysParam); + ddjThread.setName("¶Ñ¶â»úÏß³Ì×é1"); + ddjThread.start();//¶Ñ¶â»úµ÷¶È + Thread.sleep(400); + ddjThread2 = new DDJThread2( m_hsSysParam); + ddjThread2.setName("¶Ñ¶â»úÏß³Ì×é2"); + ddjThread2.start();//¶Ñ¶â»úµ÷¶È + Thread.sleep(400); + + agvThread = new AGVThread(m_hsSysParam); + agvThread.setName("AGV½»»¥Ïß³Ì"); + agvThread.start(); + Thread.sleep(400); + //ÍÐÅ̳ö¿âÇëÇóÊäËÍ»ú+ÁϼÜÐźÅÅÐ¶Ï + transferSsjThread = new TransferSsjThread( m_hsSysParam); + transferSsjThread.setName("ÍÐÅ̳ö¿âÇëÇóÊäËÍ»ú+ÁϼÜÐźÅÅжÏ"); + transferSsjThread.start(); + Thread.sleep(400); + //ÁÏÏä·´À¡ÊäËÍ»ú + boxSsjThread = new BoxSsjThread( m_hsSysParam); + boxSsjThread.setName("ÁÏÏä·´À¡ÊäËÍ»ú"); + boxSsjThread.start(); + Thread.sleep(400); + controlThread = new ControlThread( m_hsSysParam); + controlThread.setName("É豸¼à¿ØÏß³Ì"); + controlThread.start(); + //¼à¿Ø + Thread.sleep(400); + } catch (Exception er) { + Logger.error("........É豸µ÷¶ÈÏß³ÌÆô¶¯³ö´í........" + er.getMessage()); + } + } +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/AGVThread.java b/src/com/wms/dss/ats/customs/abb/schedule/AGVThread.java new file mode 100644 index 0000000..efe01f6 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/AGVThread.java @@ -0,0 +1,106 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.log.Log; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.ExceptionInfo; +import com.wms.dss.ats.customs.abb.entity.SSJ_Device; +import com.wms.dss.ats.customs.abb.entity.WcsPortState; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientSSJ; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; +import org.hibernate.cfg.annotations.QueryBinder; + +import java.util.Date; +import java.util.Hashtable; +import java.util.List; +import java.util.Optional; + +public class AGVThread extends CraneThread { + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamSSJ = null; + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public AGVThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + hsComParamSSJ = (Hashtable) hsSysParam.get("hsComParamSSJ"); + m_dao = (EntityDAO) hsSysParam.get("dao"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + continue; + } + } catch (Exception e) { + Logger.error(e.getMessage()); + } + try { + List portState = QueryDbDataUtils.getPortState(m_dao); + if (CollUtil.isNotEmpty(portState)){ + for (WcsPortState wcsPortState : portState) { + //Èë¿â + if (wcsPortState.getOccupationState() == 1 && "1".equals(wcsPortState.getSpare1())) { + //todo дÈëÈë¿âÈÎÎñ + List inStockSsj = DbGet.getSmSsj(); + Optional first = inStockSsj.stream().filter(ssj_device -> ssj_device.ssjNo.equals(wcsPortState.getPortName())).findFirst(); + if (first.isPresent()) { + SSJ_Device ssjDevice = first.get(); + byte[] sendData = Tools.sendDataToDevice(0, null, 0, 0, 1); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + /*if (ssjDevice.ssjNo.equals("L1009")){ + IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + }*/ + //todo ÅжÏÒ»ÏÂÊÇ·ñ½ÓÊÕµ½ + Logger.info("ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "Æô¶¯ÈÎÎñ³É¹¦£¡"); + /*if (ssjDevice.ssjNo.equals("G2003")){ + QueryDbDataUtils.updateWcsPortState(m_dao, ssjDevice.ssjNo, "1"); + }*/ + //QueryDbDataUtils.updateWcsPortState(m_dao, wcsPortState.getPortName(), "1"); + } + } + } + //³ö¿â + if (wcsPortState.getOccupationState()==0 && "2".equals(wcsPortState.getSpare1()) && "0".equals(wcsPortState.getSpare2())){ + //È¡»õÍê³ÉÒÔºó 10Ãë×Ô¶¯Çå³ýÈÎÎñ + /*List inStockSsj = DbGet.getInStockSsj(); + Optional first = inStockSsj.stream().filter(ssj_device -> ssj_device.ssjNo.equals(wcsPortState.getPortName())).findFirst(); + if (first.isPresent()){ + SSJ_Device ssjDevice = first.get(); + byte[] sendData = Tools.sendDataToDevice(0, "", 1 ); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("Ïò³ö¿ÚÊäËÍ»ú" + ssjDevice.ssjNo + "дÈëÇå¿Õ±êÖ¾³É¹¦"); + QueryDbDataUtils.updateWcsPortState(m_dao, wcsPortState.getPortName(), "1"); + } + }*/ + } + } + } + } catch (Exception e) { + Logger.error(e.getMessage()); + }finally { + try { + sleep(1500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/BoxSsjThread.java b/src/com/wms/dss/ats/customs/abb/schedule/BoxSsjThread.java new file mode 100644 index 0000000..1017562 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/BoxSsjThread.java @@ -0,0 +1,306 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUnit; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.MydoJob; +import com.wms.dss.ats.customs.abb.entity.SSJ_Device; +import com.wms.dss.ats.customs.abb.entity.StoredParameters; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientSSJ; +import com.wms.dss.ats.customs.abb.utils.ProcedureResult; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.RequestUrls; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; + +import java.sql.SQLException; +import java.util.*; + +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.taskExceptionUpload; + +public class BoxSsjThread extends CraneThread { + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamSSJ = null; + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public BoxSsjThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + hsComParamSSJ = (Hashtable) hsSysParam.get("hsComParamSSJ"); + m_dao = (EntityDAO) hsSysParam.get("dao"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + continue; + } + } catch (Exception e) { + Logger.error(e); + //throw new RuntimeException(e); + } + try { + //Logger.info("=======================ÊäËÍ»úÏß³ÌÆô¶¯==========================="); + //»ñÈ¡DB¿éÖеÄÐÅÏ¢ + DbGet.hsComParamSSJ = hsComParamSSJ; + + int ssjH = 0; //¶Ñ¶â»úºÅ + try { ///¶Ñ¶â»úµ÷¶È + List ssj = DbGet.getFirstBoxSsj(); + if (!ssj.isEmpty()) { + for (SSJ_Device ssj_device : ssj) { + //¶Ñ¶â»úÑ­»· + ssj_dd(ssj_device,DbGet.getJxSsj()); + } + } + List requestSsj = DbGet.getRequestBoxSsj(); + + if (!requestSsj.isEmpty()) { + for (SSJ_Device ssj_device : requestSsj) { + //¶Ñ¶â»úÑ­»· + ssj_request_dd(ssj_device,DbGet.getJxSsj()); + } + } + } catch (Exception ex) { + Logger.info("ÊäËÍ»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ssjH + ex.getMessage()); + }///¶Ñ¶â»úµ÷¶È + } catch (Exception e) { + //Logger.info("==========ÊäËÍ»úÏß³Ì×éÒì³£,Òì³£ÐÅÏ¢¡¾" + e.getMessage() + "¡¿========"); + Logger.error(e); + } finally { + //Logger.info("=======================ÊäËÍ»úÏß³Ì×éÐÝÃß==========================="); + try { + sleep(1500); + } catch (InterruptedException e) { + Logger.error(e); + } + } + } + } + + private void ssj_request_dd(SSJ_Device ssjDevice, List jxSsj) throws Exception { + if (ssjDevice.exceptionId == 0 && ssjDevice.DW == 1 && StrUtil.isNotBlank(ssjDevice.trayCode)) { + + + MydoJob mydoJob = QueryDbDataUtils.getMyDoJobByTrayCode(m_dao, String.valueOf(ssjDevice.trayCode)); + if (mydoJob != null){ + DateTime startTime = DateUtil.parse(mydoJob.getStart_time()); + DateTime currentTime = DateUtil.parse(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + if (DateUtil.between(startTime, currentTime, DateUnit.SECOND) > 20) { + //´¦Àí»ØÁ÷ÈÎÎñ Èë¿âÈÎÎñ ·¢ËÍÈ¥Ïò + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + long taskNo = Convert.toInt(mydoJob.getTask_no()); + int qx=1; + int sendCompleted=1; + byte[] sendData = Tools.sendDataToDevice( taskNo, null,sendCompleted,qx); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + MydoJob slotJobByTask = QueryDbDataUtils.getSlotJobByTask(m_dao, ssjDevice.RWH, null); + if (slotJobByTask != null) { + Logger.info("ÏòÊäËÍ»ú" + ssjDevice.ssjNo + "ÖØ¸´Ï·¢»ØÁ÷ÈÎÎñ" + taskNo + "³É¹¦£¡"); + //×÷Òµ¿ªÊ¼ + m_dao.updateSql("update MydoJob set status=3, class_now_name='"+qx+"', start_time='" + format + "',execution_phase= 2,car_number='"+ ssjDevice.ssjNo+"' where task_no='" + slotJobByTask.getTask_no() + "'"); + } + + } + } + }else { + Map map = new HashMap<>(); + map.put("trayCode", ssjDevice.trayCode); + map.put("ssjNo", ssjDevice.ssjNo); + String requestParam = JSONUtil.toJsonStr(map); + //ÇëÇówms½Ó¿Ú + String post = HttpUtil.post(RequestUrls.TrayCodeDirection.getUrl(), requestParam); + JSONObject entries = JSONUtil.parseObj(post); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + //Thread.sleep(10000); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + JSONObject data = JSONUtil.parseObj(post).getJSONObject("data"); + int whereAbouts = data.getInt("whereAbouts"); + sendWhereAbouts(ssjDevice,whereAbouts); + } + + + } + } + + /** + * ÊäËÍ»úµ÷¶È + * + * @param ssjDevice + */ + private void ssj_dd(SSJ_Device ssjDevice,List jxList) throws Exception { + if (ssjDevice.exceptionId == 0 && ssjDevice.DW == 1 && ssjDevice.RWH > 0 && StrUtil.isNotBlank(ssjDevice.trayCode) ) { + + + + //ÅжÏÊdzö¿âÈÎÎñ »¹ÊǼðÑ¡ÈÎÎñ + MydoJob mydoJob = QueryDbDataUtils.getMyDoJobByTrayCode(m_dao, String.valueOf(ssjDevice.trayCode)); + + if (mydoJob != null) { + if ("G2049".equals(mydoJob.getExit_id())) { + //Ö´Ðгö¿âÈÎÎñ + int taskNo; + int jym; + byte[] sendData; + int isSend; + int qx=2 ; + int sendCompleted=1; + //ͨ¹ý×÷Òµ³ö¿ÚºÅÅÐ¶Ï + //Ï·¢ÊäËÍ»úÇëÇó ÖÁ¼ðÑ¡¿Ú + taskNo = Convert.toInt(ssjDevice.RWH); + sendData = Tools.sendDataToDevice(taskNo, null, sendCompleted,qx); + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("ÏòÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢G2049³ö¿âÈÎÎñ" + taskNo + "³É¹¦£¡"); + m_dao.updateSql("update MydoJob set class_now_name='"+qx+"' where task_no='" + taskNo + "'"); + + } + } else if ( + Convert.toInt(mydoJob.getIn_or_out())>9 && ("G2026".equals(mydoJob.getExit_id()) ||"G2041".equals(mydoJob.getExit_id())) + ) { + + if (mydoJob.getExecution_phase().equals("5")){ + DateTime startTime = DateUtil.parse(mydoJob.getStart_time()); + DateTime currentTime = DateUtil.parse(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + if (DateUtil.between(startTime, currentTime, DateUnit.SECOND) > 20) { + String exitId = mydoJob.getExit_id(); + int whereAbouts = 0; + if (exitId.equals("G2026")){ + whereAbouts = 1 ; + }else if (exitId.equals("G2041")){ + whereAbouts = 2 ; + } + sendWhereAbouts(ssjDevice, whereAbouts); + } + + }else { + String exitId = mydoJob.getExit_id(); + int whereAbouts = 0; + if (exitId.equals("G2026")){ + whereAbouts = 1 ; + }else if (exitId.equals("G2041")){ + whereAbouts = 2 ; + } + sendWhereAbouts(ssjDevice, whereAbouts); + } + + } + } + } + + catchException(ssjDevice); + } + + private static void catchException(SSJ_Device ssjDevice) throws Exception { + if (ssjDevice.exceptionId == 7 && ssjDevice.DW == 1 && ssjDevice.RWH > 0 && StrUtil.isBlank(ssjDevice.trayCode)){ + //µ÷ÓÃÓÃÒì³£Éϱ¨½Ó¿Ú + //ÇëÇówms½Ó¿Ú + Map map = new HashMap<>(); + map.put("trayCode", ssjDevice.trayCode); + map.put("errorType", ssjDevice.exceptionId); + map.put("jobId", IdUtil.getSnowflakeNextIdStr()); + String post = HttpUtil.post(taskExceptionUpload.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(post); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + Logger.info("·¢ËÍɨÃèÒì³£" + ssjDevice.ssjNo+":" + post ); + } + } + + private void sendWhereAbouts(SSJ_Device ssjDevice, int whereAbouts) throws Exception { + int qx; + int isSend; + int taskNo; + byte[] sendData; + int sendCompleted; + switch (whereAbouts) { + case 1: + //ͨ¹ý×÷Òµ³ö¿ÚºÅÅÐ¶Ï + //Ï·¢ÊäËÍ»úÇëÇó ÖÁ¼ðÑ¡¿Ú + sendCompleted = 1; + qx = 33; + taskNo = Convert.toInt(ssjDevice.RWH); + sendData = Tools.sendDataToDevice(taskNo, null, sendCompleted, qx); + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + + Logger.info("ÏòÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢¼ðÑ¡¿Ú1ÈÎÎñ" + taskNo + "³É¹¦£¡"); + m_dao.updateSql("update MydoJob set class_now_name='" + qx + "', execution_phase=5,car_number='" + ssjDevice.ssjNo + "' where task_no='" + taskNo + "'"); + /*if (ssjDevice.RWH==taskNo){ + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + Logger.info("ÏòÊäËÍ»ú" + ssjDevice.ssjNo + "ÖØ¸´Ï·¢¼ðÑ¡¿Ú1ÈÎÎñ" + taskNo + "³É¹¦£¡"); + + }*/ + + } + + break; + case 2: + //ͨ¹ý×÷Òµ³ö¿ÚºÅÅÐ¶Ï + //Ï·¢ÊäËÍ»úÇëÇó ÖÁ¼ðÑ¡¿Ú + taskNo = Convert.toInt(ssjDevice.RWH); + sendCompleted = 1; + qx = 34; + sendData = Tools.sendDataToDevice(taskNo, null, sendCompleted, qx); + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + + + Logger.info("ÏòÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢¼ðÑ¡¿Ú2ÈÎÎñ" + taskNo + "³É¹¦£¡"); + m_dao.updateSql("update MydoJob set class_now_name='" + qx + "', execution_phase=5,car_number='" + ssjDevice.ssjNo + "' where task_no='" + taskNo + "'"); + /*if (ssjDevice.RWH==taskNo){ + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + Logger.info("ÏòÊäËÍ»ú" + ssjDevice.ssjNo + "ÖØ¸´Ï·¢¼ðÑ¡¿Ú2ÈÎÎñ" + taskNo + "³É¹¦£¡"); + + }*/ + + } + + break; + case 3: + //»Ø¿â ´¦Àí³ö¿â×÷Òµ + //Ï·¢ÊäËÍ»úÇëÇó »Ø¿â + //²éѯ»ØÁ÷×÷Òµ + MydoJob job = QueryDbDataUtils.getHlMyDoJobByTaskNo(m_dao, ssjDevice.trayCode); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + taskNo = Convert.toInt(job.getTask_no()); + qx = 1; + sendCompleted = 1; + sendData = Tools.sendDataToDevice(taskNo, null, sendCompleted, qx); + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + + Logger.info("ÏòÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢»ØÁ÷ÈÎÎñ" + taskNo + "³É¹¦£¡"); + //×÷Òµ¿ªÊ¼ + m_dao.updateSql("update MydoJob set status=3, class_now_name='" + qx + "', start_time='" + format + "',execution_phase= 2,car_number='" + ssjDevice.ssjNo + "' where task_no='" + job.getTask_no() + "'"); + + } + break; + } + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/ControlThread.java b/src/com/wms/dss/ats/customs/abb/schedule/ControlThread.java new file mode 100644 index 0000000..2fcacbd --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/ControlThread.java @@ -0,0 +1,287 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; + +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Hashtable; +import java.util.List; +import java.text.*; + +/* + ����߳� + *@Version 1.0 + **/ +public class ControlThread extends CraneThread { + + String strConfigPath = ""; + Hashtable hsComParamDDJ1 = null; + Hashtable hsComParamDDJ2 = null; + Hashtable hsComParamSSJ = null; + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public ControlThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + m_dao = (EntityDAO) hsSysParam.get("dao"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + hsComParamDDJ1 = (Hashtable) m_hsSysParam.get("hsComParamDDJ1"); + hsComParamDDJ2 = (Hashtable) m_hsSysParam.get("hsComParamDDJ2"); + hsComParamSSJ = (Hashtable) m_hsSysParam.get("hsComParamSSJ"); + + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + continue; + } + } catch (Exception e) { + Logger.error(e); + } + try { + //Logger.info("-------------------�豸����߳�-------����-------------------------------------"); + DbGet.hsComParamDDJ1 = hsComParamDDJ1; + DbGet.hsComParamDDJ2 = hsComParamDDJ2; + DbGet.hsComParamSSJ = hsComParamSSJ; + + //�Ѷ����� + List ddjList = DbGet.getDDJ_Tp_Devices(); + if (CollUtil.isNotEmpty(ddjList)) { + ddj_tp_jk(m_dao, ddjList); + } + List ddjLxDevices = DbGet.getDDJ_LX_Devices(); + if (CollUtil.isNotEmpty(ddjLxDevices)){ + ddj_lx_jk(m_dao, ddjLxDevices); + } + //���ͻ���� + List roadwaySsj = DbGet.getRoadwaySsj(); + if (CollUtil.isNotEmpty(roadwaySsj)){ + roadwaySsjJk(m_dao, roadwaySsj); + } + inStockSsjJk(m_dao, DbGet.getSmSsj(),2); + inStockSsjJk(m_dao,DbGet.getJKSsj(),1); + inStockSsjJk(m_dao,DbGet.getOutExitStockSsj(),3); + + + + + } catch (Exception e) { + e.printStackTrace(); + Logger.info("----------�豸����̳߳��쳣----�쳣��Ϣ��" + e.getMessage() + "��"); + } finally { + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + //Logger.info("-------------------�豸����߳�-------����-------------------------------------"); + } + } + + private void ddj_lx_jk(EntityDAO m_dao, List ddjList) { + for (int i = 0; i < ddjList.size(); i++) { + DDJ_Device_2 ddj = ddjList.get(i); + int xtxh = 0; + if (ddj.CZFS==5){ + xtxh = ddj.XTXH; + } + int yl = 0; + int ml = 0; + if (ddj.DQL-1>=0){ + yl = ddj.DQL-1; + } + if (ddj.MBLH-1>=0){ + ml = ddj.MBLH-1; + } + //String errMsg = getZt(sbzt); + m_dao.updateSql("UPDATE MsgDdj " + + "SET " + + " rwh = "+ddj.ZXRWH_1+"," + + " jdbz = "+ddj.ZXJD+"," + + " sbzt = "+ddj.SBZT+"," + + " czfs = "+ddj.CZFS+"," + + " yxxf ="+ddj.YXXF+"," + + " yp = "+ddj.DQP+"," + + " yl = "+yl+"," + + " yc = "+ddj.DQC+"," + + " mbp = "+ddj.MBPH+"," + + " mbl = "+ml+"," + + " mbc = "+ddj.MBCH+"," + + " xtxh = "+xtxh+"," + + " rwh_2 = "+ddj.ZXRWH_2+"," + + " hczt = "+ddj.HCZT+"," + + " yxxf_2 = "+ddj.YXXF_2+"," + + " zxjd_2 = "+ddj.ZXJD_2+ + " WHERE" + + " id = "+ddj.btId); + + //�ж϶Ѷ��ִ�������Ƿ��쳣�����쳣���ұ�����¼�����޸����ñ±¨¾ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ + //���Ѷ��ִ�������������жϸ������Ƿ��б���δ��λ����������� + if (ddj.SBZT >1000){ + List list = m_dao.searchEntities("from BasFaultRecord where taskNo = " + ddj.ZXRWH_1 + " and jobId = 0"); + if (CollUtil.isEmpty(list)){ + if (ddj.ZXRWH_1!=0){ + BasFaultRecord basFaultRecord = new BasFaultRecord(); + basFaultRecord.setId(IdUtil.getSnowflakeNextIdStr()); + basFaultRecord.setDeviceId(String.valueOf(ddj.btId)); + basFaultRecord.setDeviceName(ddj.dName); + basFaultRecord.setDeviceType(String.valueOf(ddj.dtype)); + basFaultRecord.setTaskNo(String.valueOf(ddj.ZXRWH_1)); + basFaultRecord.setJobId("0"); + basFaultRecord.setFault(String.valueOf(ddj.SBZT)); + basFaultRecord.setStartTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + m_dao.save(basFaultRecord); + } + if (ddj.ZXRWH_2!=0){ + BasFaultRecord basFaultRecord = new BasFaultRecord(); + basFaultRecord.setId(IdUtil.getSnowflakeNextIdStr()); + basFaultRecord.setDeviceId(String.valueOf(ddj.btId)); + basFaultRecord.setDeviceName(ddj.dName); + basFaultRecord.setDeviceType(String.valueOf(ddj.dtype)); + basFaultRecord.setTaskNo(String.valueOf(ddj.ZXRWH_1)); + basFaultRecord.setJobId("0"); + basFaultRecord.setFault(String.valueOf(ddj.SBZT)); + basFaultRecord.setStartTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + m_dao.save(basFaultRecord); + } + + }else { + BasFaultRecord basFaultRecord = (BasFaultRecord) list.get(0); + basFaultRecord.setFinishTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + basFaultRecord.setJobId("1"); + m_dao.update(basFaultRecord); + } + } + + } + } + + private void inStockSsjJk(EntityDAO mDao, List inStockSsj,int type) { + for (SSJ_Device ssjDevice : inStockSsj) { + + int height = 0; + switch (ssjDevice.height){ + case 0: + height=800; + break; + case 1: + height=1000; + break; + case 2: + height=1300; + break; + } + if (type==1){ + mDao.updateSql( + "UPDATE MsgRkSsj SET rwh = '"+ssjDevice.RWH+"', rkqq = '"+ssjDevice.DW+"' "+", bjxx = '"+ssjDevice.exceptionId+"',tpjc='"+ssjDevice.trayCode+"' WHERE id = '"+ssjDevice.ssjNo+"'"); + }else if (type==2){ + mDao.updateSql( + "UPDATE MsgRkSsj SET rwh = '"+ssjDevice.RWH+"', height = '"+height+"', rkqq = '"+ssjDevice.RKQQ+"' "+", tpjc = '"+ssjDevice.trayCode+"', ljxh = '"+ssjDevice.LJXH+"',bjxx='"+ssjDevice.exceptionId+"' WHERE id = '"+ssjDevice.ssjNo+"'"); + }else if (type==3){ + mDao.updateSql( + "UPDATE MsgRkSsj SET rwh = '"+ssjDevice.RWH+"', ckkx = '"+ssjDevice.KX+"', rkqq = '"+ssjDevice.DW+"' "+", ljxh = '"+ssjDevice.LJXH+"' WHERE id = '"+ssjDevice.ssjNo+"'"); + + } + + + } + } + + private void roadwaySsjJk(EntityDAO mDao, List roadwaySsj) { + for (SSJ_Device ssjDevice : roadwaySsj) { + mDao.updateSql("UPDATE MsgXdkSsj " + + "SET " + + "ckkx = '"+ssjDevice.KX+"'," + + "ckdw = '"+ssjDevice.DW+"'," + + "ckrwh = '"+ssjDevice.RWH+"'," + + "rkdw = '"+ssjDevice.DW+"'," + + "location = '"+ssjDevice.trayCode+"'," + + "rkkx = '"+ssjDevice.KX +"'," + + "rkrwh = '"+ssjDevice.RWH+"' " + + "WHERE" + + " id = '"+ssjDevice.ssjNo+"'"); + } + } + + + + + + private void ddj_tp_jk(EntityDAO m_dao, List ddjList) throws Exception { + for (int i = 0; i < ddjList.size(); i++) { + DDJ_Device ddj = ddjList.get(i); + //String errMsg = getZt(sbzt); + int xtxh = 0; + if (ddj.CZFS==5){ + xtxh = ddj.XTXH; + } + + m_dao.updateSql("UPDATE MsgDdj " + + "SET " + + " rwh = "+ddj.ZXRWH+"," + + " hczt = "+ddj.HCZT+"," + + " jdbz = "+ddj.ZXJD+"," + + " sbzt = "+ddj.SBZT+"," + + " czfs = "+ddj.CZFS+"," + + " yxxf ="+ddj.YXXF+"," + + " yp = "+ddj.DQP+"," + + " yl = "+ddj.DQL+"," + + " yc = "+ddj.DQC+"," + + " mbp = "+ddj.MBPH+"," + + " mbl = "+ddj.MBLH+"," + + " mbc = "+ddj.MBCH+"," + + " xtxh = "+xtxh + + " WHERE" + + " id = "+ddj.btId); + + //�ж϶Ѷ��ִ�������Ƿ��쳣�����쳣���ұ�����¼�����޸����ñ±¨¾ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ + //���Ѷ��ִ�������������жϸ������Ƿ��б���δ��λ����������� + List list = m_dao.searchEntities("from BasFaultRecord where taskNo = " + ddj.ZXRWH + " and jobId = 0"); + if (ddj.SBZT >1000){ + if (CollUtil.isEmpty(list)){ + BasFaultRecord basFaultRecord = new BasFaultRecord(); + basFaultRecord.setId(IdUtil.getSnowflakeNextIdStr()); + basFaultRecord.setDeviceId(String.valueOf(ddj.btId)); + basFaultRecord.setDeviceName(ddj.dName); + basFaultRecord.setDeviceType(String.valueOf(ddj.dtype)); + basFaultRecord.setTaskNo(String.valueOf(ddj.ZXRWH)); + basFaultRecord.setJobId("0"); + basFaultRecord.setFault(String.valueOf(ddj.SBZT)); + basFaultRecord.setStartTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + m_dao.save(basFaultRecord); + } + }else{ + if (CollUtil.isNotEmpty(list)){ + BasFaultRecord basFaultRecord = (BasFaultRecord) list.get(0); + basFaultRecord.setFinishTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); + basFaultRecord.setJobId("1"); + m_dao.update(basFaultRecord); + } + + } + + } + } + + +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/DDJThread.java b/src/com/wms/dss/ats/customs/abb/schedule/DDJThread.java new file mode 100644 index 0000000..269fa8d --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/DDJThread.java @@ -0,0 +1,376 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientDDJ1; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientDDJ2; +import com.wms.dss.ats.customs.abb.utils.ProcedureResult; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; + +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.*; + +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.handleExceptionUrl; + +/* + *@Version 1.0 + * ¶Ñ¶â»úÏß³Ì + **/ +public class DDJThread extends CraneThread { + + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamDDJ1 = null; + Hashtable hsComParamDDJ2 = null; + Hashtable hsComParamSSJ = null; + + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public DDJThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + m_dao = (EntityDAO) hsSysParam.get("dao"); + hsComParamDDJ1 = (Hashtable) m_hsSysParam.get("hsComParamDDJ1"); + hsComParamDDJ2 = (Hashtable) m_hsSysParam.get("hsComParamDDJ2"); + hsComParamSSJ = (Hashtable) m_hsSysParam.get("hsComParamSSJ"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + return; + } + } catch (Exception e) { + Logger.error(e); + } + try { + //Logger.info("=======================¶Ñ¶â»úÏß³ÌÆô¶¯==========================="); + //»ñÈ¡DB¿éÖеÄÐÅÏ¢ + DbGet.hsComParamDDJ1 = hsComParamDDJ1; + DbGet.hsComParamDDJ2 = hsComParamDDJ2; + DbGet.hsComParamSSJ = hsComParamSSJ; + + int ddjh = 0; //¶Ñ¶â»úºÅ + try { ///¶Ñ¶â»úµ÷¶È + List ddj = DbGet.getDDJ_Tp_Devices(); + List tpOutRoadwaySsj = DbGet.getOutRoadwaySsj(); + if (!ddj.isEmpty()) { + for (DDJ_Device ddjDevice : ddj) { + //ÍÐÅ̶Ѷâ»ú + ddjh = ddjDevice.btId; + ddj_dd(ddjDevice, ddjh,tpOutRoadwaySsj); + } + } + + } catch (Exception ex) { + //conn.close(); + Logger.info("¶Ñ¶â»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ddjh + ex.getMessage()); + }///¶Ñ¶â»úµ÷¶È + } catch (Exception e) { + Logger.info("==========¶Ñ¶â»úÏß³Ì×éÒì³£,Òì³£ÐÅÏ¢¡¾" + e.getMessage() + "¡¿========"); + e.printStackTrace(); + } finally { + //Logger.info("=======================¶Ñ¶â»úÏß³Ì×éÐÝÃß==========================="); + try { + sleep(1500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + } + + + + + + + //¶Ñ¶â»úµ÷¶È + private void ddj_dd(DDJ_Device ddj_c, int ddjh,List tpOutRoadSsj) throws SQLException { + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + + /* + µÚÒ»²¿·Ö + ¶Ñ¶â»úÏ߳̽øÀ´ºóµÚÒ»¼þÊÂÏȽøÐжѶâ»úÕýÖ´ÐÐÈÎÎñµÄÕËÎñ´¦Àí + ÒÔ·À´æÔÚ©´¦Àí£¬Ã»´¦ÀíµÄÇé¿ö·¢Éú + */ + if (ddj_c.CZFS == 5 && ddj_c.SBZT==0 && ddj_c.ZXJD == 5) { /// + Long rwh = ddj_c.ZXRWH; + //¶Ñ¶â»ú·´À¡Íê³É£¬´¦ÀíÕËÎñ + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, rwh); + if(queue != null){ + ddj_finish(m_dao, Long.parseLong(queue.getRwh())); + } + } + + /* + µÚ¶þ²¿·Ö + ¸ú×Ù¶ÓÁÐÖ´Ðн׶Π+ */ + if (ddj_c.CZFS == 5 && ddj_c.SBZT==1 && (ddj_c.ZXJD == 2 || ddj_c.ZXJD == 3 || ddj_c.ZXJD == 4)) { + //¸ù¾Ý¶Ñ¶â»úÉÏÈÎÎñºÅ£¬ÐÞ¸ÄÈÎÎñÖ´Ðн׶Π+ long rwh = ddj_c.ZXRWH; + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh,null); + if (mydoJob!=null){ + m_dao.updateSql("update MydoJob set execution_phase = 6 where task_no = '" + rwh + "'"); + m_dao.updateSql("update WmsDeviceExecutionQueue set xcykh = 10 where rwh= '"+rwh+"'"); + Logger.info("ÍÐÅ̶Ѷâ»ú¸ú×ÙÈÎÎñ״̬ rwh:"+rwh+",ZXJD:"+ddj_c.ZXJD); + } + } + + /* + µÚÈý²¿·Ö + ´¦Àí·½Ê½£ºÖØÐ·ÖÅ䴢λ + */ + if (ddj_c.CZFS == 5 && ddj_c.SBZT == 1052 && ddj_c.ZXJD < 5 && ddj_c.YXXF ==1) { + //Åж϶Ѷâ»úÉÏÈÎÎñÊÇ·ñÒÑÖØ·Ö£¬ÈôÎ´ÖØ·Ö£¬Ôòµ÷Óýӿڣ¬ÇëÇóÖØ·Ö»õλ + long rwh = ddj_c.ZXRWH; + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, rwh); + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh,Arrays.asList("1","3","21")); + if (queue != null && queue.getXcykh()==10 && mydoJob != null) { + if ("0".equals(mydoJob.getFault_flag())){ + m_dao.updateSql("update MydoJob set fault_flag = 1 where job_id = '"+mydoJob.getJob_id()+"'"); + } + mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh,Arrays.asList("1","3")); + if ("1".equals(mydoJob.getFault_flag())){ + //ÐÞ¸ÄÖ´ÐжÓÁÐ + //m_dao.updateSql("update wms_Device_execution_queue set rwzt ='" + ddj_c.SBZT + "' where rwh='" + mydoJob.getTask_no() + "'"); + Map map = new HashMap<>(); + map.put("jobId",mydoJob.getClass_id()); + map.put("errorType",1052); + map.put("trayCode",mydoJob.getTray_code()); + //½âÎö·µ»Ø½á¹û + String resultStr = HttpUtil.post(handleExceptionUrl.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(resultStr); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + Logger.info("ÍÐÅ̶Ѷâ»úrwh:"+rwh+",·Å»õÓлõÉϱ¨£º" + resultStr); + m_dao.updateSql("update WmsDeviceExecutionQueue set xcykh = 1 where rwh= '"+rwh+"'"); + + } + } + } + + /* + µÚËIJ¿·Ö + Ö´Ðгö¿â×÷ҵʱȡ»õÔ´ÎÞ»õ + */ + if (ddj_c.CZFS == 5 && ddj_c.SBZT == 1053 && ddj_c.ZXJD < 5) { + long rwh = ddj_c.ZXRWH; + //ÎÞ»õÒì³£´¦Àí + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, rwh); + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh, Collections.singletonList("10")); + + if (queue != null && mydoJob != null) { + //ÐÞ¸ÄÖ´ÐжÓÁÐ + //m_dao.updateSql("update wms_Device_execution_queue set rwzt ='" + ddj_c.SBZT + "' where rwh='" + mydoJob.getTask_no() + "'"); + Map map = new HashMap<>(); + map.put("jobId",mydoJob.getClass_id()); + map.put("errorType",1053); + map.put("trayCode",mydoJob.getTray_code()); + //½âÎö·µ»Ø½á¹û + String resultStr = HttpUtil.post(handleExceptionUrl.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(resultStr); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + Logger.info("ÍÐÅ̶Ѷâ»úrwh:"+rwh+",È¡»õÎÞ»õÉϱ¨£º" + resultStr); + //Ö±½ÓÍê³É×÷Òµ + proc_wcs_ddj_info_ywh(m_dao,Convert.toLong(mydoJob.getTask_no())); + } + } + + + + + /* + µÚÁù²¿·Ö + ¸ø¶Ñ¶â»úÏ·¢ÈÎÎñ + */ + //·Å»õÄ¿±êÓлõÖØÐÂÏ·¢ + if (ddj_c.YXXF == 1 && ddj_c.CZFS == 5 && ddj_c.SBZT == 1052) { + long rwh = ddj_c.ZXRWH; + //Åж϶Ѷâ»úÉÏÈÎÎñºÅÊÇ·ñÒÑÖØ·ÖÍ꣬ÈôÖØ·ÖÍê³É£¬Ôò½«¶Ñ¶â»úÈÎÎñºÅ¶ÔÓ¦¶ÓÁÐÏ·¢ + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh,Arrays.asList("1","3","21")); + if(mydoJob!=null && "2".equals(mydoJob.getFault_flag())){ + WmsDeviceExecutionQueue queueByTask0 = QueryDbDataUtils.getQueueByTask0(m_dao, rwh); + int i = issuedDDJTask(1, queueByTask0); + if (i==1){ + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(queueByTask0.getRwh())); + //³õʼ»¯ Fault_flag 0 + m_dao.updateSql("update MydoJob set Fault_flag=0 where task_no='" + mydoJob.getTask_no() + "'"); + Logger.info("ÍÐÅ̶Ѷâ»úÖØÐÂÏ·¢ÈÎÎñ³É¹¦ rwh:"+rwh); + }else{ + Logger.error("¶Ñ¶â»úÖØÐÂÏ·¢Ê§°Ü£¡£¡£¡£¡£¡£¡£¡"); + } + } + } + //Õý³£Ï·¢ + if (ddj_c.YXXF == 1 && ddj_c.CZFS == 5 && ddj_c.SBZT == 0) { + long rwh = ddj_c.ZXRWH; + //¶Ô¶Ñ¶â»úÖ´ÐжÓÁÐÖÐÎÞÒÑÏ·¢¶ÓÁÐ + int count = QueryDbDataUtils.getWmsDeviceExecutionQueueByXF(m_dao,ddjh); + //È¡¶Ñ¶â»ú¶ÓÁÐÖУ¬Éú³Éʱ¼ä×îÔçµÄÖ´ÐжÓÁÐÏ·¢ + if(count==0){ + TaskPriority taskPriority = QueryDbDataUtils.getTaskPriority(m_dao,ddjh); + WmsDeviceExecutionQueue firstWmsDeviceExecutionQueue = null; + if (taskPriority.getPriority().equals("1")){ + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"1"); + }else if (taskPriority.getPriority().equals("2")){ + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"2"); + List allOutWmsDeviceExecutionQueueOrderbyRwlx = QueryDbDataUtils.getAllOutWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh); + if (CollUtil.isNotEmpty(allOutWmsDeviceExecutionQueueOrderbyRwlx)){ + for (WmsDeviceExecutionQueue outWmsDeviceExecutionQueueOrderbyRwlx : allOutWmsDeviceExecutionQueueOrderbyRwlx) { + int rwlx = outWmsDeviceExecutionQueueOrderbyRwlx.getRwlx(); + if (rwlx==10){ + Optional first = tpOutRoadSsj.stream().filter(x -> x.ssjNo.equals("L1001") && x.KX == 1).findFirst(); + if (first.isPresent()){ + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueByRwlx(m_dao, ddjh, 10); + break; + } + } else if (rwlx==14) { + Optional first = tpOutRoadSsj.stream().filter(x -> x.ssjNo.equals("L2001") && x.KX == 1).findFirst(); + if (first.isPresent()){ + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueByRwlx(m_dao, ddjh, 14); + break; + } + } else if (rwlx==12) { + Optional first = tpOutRoadSsj.stream().filter(x -> x.ssjNo.equals("G2050-2") && x.KX == 1).findFirst(); + if (first.isPresent()){ + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueByRwlx(m_dao, ddjh, 12); + break; + } + } else if (rwlx==13) { + Optional first = tpOutRoadSsj.stream().filter(x -> x.ssjNo.equals("G2051-2") && x.KX == 1).findFirst(); + if (first.isPresent()){ + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueByRwlx(m_dao, ddjh, 13); + break; + } + } + } + if (firstWmsDeviceExecutionQueue==null){ + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"1"); + } + }else { + firstWmsDeviceExecutionQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"1"); + } + + } + if(firstWmsDeviceExecutionQueue==null){ + //Logger.error("¶Ñ¶â»ú¶ÓÁÐÖÐÎÞÖ´ÐжÓÁУ¡£¡£¡£¡£¡£¡£¡"); + return; + } + int i = issuedDDJTask(ddjh, firstWmsDeviceExecutionQueue); + if (i==1){ + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(firstWmsDeviceExecutionQueue.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4 where task_no="+firstWmsDeviceExecutionQueue.getRwh()); + Logger.info("ÍÐÅ̶Ѷâ»úÏ·¢ÈÎÎñ³É¹¦ rwh:"+rwh); + }else{ + Logger.error("¶Ñ¶â»úÏ·¢Ê§°Ü£¡£¡£¡£¡£¡£¡£¡"); + } + } + } + + } catch (Exception e) { + Logger.error(e); + } + } + + + /** + * µ÷Óô洢¹ý³Ìproc_ddj_finish Íê³ÉddjÈÎÎñ + */ + private void ddj_finish(EntityDAO m_dao, long taskNo) { + StoredParameters ddjhParameter = new StoredParameters(1, String.valueOf(taskNo)); + StoredParameters result = new StoredParameters(2, ""); + StoredParameters result_msg = new StoredParameters(3, ""); + + try { + ProcedureResult procedureResult = Tools.storedProcedureMsg(m_dao, "{call proc_ddj_finish(?,?,?)}", + 2, 3, ddjhParameter, result, result_msg); + switch (procedureResult.getResult()) { + case 1: + Logger.info("proc_ddj_finish ÎÞ¸Ã×÷Òµ£¬Çë¼ì²é£¬ÈÎÎñºÅ£º" + taskNo); + break; + case 9: + Logger.info("proc_ddj_finish ´æ´¢¹ý³ÌÎÊÌ⣬Çë¼ì²é"); + break; + case 10: + Logger.info("proc_ddj_finish Ö´Ðгɹ¦ ÈÎÎñºÅ£º"+ taskNo); + break; + default: + throw new SQLException("proc_ddj_finish δ֪µÄ·µ»ØÖµ£¬ÈÎÎñºÅ£º" + taskNo); + } + } catch (SQLException exception) { + Logger.error("e{}",exception.getMessage()); + } + } + + + private void proc_wcs_ddj_info_ywh(EntityDAO m_dao, Long rwh) { + StoredParameters taskParameter = new StoredParameters(1, String.valueOf(rwh)); + try { + int back = Tools.storedProcedure(m_dao, "{call proc_wcs_ddj_info_ywh(?,?)}", 2, taskParameter); + switch (back) { + case 10: + Logger.info("proc_wcs_ddj_info_ywh Ö´Ðгɹ¦£¬ÈÎÎñºÅ£º" + rwh); + break; + case 1: + Logger.info("proc_wcs_ddj_info_ywh ÎÞ¸Ã×÷Òµ£¬Çë¼ì²é£¬ÈÎÎñºÅ£º" + rwh); + break; + default: + throw new SQLException("proc_wcs_ddj_info_ywh δ֪µÄ·µ»ØÖµ£¬ÈÎÎñºÅ£º" + rwh); + } + } catch (SQLException throwables) { + Logger.error(throwables); + } + } + + /** + * ¸ø¶Ñ¶â»úÏ·¢ÈÎÎñ + * @param queue ¶Ñ¶â»úÖ´ÐеĶÓÁÐ + */ + private int issuedDDJTask(int devId, WmsDeviceExecutionQueue queue) { + long taskNo =Integer.parseInt(queue.getRwh()) ; + int yph = queue.getYph(); + int ylh = queue.getYlh(); + int ych = queue.getYch(); + int mbph = queue.getMbph(); + int mblh = queue.getMblh(); + int mbch = queue.getMbch(); + int mlfs = 5; + int xfwc = 1; + int jym = Tools.getJYM((int) taskNo, yph, ylh, ych, mbph, mblh, mbch, mlfs, xfwc); + byte[] sendData = Tools.sendDataToDevice(taskNo, null, yph, ylh, ych, mbph, mblh, mbch, mlfs, xfwc,jym); + + + return IsoTcpClientDDJ1.WritetoDDJ("DB61.0", sendData); + } +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/DDJThread2.java b/src/com/wms/dss/ats/customs/abb/schedule/DDJThread2.java new file mode 100644 index 0000000..e3ebbf3 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/DDJThread2.java @@ -0,0 +1,643 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.convert.Convert; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientDDJ1; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientDDJ2; +import com.wms.dss.ats.customs.abb.utils.ProcedureResult; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; + +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.handleExceptionUrl; + +/* + *@Version 1.0 + * ¶Ñ¶â»úÏß³Ì + **/ +public class DDJThread2 extends CraneThread { + + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamDDJ1 = null; + Hashtable hsComParamDDJ2 = null; + Hashtable hsComParamSSJ = null; + int count = 0; + int count1 = 0; + + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public DDJThread2(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + m_dao = (EntityDAO) hsSysParam.get("dao"); + hsComParamDDJ1 = (Hashtable) m_hsSysParam.get("hsComParamDDJ1"); + hsComParamDDJ2 = (Hashtable) m_hsSysParam.get("hsComParamDDJ2"); + hsComParamSSJ = (Hashtable) m_hsSysParam.get("hsComParamSSJ"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + return; + } + } catch (Exception e) { + Logger.error(e); + } + try { + //Logger.info("=======================¶Ñ¶â»úÏß³ÌÆô¶¯==========================="); + //»ñÈ¡DB¿éÖеÄÐÅÏ¢ + DbGet.hsComParamDDJ1 = hsComParamDDJ1; + DbGet.hsComParamDDJ2 = hsComParamDDJ2; + DbGet.hsComParamSSJ = hsComParamSSJ; + + int ddjh = 0; //¶Ñ¶â»úºÅ + try { ///¶Ñ¶â»úµ÷¶È + + List ddjLxDevices = DbGet.getDDJ_LX_Devices(); + List doubleRoadway = DbGet.getDoubleRoadway(); + List jxSsj = DbGet.getJxSsj(); + if (!ddjLxDevices.isEmpty()) { + for (DDJ_Device_2 ddjLxDevice : ddjLxDevices) { + ddjh = ddjLxDevice.btId; + ddj_lx_dd(ddjLxDevice, ddjh,doubleRoadway,jxSsj); + } + } + } catch (Exception ex) { + //conn.close(); + Logger.info("¶Ñ¶â»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ddjh + ex.getMessage()); + }///¶Ñ¶â»úµ÷¶È + } catch (Exception e) { + Logger.info("==========¶Ñ¶â»úÏß³Ì×éÒì³£,Òì³£ÐÅÏ¢¡¾" + e.getMessage() + "¡¿========"); + e.printStackTrace(); + } finally { + //Logger.info("=======================¶Ñ¶â»úÏß³Ì×éÐÝÃß==========================="); + try { + sleep(1500); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + + } + + /** + * ÁÏÏä¶Ñ¶â»úµ÷¶È + */ + private void ddj_lx_dd(DDJ_Device_2 ddj_c, int ddjh,List doubleRoadway,List jx) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + + /* + µÚÒ»²¿·Ö + ¶Ñ¶â»úÏ߳̽øÀ´ºóµÚÒ»¼þÊÂÏȽøÐжѶâ»úÕýÖ´ÐÐÈÎÎñµÄÕËÎñ´¦Àí + ÒÔ·À´æÔÚ©´¦Àí£¬Ã»´¦ÀíµÄÇé¿ö·¢Éú + */ + if (ddj_c.CZFS == 5 && ddj_c.ZXJD == 5) { /// + long zwh1 = ddj_c.ZXRWH_1; + //¶Ñ¶â»ú·´À¡Íê³É£¬´¦ÀíÕËÎñ + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, zwh1); + if(queue != null){ + ddj_finish(m_dao, Long.parseLong(queue.getRwh())); + } + } + if (ddj_c.CZFS == 5 && ddj_c.ZXJD_2 == 5) { /// + long zwh2 = ddj_c.ZXRWH_2; + //¶Ñ¶â»ú·´À¡Íê³É£¬´¦ÀíÕËÎñ + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, zwh2); + if(queue != null){ + ddj_finish(m_dao, Long.parseLong(queue.getRwh())); + } + } + + /* + µÚ¶þ²¿·Ö + ¸ú×Ù¶ÓÁÐÖ´Ðн׶Π+ */ + if (ddj_c.CZFS == 5 && ddj_c.SBZT==1 && (ddj_c.ZXJD == 2 || ddj_c.ZXJD == 3 || ddj_c.ZXJD == 4)) { + long zwh1 = ddj_c.ZXRWH_1; + //¸ù¾Ý¶Ñ¶â»úÉÏÈÎÎñºÅ£¬ÐÞ¸ÄÈÎÎñÖ´Ðн׶Π+ MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, zwh1,null); + if (mydoJob!=null){ + m_dao.updateSql("update MydoJob set execution_phase = 6 where task_no = '"+zwh1+"'"); + m_dao.updateSql("update WmsDeviceExecutionQueue set xcykh = 10 where rwh= '"+zwh1+"'"); + } + } + if (ddj_c.CZFS == 5 && ddj_c.SBZT == 1 && (ddj_c.ZXJD_2 == 2 || ddj_c.ZXJD_2 == 3 || ddj_c.ZXJD_2 == 4)) { + long zwh2 = ddj_c.ZXRWH_2; + //¸ù¾Ý¶Ñ¶â»úÉÏÈÎÎñºÅ£¬ÐÞ¸ÄÈÎÎñÖ´Ðн׶Π+ MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, zwh2, null); + if (mydoJob != null) { + m_dao.updateSql("update MydoJob set execution_phase = 6 where task_no = '" + zwh2 + "'"); + m_dao.updateSql("update WmsDeviceExecutionQueue set xcykh = 10 where rwh= '"+zwh2+"'"); + + } + } + + /* + µÚÈý²¿·Ö + ¶Ñ¶â»ú·Å»õÄ¿±êÓлõ + ´¦Àí·½Ê½£ºÖØÐ·ÖÅ䴢λ + */ + if (ddj_c.CZFS == 5 && (ddj_c.SBZT == 1046 || ddj_c.SBZT == 1065) && ddj_c.ZXJD < 5) { + if (count<10){ + count++; + return; + } + long rwh1 =ddj_c.ZXRWH_1; + //Åж϶Ѷâ»úÉÏÈÎÎñÊÇ·ñÒÑÖØ·Ö£¬ÈôÎ´ÖØ·Ö£¬Ôòµ÷Óýӿڣ¬ÇëÇóÖØ·Ö»õλ + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, rwh1); + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh1,Arrays.asList("1","3","21")); + if (queue != null && queue.getXcykh()==10 && mydoJob != null) { + if ("0".equals(mydoJob.getFault_flag())){ + m_dao.updateSql("update MydoJob set fault_flag = 1 where job_id = '"+mydoJob.getJob_id()+"'"); + } + mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh1,Arrays.asList("1","3","21")); + if ("1".equals(mydoJob.getFault_flag())){ + + //ÐÞ¸ÄÖ´ÐжÓÁÐ + //m_dao.updateSql("update wms_Device_execution_queue set rwzt ='" + ddj_c.SBZT + "' where rwh='" + mydoJob.getTask_no() + "'"); + Map map = new HashMap<>(); + map.put("jobId",mydoJob.getClass_id()); + map.put("errorType",1052); + map.put("trayCode",mydoJob.getTray_code()); + //½âÎö·µ»Ø½á¹û + String resultStr = HttpUtil.post(handleExceptionUrl.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(resultStr); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + Logger.info("¹¤Î»1ÖØ·Ö»õλ rwh:"+rwh1); + m_dao.updateSql("update WmsDeviceExecutionQueue set xcykh = 1 where rwh= '"+rwh1+"'"); + + //Logger.info("½Ó¿Ú·µ»Ø½á¹û{}" + resultStr); + } + } + } + if (ddj_c.CZFS == 5 && (ddj_c.SBZT == 1062 || ddj_c.SBZT == 1066) && ddj_c.ZXJD_2 < 5) { + if (count1<10){ + count1++; + return; + } + long rwh2 = ddj_c.ZXRWH_2; + //Åж϶Ѷâ»úÉÏÈÎÎñÊÇ·ñÒÑÖØ·Ö£¬ÈôÎ´ÖØ·Ö£¬Ôòµ÷Óýӿڣ¬ÇëÇóÖØ·Ö»õλ + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, rwh2); + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh2,Arrays.asList("1","3","21")); + if (queue != null && queue.getXcykh()==10 && mydoJob != null) { + if ("0".equals(mydoJob.getFault_flag())){ + m_dao.updateSql("update MydoJob set fault_flag = 1 where job_id = '"+mydoJob.getJob_id()+"'"); + } + mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh2,Arrays.asList("1","3","21")); + if ("1".equals(mydoJob.getFault_flag())){ + //ÐÞ¸ÄÖ´ÐжÓÁÐ + //m_dao.updateSql("update wms_Device_execution_queue set rwzt ='" + ddj_c.SBZT + "' where rwh='" + mydoJob.getTask_no() + "'"); + Map map = new HashMap<>(); + map.put("jobId",mydoJob.getClass_id()); + map.put("errorType",1052); + map.put("trayCode",mydoJob.getTray_code()); + //½âÎö·µ»Ø½á¹û + String resultStr = HttpUtil.post(handleExceptionUrl.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(resultStr); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + Logger.info("¹¤Î»2ÖØ·Ö»õλ rwh:"+rwh2); + m_dao.updateSql("update WmsDeviceExecutionQueue set xcykh = 1 where rwh= '"+rwh2+"'"); + + Logger.info("½Ó¿Ú·µ»Ø½á¹û{}" + resultStr); + } + } + } + + /* + µÚËIJ¿·Ö + Ö´Ðгö¿â×÷ҵʱȡ»õÔ´ÎÞ»õ + */ + if (ddj_c.CZFS == 5 && ddj_c.SBZT == 1047 && ddj_c.ZXJD < 5) { + long rwh1 = ddj_c.ZXRWH_1; + //ÎÞ»õÒì³£´¦Àí + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, rwh1); + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh1, Collections.singletonList("10")); + + if (queue != null && mydoJob != null) { + //ÐÞ¸ÄÖ´ÐжÓÁÐ + //m_dao.updateSql("update wms_Device_execution_queue set rwzt ='" + ddj_c.SBZT + "' where rwh='" + mydoJob.getTask_no() + "'"); + Map map = new HashMap<>(); + map.put("jobId",mydoJob.getClass_id()); + map.put("errorType",1053); + map.put("trayCode",mydoJob.getTray_code()); + //½âÎö·µ»Ø½á¹û + String resultStr = HttpUtil.post(handleExceptionUrl.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(resultStr); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + Logger.info("½Ó¿Ú·µ»Ø½á¹û{}" + resultStr); + //Ö±½ÓÍê³É×÷Òµ + proc_wcs_ddj_info_ywh(m_dao,Convert.toLong(mydoJob.getTask_no())); + } + } + if (ddj_c.CZFS == 5 && ddj_c.SBZT == 1063 && ddj_c.ZXJD_2 < 5) { + long rwh2 = ddj_c.ZXRWH_2; + //ÎÞ»õÒì³£´¦Àí + WmsDeviceExecutionQueue queue = QueryDbDataUtils.getQueueByTask(m_dao, rwh2); + MydoJob mydoJob = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh2, Collections.singletonList("10")); + + if (queue != null && mydoJob != null) { + //ÐÞ¸ÄÖ´ÐжÓÁÐ + //m_dao.updateSql("update wms_Device_execution_queue set rwzt ='" + ddj_c.SBZT + "' where rwh='" + mydoJob.getTask_no() + "'"); + Map map = new HashMap<>(); + map.put("jobId",mydoJob.getClass_id()); + map.put("errorType",1053); + map.put("trayCode",mydoJob.getTray_code()); + //½âÎö·µ»Ø½á¹û + String resultStr = HttpUtil.post(handleExceptionUrl.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(resultStr); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + Logger.info("½Ó¿Ú·µ»Ø½á¹û{}" + resultStr); + //Ö±½ÓÍê³É×÷Òµ + proc_wcs_ddj_info_ywh(m_dao,Convert.toLong(mydoJob.getTask_no())); + } + } + + + + + /* + µÚÁù²¿·Ö + ¸ø¶Ñ¶â»úÏ·¢ÈÎÎñ + */ + //·Å»õÄ¿±êÓлõÖØÐÂÏ·¢ + if (ddj_c.YXXF == 1 && ddj_c.CZFS == 5 && (ddj_c.SBZT == 1046|| ddj_c.SBZT == 1062 || ddj_c.SBZT == 1065 || ddj_c.SBZT==1066)) { + long rwh1 = ddj_c.ZXRWH_1; + long rwh2 = ddj_c.ZXRWH_2; + Thread.sleep(100); + //´¦Àí»õ²æ1µÄÖØÐÂÏ·¢ + if (ddj_c.ZXJD == 3 && (ddj_c.SBZT == 1046|| ddj_c.SBZT == 1065)){ + MydoJob mydoJob1 = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh1,Arrays.asList("1","3","21")); + if (mydoJob1 != null && mydoJob1.getFault_flag().equals("2")) { + WmsDeviceExecutionQueue queueBegin = QueryDbDataUtils.findDeviceQueueByTaskNo(m_dao, ddjh, rwh1, 1); + WmsDeviceExecutionQueue queueSecond = QueryDbDataUtils.findDeviceQueueByTaskNo(m_dao, ddjh, rwh2, 1); + if (queueBegin !=null && queueSecond ==null){ + int i = issuedDDJTaskTwoWork(ddjh, queueBegin,queueSecond); + if (i == 1) { + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao, Long.valueOf(queueBegin.getRwh())); + Logger.info("¶Ñ¶â»úÏ·¢³É¹¦£¡£¡£¡£¡"); + count = 0; + //³õʼ»¯ Fault_flag 0 + m_dao.updateSql("update MydoJob set Fault_flag=0 where task_no='" + queueBegin.getRwh() + "'"); + } else { + Logger.error("¶Ñ¶â»úÏ·¢Ê§°Ü£¡£¡£¡£¡£¡£¡£¡"); + } + } + + if (queueSecond !=null && queueBegin!=null){ + //Á½¸öλÖö¼¿ÕÏУ¬¶¼¿ÉÒÔÏ·¢,±ØÐë¸ù¾Ý»õ²æÄ£Ê½Ï·¢ + int i = issuedDDJTaskTwoWork(ddjh, queueBegin, queueSecond); + + if (i==1){ + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(queueBegin.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4,Fault_flag=0 where task_no="+queueBegin.getRwh()); + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(queueSecond.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4 where task_no="+queueSecond.getRwh()); + Logger.info("¶Ñ¶â»úÏ·¢³É¹¦£¡£¡£¡£¡"); + count = 0; + + }else{ + Logger.error("¶Ñ¶â»úÏ·¢Ê§°Ü£¬ÖØÐÂÏ·¢£¡£¡£¡£¡£¡£¡£¡"); + } + } + } + + } + + + if (ddj_c.ZXJD_2 == 3 && (ddj_c.SBZT == 1062 || ddj_c.SBZT == 1066)){ + MydoJob mydoJob2 = QueryDbDataUtils.getSlotJobByTask(m_dao, rwh2,Arrays.asList("1","3","21")); + if (mydoJob2 != null && mydoJob2.getFault_flag().equals("2")) { + WmsDeviceExecutionQueue queueBegin = QueryDbDataUtils.findDeviceQueueByTaskNo(m_dao, ddjh, rwh1, 1); + WmsDeviceExecutionQueue queueSecond = QueryDbDataUtils.findDeviceQueueByTaskNo(m_dao, ddjh, rwh2, 1); + if (queueSecond !=null && queueBegin == null){ + int i = issuedDDJTaskTwoWork(ddjh, null, queueSecond); + if (i == 1) { + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao, Long.valueOf(queueSecond.getRwh())); + Logger.info("¶Ñ¶â»úÏ·¢³É¹¦£¡£¡£¡£¡"); + count1 = 0; + //³õʼ»¯ Fault_flag 0 + m_dao.updateSql("update MydoJob set Fault_flag=0 where task_no='" + queueSecond.getRwh() + "'"); + } else { + Logger.error("¶Ñ¶â»úÏ·¢Ê§°Ü£¡£¡£¡£¡£¡£¡£¡"); + } + } + + if (queueSecond !=null && queueBegin!=null){ + //Á½¸öλÖö¼¿ÕÏУ¬¶¼¿ÉÒÔÏ·¢,±ØÐë¸ù¾Ý»õ²æÄ£Ê½Ï·¢ + int i = issuedDDJTaskTwoWork(ddjh, queueBegin,queueSecond ); + + if (i==1){ + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(queueBegin.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4 where task_no="+queueBegin.getRwh()); + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(queueSecond.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4,Fault_flag=0 where task_no="+queueSecond.getRwh()); + Logger.info("¶Ñ¶â»úÏ·¢³É¹¦£¡£¡£¡£¡"); + count1 = 0; + }else{ + Logger.error("¶Ñ¶â»úÏ·¢Ê§°Ü£¬ÖØÐÂÏ·¢£¡£¡£¡£¡£¡£¡£¡"); + } + } + } + + } + } + + //Õý³£Ï·¢ + if (ddj_c.YXXF == 1 && ddj_c.CZFS == 5) { + int count = QueryDbDataUtils.getWmsDeviceExecutionQueueByXF(m_dao,ddjh); + + if(count==0 ){ + WmsDeviceExecutionQueue firstQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueByRwlx(m_dao, ddjh,6); + if (firstQueue !=null){ + sendRw(ddjh, doubleRoadway, firstQueue); + }else { + TaskPriority taskPriority = QueryDbDataUtils.getTaskPriority(m_dao,ddjh); + if (taskPriority.getPriority().equals("1")){ + //RK + firstQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"1"); + sendRw(ddjh, doubleRoadway, firstQueue); + }else if (taskPriority.getPriority().equals("2")){ + firstQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"2"); + if (firstQueue !=null){ + if (firstQueue.getRwlx() == 16){ + //ÓÅÏÈÒÆ¿â + sendRw(ddjh, doubleRoadway, firstQueue); + }else if (firstQueue.getRwlx()==15){ + //¶þ²ã³ö¿â + if (jx.stream().anyMatch(x->x.KX==1)){ + //CK 2015 + sendRw(ddjh, doubleRoadway, firstQueue); + }else { + firstQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueByRwlx(m_dao, ddjh,11); + if (firstQueue !=null){ + //CK 1012 + sendRw(ddjh, doubleRoadway, firstQueue); + }else { + //RK + firstQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"1"); + sendRw(ddjh, doubleRoadway, firstQueue); + } + } + }else { + //Ò»²ã³ö¿â + firstQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueByRwlx(m_dao, ddjh,11); + if (firstQueue !=null){ + //CK 1012 + sendRw(ddjh, doubleRoadway, firstQueue); + }else { + //RK + firstQueue = QueryDbDataUtils.getFirstWmsDeviceExecutionQueueOrderbyRwlx(m_dao, ddjh,"1"); + sendRw(ddjh, doubleRoadway, firstQueue); + } + } + + } + } + } + } + } + + } catch (Exception e) { + Logger.error(e); + } + } + + private void sendRw(int ddjh, List doubleRoadway, WmsDeviceExecutionQueue firstQueue) throws Exception { + if (firstQueue!=null){ + //¸ù¾ÝÈÎÎñÀàÐͲéѯÊÇ·ñ´æÔÚµÚ¶þ¶ÓÁÐ + WmsDeviceExecutionQueue secondQueue = QueryDbDataUtils.getSecondQueueByDdjhAndRwlx(m_dao, ddjh, firstQueue.getRwlx(), firstQueue.getRwh()); + + if (secondQueue != null){ + WmsDeviceExecutionQueue firstRunningQueue = null; + WmsDeviceExecutionQueue secondRunningQueue = null; + //È¡³öË«¹¤Î»ÈÎÎñºÅ£¬°´ÕÕ1-1 1-2ÅÅÐòÏ·¢ÈÎÎñ + if (firstQueue.getRwlx() ==2){ + //G1011-1-1 + Optional first = doubleRoadway.stream().filter(x -> x.ssjNo.equals("G1011-1-1")).findFirst(); + if (first.isPresent()){ + if (firstQueue.getRwh().equals(Convert.toStr(first.get().RWH))){ + firstRunningQueue = firstQueue; + secondRunningQueue = secondQueue; + }else if (secondQueue.getRwh().equals(Convert.toStr(first.get().RWH))){ + firstRunningQueue = secondQueue; + secondRunningQueue = firstQueue; + }else { + firstRunningQueue = firstQueue; + secondRunningQueue = secondQueue; + } + }else { + Logger.error("δÕÒµ½Ë«¹¤Î»ÊäËÍ»úÐÅÏ¢"); + throw new RuntimeException("δÕÒµ½Ë«¹¤Î»ÊäËÍ»úÐÅÏ¢"); + } + }else if (firstQueue.getRwlx() ==6){ + //G2016-1-1 + Optional first = doubleRoadway.stream().filter(x -> x.ssjNo.equals("G2016-1-1")).findFirst(); + if (first.isPresent()){ + if (firstQueue.getRwh().equals(Convert.toStr(first.get().RWH))){ + firstRunningQueue = firstQueue; + secondRunningQueue = secondQueue; + }else if (secondQueue.getRwh().equals(Convert.toStr(first.get().RWH))){ + firstRunningQueue = secondQueue; + secondRunningQueue = firstQueue; + }else { + firstRunningQueue = firstQueue; + secondRunningQueue = secondQueue; + } + }else { + Logger.error("δÕÒµ½Ë«¹¤Î»ÊäËÍ»úÐÅÏ¢"); + throw new RuntimeException("δÕÒµ½Ë«¹¤Î»ÊäËÍ»úÐÅÏ¢"); + } + }else { + //³ö¿âÈÎÎñÏ·¢ + firstRunningQueue = firstQueue; + secondRunningQueue = secondQueue; + } + + //Á½¸öλÖö¼¿ÕÏУ¬¶¼¿ÉÒÔÏ·¢,±ØÐë¸ù¾Ý»õ²æÄ£Ê½Ï·¢ + int i = issuedDDJTaskTwoWork(ddjh, firstRunningQueue, secondRunningQueue); + + if (i==1){ + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(firstQueue.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4 where task_no="+ firstQueue.getRwh()); + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(secondQueue.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4 where task_no="+secondQueue.getRwh()); + Logger.info("¶Ñ¶â»úÏ·¢³É¹¦£¡£¡£¡£¡"); + }else{ + Logger.error("¶Ñ¶â»úÏ·¢Ê§°Ü£¬ÖØÐÂÏ·¢£¡£¡£¡£¡£¡£¡£¡"); + } + }else { + //Ö»ÓÐÒ»¸öÈÎÎñ + int i = issuedDDJTaskTwoWork(ddjh, firstQueue,null); + + if (i==1){ + //¸üпªÊ¼Ê±¼ä£¬ÐÞ¸ÄddjxfΪÒÑÏ·¢1 + QueryDbDataUtils.updateWmsDeviceExecutionQueueTime(m_dao,Long.valueOf(firstQueue.getRwh())); + //¸ü¸ÄÖ´Ðн׶ÎΪ4 + m_dao.updateSql("update MydoJob set execution_phase= 4 where task_no="+ firstQueue.getRwh()); + Logger.info("¶Ñ¶â»úÏ·¢³É¹¦£¡£¡£¡£¡"); + }else{ + Logger.error("¶Ñ¶â»úÏ·¢Ê§°Ü£¬ÖØÐÂÏ·¢£¡£¡£¡£¡£¡£¡£¡"); + } + } + } + } + + + private int issuedDDJTaskTwoWork(int devId, WmsDeviceExecutionQueue queueFirst, WmsDeviceExecutionQueue queueSecond) { + int type = 0; + if (queueFirst != null && queueSecond ==null){ + type = 1; + queueSecond = new WmsDeviceExecutionQueue(); + queueSecond.setRwh("0"); + queueSecond.setYph(0); + queueSecond.setYlh(0); + queueSecond.setYch(0); + queueSecond.setMbch(0); + queueSecond.setMblh(0); + queueSecond.setMbch(0); + }else if (queueSecond !=null && queueFirst ==null){ + type = 2; + queueFirst = new WmsDeviceExecutionQueue(); + queueFirst.setRwh("0"); + queueFirst.setYph(0); + queueFirst.setYlh(0); + queueFirst.setYch(0); + queueFirst.setMbch(0); + queueFirst.setMblh(0); + queueFirst.setMbch(0); + }else { + type =3; + } + SendData task1Data = new SendData(Tools.DINT, queueFirst.getRwh()); + SendData yp1Data = new SendData(Tools.INT, queueFirst.getYph()); + SendData yl1Data = new SendData(Tools.INT, queueFirst.getYlh()); + SendData yc1Data = new SendData(Tools.INT, queueFirst.getYch()); + SendData mbp1Data = new SendData(Tools.INT, queueFirst.getMbph()); + SendData mbl1Data = new SendData(Tools.INT, queueFirst.getMblh()); + SendData mbc1Data = new SendData(Tools.INT, queueFirst.getMbch()); + SendData task2Data = new SendData(Tools.DINT, queueSecond.getRwh()); + SendData yp2Data = new SendData(Tools.INT, queueSecond.getYph()); + SendData yl2Data = new SendData(Tools.INT, queueSecond.getYlh()); + SendData yc2Data = new SendData(Tools.INT, queueSecond.getYch()); + SendData mbp2Data = new SendData(Tools.INT, queueSecond.getMbph()); + SendData mbl2Data = new SendData(Tools.INT, queueSecond.getMblh()); + SendData mbc2Data = new SendData(Tools.INT, queueSecond.getMbch()); + SendData hcmsData = new SendData(Tools.INT, type); + SendData mlfsData = new SendData(Tools.INT, 5); + SendData gw1 = new SendData(Tools.INT, 0); + SendData gw2 = new SendData(Tools.INT, 0); + SendData xfData = new SendData(Tools.INT, 1); + + int jym = Tools.getJYM(task1Data.getNum2(), yp1Data.getNum2(), yl1Data.getNum2(), yc1Data.getNum2(), mbp1Data.getNum2(), + mbl1Data.getNum2(), mbc1Data.getNum2(), task2Data.getNum2(), yp2Data.getNum2(), yl2Data.getNum2(), yc2Data.getNum2(), mbp2Data.getNum2(), + mbl2Data.getNum2(), mbc2Data.getNum2(), hcmsData.getNum2(), mlfsData.getNum2(),gw1.getNum2(),gw2.getNum2()); + SendData checkData = new SendData(Tools.INT, jym); + //ת»¯ÎªbyteÊý×é + byte[] sendData = Tools.sendData(task1Data, yp1Data, yl1Data, yc1Data, mbp1Data, + mbl1Data, mbc1Data, task2Data, yp2Data, yl2Data, yc2Data, mbp2Data, + mbl2Data, mbc2Data, hcmsData, mlfsData,gw1,gw2, xfData, checkData); + //·¢Ë͸øÉ豸 + return IsoTcpClientDDJ2.WritetoDDJ("DB5.0", sendData); + } + + + + /** + * µ÷Óô洢¹ý³Ìproc_ddj_finish Íê³ÉddjÈÎÎñ + */ + private void ddj_finish(EntityDAO m_dao, long taskNo) { + StoredParameters ddjhParameter = new StoredParameters(1, String.valueOf(taskNo)); + StoredParameters result = new StoredParameters(2, ""); + StoredParameters result_msg = new StoredParameters(3, ""); + + try { + ProcedureResult procedureResult = Tools.storedProcedureMsg(m_dao, "{call proc_ddj_finish(?,?,?)}", + 2, 3, ddjhParameter, result, result_msg); + switch (procedureResult.getResult()) { + case 1: + Logger.info("proc_ddj_finish ÎÞ¸Ã×÷Òµ£¬Çë¼ì²é£¬ÈÎÎñºÅ£º" + taskNo); + break; + case 9: + Logger.info("proc_ddj_finish ´æ´¢¹ý³ÌÎÊÌ⣬Çë¼ì²é"); + break; + case 10: + Logger.info("proc_ddj_finish Ö´Ðгɹ¦ ÈÎÎñºÅ£º"+ taskNo); + break; + default: + throw new SQLException("proc_ddj_finish δ֪µÄ·µ»ØÖµ£¬ÈÎÎñºÅ£º" + taskNo); + } + } catch (SQLException exception) { + Logger.error("e{}",exception.getMessage()); + } + } + + + private void proc_wcs_ddj_info_ywh(EntityDAO m_dao, Long rwh) { + StoredParameters taskParameter = new StoredParameters(1, String.valueOf(rwh)); + try { + int back = Tools.storedProcedure(m_dao, "{call proc_wcs_ddj_info_ywh(?,?)}", 2, taskParameter); + switch (back) { + case 10: + Logger.info("proc_wcs_ddj_info_ywh Ö´Ðгɹ¦£¬ÈÎÎñºÅ£º" + rwh); + break; + case 1: + Logger.info("proc_wcs_ddj_info_ywh ÎÞ¸Ã×÷Òµ£¬Çë¼ì²é£¬ÈÎÎñºÅ£º" + rwh); + break; + default: + throw new SQLException("proc_wcs_ddj_info_ywh δ֪µÄ·µ»ØÖµ£¬ÈÎÎñºÅ£º" + rwh); + } + } catch (SQLException throwables) { + Logger.error(throwables); + } + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/DbGet.java b/src/com/wms/dss/ats/customs/abb/schedule/DbGet.java new file mode 100644 index 0000000..dfe99f7 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/DbGet.java @@ -0,0 +1,286 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.common.server.form.Logger; + +import java.util.*; + +/** + * @author 13623 + */ /* + *@Version 1.0 + * Êý¾Ý»ñÈ¡ + **/ +public class DbGet { + + static Hashtable hsComParamDDJ1 = null; + static Hashtable hsComParamDDJ2 = null; + static Hashtable hsComParamSSJ = null; + + + //»ñÈ¡¶Ñ¶â»ú״̬ + public static List getDDJ_Tp_Devices() { + List ls = new ArrayList<>(); + try { + HashMap hsDDJMap1 = (HashMap) hsComParamDDJ1.get("hsDDJMap1"); + ls.add((DDJ_Device) hsDDJMap1.get("ddj-1")); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡¶Ñ¶â»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + + public static List getDDJ_LX_Devices() { + List ls = new ArrayList<>(); + try { + HashMap hsDDJMap2 = (HashMap) hsComParamDDJ2.get("hsDDJMap2"); + ls.add((DDJ_Device_2) hsDDJMap2.get("ddj-2")); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡¶Ñ¶â»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + public static List getOutExitStockSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + for (int i = 1; i <= 10; i++) { + ls.add((SSJ_Device) hsSSJMap.get("inStockSsj-"+i)); + } + for (int i = 1; i <= 2; i++) { + ls.add((SSJ_Device) hsSSJMap.get("jxSsj-" + i)); + } + + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + /** + * »ñÈ¡¶þÂ¥×ó²àÊäËÍ»úÊÇ·ñ¿ÕÏÐ + * @return + */ + public static Map> getOutZtStockSsj() { + HashMap> kxOut = new HashMap<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + List L2001 = new ArrayList<>(); + L2001.add((SSJ_Device)hsSSJMap.get("inStockSsj-"+8)); + L2001.add((SSJ_Device)hsSSJMap.get("inStockSsj-"+9)); + L2001.add((SSJ_Device)hsSSJMap.get("inStockSsj-"+10)); + kxOut.put("L2001",L2001); + List G2050 = new ArrayList<>(); + G2050.add((SSJ_Device)hsSSJMap.get("inStockSsj-"+5)); + kxOut.put("G2050",G2050); + List G2051 = new ArrayList<>(); + G2051.add((SSJ_Device)hsSSJMap.get("inStockSsj-"+6)); + kxOut.put("G2051",G2051); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return kxOut; + } + + + public static List getRoadwaySsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + for (int i = 1; i <= 14; i++) { + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+i)); + } + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + + public static List getTransferSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + for (int i = 1; i <= 1; i++) { + ls.add((SSJ_Device) hsSSJMap.get("transferSsj-"+i)); + } + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + public static List getRackXh() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + for (int i = 1; i <= 2; i++) { + ls.add((SSJ_Device) hsSSJMap.get("rack-"+i)); + } + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÁϼÜ״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + public static List getSmSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + for (int i = 1; i <= 8; i++) { + ls.add((SSJ_Device) hsSSJMap.get("smSsj-"+i)); + } + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÁϼÜ״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + public static List getCbOutSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("smSsj-"+6)); + ls.add((SSJ_Device) hsSSJMap.get("smSsj-"+7)); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÁϼÜ״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + public static List getJxSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("jxSsj-"+1)); + ls.add((SSJ_Device) hsSSJMap.get("jxSsj-"+2)); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÁϼÜ״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + public static List getDoubleRoadway() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+3)); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+11)); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+8)); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+14)); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÁϼÜ״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + /** + * ÁÏÏä×ªÒÆÊäËÍ»ú + * @return + */ + public static List getFirstBoxSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+1)); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + /** + * ÁÏÏäÇëÇóÈ¥ÏòÊäËÍ»ú + * @return + */ + public static List getRequestBoxSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+5)); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+4)); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + + public static List getJKSsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("inStockSsj-"+4)); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+1)); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+2)); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+3)); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+4)); + ls.add((SSJ_Device) hsSSJMap.get("boxSsj-"+5)); + ls.add((SSJ_Device) hsSSJMap.get("inStockSsj-"+3)); + ls.add((SSJ_Device) hsSSJMap.get("transferSsj-"+1)); + + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + public static List getOutRoadwaySsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+1)); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+5)); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+9)); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+10)); + + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } + + public static List getLxOutRoadwaySsj() { + List ls = new ArrayList<>(); + try { + HashMap hsSSJMap = (HashMap) hsComParamSSJ.get("hsSSJMap"); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+7)); + ls.add((SSJ_Device) hsSSJMap.get("roadwaySsj-"+4)); + } catch (Exception ex) { + ex.printStackTrace(); + Logger.error("»ñÈ¡ÊäËÍ»ú״̬ÐÅÏ¢Òì³£" + ex.getMessage()); + } + return ls; + } +} + + + + + + + + + + + + + + + diff --git a/src/com/wms/dss/ats/customs/abb/schedule/ExceptionUploadThread.java b/src/com/wms/dss/ats/customs/abb/schedule/ExceptionUploadThread.java new file mode 100644 index 0000000..46fec78 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/ExceptionUploadThread.java @@ -0,0 +1,264 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientSSJ; +import com.wms.dss.ats.customs.abb.utils.ProcedureResult; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; + +import java.sql.SQLException; +import java.util.*; + +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.getInStorageInformation; +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.taskExceptionUpload; + +public class ExceptionUploadThread extends CraneThread { + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamSSJ = null; + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public ExceptionUploadThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + hsComParamSSJ = (Hashtable) hsSysParam.get("hsComParamSSJ"); + m_dao = (EntityDAO) hsSysParam.get("dao"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + continue; + } + } catch (Exception e) { + Logger.error(e); + } + try { + //Logger.info("=======================ÊäËÍ»úÏß³ÌÆô¶¯==========================="); + //»ñÈ¡DB¿éÖеÄÐÅÏ¢ + DbGet.hsComParamSSJ = hsComParamSSJ; + int ssjH = 0; //¶Ñ¶â»úºÅ + + List smSsj = DbGet.getSmSsj(); + + + + if (!smSsj.isEmpty()) { + for (SSJ_Device ssj_device : smSsj) { + try { ///ÊäËÍ»úµ÷¶È + //ÊäËÍ»úÑ­»· + ssj_exception_dd(ssj_device); + } catch (Exception ex) { + //conn.close(); + Logger.info("ÊäËÍ»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ssj_device.ssjNo + ex.getMessage()); + } + } + } + } catch (Exception e) { + Logger.info("==========ÊäËÍ»úÏß³Ì×éÒì³£,Òì³£ÐÅÏ¢¡¾" + e.getMessage() + "¡¿========"); + Logger.error(e); + } finally { + //Logger.info("=======================ÊäËÍ»úÏß³Ì×éÐÝÃß==========================="); + try { + sleep(3000); + } catch (InterruptedException e) { + Logger.error(e); + } + } + } + } + + + + private void ssj_exception_dd(SSJ_Device ssjDevice) throws Exception { + + + if (ssjDevice.exceptionId != 0 && ssjDevice.CKKX ==0) { + + if (ssjDevice.ssjNo.equals("G2050")||ssjDevice.ssjNo.equals("G2051")){ + if (ssjDevice.exceptionId==7){ + return; + } + } + + //µ÷ÓÃÓÃÒì³£Éϱ¨½Ó¿Ú + //ÇëÇówms½Ó¿Ú + Map map = new HashMap<>(); + map.put("trayCode", ssjDevice.trayCode); + map.put("errorType", ssjDevice.exceptionId); + map.put("jobId", IdUtil.getSnowflakeNextIdStr()); + String post = HttpUtil.post(taskExceptionUpload.getUrl(), JSONUtil.toJsonStr(map)); + JSONObject entries = JSONUtil.parseObj(post); + if (!"0".equals(entries.get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } +// HashMap bean = JSONUtil.toBean(post, HashMap.class); + int exceptionId = ssjDevice.exceptionId; + if ((exceptionId>0&& exceptionId <=5) || exceptionId ==8){ + String trayCode = ssjDevice.trayCode; + if (StrUtil.isNotEmpty(trayCode)){ + //ÍâÐÎÒì³£1-5 ÖØÁ¿Òì³£8 + if ("L1009".equals(ssjDevice.ssjNo)) { + sleep(5000); + //Ï·¢ÐÅÏ¢ÖÁÒì³£¿Ú 1 + //ûÓÐÉú³ÉÈÎÎñµ½Òì³£¿Ú Ö¸¶¨ÈÎÎñºÅΪ500 + Map map1 = new HashMap<>(); + map1.put("trayCode", trayCode); + map1.put("exceptionId", ssjDevice.exceptionId); + map1.put("ssjNo", ssjDevice.ssjNo); + String post1 = HttpUtil.post("http://localhost:8089/external/log/exceptionInfoAdd", JSONUtil.toJsonStr(map1)); + if (!"0".equals(JSONUtil.parseObj(post1).get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + int taskNo = Convert.toInt(JSONUtil.parseObj(post1).get("data")); + //1 ΪÒì³£¿Ú + int qx = 99; + int sendCompleted = 1; + byte[] sendData = Tools.sendDataToDevice(taskNo, null, qx,sendCompleted); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢Òì³£¿ÚÈÎÎñ" + taskNo + "³É¹¦£¡"); + //m_dao.updateSql("update WcsPortState set occupationState=0,spare1=null,spare2='0' where portName='" + ssjDevice.ssjNo + "'"); + //m_dao.updateSql("update WcsPortState set spare3='"+ssjDevice.trayCode+"' where portName='L1004'"); + }else { + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷ҵʧ°Ü£¡£¡£¡"); + + } + } + if ("G2003".equals(ssjDevice.ssjNo)||"G2006".equals(ssjDevice.ssjNo)||"G2007".equals(ssjDevice.ssjNo) + ) { + sleep(5000); + String ssjNo = ssjDevice.ssjNo; + Map map1 = new HashMap<>(); + map1.put("trayCode", trayCode); + map1.put("exceptionId", ssjDevice.exceptionId); + map1.put("ssjNo", ssjNo); + String post1 = HttpUtil.post("http://localhost:8089/external/log/exceptionInfoAdd", JSONUtil.toJsonStr(map1)); + if (!"0".equals(JSONUtil.parseObj(post1).get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + int taskNo = Convert.toInt(JSONUtil.parseObj(post1).get("data")); + //Éϱ¨wms + ExceptionInfo exceptionInfo = QueryDbDataUtils.selectExceptionByPort(m_dao, ssjNo); + if (exceptionInfo != null) { + + if ("G2006".equals(ssjNo) || "G2007".equals(ssjNo)) { + MydoJob mydoJob = QueryDbDataUtils.selectJobByEntranceId(m_dao, ssjNo); + if (mydoJob != null) { + trayCode = mydoJob.getTray_code(); + } + } + + if (exceptionInfo.getSendCompleted().equals("0")) { + //Éϱ¨Òì³£ + Map mapError = new HashMap<>(); + mapError.put("trayCode", trayCode); + mapError.put("height", 3); + mapError.put("entranceId", ssjNo); + + String requestParam = JSONUtil.toJsonStr(mapError); + //ÇëÇówms½Ó¿Ú + String post2 = HttpUtil.post(getInStorageInformation.getUrl(), requestParam); + + //HashMap bean = JSONUtil.toBean(post2, HashMap.class); + + if (!"0".equals(JSONUtil.parseObj(post2).get("code").toString())){ + Logger.info("ÇëÇówms½Ó¿ÚÒì³£"); + throw new Exception("ÇëÇówms½Ó¿ÚÒì³£"); + } + QueryDbDataUtils.updateWcsPortState(m_dao, ssjNo, "1"); + m_dao.updateSql("update ExceptionInfo set sendCompleted = '1' where taskNo=" + taskNo); + + } + + + } + } + } + } + + } + + } + + + + /** + * ³ö¿â´æ´¢Á÷³Ì + * + */ + private void callCkProcess(long rwh) { + StoredParameters taskNoParameter = new StoredParameters(1, String.valueOf(rwh)); + StoredParameters result = new StoredParameters(2, ""); + StoredParameters result_msg = new StoredParameters(3, ""); + + try { + ProcedureResult procedureResult = Tools.storedProcedureMsg(m_dao, "{call proc_job_finish(?,?,?)}", + 2, 3, taskNoParameter, result, result_msg); + switch (procedureResult.getResult()) { + case 1: + Logger.info("proc_job_finish ÎÞ¸Ã×÷Òµ£¬Çë¼ì²é£¬ÈÎÎñºÅ£º" + rwh); + break; + case 9: + Logger.info("proc_job_finish ´æ´¢¹ý³ÌÎÊÌ⣬Çë¼ì²é"); + break; + case 10: + Logger.info("proc_job_finish Ö´Ðгɹ¦ ÈÎÎñºÅ£º" + rwh); + break; + default: + throw new SQLException("proc_job_finish δ֪µÄ·µ»ØÖµ£¬ÈÎÎñºÅ£º" + rwh); + } + } catch (SQLException exception) { + Logger.error("e{}", exception.getMessage()); + } + + + } + + private void ssj_hldd(SSJ_Device ssjDevice) throws Exception { + //¼ì²âµ½ µ½Î»×´Ì¬ ÇëÇówmsÉú³ÉÈë¿â×÷Òµ + if (ssjDevice.DW == 1 && ssjDevice.exceptionId == 0) { + MydoJob job = QueryDbDataUtils.getHlMyDoJobByEntranceId(m_dao, ssjDevice.ssjNo); + if (ObjUtil.isNotNull(job)) { + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú + int taskNo = Integer.parseInt(job.getTask_no()); + int qx = 12; + //int jym = Tools.getJYM(taskNo); + byte[] sendData = Tools.sendDataToDevice(taskNo, ssjDevice.trayCode, qx); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢Èë¿âÈÎÎñ" + taskNo + "³É¹¦£¡"); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "',execution_phase=2 where task_no='" + taskNo + "'"); + } + } + } + } + + +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/InOutStockSsjThread.java b/src/com/wms/dss/ats/customs/abb/schedule/InOutStockSsjThread.java new file mode 100644 index 0000000..d5c7f2a --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/InOutStockSsjThread.java @@ -0,0 +1,420 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateTime; +import cn.hutool.core.date.DateUnit; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.date.LocalDateTimeUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientSSJ; +import com.wms.dss.ats.customs.abb.utils.ProcedureResult; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; + +import java.sql.SQLException; +import java.util.*; + +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.getInStorageInformation; +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.taskExceptionUpload; + +public class InOutStockSsjThread extends CraneThread { + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamSSJ = null; + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public InOutStockSsjThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + hsComParamSSJ = (Hashtable) hsSysParam.get("hsComParamSSJ"); + m_dao = (EntityDAO) hsSysParam.get("dao"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + continue; + } + } catch (Exception e) { + Logger.error(e); + //throw new RuntimeException(e); + } + try { + //Logger.info("=======================ÊäËÍ»úÏß³ÌÆô¶¯==========================="); + //»ñÈ¡DB¿éÖеÄÐÅÏ¢ + DbGet.hsComParamSSJ = hsComParamSSJ; + int ssjH = 0; //¶Ñ¶â»úºÅ + List ckSsj = DbGet.getOutExitStockSsj(); + List smSsj = DbGet.getSmSsj(); + List cbSsj = DbGet.getCbOutSsj(); + if (!ckSsj.isEmpty()) { + for (SSJ_Device ssj_device : ckSsj) { + try { ///ÊäËÍ»úµ÷¶È + //ÊäËÍ»úÑ­»· + ssj_ck_dd(ssj_device); + } catch (Exception ex) { + //conn.close(); + Logger.info("ÊäËÍ»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ssj_device.ssjNo + ex.getMessage()); + } + } + } + + if (!cbSsj.isEmpty()) { + for (SSJ_Device ssj_device : cbSsj) { + try { ///ÊäËÍ»úµ÷¶È + //ÊäËÍ»úÑ­»· + ssj_cb_ck_dd(ssj_device); + } catch (Exception ex) { + //conn.close(); + Logger.info("ÊäËÍ»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ssj_device.ssjNo + ex.getMessage()); + } + } + } + + if (!smSsj.isEmpty()) { + for (SSJ_Device ssj_device : smSsj) { + try { ///ÊäËÍ»úµ÷¶È + //ÊäËÍ»úÑ­»· + ssj_rk_dd(ssj_device); + } catch (Exception ex) { + //conn.close(); + Logger.info("ÊäËÍ»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ssj_device.ssjNo + ex.getMessage()); + } + } + } + } catch (Exception e) { + Logger.info("==========ÊäËÍ»úÏß³Ì×éÒì³£,Òì³£ÐÅÏ¢¡¾" + e.getMessage() + "¡¿========"); + Logger.error(e); + } finally { + //Logger.info("=======================ÊäËÍ»úÏß³Ì×éÐÝÃß==========================="); + try { + sleep(1500); + } catch (InterruptedException e) { + Logger.error(e); + } + } + } + } + + private void ssj_cb_ck_dd(SSJ_Device ssjDevice) { + //¼ì²âµ½Õý³£³ö¿â³ö¿âµ½Î» + if (ssjDevice.CKDW == 1 && ssjDevice.KX ==0 && ssjDevice.RWH > 0) { + // Íê³É³ö¿â×÷Òµ ²åÈë³É¹¦»Ø´« + callCkProcess(ssjDevice.RWH); + } + } + + private void ssj_rk_dd(SSJ_Device ssjDevice) throws Exception { + //¼ì²âµ½ µ½Î»×´Ì¬ ÇëÇówmsÉú³ÉÈë¿â×÷Òµ + if (ssjDevice.RKQQ == 1 && ssjDevice.exceptionId == 0) { + + + if (StrUtil.isNotBlank(ssjDevice.trayCode)) { + + MydoJob job = QueryDbDataUtils.getRKMyDoJobByTrayCode(m_dao, ssjDevice.trayCode, Collections.singletonList("1")); + if (ObjUtil.isNull(job)) { + + //²éѯÊÇ·ñÈÎÎñÒÑÔÚÔËÐÐ + MydoJob runningJob = QueryDbDataUtils.getRKMyDoJobByTrayCode(m_dao, ssjDevice.trayCode, Collections.singletonList("3")); + if (runningJob == null) { + + Map map = new HashMap<>(); + map.put("trayCode", ssjDevice.trayCode); + map.put("height", ssjDevice.height); + map.put("entranceId", ssjDevice.ssjNo); + + String requestParam = JSONUtil.toJsonStr(map); + //ÇëÇówms½Ó¿Ú + String post = HttpUtil.post(getInStorageInformation.getUrl(), requestParam); + + HashMap bean = JSONUtil.toBean(post, HashMap.class); + if ("0".equals(Convert.toStr(bean.get("code")))) { + //¸ù¾ÝÍÐÅÌÂë»òÕßÁÏÏäÂë²éѯ¶ÔÓ¦taskNo + job = QueryDbDataUtils.getRKMyDoJobByTrayCode(m_dao, ssjDevice.trayCode, Collections.singletonList("1")); + //³É¹¦ + if (ObjUtil.isNotNull(job) && "1".equals(job.getStatus()) && "1".equals(job.getExecution_phase())) { + int qx = 1; + int sendCompleted = 1; + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú 2 + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷Òµ³É¹¦£¡£¡£¡"); + int taskNo = Integer.parseInt(job.getTask_no()); + byte[] sendData = Tools.sendDataToDevice(taskNo, null, qx, sendCompleted); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + //ÅжÏÒ»ÏÂÊÇ·ñ½ÓÊÕµ½ + Logger.info("ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢ÏïµÀ¿Ú·½ÏòÈÎÎñ" + taskNo + "³É¹¦£¡"); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "',execution_phase=2,class_now_name='" + qx + "' where task_no='" + taskNo + "'"); + if (ssjDevice.ssjNo.equals("L1009") || ssjDevice.ssjNo.equals("G1011-7") || ssjDevice.ssjNo.equals("G2003")){ + QueryDbDataUtils.updateWcsPortState(m_dao, ssjDevice.ssjNo, "1"); + } + + } else { + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "·¢ËÍÈ¥Ïòʧ°Ü£¡£¡£¡"); + + } + } + } else { + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷ҵʧ°Ü£¡£¡£¡"); + } + }else { + if (runningJob.getExecution_phase().equals("2")) { + DateTime startTime = DateUtil.parse(runningJob.getStart_time()); + DateTime currentTime = DateUtil.parse(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + if (DateUtil.between(startTime, currentTime, DateUnit.SECOND) > 20) { + int qx = 1; + int sendCompleted = 1; + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú 2 + //Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷Òµ³É¹¦£¡£¡£¡"); + int taskNo = Integer.parseInt(runningJob.getTask_no()); + byte[] sendData = Tools.sendDataToDevice(taskNo, null, qx, sendCompleted); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + //ÅжÏÒ»ÏÂÊÇ·ñ½ÓÊÕµ½ + Logger.info("ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "ÖØ¸´Ï·¢ÏïµÀ¿Ú·½ÏòÈÎÎñ" + taskNo + "³É¹¦£¡"); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "',execution_phase=2,class_now_name='" + qx + "' where task_no='" + taskNo + "'"); + + + } else { + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "·¢ËÍÈ¥Ïòʧ°Ü£¡£¡£¡"); + + } + } + } + } + } else { + if (job.getExecution_phase().equals("1")) { + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷Òµ³É¹¦£¡£¡£¡"); + int qx = 1; + int sendCompleted = 1; + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú 2 + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷Òµ³É¹¦£¡£¡£¡"); + int taskNo = Integer.parseInt(job.getTask_no()); + byte[] sendData = Tools.sendDataToDevice(taskNo, null, qx, sendCompleted); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + + Logger.info("204ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢ÏïµÀ¿Ú·½ÏòÈÎÎñ" + taskNo + "³É¹¦£¡"); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "',execution_phase=2,class_now_name='" + qx + "' where task_no='" + taskNo + "'"); + SSJ_Device currentStatus = IsoTcpClientSSJ.readSsjRwh(ssjDevice.ssjNo); + + } else { + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "·¢ËÍÈ¥Ïòʧ°Ü£¡£¡£¡"); + + } + } + + } + + + } else { + if ("G2006".equals(ssjDevice.ssjNo) || "G2007".equals(ssjDevice.ssjNo)) { + MydoJob mydoJob = QueryDbDataUtils.selectJobByEntranceId(m_dao, ssjDevice.ssjNo); + if (mydoJob != null) { + if (mydoJob.getExecution_phase().equals("1")){ + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú + int qx = 1; + int sendCompleted = 1; + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú 2 + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷Òµ³É¹¦£¡£¡£¡"); + int taskNo = Integer.parseInt(mydoJob.getTask_no()); + byte[] sendData = Tools.sendDataToDevice(taskNo, null, qx, sendCompleted); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + + Logger.info("231ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢ÏïµÀ¿Ú·½ÏòÈÎÎñ" + taskNo + "³É¹¦£¡"); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "',execution_phase=2 ,class_now_name='" + qx + "' where task_no='" + taskNo + "'"); + SSJ_Device currentStatus = IsoTcpClientSSJ.readSsjRwh(ssjDevice.ssjNo); + + } else { + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "·¢ËÍÈ¥Ïòʧ°Ü£¡£¡£¡"); + + } + } + + if (mydoJob.getExecution_phase().equals("2")){ + DateTime startTime = DateUtil.parse(mydoJob.getStart_time()); + DateTime currentTime = DateUtil.parse(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + if (DateUtil.between(startTime,currentTime, DateUnit.SECOND)>20){ + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú + int qx = 1; + int sendCompleted = 1; + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú 2 + //Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "µ÷ÓýӿÚÉú³É×÷Òµ³É¹¦£¡£¡£¡"); + int taskNo = Integer.parseInt(mydoJob.getTask_no()); + byte[] sendData = Tools.sendDataToDevice(taskNo, null, qx, sendCompleted); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + + Logger.info("231ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "ÖØ¸´Ï·¢ÏïµÀ¿Ú·½ÏòÈÎÎñ" + taskNo + "³É¹¦£¡"); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "',execution_phase=2 ,class_now_name='" + qx + "' where task_no='" + taskNo + "'"); + SSJ_Device currentStatus = IsoTcpClientSSJ.readSsjRwh(ssjDevice.ssjNo); + //if (currentStatus.RWH >60000){ + IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + Logger.info("231ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "ÖØ¸´Ï·¢ÏïµÀ¿Ú·½ÏòÈÎÎñ" + taskNo + "³É¹¦£¡"); + + //} + } else { + Logger.info("ÍÐÅÌ" + ssjDevice.trayCode + "·¢ËÍÈ¥Ïòʧ°Ü£¡£¡£¡"); + + } + } + } + + } else { + //Ï·¢ + int qx = 1; + int sendCompleted = 2; + byte[] sendData = Tools.sendDataToDevice(0, null, qx, sendCompleted); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info(ssjDevice.ssjNo + "ÎÞ»ØÁ÷ÈÎÎñ,·¢ËÍÍË»ØÈ¥Ïò³É¹¦"); + } + } + } + + } + } + } + + /** + * ÊäËÍ»úµ÷¶È + * + */ + private void ssj_ck_dd(SSJ_Device ssjDevice) throws Exception { + //¼ì²âµ½Õý³£³ö¿â³ö¿âµ½Î» + if (ssjDevice.DW == 1 && ssjDevice.KX == 0 && ssjDevice.RWH > 0) { + long rwh = ssjDevice.RWH; + if (ssjDevice.ssjNo.equals("L1004") ) { + ExceptionInfo exceptionInfo = QueryDbDataUtils.selectException(m_dao, rwh); + if (exceptionInfo == null){ + // Íê³É³ö¿â×÷Òµ ²åÈë³É¹¦»Ø´« + callCkProcess(ssjDevice.RWH); + }else { + WcsPortState portStateByName = QueryDbDataUtils.getPortStateByName(m_dao, ssjDevice.ssjNo); + if (portStateByName !=null ) { + + + if (exceptionInfo.getSendCompleted().equals("0")) { + //Éϱ¨Òì³£ + Map map = new HashMap<>(); + map.put("trayCode", exceptionInfo.getTrayCode()); + map.put("height", 3); + map.put("entranceId", "L1004"); + + String requestParam = JSONUtil.toJsonStr(map); + //ÇëÇówms½Ó¿Ú + String post = HttpUtil.post(getInStorageInformation.getUrl(), requestParam); + + HashMap bean = JSONUtil.toBean(post, HashMap.class); + if ("0".equals(Convert.toStr(bean.get("code")))) { + Logger.info(bean.get("msg").toString()); + QueryDbDataUtils.updateWcsPortState(m_dao, portStateByName.getPortName(), "1"); + m_dao.updateSql("update ExceptionInfo set sendCompleted = '1' where taskNo=" + rwh); + } + } + + + } + } + + + + + + } else { + // Íê³É³ö¿â×÷Òµ ²åÈë³É¹¦»Ø´« + callCkProcess(ssjDevice.RWH); + } + + + } + // ÐÞ¸ÄÈë¿Ú±êÖ¾ + if (ssjDevice.KX == 0){ + m_dao.updateSql("update WcsPortState set occupationState=1 where portName='" + ssjDevice.ssjNo + "'"); + } + + if (ssjDevice.KX == 1){ + m_dao.updateSql("update WcsPortState set occupationState=0,spare1=null,spare2=0,spare3=null where portName='" + ssjDevice.ssjNo + "'"); + } + } + + /** + * ³ö¿â´æ´¢Á÷³Ì + * + */ + private void callCkProcess(long rwh) { + StoredParameters taskNoParameter = new StoredParameters(1, String.valueOf(rwh)); + StoredParameters result = new StoredParameters(2, ""); + StoredParameters result_msg = new StoredParameters(3, ""); + + try { + ProcedureResult procedureResult = Tools.storedProcedureMsg(m_dao, "{call proc_job_finish(?,?,?)}", + 2, 3, taskNoParameter, result, result_msg); + switch (procedureResult.getResult()) { + case 1: + //Logger.info("proc_job_finish ÎÞ¸Ã×÷Òµ£¬Çë¼ì²é£¬ÈÎÎñºÅ£º" + rwh); + break; + case 9: + Logger.info("proc_job_finish ´æ´¢¹ý³ÌÎÊÌ⣬Çë¼ì²é"); + break; + case 10: + Logger.info("proc_job_finish Ö´Ðгɹ¦ ÈÎÎñºÅ£º" + rwh); + break; + default: + throw new SQLException("proc_job_finish δ֪µÄ·µ»ØÖµ£¬ÈÎÎñºÅ£º" + rwh); + } + } catch (SQLException exception) { + Logger.error("e{}", exception.getMessage()); + } + + + } + + private void ssj_hldd(SSJ_Device ssjDevice) throws Exception { + //¼ì²âµ½ µ½Î»×´Ì¬ ÇëÇówmsÉú³ÉÈë¿â×÷Òµ + if (ssjDevice.DW == 1 && ssjDevice.exceptionId == 0) { + MydoJob job = QueryDbDataUtils.getHlMyDoJobByEntranceId(m_dao, ssjDevice.ssjNo); + if (ObjUtil.isNotNull(job)) { + //Ï·¢ÐÅÏ¢ÖÁÏïµÀ¿Ú + int taskNo = Integer.parseInt(job.getTask_no()); + int qx = 12; + //int jym = Tools.getJYM(taskNo); + byte[] sendData = Tools.sendDataToDevice(taskNo, ssjDevice.trayCode, qx); + int isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("ÏòÈë¿âÊäËÍ»ú" + ssjDevice.ssjNo + "Ï·¢Èë¿âÈÎÎñ" + taskNo + "³É¹¦£¡"); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "',execution_phase=2 where task_no='" + taskNo + "'"); + } + } + } + } + + +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/RoadwaySsjThread.java b/src/com/wms/dss/ats/customs/abb/schedule/RoadwaySsjThread.java new file mode 100644 index 0000000..1f0afb9 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/RoadwaySsjThread.java @@ -0,0 +1,348 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; + +import java.sql.SQLException; +import java.util.*; +import java.util.stream.Collectors; + +public class RoadwaySsjThread extends CraneThread { + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamSSJ = null; + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public RoadwaySsjThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + hsComParamSSJ = (Hashtable) hsSysParam.get("hsComParamSSJ"); + m_dao = (EntityDAO) hsSysParam.get("dao"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + continue; + } + } catch (Exception e) { + Logger.error(e); + } + try { + //Logger.info("=======================ÊäËÍ»úÏß³ÌÆô¶¯==========================="); + //»ñÈ¡DB¿éÖеÄÐÅÏ¢ + DbGet.hsComParamSSJ = hsComParamSSJ; + + int ssjH = 0; //ÊäËÍ»ú + try { ///ÊäËÍ»úµ÷¶È + List ssjXdk = DbGet.getRoadwaySsj(); + Map> outStockSsj = DbGet.getOutZtStockSsj(); + if (!ssjXdk.isEmpty()) { + for (SSJ_Device ssj_device : ssjXdk) { + //ÊäËÍ»úÑ­»· + ssj_dd(ssj_device,outStockSsj); + } + } + } catch (Exception ex) { + //conn.close(); + Logger.info("ÊäËÍ»úÏß³Ì×éµ÷¶ÈÖ´ÐÐÒì³£" + ssjH + ex.getMessage()); + }///¶Ñ¶â»úµ÷¶È + } catch (Exception e) { + Logger.info("==========ÊäËÍ»úÏß³Ì×éÒì³£,Òì³£ÐÅÏ¢¡¾" + e.getMessage() + "¡¿========"); + Logger.error(e); + } finally { + //Logger.info("=======================ÊäËÍ»úÏß³Ì×éÐÝÃß==========================="); + try { + sleep(1500); + } catch (InterruptedException e) { + Logger.error(e); + } + } + } + } + + /** + * ÊäËÍ»úµ÷¶È + */ + private void ssj_dd(SSJ_Device ssjDevice,Map> outStatus) throws Exception { + //·ÖÈÎÎñÀàÐÍ + if (ssjDevice.DW == 1 && ssjDevice.RWH>0) { + //¸Ã¿ÚÊÇ·ñÓÐÕýÖ´ÐÐÈë¿âÈÎÎñ + MydoJob mydoJob = QueryDbDataUtils.getRKMydoJobByTaskNoAndEp(m_dao, String.valueOf(ssjDevice.RWH),"2"); + if (mydoJob != null) { + + //delete exception + m_dao.deleteSql("delete from ExceptionInfo where trayCode = '" + mydoJob.getTray_code() + "'"); + + + //ÈôÈë¿âÈÎÎñ´æÔÚ£¬ÅжÏÈë¿â¶ÓÁÐÊÇ·ñ´æÔÚ£¬ÎÞÈë¿â¶ÓÁУ¬ÔòÉú³ÉÈë¿â¶ÓÁÐ + MsgDdj msg = QueryDbDataUtils.getDevIdByRoadwayId(m_dao, mydoJob.getRoadway_id()); + int count; + if ("G2050-2".equals(ssjDevice.ssjNo) || "G2051-2".equals(ssjDevice.ssjNo)) { + count = QueryDbDataUtils.getWmsDeviceExecutionQueueByRwlxAndDev(m_dao, msg.getId(), getRKRwlx(ssjDevice), getCKRwlx(ssjDevice)); + } else { + count = QueryDbDataUtils.getWmsDeviceExecutionQueueByRwlxAndDev(m_dao, msg.getId(), getRKRwlx(ssjDevice)); + } + if (count == 0 /*&& ("G2016-1-1".equals(ssjDevice.ssjNo) || "G1011-1-1".equals(ssjDevice.ssjNo))*/) { + //Ð޸ĶÓÁÐ״̬ + m_dao.updateSql("update MydoJob set execution_phase=3 where task_no='" + ssjDevice.RWH + "'"); + createDDJQueue(m_dao, mydoJob.getTask_no(), msg.getId(), getRKRwlx(ssjDevice), ssjDevice.ssjNo, mydoJob.getRoadway_id()); + + } + + //ÁÏÏäË«¹¤Î»¿ÉÉú³ÉÁ½¸öÈë¿â¶ÓÁÐ + if (count > 0 && msg.getId() == 2 && ("G2016-1-1".equals(ssjDevice.ssjNo) || ("G1011-1-1".equals(ssjDevice.ssjNo)) || ("G2016-1-2".equals(ssjDevice.ssjNo)) || ("G1011-1-2".equals(ssjDevice.ssjNo)))) { + List wmsDeviceExecutionQueueInfoByRwlxAndDev = QueryDbDataUtils.getWmsDeviceExecutionQueueInfoByRwlxAndDev(m_dao, msg.getId(), getRKRwlx(ssjDevice)); + if (ssjDevice.RWH != Convert.toLong(wmsDeviceExecutionQueueInfoByRwlxAndDev.get(0).getRwh())) { + //Ð޸ĶÓÁÐ״̬ + m_dao.updateSql("update MydoJob set execution_phase=3 where task_no='" + ssjDevice.RWH + "'"); + createDDJQueue(m_dao, mydoJob.getTask_no(), msg.getId(), getRKRwlx(ssjDevice), ssjDevice.ssjNo, mydoJob.getRoadway_id()); + + } + } + } + mydoJob = QueryDbDataUtils.getRKMydoJobByTaskNoAndEp(m_dao, String.valueOf(ssjDevice.RWH),"3"); + if (mydoJob!=null){ + //pan duan shi fou sheng cheng ren wu + int count = QueryDbDataUtils.getWmsDeviceExecutionQueueByRwh(m_dao, String.valueOf(ssjDevice.RWH)); + //ÈôÈë¿âÈÎÎñ´æÔÚ£¬ÅжÏÈë¿â¶ÓÁÐÊÇ·ñ´æÔÚ£¬ÎÞÈë¿â¶ÓÁУ¬ÔòÉú³ÉÈë¿â¶ÓÁÐ + MsgDdj msg = QueryDbDataUtils.getDevIdByRoadwayId(m_dao, mydoJob.getRoadway_id()); + if (count==0){ + //m_dao.updateSql("update MydoJob set execution_phase=3 where task_no='" + ssjDevice.RWH + "'"); + createDDJQueue(m_dao, mydoJob.getTask_no(), msg.getId(), getRKRwlx(ssjDevice), ssjDevice.ssjNo, mydoJob.getRoadway_id()); + } + } + } + if (ssjDevice.KX == 1 && ssjDevice.RWH == 0) { + //ÅжϸÃÊäËÍ»úËùÊôµÄ³ö¿â¿ÚÊÇ·ñÓгö¿âÈÎÎñ + MydoJob mydoJob = null; + List outList; + List outKxList; + switch (ssjDevice.ssjNo){ + case "L1001": + mydoJob = QueryDbDataUtils.getCKMydoJobByExitId(m_dao, Collections.singletonList("L1004")); + break; + case "G1012-1-1": + case "G1012-1-2": + mydoJob = QueryDbDataUtils.getCKMydoJobByExitId(m_dao, Collections.singletonList("G1012-5")); + break; + case "G2015-1-2": + case "G2015-1-1": + List out1 = new ArrayList<>(); + List out3 = new ArrayList<>(); + //out1.add("G2049"); + out1.add("G2026"); + out3.add("G2041"); + + int ckCountMydoJobRunningG2026 = QueryDbDataUtils.getCKCountMydoJobByExitId(m_dao, out1); + int ckCountMydoJobRunningG2041 = QueryDbDataUtils.getCKCountMydoJobByExitId(m_dao, out3); + if (ckCountMydoJobRunningG2026 >= 0 && ckCountMydoJobRunningG2026<5) { + mydoJob = QueryDbDataUtils.getCKMydoJobByExitId(m_dao,out1); + } + if (mydoJob==null && ckCountMydoJobRunningG2041 >=0 && ckCountMydoJobRunningG2041<9) { + mydoJob = QueryDbDataUtils.getCKMydoJobByExitId(m_dao,out3); + } + + break; + case "G2050-2": + outList = outStatus.get("G2050"); + outKxList = outList.stream().filter(x -> x.KX == 1).collect(Collectors.toList()); + if (CollUtil.isEmpty(outKxList)){ + Logger.info("G2050 ÎÞ¿ÕÏÐλ"); + mydoJob = null; + }else { + mydoJob = QueryDbDataUtils.getCKMydoJobByExitId(m_dao, Collections.singletonList("G2050")); + } + break; + case "G2051-2": + outList = outStatus.get("G2051"); + outKxList = outList.stream().filter(x -> x.KX == 1).collect(Collectors.toList()); + if (CollUtil.isEmpty(outKxList)){ + Logger.info("G2051 ÎÞ¿ÕÏÐλ"); + mydoJob = null; + }else { + mydoJob = QueryDbDataUtils.getCKMydoJobByExitId(m_dao, Collections.singletonList("G2051")); + } + break; + case "L2001": + outList = outStatus.get("L2001"); + outKxList = outList.stream().filter(x -> x.KX == 1).collect(Collectors.toList()); + if (CollUtil.isEmpty(outKxList)){ + Logger.info("G2003,G2006,G2007 ÎÞ¿ÕÏÐλ"); + mydoJob = null; + }else { + List out2 = new ArrayList<>(); + for (SSJ_Device ssj_device : outKxList) { + if (ssj_device.KX==1){ + out2.add(ssj_device.ssjNo); + } + } + mydoJob = QueryDbDataUtils.getCKMydoJobByExitId(m_dao,out2); + } + break; + default: + mydoJob = null; + } + //Èç¹û´æÔÚÈÎÎñ£¬ÔòÏ·¢¶Ñ¶â»úÈÎÎñ + if (mydoJob != null) { + if ("1".equals(mydoJob.getExecution_phase())) { + if (ssjDevice.ssjNo.equals("L2001")){ + List out3 = new ArrayList<>(); + out3.add(mydoJob.getExit_id()); + MydoJob ckRunningMydoJobByExitId = QueryDbDataUtils.getCKRunningMydoJobByExitId(m_dao, out3); + if (ckRunningMydoJobByExitId !=null){ + Logger.error("ck "+mydoJob.getExit_id()+" exists job "+ckRunningMydoJobByExitId.getTask_no()); + return; + } + } + + + String rwh = mydoJob.getTask_no(); + String format = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + //Èô³ö¿âÈÎÎñ´æÔÚ£¬Åжϳö¿â¶ÓÁÐÊÇ·ñ´æÔÚ£¬ÎÞ³ö¿â¶ÓÁУ¬ÔòÉú³É³ö¿â¶ÓÁÐ + MsgDdj msg = QueryDbDataUtils.getDevIdByRoadwayId(m_dao, mydoJob.getRoadway_id()); + int count; + if ("G2050-2".equals(ssjDevice.ssjNo) || "G2051-2".equals(ssjDevice.ssjNo)) { + //ÅжÏÈë³ö¿ÚÊÇ·ñ´æÔÚÈë¿âÈÎÎñ»ò³ö¿âÈÎÎñ + count = QueryDbDataUtils.getWmsDeviceExecutionQueueByRwlxAndDev(m_dao, msg.getId(), getCKRwlx(ssjDevice), getRKRwlx(ssjDevice)); + } else { + //ÅжÏÊÇ·ñ´æÔÚÈÎÎñ + count = QueryDbDataUtils.getWmsDeviceExecutionQueueByRwlxAndDev(m_dao, msg.getId(), getCKRwlx(ssjDevice)); + } + if (count == 0) { + //Èç¹û²»´æÔÚ£¬Ôò´´½¨¶Ñ¶â»úÈÎÎñ + createDDJQueue(m_dao, mydoJob.getTask_no(), msg.getId(), getCKRwlx(ssjDevice), ssjDevice.ssjNo, mydoJob.getRoadway_id()); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "' where task_no='" + rwh + "'"); + } + if (count>0 && msg.getId() == 2 && ( ("G1012-1-1".equals(ssjDevice.ssjNo)) || ("G1012-1-2".equals(ssjDevice.ssjNo)))) { + //Èç¹ûÊÇÁÏÏä¶Ñ¶â»ú,Ë«¹¤Î»£¬¿ÉÉú³É¶à¸ö¶Ñ¶â»úÈÎÎñ + List wmsDeviceExecutionQueueInfoByRwlxAndDev = QueryDbDataUtils.getWmsDeviceExecutionQueueInfoByRwlxAndDev(m_dao, msg.getId(), getCKRwlx(ssjDevice)); + if (wmsDeviceExecutionQueueInfoByRwlxAndDev.size() <=5) { + Optional first = wmsDeviceExecutionQueueInfoByRwlxAndDev.stream().filter(x -> x.getRwh().equals(ssjDevice.RWH + "")).findFirst(); + if (!first.isPresent()) { + createDDJQueue(m_dao, mydoJob.getTask_no(), msg.getId(), getCKRwlx(ssjDevice), ssjDevice.ssjNo, mydoJob.getRoadway_id()); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "' where task_no='" + rwh + "'"); + } + } + } + + if (count>0 && msg.getId() == 2 && ("G2015-1-1".equals(ssjDevice.ssjNo) || ("G2015-1-2".equals(ssjDevice.ssjNo)) )) { + //Èç¹ûÊÇÁÏÏä¶Ñ¶â»ú,Ë«¹¤Î»£¬¿ÉÉú³É¶à¸ö¶Ñ¶â»úÈÎÎñ + List wmsDeviceExecutionQueueInfoByRwlxAndDev = QueryDbDataUtils.getWmsDeviceExecutionQueueInfoByRwlxAndDev(m_dao, msg.getId(), getCKRwlx(ssjDevice)); + if (wmsDeviceExecutionQueueInfoByRwlxAndDev.size() <= 14) { + Optional first = wmsDeviceExecutionQueueInfoByRwlxAndDev.stream().filter(x -> x.getRwh().equals(ssjDevice.RWH + "")).findFirst(); + if (!first.isPresent()) { + createDDJQueue(m_dao, mydoJob.getTask_no(), msg.getId(), getCKRwlx(ssjDevice), ssjDevice.ssjNo, mydoJob.getRoadway_id()); + m_dao.updateSql("update MydoJob set status=3,start_time='" + format + "' where task_no='" + rwh + "'"); + } + } + } + + } + } + } + } + + + public static int getRKRwlx(SSJ_Device ssjDevice) { + int rwlx = 0; + switch (ssjDevice.ssjNo){ + case "L1006": + rwlx =1; + break; + case "G1011-1-1": + case "G1011-1-2": + rwlx =2; + break; + case "G2050-2": + rwlx =3; + break; + case "G2051-2": + rwlx =4; + break; + case "L2014": + rwlx =5; + break; + case "G2016-1-1": + case "G2016-1-2": + rwlx =6; + break; + default: + throw new IllegalStateException("δ֪µÄÏïµÀ¿Ú"); + } + return rwlx; + } + + public static int getCKRwlx(SSJ_Device ssjDevice) { + int rwlx = 0; + switch (ssjDevice.ssjNo){ + case "L1001": + rwlx =10; + break; + case "G1012-1-1": + case "G1012-1-2": + rwlx =11; + break; + case "G2050-2": + rwlx =12; + break; + case "G2051-2": + rwlx =13; + break; + case "L2001": + rwlx =14; + break; + case "G2015-1-1": + case "G2015-1-2": + rwlx =15; + break; + default: + throw new IllegalStateException("δ֪µÄÏïµÀ¿Ú"); + } + return rwlx; + } + + private synchronized void createDDJQueue(EntityDAO m_dao,String taskNo, int devId, int rwlx,String ssjNo,String hd) { + StoredParameters taskParameter = new StoredParameters(1, taskNo); + StoredParameters devParameter = new StoredParameters(2, devId); + StoredParameters ssjNoParameter = new StoredParameters(3, ssjNo); + StoredParameters typeParameter = new StoredParameters(4, rwlx); + StoredParameters roadwayParameter = new StoredParameters(5, Integer.parseInt(hd)); + StoredParameters vResult = new StoredParameters(6, 0); + + try { + int back = Tools.storedProcedure(m_dao, "{call proc_add_zxdl(?,?,?,?,?,?)}", + 6, taskParameter, devParameter,ssjNoParameter,typeParameter, roadwayParameter,vResult); + switch (back) { + case 10: + Logger.info(" proc_add_zxdl_ddj Ö´Ðгɹ¦£¬ÈÎÎñºÅ£º" + taskNo); + break; + case 1: + Logger.info("proc_add_zxdl_ddj ÎÞ¸ÃÈÎÎñ£¬ÈÎÎñºÅ£º" + taskNo); + break; + default: + throw new SQLException("proc_add_zxdl_ddj δ֪µÄ·µ»ØÖµ£¬ÈÎÎñºÅ£º" + taskNo); + } + } catch (SQLException e) { + Logger.error(e.getMessage()); + } + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/schedule/TransferSsjThread.java b/src/com/wms/dss/ats/customs/abb/schedule/TransferSsjThread.java new file mode 100644 index 0000000..91b42d8 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/schedule/TransferSsjThread.java @@ -0,0 +1,204 @@ +package com.wms.dss.ats.customs.abb.schedule; + +import cn.hutool.core.convert.Convert; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import cn.hutool.http.HttpUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.MydoJob; +import com.wms.dss.ats.customs.abb.entity.SSJ_Device; +import com.wms.dss.ats.customs.abb.entity.StoredParameters; +import com.wms.dss.ats.customs.abb.entity.WcsPortState; +import com.wms.dss.ats.customs.abb.plc.IsoTcpClientSSJ; +import com.wms.dss.ats.customs.abb.utils.QueryDbDataUtils; +import com.wms.dss.ats.customs.abb.utils.Tools; +import com.wms.dss.common.server.config.WMSDDSConfig; +import com.wms.dss.common.server.form.Logger; +import com.wms.dss.common.server.schedule.CraneThread; +import org.hibernate.HibernateException; + +import java.sql.SQLException; +import java.util.*; + +import static com.wms.dss.ats.customs.abb.utils.RequestUrls.CLEAR_RACK; + +public class TransferSsjThread extends CraneThread { + protected byte btid = 0; + String strConfigPath = ""; + Hashtable hsComParamSSJ = null; + + + @Override + public void setStop(boolean b) { + m_bStop = b; + } + + public TransferSsjThread(Hashtable hsSysParam) { + super(hsSysParam); + m_bStop = false; + m_hsSysParam = hsSysParam; + hsComParamSSJ = (Hashtable) hsSysParam.get("hsComParamSSJ"); + m_dao = (EntityDAO) hsSysParam.get("dao"); + strConfigPath = ((WMSDDSConfig) hsSysParam.get("config")).getConfigPath(); + } + + @Override + public void run() { + while (!m_bStop) { + try { + if (QueryDbDataUtils.getEndTime(m_dao)){ + continue; + } + } catch (Exception e) { + Logger.error(e); + } + try { + //Logger.info("=========输é€�机线程å�¯åЍ========="); + //获å�–DBå�—中的信æ�¯ + DbGet.hsComParamSSJ = hsComParamSSJ; + + int ssjH = 0; //输é€�机 + try { ///输é€�机调度 + List ssjXdk = DbGet.getTransferSsj(); + if (!ssjXdk.isEmpty()) { + for (SSJ_Device ssj_device : ssjXdk) { + //输é€�机循环 + ssj_dd(ssj_device); + } + } + List rackXh = DbGet.getRackXh(); + if (!rackXh.isEmpty()) { + for (SSJ_Device ssj_device : rackXh) { + //输é€�机循环 + rack_dd(ssj_device); + } + } + } catch (Exception ex) { + //conn.close(); + Logger.info("输é€�机线程组调度执行异常" + ssjH + ex.getMessage()); + }///堆垛机调度 + } catch (Exception e) { + Logger.info("==========输é€�机线程组异常,异常信æ�¯ã€�" + e.getMessage() + "】========"); + Logger.error(e); + } finally { + //Logger.info("==========输é€�机线程组休眠============"); + try { + sleep(1500); + } catch (InterruptedException e) { + Logger.error(e); + } + } + } + } + + /** + * 料架信å�·è°ƒåº¦ + * @param ssjDevice + */ + private void rack_dd(SSJ_Device ssjDevice) { + if (ssjDevice.LJXH ==1){ + m_dao.updateSql("update WcsPortState set occupationState = 1 where portName = '"+ssjDevice.ssjNo+"'"); + try { + String portName =""; + if ("ZJ001".equals(ssjDevice.ssjNo)){ + portName = "2FTPSJ01"; + }else if ("ZJ002".equals(ssjDevice.ssjNo)){ + portName = "2FTPSJ02"; + } + WcsPortState portStateByName = QueryDbDataUtils.getPortStateByName(m_dao, ssjDevice.ssjNo); + if (portStateByName != null && portStateByName.getSpare2().equals("0")) { + Map map = new HashMap<>(); + map.put("rackPosition",portName); + //è§£æž�返回结果 + String resultStr = HttpUtil.post(CLEAR_RACK.getUrl(), JSONUtil.toJsonStr(map)); + Logger.info("接å�£è¿”回结果{}" + resultStr); + JSONObject entries = JSONUtil.parseObj(resultStr); + if (!"0".equals(entries.get("code").toString())){ + throw new Exception("请求wms接å�£ç©ºæ‰˜ç›˜åž›å¼‚常"); + } + QueryDbDataUtils.updateWcsPortState(m_dao, ssjDevice.ssjNo, "1"); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + + }else { + m_dao.updateSql("update WcsPortState set occupationState = 0,spare1=0,spare2=0,spare3=0 where portName = '"+ssjDevice.ssjNo+"'"); + } + + } + + /** + * 输é€�机调度 + * @param ssjDevice + */ + private void ssj_dd(SSJ_Device ssjDevice) throws Exception { + if (ssjDevice.DW == 1 && ssjDevice.QQ==1 && ssjDevice.RWH > 0 ) { + + MydoJob myDoJobByTaskNo = QueryDbDataUtils.getMyDoJobByTaskNo(m_dao, String.valueOf(ssjDevice.RWH)); + if (myDoJobByTaskNo != null) { + //执行出库任务 + int taskNo = Convert.toInt(myDoJobByTaskNo.getTask_no()); + int jym; + byte[] sendData; + int isSend; + int qx; + int sendCompleted; + + + switch (myDoJobByTaskNo.getExit_id()){ + case "G2003": + //执行出库任务 + //通过作业出å�£å�·åˆ¤æ–­ + //下å�‘输é€�机请求 至拣选å�£ + //taskNo = Convert.toInt(ssjDevice.RWH); + qx=30; + sendCompleted=1; + //jym = Tools.getJYM(taskNo); + sendData = Tools.sendDataToDevice(taskNo, null, sendCompleted,qx); + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("å�‘输é€�机" + ssjDevice.ssjNo + "下å�‘G2003出库任务" + taskNo + "æˆ�功ï¼�"); + } + break; + case "G2006": + //下å�‘输é€�机请求 至拣选å�£ + //taskNo = Convert.toInt(ssjDevice.RWH); + //jym = Tools.getJYM(taskNo); + sendCompleted=1; + qx=31; + sendData = Tools.sendDataToDevice(taskNo, null, sendCompleted,qx); + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("å�‘输é€�机" + ssjDevice.ssjNo + "下å�‘G2006出库任务" + taskNo + "æˆ�功ï¼�"); + } + break; + case "G2007": + //下å�‘输é€�机请求 至拣选å�£ + //taskNo = Convert.toInt(ssjDevice.RWH); + //jym = Tools.getJYM(taskNo); + sendCompleted=1; + qx=32; + sendData = Tools.sendDataToDevice(taskNo, null, sendCompleted,qx); + isSend = IsoTcpClientSSJ.WritetoSSJ(ssjDevice.writeDB, sendData); + if (isSend == 1) { + Logger.info("å�‘输é€�机" + ssjDevice.ssjNo + "下å�‘G2007出库任务" + taskNo + "æˆ�功ï¼�"); + } + break; + default: + qx = 0; + break; + } + try { + m_dao.updateSql("update MydoJob set class_now_name='"+qx+"' where task_no='" + taskNo + "'"); + } catch (HibernateException e) { + Logger.error(e); + } + } + } + } + + +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/AGV_GET.java b/src/com/wms/dss/ats/customs/abb/utils/AGV_GET.java new file mode 100644 index 0000000..c75d6ba --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/AGV_GET.java @@ -0,0 +1,218 @@ +package com.wms.dss.ats.customs.abb.utils; + +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +import java.io.*; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLEncoder; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Date; + + +public class AGV_GET { + + /** + * µ÷ÓöԷ½½Ó¿Ú·½·¨ + * @param path ¶Ô·½»òµÚÈý·½ÌṩµÄ·¾¶ + * @param data Ïò¶Ô·½»òµÚÈý·½·¢Ë͵ÄÊý¾Ý£¬´ó¶àÊýÇé¿öϸø¶Ô·½·¢ËÍJSONÊý¾ÝÈöԷ½½âÎö + * @return + */ + public static String interfaceUtil(String path,String data) { + + String str = ""; + StringBuffer sb = new StringBuffer(); + String success=""; + try { + URL url = new URL(path); + //´ò¿ªºÍurlÖ®¼äµÄÁ¬½Ó + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + PrintWriter out = null; + + /**ÉèÖÃURLConnectionµÄ²ÎÊýºÍÆÕͨµÄÇëÇóÊôÐÔ****start***/ + + conn.setRequestProperty("accept", "*/*"); + conn.setRequestProperty("connection", "Keep-Alive"); + conn.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"); + + conn.setDoOutput(true); + conn.setDoInput(true); + + conn.setRequestMethod("POST");//GETºÍPOST±ØÐëÈ«´óд + + // ÉèÖÃÎļþ³¤¶È + conn.setRequestProperty("Content-Length", String.valueOf(data.length())); + // ÉèÖÃÎļþÀàÐÍ: + conn.setRequestProperty("Content-Type", "text/xml");// ¿ªÊ¼Á¬½ÓÇëÇó + + + + conn.connect(); + + OutputStream out1 = conn.getOutputStream(); + // дÈëÇëÇóµÄ×Ö·û´® + out1.write(data.getBytes()); + out1.flush(); + out1.close(); + + //»ñÈ¡URLConnection¶ÔÏó¶ÔÓ¦µÄÊäÈëÁ÷ + InputStream is = conn.getInputStream(); + //¹¹ÔìÒ»¸ö×Ö·ûÁ÷»º´æ + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + + while ((str = br.readLine()) != null) { + str=new String(str.getBytes(),"UTF-8");//½â¾öÖÐÎÄÂÒÂëÎÊÌâ + + + sb.append(str); + //System.out.println(str); + JSONObject jsonObject = JSONObject.fromObject(str); + success=jsonObject.getString("message"); + int code=jsonObject.getInt("code"); + + + } + //¹Ø±ÕÁ÷ + is.close(); + //¶Ï¿ªÁ¬½Ó£¬×îºÃдÉÏ£¬disconnectÊÇÔڵײãtcp socketÁ´½Ó¿ÕÏÐʱ²ÅÇжϡ£Èç¹ûÕýÔÚ±»ÆäËûÏß³ÌʹÓþͲ»Çжϡ£ + //¹Ì¶¨¶àÏ̵߳ϰ£¬Èç¹û²»disconnect£¬Á´½Ó»áÔö¶à£¬Ö±µ½ÊÕ·¢²»³öÐÅÏ¢¡£Ð´ÉÏdisconnectºóÕý³£Ò»Ð©¡£ + conn.disconnect(); + System.out.println("ÍêÕû½áÊø"); + + } catch (Exception e) { + e.printStackTrace(); + } + + + return success; +// return sb.toString(); + } + + /** + * ½Ó¿Úµ÷Óà GET + */ + public static void httpURLConectionGET(String path) { + try { + URL url = new URL(path); // °Ñ×Ö·û´®×ª»»ÎªURLÇëÇóµØÖ· + HttpURLConnection connection = (HttpURLConnection) url.openConnection();// ´ò¿ªÁ¬½Ó + connection.connect();// Á¬½Ó»á»° + // »ñÈ¡ÊäÈëÁ÷ + BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream())); + String line; + StringBuilder sb = new StringBuilder(); + while ((line = br.readLine()) != null) {// Ñ­»·¶ÁÈ¡Á÷ + sb.append(line); + } + br.close();// ¹Ø±ÕÁ÷ + connection.disconnect();// ¶Ï¿ªÁ¬½Ó + //System.out.println(sb.toString()); + } catch (Exception e) { + e.printStackTrace(); + System.out.println("ʧ°Ü!"); + } + } + + /** + * ½Ó¿Úµ÷Óà POST + */ + public static void httpURLConnectionPOST (String path) { + try { + URL url = new URL(path); + + // ½«urlÒÔopen·½·¨·µ»ØµÄurlConnectionÁ¬½ÓǿתΪHttpURLConnectionÁ¬½Ó(±êʶһ¸öurlËùÒýÓõÄÔ¶³Ì¶ÔÏóÁ¬½Ó) + // ´ËʱcnnectionÖ»ÊÇΪһ¸öÁ¬½Ó¶ÔÏó,´ýÁ¬½ÓÖÐ + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + // ÉèÖÃÁ¬½ÓÊä³öÁ÷Ϊtrue,ĬÈÏfalse (post ÇëÇóÊÇÒÔÁ÷µÄ·½Ê½ÒþʽµÄ´«µÝ²ÎÊý) + connection.setDoOutput(true); + + // ÉèÖÃÁ¬½ÓÊäÈëÁ÷Ϊtrue + connection.setDoInput(true); + + // ÉèÖÃÇëÇó·½Ê½Îªpost + connection.setRequestMethod("POST"); + + // postÇëÇ󻺴æÉèΪfalse + connection.setUseCaches(false); + + // ÉèÖøÃHttpURLConnectionʵÀýÊÇ·ñ×Ô¶¯Ö´ÐÐÖØ¶¨Ïò + connection.setInstanceFollowRedirects(true); + + // ÉèÖÃÇëÇóÍ·ÀïÃæµÄ¸÷¸öÊôÐÔ (ÒÔÏÂΪÉèÖÃÄÚÈݵÄÀàÐÍ,ÉèÖÃΪ¾­¹ýurlEncoded±àÂë¹ýµÄfrom²ÎÊý) + // application/x-javascript text/xml->xmlÊý¾Ý + //¡¡application/x-javascript->json¶ÔÏó + //¡¡application/x-www-form-urlencoded->±íµ¥Êý¾Ý + connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); + + // ½¨Á¢Á¬½Ó (ÇëÇóδ¿ªÊ¼,Ö±µ½connection.getInputStream()·½·¨µ÷ÓÃʱ²Å·¢Æð,ÒÔÉϸ÷¸ö²ÎÊýÉèÖÃÐèÔÚ´Ë·½·¨Ö®Ç°½øÐÐ) + connection.connect(); + + // ´´½¨ÊäÈëÊä³öÁ÷,ÓÃÓÚÍùÁ¬½ÓÀïÃæÊä³öЯ´øµÄ²ÎÊý,(Êä³öÄÚÈÝΪ?ºóÃæµÄÄÚÈÝ) + DataOutputStream dataout = new DataOutputStream(connection.getOutputStream()); + //URLEncoder.encode()·½·¨ Ϊ×Ö·û´®½øÐбàÂë(¾ßÌå±àÂë¸ñʽÒÀ¾ÝÏîÄ¿Îĵµ¶ø¶¨) + String parm = "storeId=" + URLEncoder.encode("32", "utf-8"); + // ½«²ÎÊýÊä³öµ½Á¬½Ó + dataout.writeBytes(parm); + + // Êä³öÍê³Éºóˢв¢¹Ø±ÕÁ÷ + dataout.flush(); + dataout.close(); // ÖØÒªÇÒÒ׺öÂÔ²½Öè (¹Ø±ÕÁ÷,ÇмÇ!) + + //System.out.println(connection.getResponseCode()); + + // Á¬½Ó·¢ÆðÇëÇó,´¦Àí·þÎñÆ÷ÏìÓ¦ (´ÓÁ¬½Ó»ñÈ¡µ½ÊäÈëÁ÷²¢°üװΪbufferedReader) + BufferedReader bf = new BufferedReader(new InputStreamReader(connection.getInputStream())); + String line; + StringBuilder sb = new StringBuilder(); // ÓÃÀ´´æ´¢ÏìÓ¦Êý¾Ý + + // Ñ­»·¶ÁÈ¡Á÷,Èô²»µ½½áβ´¦ + while ((line = bf.readLine()) != null) { + sb.append(bf.readLine()); + } + bf.close(); // ÖØÒªÇÒÒ׺öÂÔ²½Öè (¹Ø±ÕÁ÷,ÇмÇ!) + connection.disconnect(); // Ïú»ÙÁ¬½Ó + //System.out.println(sb.toString()); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) { +// String url = "http://IP:PORT/rcms/services/rest/hikRpcService/genAgvSchedulingTask"; + +// String url="http://192.168.37.99:8182/rcms/services/rest/hikRpcService/genAgvSchedulingTask"; +// String url="http://www.baidu.com"; + Timestamp currentTime = new Timestamp(new Date().getTime()); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String time = formatter.format(currentTime); + JSONObject json = new JSONObject(); + + json.put("reqCode", "156896");//ÇëÇó±àÂë + json.put("reqTime", time);//ÇëÇóʱ¼ä + json.put("taskTyp", "F01");//ÈÎÎñÀàÐÍ£¬³§ÄÚ»õ¼Ü°áÔË: F01; ÏïµÀµ½¹¤×÷̨: F13; ¹¤×÷̨µ½ÏïµÀ: F14 +// json.put("wbCode", "¹¤×÷λ"); + JSONArray array = new JSONArray(); + for(int p=0 ; p < 2; p++) { + JSONObject tjson = new JSONObject(); + if(p==0) { + tjson.put("positionCode","L1005");//λÖñàºÅ, + tjson.put("type", "00");//λÖÃÀàÐÍ˵Ã÷: + array.add(tjson); + }else if(p==1) { + tjson.put("positionCode","L2003");//λÖñàºÅ, + tjson.put("type", "00");//λÖÃÀàÐÍ˵Ã÷: + array.add(tjson); + } + } + json.put("positionCodePath",array); + json.put("priority","");//ÓÅÏȼ¶£¬ +// json.put("priority", MydoJob_Rkd_Md.getPriority());//ÓÅÏȼ¶£¬ + json.put("agvCode","");//AGV ±àºÅ + json.put("taskCode", "99999");//ÈÎÎñµ¥ºÅ + json.put("data","");//ÈÎÎñÖ´Ðн׶Π+ //System.out.println(json.toString()); + String url= interfaceUtil("http://192.168.37.205:8182/rcms/services/rest/hikRpcService/genAgvSchedulingTask",json.toString());//getÇëÇó + } +} \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/utils/AllocatePropUtils.java b/src/com/wms/dss/ats/customs/abb/utils/AllocatePropUtils.java new file mode 100644 index 0000000..49b5f05 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/AllocatePropUtils.java @@ -0,0 +1,526 @@ +package com.wms.dss.ats.customs.abb.utils; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.util.Hashtable; +import com.wms.dss.ats.common.command.CarCommand; +import com.wms.dss.ats.common.command.CraneCommand; + +/** + * ÃèÊö: ÈÎÎñ»òÖ¸ÁîµÄÎļþ²Ù×÷ + * + * @author yao 2017-5-8 + * @since WMS 3.0 + */ +public class AllocatePropUtils { + /** + * ¹¦ÄÜ:»ñȡС³µÖ¸Áî + * + * @author hug 2013-5-8 + * @param strConfigPath + * @param bit + * @return + */ + public static CarCommand getLastCarCmd(String strConfigPath, byte bit, String xctype) { + FileInputStream fin = null; + ObjectInputStream in = null; + + try { + File file = new File(strConfigPath + "carcommand" + xctype + bit + ".dat"); + if (file.exists()) { + fin = new FileInputStream(file); + in = new ObjectInputStream(fin); + Object obj = in.readObject(); + if (obj != null) { + return (CarCommand) obj; + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (fin != null) { + try { + fin.close(); + } catch (Exception e) { + } + } + if (in != null) { + try { + in.close(); + } catch (Exception e) { + } + } + } + return null; + } + + /** + * ¹¦ÄÜ:±£´æÐ¡³µÖ¸Áî + * + * @author hug 2013-5-8 + * @param strConfigPath + * @param carCommand + * @param bit + */ + public static void saveCarCommand(String strConfigPath, CarCommand carCommand, byte bit, String xctype) { + FileOutputStream fos = null; + ObjectOutputStream out = null; + + try { + fos = new FileOutputStream(strConfigPath + "carcommand" + xctype + bit + ".dat"); + out = new ObjectOutputStream(fos); + out.writeObject(carCommand); + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (fos != null) { + try { + fos.close(); + } catch (Exception e) { + } + } + if (out != null) { + try { + out.close(); + } catch (Exception e) { + } + } + } + } + + /** + * ¹¦ÄÜ:±£´æ¶Ñ¶â»ú×îºóÏ·¢µÄÖ¸Áî + * + * @param strConfigPath + * @param bit + * @param craneCmd + */ + public static void saveCraneCommand(String strConfigPath, byte bit, CraneCommand craneCmd) { + FileOutputStream fos = null; + ObjectOutputStream out = null; + + try { + fos = new FileOutputStream(strConfigPath + "cranecommand" + bit + ".dat"); + out = new ObjectOutputStream(fos); + out.writeObject(craneCmd); + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (fos != null) { + try { + fos.close(); + } catch (Exception e) { + } + } + if (out != null) { + try { + out.close(); + } catch (Exception e) { + } + } + } + } + + /** + * ¹¦ÄÜ:±£´æÊäËÍÏß×îºóÏ·¢µÄÖ¸Áî + * + * @param strConfigPath + * @param bit + * @param craneCmd + */ + public static void saveSSXCommand(String strConfigPath, byte bit, Hashtable ssjcmd) { + FileOutputStream fos = null; + ObjectOutputStream out = null; + + try { + fos = new FileOutputStream(strConfigPath + "ssxcommand" + bit + ".dat"); + out = new ObjectOutputStream(fos); + out.writeObject(ssjcmd); + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (fos != null) { + try { + fos.close(); + } catch (Exception e) { + } + } + if (out != null) { + try { + out.close(); + } catch (Exception e) { + } + } + } + } + + /** + * ¹¦ÄÜ:±£´æÊäËÍÏß×îºóÏ·¢µÄÖ¸Áî + * + * @param strConfigPath + * @param bit + * @param craneCmd + */ + public static void saveSSXLCCommand(String strConfigPath, byte bit, Hashtable ssjcmd) { + FileOutputStream fos = null; + ObjectOutputStream out = null; + + try { + fos = new FileOutputStream(strConfigPath + "ssxcommandLC" + bit + ".dat"); + out = new ObjectOutputStream(fos); + out.writeObject(ssjcmd); + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (fos != null) { + try { + fos.close(); + } catch (Exception e) { + } + } + if (out != null) { + try { + out.close(); + } catch (Exception e) { + } + } + } + } + + /** + * ¹¦ÄÜ:±£´æ¸Ã¶Ñ¶â»úÈÎÎñ + * + * @param strConfigPath + * @param bit + * @param hsExecTask + */ +// public static void saveExecTask(String strConfigPath, byte bit, Hashtable hsExecTask) { +// FileOutputStream fos = null; +// ObjectOutputStream out = null; +// try { +// fos = new FileOutputStream(strConfigPath + "exectask" + bit + ".dat"); +// out = new ObjectOutputStream(fos); +// out.writeObject(hsExecTask); +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// if (fos != null) { +// try { +// fos.close(); +// } catch (Exception e) { +// } +// } +// if (out != null) { +// try { +// out.close(); +// } catch (Exception e) { +// } +// } +// } +// } + + /** + * ¹¦ÄÜ:¶ÁÈ¡¶Ñ¶â»úδÍê³ÉµÄÈÎÎñ + * + * @param strConfigPath + * @param bit + * ¶Ñ¶â»úºÅ + * @return + */ +// public static Hashtable getLastExecTask(String strConfigPath, byte bit) { +// FileInputStream fin = null; +// ObjectInputStream in = null; +// try { +// File file = new File(strConfigPath + "exectask" + bit + ".dat"); +// if (file.exists()) { +// fin = new FileInputStream(file); +// in = new ObjectInputStream(fin); +// Object obj = in.readObject(); +// if (obj != null) { +// return (Hashtable) obj; +// } +// } +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// if (fin != null) { +// try { +// fin.close(); +// } catch (Exception e) { +// } +// } +// if (in != null) { +// try { +// in.close(); +// } catch (Exception e) { +// } +// } +// } +// return null; +// } + + /** + * ¹¦ÄÜ:»ñÈ¡¶Ñ¶â»ú×îºóÖ¸Áî + * + * @param strConfigPath + * @param bit + * @return + */ +// public static CraneCommand getLastCraneCmd(String strConfigPath, byte bit) { +// FileInputStream fin = null; +// ObjectInputStream in = null; +// try { +// File file = new File(strConfigPath + "cranecommand" + bit + ".dat"); +// if (file.exists()) { +// fin = new FileInputStream(file); +// in = new ObjectInputStream(fin); +// Object obj = in.readObject(); +// if (obj != null) { +// return (CraneCommand) obj; +// } +// } +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// if (fin != null) { +// try { +// fin.close(); +// } catch (Exception e) { +// } +// } +// if (in != null) { +// try { +// in.close(); +// } catch (Exception e) { +// } +// } +// } +// return null; +// } + + /** + * ¹¦ÄÜ:³ö¿â¶ËÈë¿ÚÊäËÍ»ú×îºóÖ¸Áî + * + * @param strConfigPath + * @param bit + * @return + */ + public static Hashtable getLastCKDRKSSJcmd(String strConfigPath, byte bit) { + FileInputStream fin = null; + ObjectInputStream in = null; + + try { + File file = new File(strConfigPath + "CKDRKSSJcmd" + bit + ".dat"); + if (file.exists()) { + fin = new FileInputStream(file); + in = new ObjectInputStream(fin); + Object obj = in.readObject(); + if (obj != null) { + return (Hashtable) obj; + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (fin != null) { + try { + fin.close(); + } catch (Exception e) { + } + } + if (in != null) { + try { + in.close(); + } catch (Exception e) { + } + } + } + + return null; + } + + /** + * ¹¦ÄÜ:»ñÈ¡ÊäËÍÏß×îºóÖ¸Áî + * + * @param strConfigPath + * @param bit + * @return + */ + public static Hashtable getLastCKDRKSSJcmdLC(String strConfigPath, byte bit) { + FileInputStream fin = null; + ObjectInputStream in = null; + + try { + File file = new File(strConfigPath + "CKDRKSSJcmdLC" + bit + ".dat"); + if (file.exists()) { + fin = new FileInputStream(file); + in = new ObjectInputStream(fin); + Object obj = in.readObject(); + if (obj != null) { + return (Hashtable) obj; + } + } + } catch (Exception ex) { + ex.printStackTrace(); + } finally { + if (fin != null) { + try { + fin.close(); + } catch (Exception e) { + } + } + if (in != null) { + try { + in.close(); + } catch (Exception e) { + } + } + } + + return null; + } + + /** + * ¹¦ÄÜ:¶ÁÈ¡³öÍÐÅÌδÍê³ÉµÄÈÎÎñ + * + * @param strConfigPath + * @return + */ +// public static Hashtable getOutTrayExecTask(String strConfigPath) { +// FileInputStream fin = null; +// ObjectInputStream in = null; +// try { +// File file = new File(strConfigPath + "outtraytask.dat"); +// if (file.exists()) { +// fin = new FileInputStream(file); +// in = new ObjectInputStream(fin); +// Object obj = in.readObject(); +// if (obj != null) { +// return (Hashtable) obj; +// } +// } +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// if (fin != null) { +// try { +// fin.close(); +// } catch (Exception e) { +// } +// } +// if (in != null) { +// try { +// in.close(); +// } catch (Exception e) { +// } +// } +// } +// return null; +// } + + /** + * ¹¦ÄÜ:±£´æ³öÍÐÅÌδÍê³ÉµÄÈÎÎñ + * + * @param strConfigPath + * @param bit + * @param hsExecTask + */ +// public static void saveOutTrayExecTask(String strConfigPath, Hashtable hsExecTask) { +// FileOutputStream fos = null; +// ObjectOutputStream out = null; +// try { +// fos = new FileOutputStream(strConfigPath + "outtraytask.dat"); +// out = new ObjectOutputStream(fos); +// out.writeObject(hsExecTask); +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// if (fos != null) { +// try { +// fos.close(); +// } catch (Exception e) { +// } +// } +// if (out != null) { +// try { +// out.close(); +// } catch (Exception e) { +// } +// } +// } +// } + + /** + * ¹¦ÄÜ:¶ÁÈ¡³é¼ì³ö¿â»ò·µ°ü³ö¿âδÍê³ÉµÄÈÎÎñ + * + * @param strConfigPath + * @return + */ +// public static Hashtable getCJOutExecTask(String strConfigPath) { +// FileInputStream fin = null; +// ObjectInputStream in = null; +// try { +// File file = new File(strConfigPath + "cjouttask.dat"); +// if (file.exists()) { +// fin = new FileInputStream(file); +// in = new ObjectInputStream(fin); +// Object obj = in.readObject(); +// if (obj != null) { +// return (Hashtable) obj; +// } +// } +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// if (fin != null) { +// try { +// fin.close(); +// } catch (Exception e) { +// } +// } +// if (in != null) { +// try { +// in.close(); +// } catch (Exception e) { +// } +// } +// } +// return null; +// } + + /** + * ¹¦ÄÜ:±£´æ³é¼ì³ö¿â»ò·µ°ü³ö¿âδÍê³ÉµÄÈÎÎñ + * + * @param strConfigPath + * @param bit + * @param hsExecTask + */ +// public static void saveCJOutExecTask(String strConfigPath, Hashtable hsExecTask) { +// FileOutputStream fos = null; +// ObjectOutputStream out = null; +// try { +// fos = new FileOutputStream(strConfigPath + "cjouttask.dat"); +// out = new ObjectOutputStream(fos); +// out.writeObject(hsExecTask); +// } catch (Exception ex) { +// ex.printStackTrace(); +// } finally { +// if (fos != null) { +// try { +// fos.close(); +// } catch (Exception e) { +// } +// } +// if (out != null) { +// try { +// out.close(); +// } catch (Exception e) { +// } +// } +// } +// } + +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/HttpClientUtility.java b/src/com/wms/dss/ats/customs/abb/utils/HttpClientUtility.java new file mode 100644 index 0000000..8b50d4b --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/HttpClientUtility.java @@ -0,0 +1,196 @@ +package com.wms.dss.ats.customs.abb.utils; + +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.auth.AuthScope; +import org.apache.http.auth.UsernamePasswordCredentials; +import org.apache.http.client.CredentialsProvider; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.BasicCredentialsProvider; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +//import com.sap.me.frame.BasicBOBeanException; +//import com.sap.me.frame.Data; + +/** + * @author zhihao.sang + * @Description: restful请求工具类 + * @date 2020å¹´6月25æ—¥ 上å�ˆ11:14:31 + */ +public class HttpClientUtility { + + /** + * @Description: å�‘é€�带jsonå�‚æ•°ã€�Headerçš„post请求至ThingWorx + * @param url + * @param jsonString + * @param paramHeader + * @return + * @throws IOException + * @throws BasicBOBeanException + */ +// public static String thingWorxPost(String url, String jsonString, Map paramHeader) throws IOException, BasicBOBeanException { +// // 创建请求客户端 +// CloseableHttpClient httpClient = HttpClients.custom().build(); +// // 创建post请求 +// HttpPost httpPost = new HttpPost(url); +// // 设置headerä¿¡æ�¯ +// setHeader(httpPost, paramHeader); +// // 设置JSONæ•°æ�® +// StringEntity entityStr = new StringEntity(jsonString, ContentType.APPLICATION_JSON); +// httpPost.setEntity(entityStr); +// // 设置连接超时时间:15ç§’ +// httpPost.setConfig(RequestConfig.custom().setConnectTimeout(15000).build()); +// // 执行并获å�–返回 +// CloseableHttpResponse response = httpClient.execute(httpPost); +// HttpEntity entity = response.getEntity(); +// String resp = EntityUtils.toString(entity, StandardCharsets.UTF_8); +// EntityUtils.consume(entity); +// // 关闭连接 +// response.close(); +// if (response.getStatusLine().getStatusCode() != 200) { +// // 20226.simple = 调用Thingworx接å�£å¤±è´¥ï¼š%MESSAGE% +// throw new BasicBOBeanException(20226, new Data("MESSAGE", resp)); +// } +// return resp; +// } + + /** + * @Description: 请求头赋值 + * @param request + * @param paramHeader + */ + private static void setHeader(HttpRequestBase request, Map paramHeader) { + // 设置Header + if (paramHeader != null) { + paramHeader.forEach(request::addHeader); + } + } + + + /** + * + * @Description: 带æ�ƒé™�的请求 + * @param url + * @param jsonString + * @param paramHeader + * @param userName + * @param password + * @return + * @throws IOException + */ + public static String sendPost(String url, String jsonString, Map paramHeader, String userName, String password) throws IOException { + CredentialsProvider provider = new BasicCredentialsProvider(); + UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(userName, password); + provider.setCredentials(AuthScope.ANY, credentials); + CloseableHttpClient httpClient = HttpClients.custom().setDefaultCredentialsProvider(provider).build(); + String resp = ""; + HttpPost httpPost = new HttpPost(url); + setHeader(httpPost, paramHeader); + StringEntity entityStr = new StringEntity(jsonString, ContentType.create("text/plain", "UTF-8")); + httpPost.setEntity(entityStr); + CloseableHttpResponse response = null; + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + resp = EntityUtils.toString(entity, "UTF-8"); + EntityUtils.consume(entity); + response.close(); + if (resp == null || resp.equals("")) { + return ""; + } + return resp; + } + + /** + * + * @Description: å�‘é€�带jsonå�‚æ•°ã€�Headerçš„post请求 + * @param url + * @param jsonString + * @param paramHeader + * @return + * @throws IOException + */ + public static String sendPost(String url, String jsonString, Map paramHeader) throws IOException { + if (jsonString == null || jsonString.isEmpty()) { + return sendPost(url, paramHeader); + } + String resp = ""; + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("Authorization",paramHeader.get("Authorization")); + setHeader(httpPost, paramHeader); + StringEntity entityStr = new StringEntity(jsonString, ContentType.create("application/json", "UTF-8")); + httpPost.setEntity(entityStr); + CloseableHttpResponse response = null; + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + resp = EntityUtils.toString(entity, "UTF-8"); + EntityUtils.consume(entity); + response.close(); + if (resp == null || resp.equals("")) { + return ""; + } + return resp; + } + + /** + * + * @Description: å�‘é€�带Headerçš„HttpPost请求 + * @param url + * @param paramHeader + * @return + * @throws IOException + */ + public static String sendPost(String url, Map paramHeader) throws IOException { + // 1.获得一个httpclient对象 + CloseableHttpClient httpclient = HttpClients.createDefault(); + // 2.生æˆ�一个post请求 + HttpPost httpPost = new HttpPost(url); + // setHeader(httpPost, paramHeader); + CloseableHttpResponse response = null; + //创建å�‚数列表 + if(paramHeader!=null){ + List paramValueList = new ArrayList(); + for (String key : paramHeader.keySet()) { + Object value = paramHeader.get(key); + if(value!=null){ + paramValueList.add(new NameValuePair() { + + @Override + public String getValue() { + return value + ""; + } + + @Override + public String getName() { + return key; + } + }); + + } + } + //模拟表å�• + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramValueList, "UTF-8"); + httpPost.setEntity(entity); + } + // 3.执行post请求并返回结果 + response = httpclient.execute(httpPost); + // 4.处ç�†ç»“果,这里将结果返回为字符串 + HttpEntity entity = response.getEntity(); + String result = null; + result = EntityUtils.toString(entity); + return result; + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/HttpConnection.java b/src/com/wms/dss/ats/customs/abb/utils/HttpConnection.java new file mode 100644 index 0000000..2a60aa4 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/HttpConnection.java @@ -0,0 +1,85 @@ +package com.wms.dss.ats.customs.abb.utils; + +import com.ricosoft.common.logger.Logger; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.net.HttpURLConnection; +import java.net.URL; + +/** + * @author zn kai + * @create 2020-06-02 17:49 + */ +public class HttpConnection { + + /** + * µ÷ÓÃwms½Ó¿Ú + * + * @param uri µØÖ· + * @param data ÇëÇóÊý¾Ý + */ + public static String httpConn(String uri, String data) { + String le = null; + HttpURLConnection conn = null; + try { + URL url = new URL(uri); + conn = (HttpURLConnection) url.openConnection(); + //µ±´´½¨ÁËÒ»¸öHttpURLConnectionºó,Æäʵµ×²ã´´½¨ÁËÒ»¸ösocket¶ÔÏó + conn.setConnectTimeout(3000);//ÉèÖÃÁ¬½ÓÖ÷»ú³¬Ê±Ê±¼ä + conn.setReadTimeout(2000);//ÉèÖôÓÖ÷»ú¶ÁÈ¡Êý¾Ý³¬Ê±Ê±¼ä + conn.setRequestMethod("POST");//ÇëÇó·½Ê½ + conn.setDoOutput(true);//¶ÁÈ¡Êä³öÁ÷£¬ÔÚʹÓÃPOSTÏò·þÎñÆ÷Ìá½»Êý¾Ýʱ±ØÐëÒª½«¸Ã·½·¨ÉèÖÃΪtrue + conn.setDoInput(true);// ÉèÖÃÊÇ·ñ´ÓhttpUrlConnection¶ÁÈ룬ĬÈÏÇé¿öÏÂÊÇtrue; + conn.setUseCaches(false);//postÇëÇó²»ÄÜʹÓûº´æ + //conn.setRequestProperty("Connection", "Keep-Alive"); + //É趨´«Ë͵ÄÄÚÈÝÀàÐÍÊÇ¿ÉÐòÁл¯µÄjava¶ÔÏó + //conn.setRequestProperty("Content-type", "application/x-java-serialized-object"); + // Á¬½Ó£¬´ÓÉÏÊöurl.openConnection()ÖÁ´ËµÄÅäÖñØÐëÒªÔÚconnect֮ǰÍê³É£¬ + conn.connect(); + //дÈëÐèÒª·¢Ë͵ÄÊý¾Ý + String body = "job=job1&jobGroup=jobGroup1"; + + //par p = new par(); + //p.setJob("1"); + //p.setJobGroup("1"); + //String json = JsonUtil.getJson(p); + + //´Ë´¦getOutputStream»áÒþº¬µÄ½øÐÐconnect(¼´£ºÈçͬµ÷ÓÃÉÏÃæµÄconnect()·½·¨, ËùÒÔ²»µ÷ÓÃÉÏÊöµÄconnect()Ò²¿ÉÒÔ + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(conn.getOutputStream(), "UTF-8")); + writer.write(data); + writer.close();//closeÖ´Ðлáflush + //·þÎñÆ÷·µ»ØµÄ״̬Âë + int responseCode = conn.getResponseCode(); + + //¶ÁÈ¡·þÎñÆ÷·µ»ØµÄÊý¾Ý + BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8")); + StringBuilder response = new StringBuilder(); + String line; + while ((line = reader.readLine()) != null) { + response.append(line); + } + //¶ÁÈ¡ÍêÏìÓ¦Êý¾ÝÖ®ºó,µ÷ÓÃclose·½·¨¹Ø±ÕÊäÈëÁ÷, + // JDK httpЭÒé´¦ÀíÆ÷»á½«Õâ¸öÁ¬½Ó·Åµ½Ò»¸öÁ¬½Ó»º´æÖУ¬ÒÔ±ãÖ®ºóµÄHTTPÇëÇó½øÐи´Óà + reader.close(); + //System.err.println("statusCode:"+responseCode+"------status:"+response.toString()); + le = response.toString(); + } catch (Exception e) { + Logger.info("wms½Ó¿ÚÁ¬½Óʧ°Ü::" + e.getMessage()); + try { + Thread.sleep(500); + } catch (InterruptedException e1) { + + } + } finally { + if (conn != null) { + //¹Ø±Õ Http Á¬½Ó,ÊÍ·Å×ÊÔ´ + conn.disconnect(); //±íʾ¹Ø±Õµ×²ãsocketÁ¬½Ó£¬²»»áÆôÓÃkeepAlive + } + } + return le; + } + +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/ParseUtil.java b/src/com/wms/dss/ats/customs/abb/utils/ParseUtil.java new file mode 100644 index 0000000..55b0740 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/ParseUtil.java @@ -0,0 +1,600 @@ +package com.wms.dss.ats.customs.abb.utils; + +import HslCommunication.BasicFramework.SoftBasic; +import com.alibaba.fastjson.JSON; +import org.apache.commons.codec.binary.Base64; +import org.libnodave.Nodave; + +import java.math.BigInteger; +import java.util.List; +import java.util.UUID; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author zn kai + * @create 2021-06-28 14:04 + */ +public class ParseUtil { + + + /** + * Õ¾µãÅÅÐò + * + * @param offset + * @param valueSize + * @return + */ + public static int[] getWriteValueSite(int offset, int valueSize) { + int[] stieArray = new int[valueSize]; + stieArray[0] = offset; + for (int i = 1; i < valueSize; i++) { + stieArray[i] = offset += 1; + } + return stieArray; + } + + /** + * Ï·¢ Êý×é´¦Àí DWORD + * + * @param values + * @param type ÀàÐÍ + * @return + */ + public static String[] getWriteValueDWORD(String[] values) { + String[] data = new String[values.length * 2]; + int index = 0; + for (int i = 0; i < values.length; i++) { + data[index] = String.valueOf(Integer.parseInt(values[i]) % 65536); + data[index + 1] = String.valueOf(Integer.parseInt(values[i]) / 65536); + index += 2; + } + return data; + } + + /** + * »ñȡȡµÃµ½µÄÖµ DWORD + * + * @param start + * @param end + * @param site 0 ²»ÐèҪƴ½Ó ²¹Áã 6λ + * @return + */ + + public static Object getReadValue(byte[] start, byte[] end, int site) { + int wordStart = getWORD(start, 0); + int wordEnd = getWORD(end, 0); + int value = wordStart == 0 || (wordStart != 0 && wordEnd != 0) ? wordStart + wordEnd * 65536 : wordStart; + if (site == 0) { + return value; + } + return String.format("%06d", value); + } + + + public static String byte2Base64StringFun(byte[] b) { + return Base64.encodeBase64String(b); + } + + public static String getSTRING30(byte[] bt, int pos) { + return Nodave.SBEString30(bt, pos).toString(); + } + + public static float getFloat(byte[] bt, int pos) { + return Nodave.BEFloat(bt, pos); + } + + public static long getDWORD(byte[] bt, int pos) { + return Nodave.USBELong(bt, pos); + } + + public static long getDINT(byte[] bt, int pos) { + return Nodave.SBELong(bt, pos); + } + + public static String getSTRING(byte[] bt, int pos) { + return Nodave.SBEString(bt, pos).toString(); + } + + public static int getWORD(byte[] bt, int pos) { + return Nodave.USBEWord(bt, pos); + } + + public static int getINT(byte[] bt, int pos) { + return Nodave.SBEWord(bt, pos); + } + + public static int getBYTE(byte[] bt, int pos) { + return Nodave.SByte(bt, pos); + } + + public static int getCHAR(byte[] bt, int pos) { + return Nodave.SByte(bt, pos); + } + + public static long getUS32(byte[] bt, int pos) { + return Nodave.USBELong(bt, pos); + } + + public static long getS32(byte[] bt, int pos) { + return Nodave.SBELong(bt, pos); + } + + public static int getUS16(byte[] bt, int pos) { + return Nodave.USBEWord(bt, pos); + } + + public static int getS16(byte[] bt, int pos) { + return Nodave.SBEWord(bt, pos); + } + + public static int getUS8(byte[] bt, int pos) { + return Nodave.USByte(bt, pos); + } + + public static int getS8(byte[] bt, int pos) { + return Nodave.SByte(bt, pos); + } + + public static byte[] byteConcatArray(String[] arr) { + int length = 0; + for (String a : arr) { + byte[] x = Nodave.bswap_16(Integer.parseInt(a)); + length += x.length; + } + byte[] bt6 = new byte[length]; + + int len = 0; + for (String a : arr) { + byte[] b = Nodave.bswap_16(Integer.parseInt(a)); + System.arraycopy(b, 0, bt6, len, b.length); + if (len < bt6.length) { + len += b.length; + } + } + return bt6; + } + + /** + * ½«¶þ½øÖÆ×ª»»³É16½øÖÆ + * + * @param buf + * @return + */ + public static String parseByte2HexStr(byte buf[]) { + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < buf.length; i++) { + String hex = Integer.toHexString(buf[i] & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + sb.append(hex.toUpperCase()); + } + return sb.toString(); + } + + /** + * ½«16½øÖÆ×ª»»Îª¶þ½øÖÆ + * + * @param hexStr + * @return + */ + public static byte[] parseHexStr2Byte(String hexStr) { + if (hexStr.length() < 1) { + return null; + } + byte[] result = new byte[hexStr.length() / 2]; + for (int i = 0; i < hexStr.length() / 2; i++) { + int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16); + int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), + 16); + result[i] = (byte) (high * 16 + low); + } + return result; + } + + + /** + * ·¢ËÍ16½øÖÆ×Ö·û´® + * + * @param hexString + * @return + */ + public static byte[] hexStringToBytes(String hexString) { + if (hexString == null || hexString.equals("")) { + return null; + } + // toUpperCase½«×Ö·û´®ÖеÄËùÓÐ×Ö·ûת»»Îª´óд + hexString = hexString.toUpperCase(); + int length = hexString.length() / 2; + // toCharArray½«´Ë×Ö·û´®×ª»»ÎªÒ»¸öеÄ×Ö·ûÊý×é¡£ + char[] hexChars = hexString.toCharArray(); + byte[] d = new byte[length]; + for (int i = 0; i < length; i++) { + int pos = i * 2; + d[i] = (byte) (charToByte(hexChars[pos]) << 4 | charToByte(hexChars[pos + 1])); + } + return d; + } + + //charToByte·µ»ØÔÚÖ¸¶¨×Ö·ûµÄµÚÒ»¸ö·¢ÉúµÄ×Ö·û´®ÖеÄË÷Òý£¬¼´·µ»ØÆ¥Åä×Ö·û + private static byte charToByte(char c) { + return (byte) "0123456789ABCDEF".indexOf(c); + } + + /** + * ½«×Ö½ÚÊý×éת»»Îª16½øÖÆ×Ö·û´® + * + * @param bytes + * @param len + * @return + */ + public static String binaryToHexString(byte[] bytes, int len) { + String hexStr = "0123456789ABCDEF"; + String result = ""; + String hex = ""; + for (int i = 0; i < len; i++) { + hex = String.valueOf(hexStr.charAt((bytes[i] & 0xF0) >> 4)); + hex += String.valueOf(hexStr.charAt(bytes[i] & 0x0F)); + result += hex; + } + /*for (byte b : bytes) { + hex = String.valueOf(hexStr.charAt((b & 0xF0) >> 4)); + hex += String.valueOf(hexStr.charAt(b & 0x0F)); + result += hex + " "; + }*/ + return result; + } + + public static String getCRC2(byte[] bytes) { +// ModBus ͨÐÅЭÒéµÄ CRC ( ÈßÓàÑ­»·Ð£ÑéÂ뺬2¸ö×Ö½Ú, ¼´ 16 λ¶þ½øÖÆÊý¡£ +// CRC ÂëÓÉ·¢ËÍÉ豸¼ÆËã, ·ÅÖÃÓÚËù·¢ËÍÐÅÏ¢Ö¡µÄβ²¿¡£ +// ½ÓÊÕÐÅÏ¢É豸ÔÙÖØÐ¼ÆËãËù½ÓÊÕÐÅÏ¢ (³ý CRC Ö®ÍâµÄ²¿·Ö£©µÄ CRC, +// ±È½Ï¼ÆËãµÃµ½µÄ CRC ÊÇ·ñÓë½ÓÊÕµ½CRCÏà·û, Èç¹ûÁ½Õß²»Ïà·û, ÔòÈÏΪÊý¾Ý³ö´í¡£ +// +// 1) Ô¤Öà 1 ¸ö 16 λµÄ¼Ä´æÆ÷ΪʮÁù½øÖÆFFFF(¼´È«Îª 1) , ³Æ´Ë¼Ä´æÆ÷Ϊ CRC¼Ä´æÆ÷¡£ +// 2) °ÑµÚÒ»¸ö 8 λ¶þ½øÖÆÊý¾Ý (ͨÐÅÐÅÏ¢Ö¡µÄµÚÒ»¸ö×Ö½Ú) Óë 16 λµÄ CRC¼Ä´æÆ÷µÄµÍ 8 λÏàÒì»ò, °Ñ½á¹û·ÅÓÚ CRC¼Ä´æÆ÷¡£ +// 3) °Ñ CRC ¼Ä´æÆ÷µÄÄÚÈÝÓÒÒÆÒ»Î»( ³¯µÍλ)Óà 0 Ìî²¹×î¸ßλ, ²¢¼ì²éÓÒÒÆºóµÄÒÆ³öλ¡£ +// 4) Èç¹ûÒÆ³öλΪ 0, ÖØ¸´µÚ 3 ²½ ( ÔÙ´ÎÓÒÒÆÒ»Î»); Èç¹ûÒÆ³öλΪ 1, CRC ¼Ä´æÆ÷Óë¶àÏîʽA001 ( 1010 0000 0000 0001) ½øÐÐÒì»ò¡£ +// 5) ÖØ¸´²½Öè 3 ºÍ²½Öè 4, Ö±µ½ÓÒÒÆ 8 ´Î,ÕâÑùÕû¸ö8λÊý¾ÝÈ«²¿½øÐÐÁË´¦Àí¡£ +// 6) ÖØ¸´²½Öè 2 µ½²½Öè 5, ½øÐÐͨÐÅÐÅÏ¢Ö¡ÏÂÒ»¸ö×ֽڵĴ¦Àí¡£ +// 7) ½«¸ÃͨÐÅÐÅÏ¢Ö¡ËùÓÐ×Ö½Ú°´ÉÏÊö²½Öè¼ÆËãÍê³Éºó,µÃµ½µÄ16λCRC¼Ä´æÆ÷µÄ¸ß¡¢µÍ×Ö½Ú½øÐн»»»¡£ +// 8) ×îºóµÃµ½µÄ CRC¼Ä´æÆ÷ÄÚÈݼ´Îª CRCÂë¡£ + + int CRC = 0x0000ffff; + int POLYNOMIAL = 0x0000a001; + + int i, j; + for (i = 0; i < bytes.length; i++) { + CRC ^= (int) bytes[i]; + for (j = 0; j < 8; j++) { + if ((CRC & 0x00000001) == 1) { + CRC >>= 1; + CRC ^= POLYNOMIAL; + } else { + CRC >>= 1; + } + } + } + //¸ßµÍλת»»£¬¿´Çé¿öʹÓã¨Æ©Èç±¾ÈËÕâ´Î¶Ôled²ÊÆÁµÄͨѶ¿ª·¢¾Í¹æ¶¨Ð£ÑéÂë¸ßλÔÚǰµÍλÔÚºó£¬Ò²¾Í²»ÐèҪת»»¸ßµÍλ) + //CRC = ( (CRC & 0x0000FF00) >> 8) | ( (CRC & 0x000000FF ) << 8); + return Integer.toHexString(CRC); + } + + public static String getCRC(String data) { + data = data.replace(" ", ""); + int len = data.length(); + if (!(len % 2 == 0)) { + return "0000"; + } + int num = len / 2; + byte[] para = new byte[num]; + for (int i = 0; i < num; i++) { + int value = Integer.valueOf(data.substring(i * 2, 2 * (i + 1)), 16); + para[i] = (byte) value; + } + return getCRC(para); + } + + /** + * ¼ÆËãCRC16УÑéÂë + * + * @param bytes ×Ö½ÚÊý×é + * @return {@link String} УÑéÂë + * @since 1.0 + */ + public static String getCRC(byte[] bytes) { + // CRC¼Ä´æÆ÷ȫΪ1 + int CRC = 0x0000ffff; + // ¶àÏîʽУÑéÖµ + int POLYNOMIAL = 0x0000a001; + int i, j; + for (i = 0; i < bytes.length; i++) { + CRC ^= ((int) bytes[i] & 0x000000ff); + for (j = 0; j < 8; j++) { + if ((CRC & 0x00000001) != 0) { + CRC >>= 1; + CRC ^= POLYNOMIAL; + } else { + CRC >>= 1; + } + } + } + // ½á¹ûת»»Îª16½øÖÆ + String result = Integer.toHexString(CRC).toUpperCase(); + if (result.length() != 4) { + StringBuffer sb = new StringBuffer("0000"); + result = sb.replace(4 - result.length(), 4, result).toString(); + } + //¸ßλÔÚǰµØÎ»ÔÚºó + //return result.substring(2, 4) + " " + result.substring(0, 2); + // ½»»»¸ßµÍ룬µÍλÔÚǰ¸ßλÔÚºó + return result.substring(2, 4) + result.substring(0, 2); + } + + + /** + * byteÊý×éת»»Îª¶þ½øÖÆ×Ö·û´®,ÿ¸ö×Ö½ÚÒÔ","¸ô¿ª + **/ + public static char[] byteArrToBinStr(byte[] b) { + StringBuffer result = new StringBuffer(); + for (int i = 0; i < b.length; i++) { + result.append(Long.toString(b[i] & 0xff, 2) + ","); + } + //Öµ + String compCode = result.toString().substring(0, result.length() - 1); + String myStr = "0000000000000000"; + String str = compCode + myStr.substring(0, myStr.length() - compCode.length()); + + return str.toCharArray(); + } + + /** + * 16½øÖÆ×ª10½øÖÆ + * + * @param content + * @return + */ + public static int hex16To10(String content) { + BigInteger integer = new BigInteger(content, 16); + return integer.intValue(); + } + + /** + * 10½øÖÆ×ª16½øÖÆ + * + * @param numb + * @return + */ + public static String encode10ToHEX16(Integer numb) { + + String hex = Integer.toHexString(numb); + return hex; + } + + /** + * 10ת16 2λ + * + * @param n + * @return + */ + public static String intToHex(int n) { + if (n == 0) { + return "00"; + } + StringBuilder sb = new StringBuilder(8); + String a; + char[] b = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; + while (n != 0) { + sb = sb.append(b[n % 16]); + n = n / 16; + } + a = sb.reverse().toString(); + return a.length() < 2 ? "0" + a : a; + } + + //16½øÖÆÊýת¶þ½øÖÆ + public static void toHex(int num) { + + //& Á½Á½Îª1¼´Îª1 + //>>>ÎÞ·ûºÅÓÒÒÆ + /** + * eg.60 + * 0000-0000 0000-0000 0000-0000 0011-1100 60µÄ¶þ½øÖƱíʾ + * & 0000-0000 0000-0000 0000-0000 0000-1111 15µÄ¶þ½øÖƱíʾ + * &ºóµÄÖµ 0000-0000 0000-0000 0000-0000 0000-1100 ֵΪ12¼´16½øÖƵÄC + */ + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < 8; i++) { + int temp = num & 15; + if (temp > 9) { + sb.append((char) (temp - 10 + 'A'));//ǿת³É16½øÖÆ + + } else { + sb.append(temp); + } + num = num >>> 4; + } + System.out.println(sb.reverse());//0000003C + + } + + + /** + * 16½øÖÆ×ª2½øÖÆ ÓÃÓÚÌáÉý»ú״̬ + * + * @param num + * @return + */ + public static int[] hex16ToBinary(String num) { + String str = Integer.toBinaryString(hex16To10(num)); + char[] chars = str.toCharArray(); + + int[] in = new int[16]; + for (int i = 0; i < chars.length; i++) { + in[i] = chars[chars.length - i - 1] - '0'; + } + return in; + } + + + /** + * ¶à¸öbyte ºÏ²¢³ÉÒ»¸öbyte + * + * @param values + * @return + */ + public static byte[] byteMerge(byte[]... values) { + int length_byte = 0; + for (int i = 0; i < values.length; i++) { + length_byte += values[i].length; + } + byte[] all_byte = new byte[length_byte]; + int countLength = 0; + for (int i = 0; i < values.length; i++) { + byte[] b = values[i]; + System.arraycopy(b, 0, all_byte, countLength, b.length); + countLength += b.length; + } + return all_byte; + } + + public static String[] stringMerge(String[]... values) { + int length_byte = 0; + for (int i = 0; i < values.length; i++) { + length_byte += values[i].length; + } + String[] all_byte = new String[length_byte]; + int countLength = 0; + for (int i = 0; i < values.length; i++) { + String[] b = values[i]; + System.arraycopy(b, 0, all_byte, countLength, b.length); + countLength += b.length; + } + return all_byte; + } + + public static int[] intMerge(int[]... values) { + int length_byte = 0; + for (int i = 0; i < values.length; i++) { + length_byte += values[i].length; + } + int[] all_byte = new int[length_byte]; + int countLength = 0; + for (int i = 0; i < values.length; i++) { + int[] b = values[i]; + System.arraycopy(b, 0, all_byte, countLength, b.length); + countLength += b.length; + } + return all_byte; + } + + + /** + * int תbyte + * + * @param value + * @param len + * @return + */ + public static byte[] int2Bytes(int value, int len) { + byte[] b = new byte[len]; + for (int i = 0; i < len; i++) { + b[len - i - 1] = (byte) ((value >> 8 * i) & 0xff); + } + return b; + } + + public static String uuids() { + UUID uuid = UUID.randomUUID(); + String a = uuid.toString().replace("-", "").toUpperCase(); + return a; + } + + /** + * ´Ó¶ÔÏóA copyµ½ ¶ÔÏóB + * + * @param ob A + * @param clazz B.class + * @return B + */ + public static T copy(Object ob, Class clazz) { + String oldOb = JSON.toJSONString(ob); + return JSON.parseObject(oldOb, clazz); + } + + /** + * ´ÓList copyµ½List + * + * @param list + * @param clazz + * @param + * @return + */ + public static List copy(List list, Class clazz) { + String oldOb = JSON.toJSONString(list); + return JSON.parseArray(oldOb, clazz); + } + + /** + * short 16λתint + * @param start + * @param data + * @return + */ + public static int optInt(int start, String data) { + return Integer.parseInt(data.substring(start * 2, (start + 2) * 2), 16); + } + /** + * int 16λתint + * @param start + * @param data + * @return + */ + public static int optDInt(int start, String data) { + return Integer.parseInt(data.substring(start * 2, (start + 4) * 2), 16); + } + /** + * long 16λתlong + * @param start + * @param data + * @return + */ + public static Long optLong(int start, String data) { + return Long.parseLong(data.substring(start * 2, (start + 8) * 2), 16); + } + /** + * string 16λתstring + * @param start + * @param data + * @return + */ + + public static String optString(int start, String data) { + byte[] bytes = SoftBasic.HexStringToBytes(data.substring(start * 2, (start + 12) * 2)); + return Tools.bytetostringtool(bytes); + } + + /** + * Æ¥Åä×Ö·û´®ÊÇ·ñÊý×Ö¿ªÍ· + * @param str + * @return + */ + public static boolean isNumeric(String str) { + Pattern pattern = Pattern.compile("[0-9]*"); + Matcher isNum = pattern.matcher(str.charAt(0)+""); + if (!isNum.matches()) { + return false; + } + return true; + } + public static void main(String[] args) { + + } + + + public static String optSpeString(int start, String data) { + byte[] bytes = SoftBasic.HexStringToBytes(data.substring(start * 2, (start + 14) * 2)); + return Tools.bytetostringtool(bytes); + } +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/ProcedureResult.java b/src/com/wms/dss/ats/customs/abb/utils/ProcedureResult.java new file mode 100644 index 0000000..a6d65ad --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/ProcedureResult.java @@ -0,0 +1,51 @@ +package com.wms.dss.ats.customs.abb.utils; + + +/* +* 存储过程返回结果 +* */ +public class ProcedureResult { + + + private Integer result; + + private String msg; + + private ProcedureResult(Integer result, String msg) { + this.result = result; + this.msg = msg; + } + + public static ProcedureResult result(){ + ProcedureResult procedureResult = new ProcedureResult(0,"åˆ�始值,未知"); + return procedureResult; + } + + public static ProcedureResult result(Integer result,String msg){ + ProcedureResult procedureResult = new ProcedureResult(0,"åˆ�始值,未知"); + if(result!=null){ + procedureResult.setResult(result); + } + if(msg!=null){ + procedureResult.setMsg(msg); + } + return procedureResult; + } + + + public Integer getResult() { + return result; + } + + private void setResult(Integer result) { + this.result = result; + } + + public String getMsg() { + return msg; + } + + private void setMsg(String msg) { + this.msg = msg; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/QueryDbDataUtils.java b/src/com/wms/dss/ats/customs/abb/utils/QueryDbDataUtils.java new file mode 100644 index 0000000..85d2279 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/QueryDbDataUtils.java @@ -0,0 +1,618 @@ +package com.wms.dss.ats.customs.abb.utils; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.*; +import com.wms.dss.common.server.form.Logger; + +import java.util.*; + +/* + *@Version 1.0 + * Êý¾Ý»ñÈ¡ + **/ +public class QueryDbDataUtils { + + public static WmsDeviceExecutionQueue getQueueByTask(EntityDAO dao, Long rwh) throws Exception { + WmsDeviceExecutionQueue queue = null; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from WmsDeviceExecutionQueue where rwzt=1 and rwh=").append(rwh); + List ls = dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + queue = (WmsDeviceExecutionQueue) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetQueueByTask»ñÈ¡¶ÓÁÐÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return queue; + } + public static WmsDeviceExecutionQueue findDeviceQueueByTaskNo(EntityDAO dao, int devId, long taskNo, int xf) { + WmsDeviceExecutionQueue wmsDeviceExecutionQueue = null; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from WmsDeviceExecutionQueue where rwh = '").append(taskNo).append("' "); + + List ls = dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + wmsDeviceExecutionQueue = (WmsDeviceExecutionQueue) ls.get(0); + } + } catch (Exception e) { + Logger.info("Ö´ÐÐfindDeviceQueueByTaskNoѰÕÒ"+devId+"ºÅ¶Ñ¶â»úÖØÐÂÏ·¢¶ÓÁÐÓÐÎ󣡣¡£¡£¡ÈÎÎñºÅΪ£º" + taskNo); + } + return wmsDeviceExecutionQueue; + } + + public static MydoJob getRKMydoJobBySSJNo(EntityDAO m_dao, String ssjNo) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out<10 and status=1 and cargo_space_id='" + ssjNo + "'"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJobÈë¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static MydoJob getRKMydoJobByTaskNo(EntityDAO m_dao, String taskNo) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out<10 and status=3 and task_no='" + taskNo + "' order by create_time asc "); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJobÈë¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static MydoJob getCKMydoJob(EntityDAO m_dao) throws Exception { + MydoJob mydoJob = new MydoJob(); + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out>9 and status=1 order by create_time asc limit 1"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" +e.getMessage()); + } + return mydoJob; + } + + public static int getWmsDeviceExecutionQueueByRwlx(EntityDAO m_dao,int rwlx) throws Exception { + int count = 0; + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where rwlx="+rwlx+" and DevId= 1"); + if (ls != null && ls.size() > 0) { + count = ls.size(); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ¶ÓÁÐWmsDeviceExecutionQueueÖÐÈë¿â¶Ñ¶â»ú¶ÓÁÐÊýÁ¿´íÎó£º" + e.getMessage()); + } + return count; + } + + public static int getWmsDeviceExecutionQueueByRwlxAndDev(EntityDAO m_dao,int devId,int rwlx) throws Exception { + int count = 0; + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where rwlx="+rwlx+" and DevId= "+devId); + if (ls != null && ls.size() > 0) { + count = ls.size(); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ¶ÓÁÐWmsDeviceExecutionQueueÖÐÈë¿â¶Ñ¶â»ú¶ÓÁÐÊýÁ¿´íÎó£º" + e.getMessage()); + } + return count; + } + + public static List getWmsDeviceExecutionQueueInfoByRwlxAndDev(EntityDAO m_dao,int devId,int rwlx) throws Exception { + List wmsDeviceExecutionQueue = new ArrayList<>(); + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where rwlx="+rwlx+" and DevId= "+devId); + if (ls != null && ls.size() > 0) { + for (Object l : ls) { + wmsDeviceExecutionQueue.add( (WmsDeviceExecutionQueue) l); + } + + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ¶ÓÁÐWmsDeviceExecutionQueueÖÐÈë¿â¶Ñ¶â»ú¶ÓÁÐÊýÁ¿´íÎó£º" + e.getMessage()); + } + return wmsDeviceExecutionQueue; + } + + + public static int getWmsDeviceExecutionQueueByRwlxAndDev(EntityDAO m_dao,int devId,int... rwlx) throws Exception { + int count = 0; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from WmsDeviceExecutionQueue where rwlx in ("); + for (int i = 0; i < rwlx.length; i++) { + strBud.append(rwlx[i]).append(","); + } + strBud.deleteCharAt(strBud.length() - 1); + strBud.append(") and DevId= ").append(devId); + List ls = m_dao.searchEntities(strBud.toString()); + if (ls != null && !ls.isEmpty()) { + count = ls.size(); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ¶ÓÁÐWmsDeviceExecutionQueueÖÐÈë¿â¶Ñ¶â»ú¶ÓÁÐÊýÁ¿´íÎó£º" + e.getMessage()); + } + return count; + } + + public static MydoJob getCKMydoJobBySSJNo(EntityDAO m_dao, String ssjNo) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out>9 and status=1 and target_cargo_space_id='" + ssjNo + "'"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static MydoJob getRKMyDoJobByTrayCode(EntityDAO m_dao, String trayCode,List status) throws Exception { + MydoJob mydoJob = null; + try { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("from MydoJob where in_or_out<10 and status in ("); + stringBuilder.append(StrUtil.join(",", status)) ; + stringBuilder.append(") and tray_code='").append(trayCode).append("'"); + List ls = m_dao.searchEntities(stringBuilder.toString()); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + e.printStackTrace(); + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + + public static MydoJob selectJobByEntranceId(EntityDAO m_dao, String entranceId) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out<10 and status=1 and entrance_id='" + entranceId + "'"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾ÝÈë¿Ú»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + public static MydoJob getCKMyDoJobByTrayCode(EntityDAO m_dao, String trayCode) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out>9 and tray_code='" + trayCode + "'"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static MydoJob getHlMyDoJobByTaskNo(EntityDAO m_dao, String trayCode) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out=3 and tray_code='" + trayCode + "'"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static MydoJob getMyDoJobByTaskNo(EntityDAO m_dao, String taskNo) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where task_no='" + taskNo + "'"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static int getWmsDeviceExecutionQueueByXF(EntityDAO m_dao,int ddjH) throws Exception{ + int count = 0; + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where ddjxf=1 and DevId= "+ddjH); + if (ls != null && ls.size() > 0) { + count = ls.size(); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ¶ÓÁÐWmsDeviceExecutionQueueÖжѶâ»úÒÑÏ·¢¶ÓÁÐÊýÁ¿´íÎó£º" + e.getMessage()); + } + return count; + } + + public static WmsDeviceExecutionQueue getFirstWmsDeviceExecutionQueue(EntityDAO m_dao,int ddjH) throws Exception { + WmsDeviceExecutionQueue wmsDeviceExecutionQueue = null; + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where DevId = "+ddjH+" and ddjxf=0 order by scsj asc"); + if (ls != null && ls.size() > 0) { + wmsDeviceExecutionQueue = (WmsDeviceExecutionQueue) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ´´½¨Ê±¼ä×îÔçÖ´ÐжÓÁÐWmsDeviceExecutionQueueÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return wmsDeviceExecutionQueue; + } + + public static WmsDeviceExecutionQueue getFirstWmsDeviceExecutionQueueByRwlx(EntityDAO m_dao,int ddjH,int rwlx) throws Exception { + WmsDeviceExecutionQueue wmsDeviceExecutionQueue = null; + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where DevId = "+ddjH+" and ddjxf=0 and rwlx="+rwlx+" order by scsj asc"); + if (ls != null && ls.size() > 0) { + wmsDeviceExecutionQueue = (WmsDeviceExecutionQueue) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ´´½¨Ê±¼ä×îÔçÖ´ÐжÓÁÐWmsDeviceExecutionQueueÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return wmsDeviceExecutionQueue; + } + + public static WmsDeviceExecutionQueue getFirstWmsDeviceExecutionQueueOrderbyRwlx(EntityDAO m_dao,int ddjH,String type) throws Exception { + WmsDeviceExecutionQueue wmsDeviceExecutionQueue = null; + try { + List ls = null; + if (type.equals("1")) { + ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where DevId = "+ddjH+" and ddjxf=0 order by rwlx asc, scsj asc"); + }else if (type.equals("2")) { + ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where DevId = "+ddjH+" and ddjxf=0 order by rwlx desc, scsj asc"); + } + if (ls != null && ls.size() > 0) { + wmsDeviceExecutionQueue = (WmsDeviceExecutionQueue) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ´´½¨Ê±¼ä×îÔçÖ´ÐжÓÁÐWmsDeviceExecutionQueueÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return wmsDeviceExecutionQueue; + } + + public static WmsDeviceExecutionQueue getQueueByTask0(EntityDAO dao, Long rwh) throws Exception { + WmsDeviceExecutionQueue queue = null; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from WmsDeviceExecutionQueue where rwh=").append(rwh); + List ls = dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + queue = (WmsDeviceExecutionQueue) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetQueueByTask»ñÈ¡¶ÓÁÐÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return queue; + } + + + public static MydoJob getSlotJobByTask(EntityDAO dao, Long zxrwh,List inOrOut) throws Exception { + MydoJob job = null; + try { + StringBuilder strBud = new StringBuilder(); + + if (CollUtil.isNotEmpty(inOrOut)){ + String join = CollUtil.join(inOrOut, ","); + strBud.append("from MydoJob where task_no=").append(zxrwh).append(" and in_or_out in (").append(join).append(")"); + }else { + strBud.append("from MydoJob where task_no=").append(zxrwh); + } + List ls = dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + job = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetJobByTask»ñÈ¡×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return job; + } + + public static void updateWmsDeviceExecutionQueueTime(EntityDAO m_dao, Long rwh){ + try { + String date = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); + m_dao.updateSql("update WmsDeviceExecutionQueue set xfsj= '"+date+"',ddjxf=1,xcykh=1 where rwh="+rwh); + } catch (Exception e) { + Logger.info("Ö´ÐÐupdateWmsDeviceExecutionQueueTime¸üжÓÁпªÊ¼Ê±¼ä´íÎó£º" + e.getMessage()); + } + } + + public static MydoJob getCKMydoJobByExitId(EntityDAO m_dao,List exitIdList) throws Exception { + + MydoJob job = null; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from MydoJob where exit_id in ('"); + String exitIdListStr = StrUtil.join("','", (Object) exitIdList); + strBud.append(exitIdListStr).append("')"); + strBud.append(" and in_or_out>9 and status=1 order by create_time asc limit 1"); + List ls = m_dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + job = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetJobByTask»ñÈ¡×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return job; + } + + public static int getCKCountMydoJobByExitId(EntityDAO m_dao,List exitIdList) throws Exception { + + int count = 0; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from MydoJob where exit_id in ('"); + String exitIdListStr = StrUtil.join("','", (Object) exitIdList); + strBud.append(exitIdListStr).append("')"); + strBud.append(" and in_or_out>9 and status=3"); + List ls = m_dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + count = ls.size(); + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetJobByTask»ñÈ¡×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return count; + } + + public static MydoJob getCKRunningMydoJobByExitId(EntityDAO m_dao,List exitIdList) throws Exception { + + MydoJob job = null; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from MydoJob where exit_id in ('"); + String exitIdListStr = StrUtil.join("','", (Object) exitIdList); + strBud.append(exitIdListStr).append("')"); + strBud.append(" and in_or_out>9 and status=3 order by create_time asc limit 1"); + List ls = m_dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + job = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetJobByTask»ñÈ¡×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return job; + } + + public static List getCKMydoJobListByExitId(EntityDAO m_dao,String... exitIdList) throws Exception { + + List jobList = new ArrayList<>(); + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from MydoJob where exit_id in ('"); + String exitIdListStr = StrUtil.join("','", (Object) exitIdList); + strBud.append(exitIdListStr).append("')"); + strBud.append(" and in_or_out>9 and status=1 order by create_time asc limit 1"); + List ls = m_dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + for (Object l : ls) { + jobList.add((MydoJob) l); + } + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetJobByTask»ñÈ¡×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return jobList; + } + + + public static MsgDdj getDevIdByRoadwayId(EntityDAO mDao, String roadwayId) throws Exception{ + MsgDdj msgDdj=null; + try { + List ls = mDao.searchEntities("from MsgDdj where dqxd='" + roadwayId + "'"); + if (ls != null && ls.size() > 0) { + msgDdj = (MsgDdj) ls.get(0); + } + }catch (Exception e){ + throw new Exception("Ö´ÐÐggetDevIdByRoadwayId»ñÈ¡DevId´íÎó£º" + e.getMessage()); + } + return msgDdj; + } + + public static MydoJob getHlMyDoJobByEntranceId(EntityDAO m_dao, String ssjNo) throws Exception { + MydoJob job = null; + try { + StringBuilder strBud = new StringBuilder(); + strBud.append("from MydoJob where status =1 and in_or_out = 3 and entrance_id = '").append(ssjNo).append("'"); + List ls = m_dao.searchEntities(strBud.toString()); + if (ls != null && ls.size() > 0) { + job = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´ÐÐgetJobByTask»ñÈ¡×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return job; + } + + public static MydoJob getMyDoJobByTrayCode(EntityDAO mDao, String trayCode) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = mDao.searchEntities("from MydoJob where tray_code='" + trayCode + "'"); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJob³ö¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static WmsDeviceExecutionQueue getSecondQueueByDdjhAndRwlx(EntityDAO m_dao, int ddjH, int rwlx,String rwh) throws Exception { + WmsDeviceExecutionQueue wmsDeviceExecutionQueue = null; + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where DevId = "+ddjH+" and ddjxf=0 and rwh !='"+rwh+"' and rwlx = "+rwlx+" order by scsj asc"); + if (ls != null && ls.size() > 0) { + wmsDeviceExecutionQueue = (WmsDeviceExecutionQueue) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ´´½¨Ê±¼ä×îÔçÖ´ÐжÓÁÐWmsDeviceExecutionQueueÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return wmsDeviceExecutionQueue; + } + + public static MydoJob getRKMydoJobByTaskNoAndEp(EntityDAO m_dao, String taskNo, String execution_phase) throws Exception { + MydoJob mydoJob = null; + try { + + List ls = m_dao.searchEntities("from MydoJob where in_or_out<10 and status=3 and task_no='" + taskNo + "' and execution_phase = "+execution_phase+" order by create_time asc "); + if (ls != null && ls.size() > 0) { + mydoJob = (MydoJob) ls.get(0); + } + } catch (Exception e) { + throw new Exception("Ö´Ðиù¾Ý¹õ´²±àÂë»ñÈ¡MydoJobÈë¿â×÷ÒµÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return mydoJob; + } + + public static List getPortState(EntityDAO m_dao) throws Exception { + List wcsPortState = new ArrayList<>(); + try { + List ls = m_dao.searchEntities("from WcsPortState where spare2 = '0' and spare1 !='0' "); + for (Object l : ls) { + wcsPortState.add((WcsPortState) l); + } + } catch (RuntimeException e) { + throw new Exception("»ñÈ¡³öÈë¿Ú״̬ÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return wcsPortState; + } + + public static void updateWcsPortState(EntityDAO mDao, String portName, String status) { + try { + mDao.updateSql("update WcsPortState set spare2 = '"+status+"' where portName = '"+portName+"'"); + } catch (Exception e) { + Logger.info("Ö´ÐÐupdateWcsPortState¸üжÓÁпªÊ¼Ê±¼ä´íÎó£º" + e.getMessage()); + } + } + + public static boolean getEndTime(EntityDAO mDao) throws Exception { + try { + List ls = mDao.searchEntities("from End "); + Object o = ls.get(0); + End end = (End) o; + if (DateUtil.compare(new Date(), end.getFinishTime()) > 0){ + return true; + } + return false; + } catch (RuntimeException e) { + throw new Exception("»ñȡʱ¼ä³ö´í£º" + e.getMessage()); + } + } + + public static ExceptionInfo selectException(EntityDAO mDao,long rwh) throws Exception { + ExceptionInfo exceptionInfo = null; + try { + List ls = mDao.searchEntities("from ExceptionInfo where taskNo="+rwh+""); + if (ls != null && !ls.isEmpty()) { + exceptionInfo = (ExceptionInfo) ls.get(0); + } + } catch (RuntimeException e) { + throw new Exception("»ñÈ¡³öÈë¿Ú״̬ÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return exceptionInfo; + } + + public static int selectCountExceptionNoSend(EntityDAO mDao,String ssjNo) throws Exception { + int count = 0; + try { + List ls = mDao.searchEntities("from ExceptionInfo where sendCompleted =0 and ssjNo = '"+ssjNo+"'"); + if (ls != null && !ls.isEmpty()) { + count = ls.size(); + } + } catch (RuntimeException e) { + throw new Exception("»ñÈ¡³öÈë¿Ú״̬ÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return count; + } + + public static WcsPortState getPortStateByName(EntityDAO mDao, String ssjNo) throws Exception { + WcsPortState wcsPortState = null; + try { + List ls = mDao.searchEntities("from WcsPortState where portName = '"+ssjNo+"'"); + wcsPortState = (WcsPortState) ls.get(0); + } catch (RuntimeException e) { + throw new Exception("»ñÈ¡³öÈë¿Ú״̬ÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return wcsPortState; + } + + public static TaskPriority getTaskPriority(EntityDAO mDao, int ddjh) throws Exception { + TaskPriority taskPriority = null; + try { + List ls = mDao.searchEntities("from TaskPriority where type = '"+ddjh+"'"); + taskPriority = (TaskPriority) ls.get(0); + } catch (RuntimeException e) { + throw new Exception("»ñÈ¡³öÈë¿Ú״̬ÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return taskPriority; + } + + public static List getAllOutWmsDeviceExecutionQueueOrderbyRwlx(EntityDAO mDao, int ddjH) throws Exception { + List wmsDeviceExecutionQueues = new ArrayList<>(); + try { + List ls = null; + ls = mDao.searchEntities("from WmsDeviceExecutionQueue where DevId = "+ddjH+" and ddjxf=0 and rwlx>=10 order by rwlx asc, scsj asc"); + if (ls != null && ls.size() > 0) { + for (Object l : ls) { + WmsDeviceExecutionQueue wmsDeviceExecutionQueue = (WmsDeviceExecutionQueue) l; + wmsDeviceExecutionQueues.add(wmsDeviceExecutionQueue); + } + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ´´½¨Ê±¼ä×îÔçÖ´ÐжÓÁÐWmsDeviceExecutionQueueÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return wmsDeviceExecutionQueues; + } + + public static ExceptionInfo selectExceptionByPort(EntityDAO mDao, String ssjNo) throws Exception { + ExceptionInfo exceptionInfo = null; + try { + List ls = mDao.searchEntities("from ExceptionInfo where ssjNo='"+ssjNo+"' and sendCompleted ='0' "); + if (ls != null && !ls.isEmpty()) { + exceptionInfo = (ExceptionInfo) ls.get(0); + } + } catch (RuntimeException e) { + throw new Exception("»ñÈ¡³öÈë¿Ú״̬ÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return exceptionInfo; + } + + public static int getWmsDeviceExecutionQueueByRwh(EntityDAO m_dao, String rwh) throws Exception { + int count = 0; + try { + List ls = m_dao.searchEntities("from WmsDeviceExecutionQueue where rwh = " + rwh + " order by scsj asc"); + if (ls != null && ls.size() > 0) { + count = ls.size(); + } + } catch (Exception e) { + throw new Exception("Ö´Ðвéѯ´´½¨Ê±¼ä×îÔçÖ´ÐжÓÁÐWmsDeviceExecutionQueueÐÅÏ¢´íÎó£º" + e.getMessage()); + } + return count; + + } +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/RequestUrls.java b/src/com/wms/dss/ats/customs/abb/utils/RequestUrls.java new file mode 100644 index 0000000..f28a83a --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/RequestUrls.java @@ -0,0 +1,19 @@ +package com.wms.dss.ats.customs.abb.utils; + +public enum RequestUrls { + CLEAR_RACK("http://localhost:8089/external/log/clearRack"), + TrayCodeDirection("http://localhost:8089/external/log/getTrayCodeDirection"), + getInStorageInformation("http://localhost:8089/external/log/getInStorageInformation"), + taskExceptionUpload("http://localhost:8089/external/log/taskExceptionUpload"), + handleExceptionUrl("http://localhost:8089/external/log/taskExceptionUpload"); + + private final String url; + + RequestUrls(String url) { + this.url = url; + } + + public String getUrl() { + return url; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/SnowflakeIdWorker.java b/src/com/wms/dss/ats/customs/abb/utils/SnowflakeIdWorker.java new file mode 100644 index 0000000..312d8d6 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/SnowflakeIdWorker.java @@ -0,0 +1,193 @@ +package com.wms.dss.ats.customs.abb.utils; + + +/** + * Twitter_Snowflake
+ * SnowFlake的结构如下(�部分用-分开):
+ * 0 - 0000000000 0000000000 0000000000 0000000000 0 - 00000 - 00000 - 000000000000
+ * 1�标识,由于long基本类型在Java中是带符�的,最高�是符��,正数是0,负数是1,所以id一般是正数,最高�是0
+ * 41�时间截(毫秒级),注�,41�时间截�是存储当�时间的时间截,而是存储时间截的差值(当�时间截 - 开始时间截) + * 得到的值),这里的的开始时间截,一般是我们的id生�器开始使用的时间,由我们程��指定的(如下下�程�IdWorker类的startTime属性)。41�的时间截,�以使用69年,年T = (1L << 41) / (1000L * 60 * 60 * 24 * 365) = 69
+ * 10�的数�机器�,�以部署在1024个节点,包括5�datacenterId和5�workerId
+ * 12��列,毫秒内的计数,12�的计数顺��支��个节点�毫秒(�一机器,�一时间截)产生4096个ID��
+ * 加起�刚好64�,为一个Long型。
+ * SnowFlake的优点是,整体上按照时间自增排åº�,并且整个分布å¼�系统内ä¸�会产生ID碰撞(由数æ�®ä¸­å¿ƒID和机器ID作区分),并且效率较高,ç»�测试,SnowFlakeæ¯�秒能够产生26万IDå·¦å�³ã€‚ + */ + + +import java.util.Random; + +/** + * @ClassName: SnowflakeIdWorker + * @Description: + * @Author: Kucha + * @Date: 2021/10/10 15:07 + */ +public class SnowflakeIdWorker { + + // ==============================Fields=========================================== + /** 开始时间截 (2015-01-01) */ + private final long twepoch = 1420041600000L; + + /** 机器id所å� çš„ä½�æ•° */ + private final long workerIdBits = 5L; + + /** æ•°æ�®æ ‡è¯†id所å� çš„ä½�æ•° */ + private final long datacenterIdBits = 5L; + + /** 支æŒ�的最大机器id,结果是31 (这个移ä½�算法å�¯ä»¥å¾ˆå¿«çš„计算出几ä½�二进制数所能表示的最大å��进制数) */ + private final long maxWorkerId = -1L ^ (-1L << workerIdBits); + + /** 支æŒ�的最大数æ�®æ ‡è¯†id,结果是31 */ + private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits); + + /** åº�列在id中å� çš„ä½�æ•° */ + private final long sequenceBits = 12L; + + /** 机器IDå�‘左移12ä½� */ + private final long workerIdShift = sequenceBits; + + /** æ•°æ�®æ ‡è¯†idå�‘左移17ä½�(12+5) */ + private final long datacenterIdShift = sequenceBits + workerIdBits; + + /** 时间截å�‘左移22ä½�(5+5+12) */ + private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits; + + /** 生æˆ�åº�列的掩ç �,这里为4095 (0b111111111111=0xfff=4095) */ + private final long sequenceMask = -1L ^ (-1L << sequenceBits); + + /** 工作机器ID(0~31) */ + private long workerId; + + /** æ•°æ�®ä¸­å¿ƒID(0~31) */ + private long datacenterId; + + /** 毫秒内åº�列(0~4095) */ + private long sequence = 0L; + + /** 上次生æˆ�ID的时间截 */ + private long lastTimestamp = -1L; + + public SnowflakeIdWorker() { + } + + //==============================Constructors===================================== + /** + * 构造函数 + * @param workerId 工作ID (0~31) + * @param datacenterId æ•°æ�®ä¸­å¿ƒID (0~31) + */ + public SnowflakeIdWorker(long workerId, long datacenterId) { + if (workerId > maxWorkerId || workerId < 0) { + throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); + } + if (datacenterId > maxDatacenterId || datacenterId < 0) { + throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); + } + this.workerId = workerId; + this.datacenterId = datacenterId; + } + + //==============================Constructors===================================== + /** + * åˆ�始化函数 + * @param workerId 工作ID (0~31) + * @param datacenterId æ•°æ�®ä¸­å¿ƒID (0~31) + */ + public void initSnowflake(long workerId, long datacenterId){ + if (workerId > maxWorkerId || workerId < 0) { + throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId)); + } + if (datacenterId > maxDatacenterId || datacenterId < 0) { + throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId)); + } + this.workerId = workerId; + this.datacenterId = datacenterId; + } + + + // ==============================Methods========================================== + /** + * 获得下一个ID (该方法是线程安全的) + * @return SnowflakeId + */ + public synchronized long nextId() { + long timestamp = timeGen(); + + //如果当å‰�æ—¶é—´å°�于上一次ID生æˆ�的时间戳,说明系统时钟回退过这个时候应当抛出异常 + if (timestamp < lastTimestamp) { + throw new RuntimeException( + String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp)); + } + + //如果是å�Œä¸€æ—¶é—´ç”Ÿæˆ�的,则进行毫秒内åº�列 + if (lastTimestamp == timestamp) { + sequence = (sequence + 1) & sequenceMask; + //毫秒内åº�列溢出 + if (sequence == 0) { + //阻塞到下一个毫秒,获得新的时间戳 + timestamp = tilNextMillis(lastTimestamp); + } + } + //时间戳改å�˜ï¼Œæ¯«ç§’内åº�列é‡�ç½® + else { + sequence = 0L; + } + + //上次生æˆ�ID的时间截 + lastTimestamp = timestamp; + + //ç§»ä½�并通过或è¿�算拼到一起组æˆ�64ä½�çš„ID + return ((timestamp - twepoch) << timestampLeftShift) // + | (datacenterId << datacenterIdShift) // + | (workerId << workerIdShift) // + | sequence; + } + + /** + * 阻塞到下一个毫秒,直到获得新的时间戳 + * @param lastTimestamp 上次生æˆ�ID的时间截 + * @return 当å‰�时间戳 + */ + protected long tilNextMillis(long lastTimestamp) { + long timestamp = timeGen(); + while (timestamp <= lastTimestamp) { + timestamp = timeGen(); + } + return timestamp; + } + + /** + * 返回以毫秒为å�•ä½�的当å‰�æ—¶é—´ + * @return 当å‰�æ—¶é—´(毫秒) + */ + protected long timeGen() { + return System.currentTimeMillis(); + } + + /** + * 获å�–2^31-1 + * @return + */ + public int getRandomId(){ + return new Random().nextInt(1000000000)+1000000000; + } + + //==============================Test============================================= + /** 测试 */ + public static void main(String[] args) { +// SnowflakeIdWorker idWorker = new SnowflakeIdWorker(0, 0); +// +// for (int i = 0; i < 100; i++) { +// long id = idWorker.nextId(); +// System.out.println(Long.toBinaryString(id)); +// System.out.println(id); +// } + String substring = "L1002".substring(1,5); + System.err.println(substring); + } + + public static SnowflakeIdWorker getSnowflakeIdWorker(){ + return new SnowflakeIdWorker(0,0); + } +} \ No newline at end of file diff --git a/src/com/wms/dss/ats/customs/abb/utils/Tools.java b/src/com/wms/dss/ats/customs/abb/utils/Tools.java new file mode 100644 index 0000000..2401c1d --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/Tools.java @@ -0,0 +1,513 @@ +package com.wms.dss.ats.customs.abb.utils; + +import HslCommunication.BasicFramework.SoftBasic; +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.ats.customs.abb.entity.SendData; +import com.wms.dss.ats.customs.abb.entity.StoredParameters; +import com.wms.dss.common.server.form.Logger; +import org.libnodave.Nodave; + +import java.io.Serializable; +import java.nio.charset.StandardCharsets; +import java.sql.CallableStatement; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Types; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; + +/** + * ÃèÊö:cyc16УÑéÂë + * + * @author zhu + */ +public class Tools implements Serializable { + public static int Debug = 0x20; + public final static int DEBUG_CONVERSIONS = 0x1000; + public static final int DINT = 4; + + public static final int INT = 2; + + public static void main(String[] arg) { + int jym = getJYM(1, 2, 3); + System.out.println(jym); + } + + /*4¡¢CRC-16УÑéÂë¼ÆËã·½·¨£º + ³£Óòé±í·¨ºÍ¼ÆËã·¨¡£¼ÆËã·½·¨Ò»°ã¶¼ÊÇ£º + £¨1£©¡¢Ô¤ÖÃ1¸ö16λµÄ¼Ä´æÆ÷ΪʮÁù½øÖÆFFFF£¨¼´È«Îª1£©£¬³Æ´Ë¼Ä´æÆ÷ΪCRC¼Ä´æÆ÷£» + £¨2£©¡¢°ÑµÚÒ»¸ö8λ¶þ½øÖÆÊý¾Ý£¨¼ÈͨѶÐÅÏ¢Ö¡µÄµÚÒ»¸ö×Ö½Ú£©Óë16λµÄCRC¼Ä´æÆ÷µÄµÍ + 8λÏàÒì»ò£¬°Ñ½á¹û·ÅÓÚCRC¼Ä´æÆ÷£¬¸ß°ËλÊý¾Ý²»±ä£» + £¨3£©¡¢°ÑCRC¼Ä´æÆ÷µÄÄÚÈÝÓÒÒÆÒ»Î»£¨³¯µÍ룩ÓÃ0Ìî²¹×î¸ß룬²¢¼ì²éÓÒÒÆºóµÄÒÆ³öλ£» + £¨4£©¡¢Èç¹ûÒÆ³öλΪ0£ºÖظ´µÚ3²½£¨ÔÙ´ÎÓÒÒÆÒ»Î»£©£»Èç¹ûÒÆ³öλΪ1£¬CRC¼Ä´æÆ÷Óë¶à + ÏîʽA001£¨1010 0000 0000 0001£©½øÐÐÒì»ò£» + £¨5£©¡¢Öظ´²½Öè3ºÍ4£¬Ö±µ½ÓÒÒÆ8´Î£¬ÕâÑùÕû¸ö8λÊý¾ÝÈ«²¿½øÐÐÁË´¦Àí£» + £¨6£©¡¢Öظ´²½Öè2µ½²½Öè5£¬½øÐÐͨѶÐÅÏ¢Ö¡ÏÂÒ»¸ö×ֽڵĴ¦Àí£» + £¨7£©¡¢½«¸ÃͨѶÐÅÏ¢Ö¡ËùÓÐ×Ö½Ú°´ÉÏÊö²½Öè¼ÆËãÍê³Éºó£¬µÃµ½µÄ16λCRC¼Ä´æÆ÷µÄ¸ß¡¢µÍ + ×Ö½Ú½øÐн»»»£» + £¨8£©¡¢×îºóµÃµ½µÄCRC¼Ä´æÆ÷ÄÚÈݼ´Îª£ºCRCÂë¡£ + ÒÔÉϼÆËã²½ÖèÖеĶàÏîʽA001ÊÇ8005°´Î»µßµ¹ºóµÄ½á¹û¡£ + ²é±í·¨Êǽ«ÒÆÎ»Òì»òµÄ¼ÆËã½á¹û×ö³ÉÁËÒ»¸ö±í£¬¾ÍÊǽ«0~256·ÅÈëÒ»¸ö³¤¶ÈΪ16λµÄ¼Ä´æÆ÷ÖеĵͰË룬¸ß°ËλÌî³ä0£¬È»ºó½«¸Ã¼Ä´æÆ÷Óë¶àÏîʽ0XA001°´ÕÕÉÏÊö3¡¢4²½Ö裬ֱµ½°Ëλȫ²¿ÒƳö£¬×îºó¼Ä´æÆ÷ÖеÄÖµ¾ÍÊDZí¸ñÖеÄÊý¾Ý£¬¸ß°Ëλ¡¢µÍ°Ëλ·Ö±ðµ¥¶ÀÒ»¸ö±í¡£*/ + + + /** + * È«²¿Ð£ÑéÂë¿ÉÓÃÕâ¸ö»ñÈ¡ + * + * @param ints ´«ÈëµÄУÑéÂë + * @return ·µ»ØµÄint + */ + public static int getJYM(int... ints) { + //½«ÕûÐÎÈÎÎñºÅתΪ32룬ÄܺóתΪËĸö×Ö½Ú£¬×îºóתΪÕûÐÎ×é4 + int[] ints1 = new int[ints.length * 4]; + for (int i = 0; i < ints.length; i++) { + int[] son; + son = binaryTints(printBits(ints[i])); + for (int j = 0; j < 4; j++) { + int s = j + i * 4; + ints1[s] = son[j]; + System.out.println(Arrays.toString(ints1)); + } + } + int a = 0; + for (int j : ints1) { + a = a + j; + } + return a; + } + + /** + * @param hex ×Ö·û´® + * @return a ÕûÐÍ + */ + public static int[] binaryTints(String hex) { + int[] a = new int[4]; + String hexString = change32(hex); + a[0] = Integer.parseInt(hexString.substring(0, 8), 2);//½« + a[1] = Integer.parseInt(hexString.substring(8, 16), 2); + a[2] = Integer.parseInt(hexString.substring(16, 24), 2); + a[3] = Integer.parseInt(hexString.substring(24, 32), 2); + return a; + } + + public static int[] binaryTints16(String hex) { + int[] a = new int[2]; + String hexString = change16(hex); + a[0] = Integer.parseInt(hexString.substring(0, 8), 2);//½«¶þ½øÖÆ×Ö·û´®×ªÎªÕûÐÎ + a[1] = Integer.parseInt(hexString.substring(8, 16), 2); + return a; + } + + public static int binaryTints8(String hex) { + int a; + String hexString = change8(hex); + a = Integer.parseInt(hexString.substring(0, 8), 2);//½«¶þ½øÖÆ×Ö·û´®×ªÎªÕûÐÎ + return a; + } + + public static int BytesToInt(int[] ss) { + if (ss != null) { + StringBuilder lString = new StringBuilder(); + for (int s : ss) { + lString.append(change8(printBits(s))); + } + return Integer.parseInt(lString.toString(), 2); + } else { + return 0; + } + } + + /** + * ½«×Ö·ûתΪÕûÐÎ + **/ + public static int showAscii(char x) { + return x; + } + + /** + * ½«ÕûÐÎתΪ×Ö·û + **/ + public static char showChar(int x) { + return (char) x; + } + + /** + * ÍÐÅÌÌõÂë½âÎö + **/ + public static String byteToStringTool(byte[] aaa) { + StringBuilder builder = new StringBuilder(); + for (byte b : aaa) { + String x = Character.toString(showChar(b)); + builder.append(x); + } + return builder.toString(); + } + + /** + * ½«ÕûÐÎתΪ¶þ½øÖÆ×Ö·û´® + */ + public static String printBits(int n) { + return Integer.toBinaryString(n); + } + + /** + * ½«ÕûÐÎתΪ¸¡µãÐÍ + */ + public static Float printFloat(int n) { + return Float.intBitsToFloat(n); + } + + /** + * ²»Âú8λ¼Ó¸ßλ¼Ó0 + **/ + public static String change8(String value) { + if (value != null && !value.equals("")) { + StringBuilder ss = new StringBuilder(value); + for (int i = 0; i < 8 - value.length(); i++) { + ss.insert(0, "0"); + } + return ss.toString(); + } else { + return "00000000"; + } + } + + /** + * ²»Âú32λ¼Ó¸ßλ¼Ó0 4¸ö×Ö½Ú + **/ + public static String change32(String value) { + if (value != null && !value.equals("")) { + StringBuilder ss = new StringBuilder(value); + for (int i = 0; i < 32 - value.length(); i++) { + ss.insert(0, "0"); + } + return ss.toString(); + } else { + return "00000000000000000000000000000000"; + } + } + + /** + * ²»Âú16λ¼Ó¸ßλ¼Ó0 4¸ö×Ö½Ú + **/ + public static String change16(String value) { + if (value != null && !value.equals("")) { + StringBuilder ss = new StringBuilder(value); + for (int i = 0; i < 16 - value.length(); i++) { + ss.insert(0, "0"); + } + return ss.toString(); + } else { + return "0000000000000000"; + } + } + + + ///×Ö½ÚתÕûÐÍ + public static int get(byte a1, byte a2, byte a3, byte a4, byte a5, byte a6, byte a7, byte a8, + byte a9, byte a10, byte a11, byte a12, byte a13, byte a14, byte a15, byte a16, + byte a17, byte a18, byte a19, byte a20, byte a21, byte a22, byte a23, byte a24, byte a25) { + int[] ints = new int[25]; + ints[0] = binaryTints8(printBits(a1)); + ints[1] = binaryTints8(printBits(a2)); + ints[2] = binaryTints8(printBits(a3)); + ints[3] = binaryTints8(printBits(a4)); + ints[4] = binaryTints8(printBits(a5)); + ints[5] = binaryTints8(printBits(a6)); + ints[6] = binaryTints8(printBits(a7)); + ints[7] = binaryTints8(printBits(a8)); + ints[8] = binaryTints8(printBits(a9)); + ints[9] = binaryTints8(printBits(a10)); + ints[10] = binaryTints8(printBits(a11)); + ints[11] = binaryTints8(printBits(a12)); + ints[12] = binaryTints8(printBits(a13)); + ints[13] = binaryTints8(printBits(a14)); + ints[14] = binaryTints8(printBits(a15)); + ints[15] = binaryTints8(printBits(a16)); + ints[16] = binaryTints8(printBits(a17)); + ints[17] = binaryTints8(printBits(a18)); + ints[18] = binaryTints8(printBits(a19)); + ints[19] = binaryTints8(printBits(a20)); + ints[20] = binaryTints8(printBits(a21)); + ints[21] = binaryTints8(printBits(a22)); + ints[22] = binaryTints8(printBits(a23)); + ints[23] = binaryTints8(printBits(a24)); + ints[24] = binaryTints8(printBits(a25)); + for (int anInt : ints) System.out.print(anInt + " "); + System.out.println(); + return BytesToInt(ints); + } + + /** + * ×Ö·û´®°²»ê»»³É FLOAT + * + * @param a String + * @return FLOAT + */ + public static float BEFloat(String a) { + byte[] b = SoftBasic.HexStringToBytes(a); + int pos = 0; + int i = 0; + // System.out.println("pos" + pos); + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("C " + i); + } + i |= Nodave.USByte(b, pos); + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Co " + i); + } + i <<= 8; + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Con " + i); + } + i |= Nodave.USByte(b, pos + 1); + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Conv " + i); + } + i <<= 8; + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Conve " + i); + } + i |= Nodave.USByte(b, pos + 2); + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Conver " + i); + } + i <<= 8; + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Convert " + i); + } + i |= Nodave.USByte(b, pos + 3); + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Converte " + i); + } + float f = Float.intBitsToFloat(i); + if ((Debug & DEBUG_CONVERSIONS) != 0) { + System.out.println("Converted " + f); + } + return (f); + } + + // + public static byte[] int2byte(int res) {///JavaÖÐ10½øÖÆ×ªbyte[] + byte[] targets = new byte[4]; + + targets[3] = (byte) (res & 0xff);// ×îµÍλ + targets[2] = (byte) ((res >> 8) & 0xff);// ´ÎµÍλ + targets[1] = (byte) ((res >> 16) & 0xff);// ´Î¸ßλ + targets[0] = (byte) (res >>> 24);// ×î¸ßλ,ÎÞ·ûºÅÓÒÒÆ¡£ + return targets; + } + + /** + * ¶à¸öbyte ºÏ²¢³ÉÒ»¸öbyte + */ + public static byte[] byteMerge(byte[]... values) { + int length_byte = 0; + for (byte[] value : values) { + length_byte += value.length; + } + byte[] all_byte = new byte[length_byte]; + int countLength = 0; + for (byte[] b : values) { + System.arraycopy(b, 0, all_byte, countLength, b.length); + countLength += b.length; + } + return all_byte; + } + + /** ???????????**/ + public static String bytetostringtool(byte[] aaa) { + String tptm = ""; + for(int i=0;i> 8 * i) & 0xff); + } + return b; + } + + /** + * Ï·¢µ½PLCµÄ·´À¡×Ö½Ú + */ + public static byte[] sendData(SendData... list) { + byte[][] values = new byte[list.length][0]; + for (int i = 0; i < list.length; i++) { + byte[] bytes = Tools.intToBytes(list[i].getNum2(), list[i].getNum()); + //System.out.println(bytes.length); + values[i] = bytes; + } + int length_byte = 0; + for (byte[] value : values) { + length_byte += value.length; + } + byte[] all_byte = new byte[length_byte]; + int countLength = 0; + for (byte[] b : values) { + System.arraycopy(b, 0, all_byte, countLength, b.length); + countLength += b.length; + } + return all_byte; + } + + //Ï·¢×Ö½ÚÊý×é + public static byte[] sendDataToDevice(long taskNo,String trayCode, int...ints){ + int length = 0; + byte[] xfData = null; + if (trayCode == null){ + length = 4 + (ints.length * 2); + xfData = new byte[length]; + byte[] RWH = new byte[4]; + RWH = Tools.int2byte((int) taskNo); + for (int i = 0; i < length; i++){ + if (i < 4){ + xfData[i] = RWH[i]; + } else { + if (i % 2 == 0){ + byte[] param = new byte[2]; + param = intbyte(ints[(i - 4) / 2]); + xfData[i] = param[0]; + xfData[i + 1] = param[1]; + } + } + } + } else { + length = 12 + (ints.length * 2); + xfData = new byte[length]; + byte[] RWH = new byte[4]; + RWH = Tools.int2byte((int) taskNo); + byte[] tCode = new byte[8]; + if ("".equals(trayCode)){ + for (int i = 0;i < tCode.length;i++){ + tCode[i] = 0; + } + }else { + byte[] code = trayCode.getBytes(); + for (int i = 0; i < tCode.length; i++) { + tCode[i] = code[i]; + } + } + for (int i = 0; i< length; i++){ + if (i < 4){ + xfData[i] = RWH[i]; + } else if (i > 3 && i< 12) { + xfData[i] = tCode[i - 4]; + } else { + if (i % 2 == 0){ + byte[] param = new byte[2]; + param = intbyte(ints[(i - 12) / 2]); + xfData[i] = param[0]; + xfData[i + 1] = param[1]; + } + } + } + } + return xfData; + } + + /** + * ×Ö½ÚÊý×éת×Ö·û´¬ + */ + public static String byteToString(String substring) { + return new String(SoftBasic.HexStringToBytes(substring), StandardCharsets.UTF_8); + } + + /** + * µ÷Óô洢¹ý³Ì·â×° + */ + public static int storedProcedure(EntityDAO m_dao, String name, Integer out, StoredParameters... storedParameters) throws SQLException { + Connection conn = null; + int back = 0; + try { + conn = m_dao.getConnection(); + CallableStatement cs = conn.prepareCall(name); + for (StoredParameters sendDatum : storedParameters) { + cs.setString(sendDatum.getNum(), sendDatum.getParameter()); + } + cs.registerOutParameter(out, java.sql.Types.INTEGER); + cs.execute(); + back = cs.getInt(out); + } catch (Exception e) { + e.printStackTrace(); + Logger.info(name + "-failed execution of stored procedure:" + e.getMessage()); + } finally { + if (conn != null) { + conn.close(); + } + } + Logger.info(name + "-Successful execution of stored procedure"); + return back; + } + + public static ProcedureResult storedProcedureMsg(EntityDAO m_dao, String name, Integer result, Integer resultMsg, StoredParameters... storedParameters){ + Connection conn = null; + int back = 0; + String msg = "³õʼ"; + try { + conn = m_dao.getConnection(); + CallableStatement cs = conn.prepareCall(name); + for (StoredParameters sendDatum : storedParameters) { + cs.setString(sendDatum.getNum(), sendDatum.getParameter()); + } + cs.registerOutParameter(result, Types.INTEGER); + cs.registerOutParameter(resultMsg, Types.VARCHAR); + cs.execute(); + back = cs.getInt(result); + msg = cs.getString(resultMsg); + } catch (Exception e) { + e.printStackTrace(); + Logger.info(name + "-failed execution of stored procedure:" + e.getMessage()); + } finally { + if (conn != null) { + try { + conn.close(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + } + //Logger.info(name + "-Successful execution of stored procedure,return ¡¾"+back+"¡¿"); + + + return ProcedureResult.result(back,msg); + } + + public static String getDate() { + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return df.format(t); + } + + //int ת2×Ö½Ú + public static byte[] intbyte(int res) {///JavaÖÐ10½øÖÆ×ªbyte[] + byte[] targets = new byte[2]; + targets[1] = (byte) ((res >> 0) & 0xff);// ´Î¸ßλ + targets[0] = (byte) (res >>> 8);// ×î¸ßλ,ÎÞ·ûºÅÓÒÒÆ¡£ + return targets; + } + + public static int[] binarysToints(String hex){ + int[] a = new int[4]; + String hexString = change32(hex); + a[0] = Integer.parseInt(hexString.substring(0,8),2);//½«¶þ½øÖÆ×Ö·û´®×ªÎªÕûÐÎ + a[1] = Integer.parseInt(hexString.substring(8,16),2); + a[2] = Integer.parseInt(hexString.substring(16,24),2); + a[3] = Integer.parseInt(hexString.substring(24,32),2); + return a; + } +} diff --git a/src/com/wms/dss/ats/customs/abb/utils/UtilId.java b/src/com/wms/dss/ats/customs/abb/utils/UtilId.java new file mode 100644 index 0000000..2136730 --- /dev/null +++ b/src/com/wms/dss/ats/customs/abb/utils/UtilId.java @@ -0,0 +1,13 @@ +package com.wms.dss.ats.customs.abb.utils; + +import java.util.UUID; + +public class UtilId { + + public static String uuids(){ + UUID uuid = UUID.randomUUID();//ç›� + String a=uuid.toString().replace("-", "").toUpperCase(); + return a; + } + +} diff --git a/src/log4j.properties b/src/log4j.properties new file mode 100644 index 0000000..ecb2bae --- /dev/null +++ b/src/log4j.properties @@ -0,0 +1,41 @@ +# Configure logging for testing +# 日志输出级别为INFO,debug1 */ + /* This code seems to be specific to 200 family. */ + + public final static int RESULT_ITEM_NOT_AVAILABLE = 10; + /* means a a piece of data is not available in the CPU, e.g. */ + /* when trying to read a non existing DB */ + + public final static int RESULT_ADDRESS_OUT_OF_RANGE = 5; + /* means the data address is beyond the CPUs address range */ + public final static int RESULT_WRITE_DATA_SIZE_MISMATCH = 7; + /* means the write data size doesn't fit item size */ + public final static int RESULT_CANNOT_EVALUATE_PDU = -123; + public final static int RESULT_CPU_RETURNED_NO_DATA = -124; + + public final static int RESULT_UNKNOWN_ERROR = -125; + public final static int RESULT_EMPTY_RESULT_ERROR = -126; + public final static int RESULT_EMPTY_RESULT_SET_ERROR = -127; + public final static int RESULT_UNEXPECTED_FUNC = -128; + public final static int RESULT_UNKNOWN_DATA_UNIT_SIZE = -129; + + public final static int RESULT_SHORT_PACKET = -1024; + public final static int RESULT_TIMEOUT = -1025; + + public static byte[] toPLCfloat(float f) { + int i = Float.floatToIntBits(f); + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("i: " + i); + return bswap_32(i); + } + + public static byte[] toPLCfloat(double d) { + float f = (float) d; + return toPLCfloat(f); + } + + public static byte[] bswap_32(int a) { + byte[] b = new byte[4]; + b[3] = (byte) (a & 0xff); + a = a >> 8; + b[2] = (byte) (a & 0xff); + a = a >> 8; + b[1] = (byte) (a & 0xff); + a = a >> 8; + b[0] = (byte) (a & 0xff); + if ((Debug & DEBUG_CONVERSIONS) != 0) + dump("In: " + a + " out:", b, 0, 4); + return b; + } + + public static byte[] bswap_32(long a) { + byte[] b = new byte[4]; + b[3] = (byte) (a & 0xff); + a = a >> 8; + b[2] = (byte) (a & 0xff); + a = a >> 8; + b[1] = (byte) (a & 0xff); + a = a >> 8; + b[0] = (byte) (a & 0xff); + if ((Debug & DEBUG_CONVERSIONS) != 0) + dump("In: " + a + " out:", b, 0, 4); + return b; + } + + public static byte[] bswap_64(int a) { + byte[] b = new byte[8]; + b[7] = (byte) (a & 0xff); + a = a >> 8; + b[6] = (byte) (a & 0xff); + a = a >> 8; + b[5] = (byte) (a & 0xff); + a = a >> 8; + b[4] = (byte) (a & 0xff); + a = a >> 8; + b[3] = (byte) (a & 0xff); + a = a >> 8; + b[2] = (byte) (a & 0xff); + a = a >> 8; + b[1] = (byte) (a & 0xff); + a = a >> 8; + b[0] = (byte) (a & 0xff); + + if ((Debug & DEBUG_CONVERSIONS) != 0) + dump("In: " + a + " out:", b, 0, 8); + return b; + } + + public static byte[] bswap_64(long a) { + byte[] b = new byte[8]; + // b[7] = (byte) (a & 0xff); + // a = a >> 8; + // b[6] = (byte) (a & 0xff); + // a = a >> 8; + // b[5] = (byte) (a & 0xff); + // a = a >> 8; + // b[4] = (byte) (a & 0xff); + // a = a >> 8; + // b[3] = (byte) (a & 0xff); + // a = a >> 8; + // b[2] = (byte) (a & 0xff); + // a = a >> 8; + // b[1] = (byte) (a & 0xff); + // a = a >> 8; + // b[0] = (byte) (a & 0xff); + + b[0] = (byte) (a & 0xff); + a = a >> 8; + b[1] = (byte) (a & 0xff); + a = a >> 8; + b[2] = (byte) (a & 0xff); + a = a >> 8; + b[3] = (byte) (a & 0xff); + a = a >> 8; + b[4] = (byte) (a & 0xff); + a = a >> 8; + b[5] = (byte) (a & 0xff); + a = a >> 8; + b[6] = (byte) (a & 0xff); + a = a >> 8; + b[7] = (byte) (a & 0xff); + + if ((Debug & DEBUG_CONVERSIONS) != 0) + dump("In: " + a + " out:", b, 0, 8); + return b; + } + + public static byte[] bswap_16(int a) { + byte[] b = new byte[2]; + b[1] = (byte) (a & 0xff); + a = a >> 8; + b[0] = (byte) (a & 0xff); + if ((Debug & DEBUG_CONVERSIONS) != 0) + dump("In: " + a + " out:", b, 0, 2); + return b; + } + + /** + * This doesn't swap anything, but the name fits into the series + * + * @param a + * @return + */ + public static byte[] bswap_8(int a) { + byte[] b = new byte[1]; + b[0] = (byte) (a & 0xff); + return b; + } + + /** + * Dumps len hex codes from byte array mem beginning at index start. + * + * @param text: + * a text to print before the list + * @return + */ + public static void dump(String text, byte[] mem, int start, int len) { + System.out.print(text + " "); + for (int i = start; i < start + len; i++) { + int j = mem[i]; + if (j < 0) + j += 256; + String s = Integer.toHexString(j); + if (s.length() < 2) + s = "0" + s; + System.out.print(s + ","); + } + System.out.println(" "); + } + + public static long USBELong(byte[] b, int pos) { + int i = b[pos]; + int j = b[pos + 1]; + int k = b[pos + 2]; + int l = b[pos + 3]; + // System.out.println( + // pos + " 0:" + i + " 1:" + j + " 2:" + k + " 3:" + l); + if (i < 0) + i += 256; + if (j < 0) + j += 256; + if (k < 0) + k += 256; + if (l < 0) + l += 256; + return (256 * k + l) + 65536L * (256 * i + j); + } + + public static long SBELong(byte[] b, int pos) { + int i = b[pos]; + int j = b[pos + 1]; + int k = b[pos + 2]; + int l = b[pos + 3]; + // if (i < 0) + // i += 256; + if (j < 0) + j += 256; + if (k < 0) + k += 256; + if (l < 0) + l += 256; + return (256 * k + l) + 65536L * (256 * i + j); + } + + /////////////////////////////////////////////// + public static StringBuffer SBEString(byte[] b, int pos) { + StringBuffer sbu = new StringBuffer(); + sbu.append((char) b[pos]); + sbu.append((char) b[pos + 1]); + sbu.append((char) b[pos + 2]); + sbu.append((char) b[pos + 3]); + sbu.append((char) b[pos + 4]); + sbu.append((char) b[pos + 5]); + sbu.append((char) b[pos + 6]); + sbu.append((char) b[pos + 7]); + + return sbu; + } + + /** + * ½«b[pos]¼°b[pos + 1] »»Ëã³É10½øÖÆÖµ + * + * @param b + * @param pos + * @return + */ + public static int USBEWord(byte[] b, int pos) { + int i = b[pos]; + int k = b[pos + 1]; + if (i < 0) + i += 256; + if (k < 0) + k += 256; + return (256 * i + k); + } + + /** + * ½«valֵת»»³É×Ö½Úb[pos]¼°b[pos + 1] + * + * @param b + * @param pos + * @param val + */ + public static void setUSBEWord(byte[] b, int pos, int val) { + b[pos] = ((byte) (val / 0x100)); + b[pos + 1] = ((byte) (val % 0x100)); + } + + /** + * ½«valֵת»»³ÉÒ»¸ö×Ö½Ú + * + * @param b + * @param pos + * @param val + */ + public static void setUSByte(byte[] b, int pos, int val) { + b[pos] = ((byte) (val & 0xff)); + } + + /** + * ½«³¤ÕûÐÎaת»»³É4¸ö×Ö½Ú + * + * @param b + * @param pos + * @param a + */ + public static void setUSBELong(byte[] b, int pos, long a) { + b[pos + 3] = (byte) (a & 0xff); + a = a >> 8; + b[pos + 2] = (byte) (a & 0xff); + a = a >> 8; + b[pos + 1] = (byte) (a & 0xff); + a = a >> 8; + b[pos] = (byte) (a & 0xff); + } + + /** + * + * @param b + * @param pos + * @param f + */ + public static void setBEFloat(byte[] b, int pos, float f) { + /* + * ÁíÍâÐèÒªÖªµÀµÄÊÇ£¬floatÀàÐÍÕ¼ÓÃ4¸ö×Ö½Ú£¬´Ó×îµÍ루×îÓұߣ©µ½×î¸ß루×î×ó±ß£©µÄ±àºÅÊÇ´Ó0-31¡£ÕâÑùµÄ»°£¬ÉÏÃæµÄ½âÊ;ÍÈÝÒ׿´¶®ÁË¡£ + * Ò²¾ÍÊÇ˵£¬×ª»»³ÉµÄ32¸ö0¡¢1×Ö·û´®ÖУ¬31ºÅ±íʾ·ûºÅ£¬30-23±íʾָÊý£¬22-0±íʾβÊý¡£ °´ÕÕIEEE + * 754±ê×¼£¬32λ¸¡µãÊýÔÚ¼ÆËã»úÖжþ½øÖÆ´æ´¢ÐÎʽ¹²Èý²¿·Ö£ºS(1룬·ûºÅ) E(8룬½×Âë) M(23λ£¬Î²Êý) + * ¸øÄã¾Ù¸öÀý×Ó°É£¬Float.floatToIntBits(20.5f)°´ÕÕÈçÏ·½Ê½¼ÆË㣺 + * 20.59D=10100.1B=1.01001*2^4B Ö¸Êýe=4 S=0-->ÕýÊý + * E=4+127=131D=10000011B-->ÕæÊµÖ¸Êýe±ä³É½×ÂëEʱÐè¼Ó127 M=01001B Ôò32λ2½øÖÆ´æ´¢ÐÎʽΪ£º0 + * 10000011 01001000000000000000000 ת»»³É10½øÖƼ´1101266944 + */ + int a = Float.floatToIntBits(f); + b[pos + 3] = (byte) (a & 0xff); + a = a >> 8; + b[pos + 2] = (byte) (a & 0xff); + a = a >> 8; + b[pos + 1] = (byte) (a & 0xff); + a = a >> 8; + b[pos] = (byte) (a & 0xff); + } + + public static int SBEWord(byte[] b, int pos) { + int i = b[pos]; + int k = b[pos + 1]; + // if (i < 0) + // i += 256; + if (k < 0) + k += 256; + return (256 * i + k); + } + + public static int USByte(byte[] b, int pos) { + int i = b[pos]; + if (i < 0) + i += 256; + return (i); + } + + public static int SByte(byte[] b, int pos) { + int i = b[pos]; + return (i); + } + + public static float BEFloat(byte[] b, int pos) { + int i = 0; + // System.out.println("pos" + pos); + + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("C " + i); + i |= Nodave.USByte(b, pos); + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Co " + i); + i <<= 8; + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Con " + i); + i |= Nodave.USByte(b, pos + 1); + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Conv " + i); + i <<= 8; + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Conve " + i); + i |= Nodave.USByte(b, pos + 2); + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Conver " + i); + i <<= 8; + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Convert " + i); + i |= Nodave.USByte(b, pos + 3); + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Converte " + i); + float f = Float.intBitsToFloat(i); + if ((Debug & DEBUG_CONVERSIONS) != 0) + System.out.println("Converted " + f); + return (f); + } + + public static String areaName(int area) { + switch (area) { + case DB: + return "DB"; + case INPUTS: + return "E"; + case OUTPUTS: + return "A"; + case FLAGS: + return "M"; + default: + return "unknown area!"; + } + } + + public static String strerror(int code) { + switch (code) { + case RESULT_OK: + return "ok"; + case RESULT_MULTIPLE_BITS_NOT_SUPPORTED: + return "the CPU does not support reading a bit block of length<>1"; + case RESULT_ITEM_NOT_AVAILABLE: + return "the desired item is not available in the PLC"; + case RESULT_ITEM_NOT_AVAILABLE200: + return "the desired item is not available in the PLC (200 family)"; + case RESULT_ADDRESS_OUT_OF_RANGE: + return "the desired address is beyond limit for this PLC"; + case RESULT_CPU_RETURNED_NO_DATA: + return "the PLC returned a packet with no result data"; + case Nodave.RESULT_UNKNOWN_ERROR: + return "the PLC returned an error code not understood by this library"; + case Nodave.RESULT_EMPTY_RESULT_ERROR: + return "this result contains no data"; + case Nodave.RESULT_EMPTY_RESULT_SET_ERROR: + return "cannot work with an undefined result set"; + case Nodave.RESULT_CANNOT_EVALUATE_PDU: + return "cannot evaluate the received PDU"; + case Nodave.RESULT_WRITE_DATA_SIZE_MISMATCH: + return "Write data size error"; + case Nodave.RESULT_NO_PERIPHERAL_AT_ADDRESS: + return "No data from I/O module"; + case Nodave.RESULT_UNEXPECTED_FUNC: + return "Unexpected function code in answer"; + case Nodave.RESULT_UNKNOWN_DATA_UNIT_SIZE: + return "PLC responds wit an unknown data type"; + case Nodave.RESULT_SHORT_PACKET: + return "Short packet from PLC"; + case Nodave.RESULT_TIMEOUT: + return "Timeout when waiting for PLC response"; + case 0x8000: + return "function already occupied."; + case 0x8001: + return "not allowed in current operating status."; + case 0x8101: + return "hardware fault."; + case 0x8103: + return "object access not allowed."; + case 0x8104: + return "context is not supported."; + case 0x8105: + return "invalid address."; + case 0x8106: + return "data type not supported."; + case 0x8107: + return "data type not consistent."; + case 0x810A: + return "object does not exist."; + case 0x8500: + return "incorrect PDU size."; + case 0x8702: + return "address invalid."; + case 0xd201: + return "block name syntax error."; + case 0xd202: + return "syntax error function parameter."; + case 0xd203: + return "syntax error block type."; + case 0xd204: + return "no linked block in storage medium."; + case 0xd205: + return "object already exists."; + case 0xd206: + return "object already exists."; + case 0xd207: + return "block exists in EPROM."; + case 0xd209: + return "block does not exist."; + case 0xd20e: + return "no block does not exist."; + case 0xd210: + return "block number too big."; + case 0xd240: + return "unfinished block transfer in progress?"; + case 0xd241: + return "protected by password."; + default: + return "no message defined for code: " + code + "!"; + } + } + + ///×Ö·û´® ת»» + public static StringBuffer SBEString30(byte[] b, int pos) { + StringBuffer sbu = new StringBuffer(); + sbu.append((char) b[pos]); + sbu.append((char) b[pos + 1]); + sbu.append((char) b[pos + 2]); + sbu.append((char) b[pos + 3]); + sbu.append((char) b[pos + 4]); + sbu.append((char) b[pos + 5]); + sbu.append((char) b[pos + 6]); + sbu.append((char) b[pos + 7]); + sbu.append((char) b[pos + 8]); + sbu.append((char) b[pos + 9]); + sbu.append((char) b[pos + 10]); + sbu.append((char) b[pos + 11]); + sbu.append((char) b[pos + 12]); + sbu.append((char) b[pos + 13]); + sbu.append((char) b[pos + 14]); + sbu.append((char) b[pos + 15]); + sbu.append((char) b[pos + 16]); + sbu.append((char) b[pos + 17]); + sbu.append((char) b[pos + 18]); + sbu.append((char) b[pos + 19]); + sbu.append((char) b[pos + 20]); + + + + return sbu; + } + +} \ No newline at end of file diff --git a/src/org/libnodave/PDU.java b/src/org/libnodave/PDU.java new file mode 100644 index 0000000..0a689e3 --- /dev/null +++ b/src/org/libnodave/PDU.java @@ -0,0 +1,520 @@ +/* + Part of Libnodave, a free communication libray for Siemens S7 300/400 via + the MPI adapter 6ES7 972-0CA22-0XAC + or MPI adapter 6ES7 972-0CA33-0XAC + or MPI adapter 6ES7 972-0CA11-0XAC. + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002. + + Libnodave is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + Libnodave is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.libnodave; +public class PDU { + /* + typedef struct { + uc P; // allways 0x32 + uc type; // a type? type 2 and 3 headers are two bytes longer. + uc a,b; // currently unknown + us number; // Number, can be used to identify answers corresponding to requests + us plen; // length of parameters which follow this header + us dlen; // length of data which follows the parameters + uc x[2]; // only present in type 2 and 3 headers. This may contain error information. + } PDUHeader; + */ + /** + * return the number of the PDU + */ + public int getNumber() { + return Nodave.USBEWord(mem, header + 4); + } + /** + * set the number of the PDU + */ + public void setNumber(int n) { + Nodave.setUSBEWord(mem, header + 4, n); + } + /** + * return the function code of the PDU + */ + public int getFunc() { + return Nodave.USByte(mem, param + 0); + } + /** + * known function codes + */ + public final static byte FUNC_READ = 4; + public final static byte FUNC_WRITE = 5; + + int header; // the position of the header; + public int param; // ²ÎÊýλÖÃ; + byte[] mem;//±¨ÎÄÊý×é + int hlen;//Õû¸ö±¨Îij¤¶È ¼õÈ¥ £¨±¨ÎÄÍ·+²ÎÊý³¤¶È£© µÄ½á¹ûÖµ + public int plen;//²ÎÊý³¤¶È + int dlen;//ÓÃÀ´¶¨ÒåÆäËû³¤¶ÈÖµ + public int udlen;//DB¿éÊý¾Ý³¤¶È + public int data;//±¨ÎÄʵ¼Ê³¤¶È + public int udata;//¶ÁDB¿éÊý¾ÝλÖà + /** + * set up the PDU information + */ + public PDU(byte[] mem, int pos) { + this.mem = mem; + this.header = pos; + } + + public int addVarToReadRequest(int area, int DBnum, int start, int len) { + byte[] pa = { 0x12, 0x0a, 0x10, 0x02, 0x00, 0x1A, + // insert length in bytes here + 0x00, 0x0B, // insert DB number here + (byte) 0x84, // change this to real area code + 0x00, 0x00, (byte) 0xC0 // insert start address in bits + }; + + if ((area == Nodave.ANALOGINPUTS200) + || (area == Nodave.ANALOGOUTPUTS200)) { + pa[3] = 4; + start *= 8; /* bits */ + } else if ( + (area == Nodave.TIMER) + || (area == Nodave.COUNTER) + || (area == Nodave.TIMER200) + || (area == Nodave.COUNTER200)) { + pa[3] = (byte) area; + } else { + start *= 8; /* bits */ + } + + Nodave.setUSBEWord(pa, 4, len); + Nodave.setUSBEWord(pa, 6, DBnum); + Nodave.setUSBELong(pa, 8, start); + Nodave.setUSByte(pa, 8, area); + + mem[param + 1]++; + System.arraycopy(pa, 0, mem, param + plen, pa.length); + plen += pa.length; + Nodave.setUSBEWord(mem, header + 6, plen); + /** + * TODO calc length of result. Do not add variable if it would exceed max. result length. + */ + return 0; + } + + public int addBitVarToReadRequest( + int area, + int DBnum, + int start, + int len) { + byte pa[] = { 0x12, 0x0a, 0x10, 0x01, /* single bits */ + 0x00, 0x1A, /* insert length in bytes here */ + 0x00, 0x0B, /* insert DB number here */ + (byte) 0x84, /* change this to real area code */ + 0x00, 0x00, (byte) 0xC0 /* insert start address in bits */ + }; + Nodave.setUSBEWord(pa, 4, len); + Nodave.setUSBEWord(pa, 6, DBnum); + Nodave.setUSBELong(pa, 8, start); + Nodave.setUSByte(pa, 8, area); + + mem[param + 1]++; + System.arraycopy(pa, 0, mem, param + plen, pa.length); + plen += pa.length; + Nodave.setUSBEWord(mem, header + 6, plen); + return 0; + + } + + /** + * prepare a read request with no item. + */ + public void prepareReadRequest() { + byte pa[] = new byte[2]; + pa[0] = PDU.FUNC_READ; + pa[1] = (byte) 0x00; + initHeader(1); + addParam(pa); + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + } + + /** + * prepare a write request with no item. + */ + public void prepareWriteRequest() { + byte pa[] = new byte[2]; + pa[0] = PDU.FUNC_WRITE; + pa[1] = (byte) 0x00; + initHeader(1); + addParam(pa); + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + } + + /** + * construct a write request for a single item in PLC memory. + */ +/* + void constructWriteRequest( + int area, + int DBnum, + int start, + int len, + byte[] buffer) { + byte pa[] = new byte[14]; + byte da[] = { 0, 4, 0, 0 }; + pa[0] = PDU.FUNC_WRITE; + pa[1] = (byte) 0x01; + pa[2] = (byte) 0x12; + pa[3] = (byte) 0x0a; + pa[4] = (byte) 0x10; + pa[5] = (byte) 0x02; + + Nodave.setUSBEWord(pa, 6, len); + Nodave.setUSBEWord(pa, 8, DBnum); + Nodave.setUSBELong(pa, 10, 8 * start); // the bit address + Nodave.setUSByte(pa, 10, area); + initHeader(1); + addParam(pa); + addData(da); + addValue(buffer); + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + } +*/ + /** + * display information about a PDU + */ + public void dump() { + Nodave.dump("PDU header ", mem, header, hlen); + System.out.println("plen: " + plen + " dlen: " + dlen); + Nodave.dump("Parameter", mem, param, plen); + if (dlen > 0) + Nodave.dump("Data ", mem, data, dlen); + if (udlen > 0) + Nodave.dump("result Data ", mem, udata, udlen); + } + /** + * reserve space for the header of a new PDU + */ + public void initHeader(int type) { + if (type == 2 || type == 3) + hlen = 12; + else + hlen = 10; + for (int i = 0; i < hlen; i++) { + mem[header + i] = 0; + } + param = header + hlen; + mem[header] = (byte) 0x32; + mem[header + 1] = (byte) type; + dlen = 0; + plen = 0; + udlen = 0; + data = 0; + udata = 0; + } + + public void addParam(byte[] pa) { + plen = pa.length; + System.arraycopy(pa, 0, mem, param, plen); + Nodave.setUSBEWord(mem, header + 6, plen);//¶¨Òå×Ö·ûÊý×émemÖеĵÚheader+6¼°header+7 Õâ¸öÓÃÀ´´æ·ÅplenµÄ³¤¶ÈÖµ + // mem[header + 6] = (byte) (pa.length / 256); + // mem[header + 7] = (byte) (pa.length % 256); + data = param + plen; + dlen = 0; + } + /** + Add data after parameters, set dlen as needed. + Needs valid header and parameters + */ + void addData(byte[] newData) { + int appPos = data + dlen; //append to this position + dlen += newData.length; + System.arraycopy(newData, 0, mem, appPos, newData.length); + Nodave.setUSBEWord(mem, header + 8, dlen); + } + /** + Add len bytes of len after parameters from a maybe longer block of bytes. + Set dlen as needed. + Needs valid header and parameters + */ + public void addData(byte[] newData, int len) { + int appPos = data + dlen; //append to this position + dlen += len; + System.arraycopy(newData, 0, mem, appPos, len); + Nodave.setUSBEWord(mem, header + 8, dlen); + } + /** + Add values after value header in data, adjust dlen and data count. + Needs valid header,parameters,data,dlen + */ + void addValue(byte[] values) { + int valCount = 0x100 * mem[data + 2] + mem[data + 3]; + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) + System.out.println("valCount: " + valCount); + if (mem[data + 1] == 4) { // bit data, length is in bits + valCount += 8 * values.length; + } else if (mem[data + 1] == 9) { // byte data, length is in bytes + valCount += values.length; + } else { + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) + System.out.println( + "unknown data type/length: " + mem[data + 1]); + } + if (udata == 0) + udata = data + 4; + udlen += values.length; + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) + System.out.println("valCount: " + valCount); + Nodave.setUSBEWord(mem, data + 2, valCount); + addData(values); + } + + int error; + + public int getError() { + return error; + } + /** + Setup a PDU instance to reflect the structure of data present in + the memory area given to initHeader. + Needs valid header. + */ + + public int setupReceivedPDU() { + int res = Nodave.RESULT_CANNOT_EVALUATE_PDU; // just assume the worst + if (mem[header + 1] == 2 || mem[header + 1] == 3) { + hlen = 12; + res = Nodave.USBEWord(mem, header + 10); + } else { + error = 0; + hlen = 10; + res = 0; + } + param = header + hlen; + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) + Nodave.dump("PDU header", mem, header, hlen); + plen = Nodave.USBEWord(mem, header + 6); + data = param + plen; + dlen = Nodave.USBEWord(mem, header + 8); + udlen = 0; + udata = 0; + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) + dump(); + return res; + } + + /* + + */ + int testResultData() { + int res = Nodave.RESULT_CANNOT_EVALUATE_PDU; // just assume the worst + if ((mem[data] == (byte)255) && (dlen > 4)) { + res = Nodave.RESULT_OK; + udata = data + 4; + // udlen=data[2]*0x100+data[3]; + udlen = Nodave.USBEWord(mem, data + 2); + if (mem[data + 1] == 4) { + udlen >>= 3; /* len is in bits, adjust */ + } else if (mem[data + 1] == 9) { + /* len is already in bytes, ok */ + } else if (mem[data + 1] == 3) { + /* len is in bits, but there is a byte per result bit, ok */ + } else { + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) + System.out.println( + "fixme: what to do with data type " + mem[data + 1]); + res = Nodave.RESULT_UNKNOWN_DATA_UNIT_SIZE; + } + } else { + res = mem[data]; + } + return res; + } + + int testReadResult() { + if (mem[param] != FUNC_READ) + return Nodave.RESULT_UNEXPECTED_FUNC; + return testResultData(); + } + + public int testPGReadResult() { + if (mem[param] != 0) + return Nodave.RESULT_UNEXPECTED_FUNC; + return testResultData(); + } + + int testWriteResult() { + int res = Nodave.RESULT_CANNOT_EVALUATE_PDU; + if (mem[param] != FUNC_WRITE) + return Nodave.RESULT_UNEXPECTED_FUNC; + if ((mem[data] == 255)) { + res = Nodave.RESULT_OK; + } else + res = mem[data]; + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + return res; + } + + /* + add data in user data. Add a user data header, if not yet present. + */ + public void addUserData(byte[] da) { + byte udh[] = {(byte) 0xff, 9, 0, 0 }; + if (dlen == 0) { + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) + System.out.println("adding user data header."); + addData(udh); + } + addValue(da); + }; + + public void initReadRequest() { + byte pa[] = new byte[2]; + pa[0] = PDU.FUNC_READ; + pa[1] = (byte) 0x00; + initHeader(1); + addParam(pa); + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + } + + public void addVarToWriteRequest( + int area, + int DBnum, + int start, + int byteCount, + byte[] buffer) { + byte da[] = { 0, 4, 0, 0, }; + byte pa[] = { 0x12, 0x0a, 0x10, 0x02, + /* unit (for count?, for consistency?) byte */ + 0, 0, /* length in bytes */ + 0, 0, /* DB number */ + 0, /* area code */ + 0, 0, 0 /* start address in bits */ + }; + if ((area == Nodave.TIMER) + || (area == Nodave.COUNTER) + || (area == Nodave.TIMER200) + || (area == Nodave.COUNTER200)) { + pa[3] = (byte) area; + pa[4] = (byte) (((byteCount + 1) / 2) / 0x100); + pa[5] = (byte) (((byteCount + 1) / 2) & 0xff); + } else if ( + (area == Nodave.ANALOGINPUTS200) + || (area == Nodave.ANALOGOUTPUTS200)) { + pa[3] = 4; + pa[4] = (byte) (((byteCount + 1) / 2) / 0x100); + pa[5] = (byte) (((byteCount + 1) / 2) & 0xff); + } else { + pa[4] = (byte) (byteCount / 0x100); + pa[5] = (byte) (byteCount & 0xff); + } + pa[6] = (byte) (DBnum / 256); + pa[7] = (byte) (DBnum & 0xff); + pa[8] = (byte) (area); + start *= 8; /* number of bits */ + pa[11] = (byte) (start & 0xff); + pa[10] = (byte) ((start / 0x100) & 0xff); + pa[9] = (byte) (start / 0x10000); + if ((dlen % 2) != 0) { + addData(da, 1); + } + mem[param + 1]++; + if (dlen > 0) { + byte[] saveData = new byte[dlen]; + System.arraycopy(mem, data, saveData, 0, dlen); + System.arraycopy(saveData, 0, mem, data + pa.length, dlen); + } + System.arraycopy(pa, 0, mem, param + plen, pa.length); + plen += pa.length; + Nodave.setUSBEWord(mem, header + 6, plen); + data = param + plen; + addData(da); + addValue(buffer); + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + } + + public void addBitVarToWriteRequest( + int area, + int DBnum, + int start, + int byteCount, + byte[] buffer) { + byte da[] = { 0, 3, 0, 0, }; + byte pa[] = { 0x12, 0x0a, 0x10, 0x01, /* single bit */ + 0, 0, /* insert length in bytes here */ + 0, 0, /* insert DB number here */ + 0, /* change this to real area code */ + 0, 0, 0 /* insert start address in bits */ + }; + if ((area == Nodave.TIMER) + || (area == Nodave.COUNTER) + || (area == Nodave.TIMER200) + || (area == Nodave.COUNTER200)) { + pa[3] = (byte) area; + pa[4] = (byte) (((byteCount + 1) / 2) / 0x100); + pa[5] = (byte) (((byteCount + 1) / 2) & 0xff); + } else if ( + (area == Nodave.ANALOGINPUTS200) + || (area == Nodave.ANALOGOUTPUTS200)) { + pa[3] = 4; + pa[4] = (byte) (((byteCount + 1) / 2) / 0x100); + pa[5] = (byte) (((byteCount + 1) / 2) & 0xff); + } else { + pa[4] = (byte) (byteCount / 0x100); + pa[5] = (byte) (byteCount & 0xff); + } + pa[6] = (byte) (DBnum / 256); + pa[7] = (byte) (DBnum & 0xff); + pa[8] = (byte) area; + pa[11] = (byte) (start & 0xff); + pa[10] = (byte) ((start / 0x100) & 0xff); + pa[9] = (byte) (start / 0x10000); + + if ((dlen % 2) != 0) { + addData(da, 1); + } + + mem[param + 1]++; + if (dlen > 0) { + byte[] saveData = new byte[dlen]; + System.arraycopy(mem, data, saveData, 0, dlen); + System.arraycopy(saveData, 0, mem, data + pa.length, dlen); + } + System.arraycopy(pa, 0, mem, param + plen, pa.length); + plen += pa.length; + Nodave.setUSBEWord(mem, header + 6, plen); + data = param + plen; + + addData(da); + addValue(buffer); + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + dump(); + } + } + +} diff --git a/src/org/libnodave/PLCinterface.java b/src/org/libnodave/PLCinterface.java new file mode 100644 index 0000000..3f5446c --- /dev/null +++ b/src/org/libnodave/PLCinterface.java @@ -0,0 +1,108 @@ +package org.libnodave; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +public class PLCinterface { + int localMPI; // the adapter's MPI address + String name; + int timeout; // Timeout in milliseconds used in transort. + int protocol; // The kind of transport used on this interface. + OutputStream out; + InputStream in; + public boolean isConnect=false; + int wp, rp; + + public PLCinterface( + OutputStream out, + InputStream in, + String name, + int localMPI, + int protocol) { + init(out, in, name, localMPI, protocol); + } + + public PLCinterface() { + } + + public void init( + OutputStream oStream, + InputStream iStream, + String name, + int localMPI, + int protocol) { + this.out = oStream; + this.in = iStream; + this.name = name; + this.localMPI = localMPI; + this.protocol = protocol; + timeout=50000;//timeout/100ºÁÃë + switch (protocol) { + case Nodave.PROTOCOL_ISOTCP:timeout=50000; break; + case Nodave.PROTOCOL_ISOTCP243:timeout=50000; break; + } + } + + public void write(byte[] b, int start, int len) { + if ((Nodave.Debug & Nodave.DEBUG_IFACE) != 0) + Nodave.dump("Interface.write", b, start, len); + try { + out.write(b, start, len); + } catch (IOException e) { + isConnect = false; + System.err.println("Interface.write: " + e); + } + } + public int read(byte[] b, int start, int len) { + int res; + int ilen = len; + if ((Nodave.Debug & Nodave.DEBUG_IFACE) != 0) + System.out.println("Interface.read"); + try { + int retry = 0; + while ((in.available() <= 0) && (retry < 50)) { + try { + if(retry>0)Thread.sleep(timeout / 2000); + retry++; + if ((Nodave.Debug & Nodave.DEBUG_IFACE) != 0) + System.out.println("Interface.read delayed"); + } catch (InterruptedException e) { + System.out.println(e); + } + } + res=0; + if(len<0){//YAO 2017-09-23 + len = 256+len; + } + while ((in.available() > 0) && (len > 0)) { + res = in.read(b, start, len); + start+=res; + len-=res; + } + if ((Nodave.Debug & Nodave.DEBUG_IFACE) != 0) + System.out.println("got "+res+"bytes"); + if ((Nodave.Debug & Nodave.DEBUG_IFACE) != 0) { + Nodave.dump("Interface.read", b, start, ilen); + } + return res; + } catch (IOException e) { + isConnect = false; + System.out.println(e); + return 0; + } + } + public int initAdapter() { + return 0; + } + public int disconnectAdapter() { + return 0; + } + public void finalize() throws Throwable{ + //System.out.println("this is finalize"); + disconnectAdapter(); + } + public static void main(String arg[]){ + Nodave.Debug = 0x00;//²»µ÷ʽ + System.out.println((Nodave.Debug & Nodave.DEBUG_IFACE) != 0); + } +} diff --git a/src/org/libnodave/Result.java b/src/org/libnodave/Result.java new file mode 100644 index 0000000..0bafc0f --- /dev/null +++ b/src/org/libnodave/Result.java @@ -0,0 +1,35 @@ +/* + Part of Libnodave, a free communication libray for Siemens S7 300/400 via + the MPI adapter 6ES7 972-0CA22-0XAC + or MPI adapter 6ES7 972-0CA33-0XAC + or MPI adapter 6ES7 972-0CA11-0XAC. + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002. + + Libnodave is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + Libnodave is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.libnodave; + +/** + * @author Thomas Hergenhahn + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class Result { +public int error; +public int length; +public int bufferStart; +} diff --git a/src/org/libnodave/ResultSet.java b/src/org/libnodave/ResultSet.java new file mode 100644 index 0000000..8495858 --- /dev/null +++ b/src/org/libnodave/ResultSet.java @@ -0,0 +1,47 @@ +/* + Part of Libnodave, a free communication libray for Siemens S7 300/400 via + the MPI adapter 6ES7 972-0CA22-0XAC + or MPI adapter 6ES7 972-0CA33-0XAC + or MPI adapter 6ES7 972-0CA11-0XAC. + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002. + + Libnodave is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + Libnodave is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.libnodave; + +/** + * @author Thomas Hergenhahn + * + */ +public class ResultSet { + private int errorState, numResults; + public Result[] results; + public void setErrorState(int error) { + errorState = error; + } + + public int getErrorState() { + return errorState; + }; + + public void setNumResults(int nr) { + numResults = nr; + } + + public int getNumResults() { + return numResults; + }; +} diff --git a/src/org/libnodave/S7Connection.java b/src/org/libnodave/S7Connection.java new file mode 100644 index 0000000..c310d6d --- /dev/null +++ b/src/org/libnodave/S7Connection.java @@ -0,0 +1,590 @@ +/* + Part of Libnodave, a free communication libray for Siemens S7 300/400 via + the MPI adapter 6ES7 972-0CA22-0XAC + or MPI adapter 6ES7 972-0CA33-0XAC + or MPI adapter 6ES7 972-0CA11-0XAC. + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002. + + Libnodave is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + Libnodave is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.libnodave; + +/** + * + * @author Thomas Hergenhahn + * + * This class comprises the variables and methods common to connections to an S7 PLC + * regardless of the type of transport. + */ +public abstract class S7Connection { + PLCinterface iface; // pointer to used interface + int answLen; // length of last message + PDU rcvdPDU; + public byte[] msgIn; + public byte[] msgOut; + /** + * position in result data, incremented when variables are extracted without position + */ + int dataPointer; + /** + * absolut begin of result data + */ + int udata; + public int packetNumber = 0; // packetNumber in transport layer + public byte messageNumber = 0; + + static int tmo_normal = 150; + public int PDUstartIn; + public int PDUstartOut; + public Semaphore semaphore; + public int maxPDUlength;//ºÏ×÷»ï°éÌṩµÄPDUµÄ³¤¶È + + private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5','6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' }; + private static final char[] DIGITS_UPPER = { '0', '1', '2', '3', '4', '5','6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + + public S7Connection(PLCinterface ifa) { + iface = ifa; + msgIn = new byte[Nodave.MAX_RAW_LEN]; + msgOut = new byte[Nodave.MAX_RAW_LEN]; + PDUstartIn = 0; + PDUstartOut = 0; + semaphore = new Semaphore(1); + } + public int getUdata(){ + return udata; + } + public byte[] getMsgIn(){ + return msgIn; + } + /** + * get a float value from the current position in result bytes + */ + public float getFloat() { + dataPointer += 4; + return Nodave.BEFloat(msgIn, dataPointer - 4); + } + /* + * The following methods are here to give Siemens users their usual data types: + */ + /** + * get a float value from the specified position in result bytes + */ + public float getFloat(int pos) { + // System.out.println("getFloat pos " + pos); + return Nodave.BEFloat(msgIn, udata + pos); + } + /** + * get an unsigned 32bit value from the specified position in result bytes + */ + public long getDWORD(int pos) { + // System.out.println("getDWORD pos " + pos); + return Nodave.USBELong(msgIn, udata + pos); + } + /** + * get an unsigned 32bit value from the current position in result bytes + */ + public long getU32() { + dataPointer += 4; + return Nodave.USBELong(msgIn, dataPointer - 4); + } + /** + * get an signed 32bit value from the current position in result bytes + */ + public long getDINT() { + dataPointer += 4; + return Nodave.SBELong(msgIn, dataPointer - 4); + } + /** + * get an signed 32bit value from the specified position in result bytes + */ + public long getDINT(int pos) { + return Nodave.SBELong(msgIn, udata + pos); + } + /** + * get an unsigned 16bit value from the specified position in result bytes + */ + public int getWORD(int pos) { + return Nodave.USBEWord(msgIn, udata + pos); + } + /** + * get an unsigned 16bit value from the current position in result bytes + */ + public int getWORD() { + dataPointer += 2; + return Nodave.USBEWord(msgIn, dataPointer - 2); + } + + public int getINT(int pos) { + return Nodave.SBEWord(msgIn, udata + pos); + } + + public int getINT() { + dataPointer += 2; + return Nodave.SBEWord(msgIn, dataPointer - 2); + } + + public int getBYTE(int pos) { + return Nodave.SByte(msgIn, udata + pos); + } + + public int getBYTE() { + dataPointer += 1; + return Nodave.SByte(msgIn, dataPointer - 1); + } + public int getCHAR(int pos) { + return Nodave.SByte(msgIn, udata + pos); + } + + public int getCHAR() { + dataPointer += 1; + return Nodave.SByte(msgIn, dataPointer - 1); + } + + public long getUS32(int pos) { + return Nodave.USBELong(msgIn, udata + pos); + } + + public long getS32(int pos) { + return Nodave.SBELong(msgIn, udata + pos); + } + + public int getUS16(int pos) { + return Nodave.USBEWord(msgIn, udata + pos); + } + + public int getS16(int pos) { + return Nodave.SBEWord(msgIn, udata + pos); + } + + public int getUS8(int pos) { + return Nodave.USByte(msgIn, udata + pos); + } + public int getS8(int pos) { + return Nodave.SByte(msgIn, udata + pos); + } + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·ûÊý×é + * @param data byte[] + * @return Ê®Áù½øÖÆchar[] + */ + public char[] encodeHex(byte[] data) { + return encodeHex(data, true); + } + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·ûÊý×é + * @param data byte[] + * @param toLowerCase true ´«»»³ÉСд¸ñʽ £¬ false ´«»»³É´óд¸ñʽ + * @return Ê®Áù½øÖÆchar[] + */ + public char[] encodeHex(byte[] data, boolean toLowerCase) { + return encodeHex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); + } + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·ûÊý×é + * @param data byte[] + * @param toDigits ÓÃÓÚ¿ØÖÆÊä³öµÄchar[] + * @return Ê®Áù½øÖÆchar[] + */ + protected char[] encodeHex(byte[] data, char[] toDigits) { + int l = data.length; + char[] out = new char[l << 1]; + for (int i = 0, j = 0; i < l; i++) { + out[j++] = toDigits[(0xF0 & data[i]) >>> 4]; + out[j++] = toDigits[0x0F & data[i]]; + } + return out; + } + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·û´® + * @param data byte[] + * @return Ê®Áù½øÖÆString + */ + public String encodeHexStr(byte[] data) { + return encodeHexStr(data, true); + } + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·û´® + * @param data byte[] + * @param toLowerCase true ´«»»³ÉСд¸ñʽ £¬ false ´«»»³É´óд¸ñʽ + * @return Ê®Áù½øÖÆString + */ + public String encodeHexStr(byte[] data, boolean toLowerCase) { + return encodeHexStr(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); + } + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·û´® + * @param data byte[] + * @param toDigits ÓÃÓÚ¿ØÖÆÊä³öµÄchar[] + * @return Ê®Áù½øÖÆString + */ + protected String encodeHexStr(byte[] data, char[] toDigits) { + return new String(encodeHex(data, toDigits)); + } + /** + * ½«Ê®Áù½øÖÆ×Ö·ûÊý×éת»»Îª×Ö½ÚÊý×é + * @param data Ê®Áù½øÖÆchar[] + * @return byte[] + * @throws RuntimeException Èç¹ûÔ´Ê®Áù½øÖÆ×Ö·ûÊý×éÊÇÒ»¸öÆæ¹ÖµÄ³¤¶È£¬½«Å׳öÔËÐÐʱÒì³£ + */ + public byte[] decodeHex(char[] data) { + int len = data.length; + if ((len & 0x01) != 0) { + throw new RuntimeException("Odd number of characters."); + } + byte[] out = new byte[len >> 1]; + for (int i = 0, j = 0; j < len; i++) { + int f = toDigit(data[j], j) << 4; + j++; + f = f | toDigit(data[j], j); + j++; + out[i] = (byte) (f & 0xFF); + } + return out; + } + /** + * ½«Ê®Áù½øÖÆ×Ö·ûת»»³ÉÒ»¸öÕûÊý + * @param chÊ®Áù½øÖÆchar + * @param indexÊ®Áù½øÖÆ×Ö·ûÔÚ×Ö·ûÊý×éÖеÄλÖà + * @return Ò»¸öÕûÊý + * @throws RuntimeException µ±ch²»ÊÇÒ»¸öºÏ·¨µÄÊ®Áù½øÖÆ×Ö·ûʱ£¬Å׳öÔËÐÐʱÒì³£ + */ + protected int toDigit(char ch, int index) { + int digit = Character.digit(ch, 16); + if (digit == -1) { + throw new RuntimeException("Illegal hexadecimal character " + ch + + " at index " + index); + } + return digit; + } + /** + * ½«byteת»»ÎªÒ»¸ö³¤¶ÈΪ8µÄbyteÊý×飬Êý×éÿ¸öÖµ´ú±íbit + * @param b + * @return + */ + public byte[] getBooleanArray_high_low(byte b) { + byte[] array = new byte[8]; + for (int i = 7; i >= 0; i--) { + array[i] = (byte) (b & 1); + b = (byte) (b >> 1); + } + return array; + } + public byte[] getBooleanArray_low_high(byte b) { + byte[] array = new byte[8]; + for (int i = 0; i <=7 ; i++) { + array[i] = (byte) (b & 1); + b = (byte) (b >> 1); + } + return array; + } + /** + * °ÑbyteתΪ×Ö·û´®µÄbit + * @param b + * @return + */ + public String byteToBit(byte b) { + return "" + (byte) ((b >> 7) & 0x1) + (byte) ((b >> 6) & 0x1) + + (byte) ((b >> 5) & 0x1) + (byte) ((b >> 4) & 0x1) + + (byte) ((b >> 3) & 0x1) + (byte) ((b >> 2) & 0x1) + + (byte) ((b >> 1) & 0x1) + (byte) ((b >> 0) & 0x1); + + } + public String bytesToHexString(byte[] src) { + StringBuilder stringBuilder = new StringBuilder(""); + if (src == null || src.length <= 0) { + return null; + } + for (int i = 0; i < src.length; i++) { + int v = src[i] & 0xFF; + String hv = Integer.toHexString(v); + if (hv.length() < 2) { + stringBuilder.append(0); + } + stringBuilder.append(hv); + } + return stringBuilder.toString(); + } + abstract public int exchange(PDU p1); + //¶ÁÈ¡³¤¶Èlen ×ֻÄÜ256¸ö×Ö½Ú + public int readBytes( + int area, + int DBnum, + int start, + int len, + byte[] buffer) { + int res = 0; + semaphore.enter(); + PDU p1 = new PDU(msgOut, PDUstartOut); + p1.initReadRequest(); + p1.addVarToReadRequest(area, DBnum, start, len); + + res = exchange(p1); + if (res != Nodave.RESULT_OK) { + semaphore.leave(); + return res; + } + PDU p2 = new PDU(msgIn, PDUstartIn); + res = p2.setupReceivedPDU(); + if ((Nodave.Debug & Nodave.DEBUG_CONN) != 0) + System.out.println( + "setupReceivedPDU() returned: " + res + Nodave.strerror(res)); + if (res != Nodave.RESULT_OK) { + semaphore.leave(); + return res; + } + + res = p2.testReadResult(); + if ((Nodave.Debug & Nodave.DEBUG_CONN) != 0) + System.out.println( + "testReadResult() returned: " + res + Nodave.strerror(res)); + if (res != Nodave.RESULT_OK) { + semaphore.leave(); + return res; + } + if (p2.udlen == 0) { + semaphore.leave(); + return Nodave.RESULT_CPU_RETURNED_NO_DATA; + } + if (buffer != null) + System.arraycopy(p2.mem, p2.udata, buffer, 0, p2.udlen); + + dataPointer = p2.udata; + udata = p2.udata; + answLen = p2.udlen; + semaphore.leave(); + return res; + } + + public PDU prepareReadRequest() { + int errorState = 0; + semaphore.enter(); + PDU p1 = new PDU(msgOut, PDUstartOut); + p1.prepareReadRequest(); + return p1; + } + + /* + Write len bytes to PLC memory area "area", data block DBnum. + */ + public int writeBytes( + int area, + int DBnum, + int start, + int len, + byte[] buffer) { + int errorState = 0; + semaphore.enter(); + PDU p1 = new PDU(msgOut, PDUstartOut); + p1.prepareWriteRequest(); + p1.addVarToWriteRequest(area, DBnum, start, len, buffer); + + errorState = exchange(p1); + + if (errorState == 0) { + PDU p2 = new PDU(msgIn, PDUstartIn); + p2.setupReceivedPDU(); + + if (p2.mem[p2.param + 0] == PDU.FUNC_WRITE) { + if (p2.mem[p2.data + 0] == (byte) 0xFF) { + if ((Nodave.Debug & Nodave.DEBUG_CONN) != 0) + System.out.println("writeBytes: success"); + semaphore.leave(); + return 0; + } + } else { + errorState |= 4096; + } + } + semaphore.leave(); + return errorState; + } + + /* + public int readByteBlock(int area, int areaNumber, int start, int len) { + return readBytes(area, areaNumber, start, len, null); + } + */ + public int disconnectPLC() { + return 0; + } + public int connectPLC() { + return 0; + } + + public class Semaphore { + private int value; + + public Semaphore(int value) { + this.value = value; + } + + public synchronized void enter() { + --value; + if (value < 0) { + try { + wait(); + } catch (Exception e) { + } + } + } + + public synchronized void leave() { + ++value; + notify(); + } + } + /* + public void sendYOURTURN() { + } + */ + public int getResponse() { + return 0; + } + + public int getPPIresponse() { + return 0; + } + + public int sendMsg(PDU p) { + return 0; + } + public void sendRequestData(int alt) { + } + + // int numResults; + /* + class Result { + int error; + byte[] data; + } + */ + /* + Read a predefined set of values from the PLC. + Return ok or an error state + If a buffer pointer is provided, data will be copied into this buffer. + If it's NULL you can get your data from the resultPointer in daveConnection long + as you do not send further requests. + */ + public ResultSet execReadRequest(PDU p) { + PDU p2; + int errorState; + errorState = exchange(p); + + p2 = new PDU(msgIn, PDUstartIn); + p2.setupReceivedPDU(); + /* + if (p2.udlen == 0) { + dataPointer = 0; + answLen = 0; + return Nodave.RESULT_CPU_RETURNED_NO_DATA; + } + */ + ResultSet rs = new ResultSet(); + if (p2.mem[p2.param + 0] == PDU.FUNC_READ) { + int numResults = p2.mem[p2.param + 1]; + // System.out.println("Results " + numResults); + rs.results = new Result[numResults]; + int pos = p2.data; + for (int i = 0; i < numResults; i++) { + Result r = new Result(); + r.error = Nodave.USByte(p2.mem, pos); + if (r.error == 255) { + + int type = Nodave.USByte(p2.mem, pos + 1); + int len = Nodave.USBEWord(p2.mem, pos + 2); + r.error = 0; + // System.out.println("Raw length " + len); + if (type == 4) + len /= 8; + else if (type == 3); //length is ok + + // System.out.println("Byte length " + len); + // r.data = new byte[len]; + + // System.arraycopy(p2.mem, pos + 4, r.data, 0, len); + // Nodave.dump("Result " + i + ":", r.data, 0, len); + r.bufferStart = pos + 4; + pos += len; + if ((len % 2) == 1) + pos++; + } else { + System.out.println("Error " + r.error); + } + pos += 4; + rs.results[i] = r; + } + numResults = p2.mem[p2.param + 1]; + rs.setNumResults(numResults); + dataPointer = p2.udata; + answLen = p2.udlen; + // } + } else { + errorState |= 2048; + } + semaphore.leave(); + rs.setErrorState(errorState); + return rs; + } + + public int useResult(ResultSet rs, int number) { + System.out.println( + "rs.getNumResults: " + rs.getNumResults() + " number: " + number); + if (rs.getNumResults() > number) { + dataPointer = rs.results[number].bufferStart; + return 0; + // udata=rs.results[number].bufferStart; + } + return -33; + }; + + /* + build the PDU for a PDU length negotiation + */ + public int negPDUlengthRequest() { + int res; + PDU p = new PDU(msgOut, PDUstartOut); + byte pa[] = + {(byte) 0xF0, 0, 0x00, 0x01, 0x00, 0x01, 0x03, (byte) 0xC0, }; + p.initHeader(1); + p.addParam(pa); + if ((Nodave.Debug & Nodave.DEBUG_PDU) != 0) { + p.dump(); + } + res = exchange(p); + if (res != 0) + return res; + PDU p2 = new PDU(msgIn, PDUstartIn); + res = p2.setupReceivedPDU(); + if (res != 0) + return res; + maxPDUlength = Nodave.USBEWord(msgIn, p2.param + 6); + if ((Nodave.Debug & Nodave.DEBUG_CONNECT) != 0) { + System.out.println( + "*** Partner offered PDU length: " + maxPDUlength); + } + return res; + } + /* + build the PDU for a PDU length negotiation + */ + + public void finalize() throws Throwable { + //System.out.println("this is finalize S7Connection"); + disconnectPLC(); + iface.finalize(); + } + +} diff --git a/src/org/libnodave/TCPConnection.java b/src/org/libnodave/TCPConnection.java new file mode 100644 index 0000000..7e7cbbe --- /dev/null +++ b/src/org/libnodave/TCPConnection.java @@ -0,0 +1,108 @@ +/* + Part of Libnodave, a free communication libray for Siemens S7 300/400 via + the MPI adapter 6ES7 972-0CA22-0XAC + or MPI adapter 6ES7 972-0CA33-0XAC + or MPI adapter 6ES7 972-0CA11-0XAC. + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002. + + Libnodave is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + Libnodave is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.libnodave; +public class TCPConnection extends S7Connection { + int rack; + int slot; + + public TCPConnection(PLCinterface ifa, int rack, int slot) { + super(ifa); + this.rack=rack; + this.slot=slot; + PDUstartIn = 7; + PDUstartOut = 7; + } + + protected int readISOPacket() { + int res = iface.read(msgIn, 0, 4); + if (res == 4) { + int len = 0x100 * msgIn[2] + msgIn[3]; + res += iface.read(msgIn, 4, len); + } else return 0; + return res; + } + protected int sendISOPacket(int size) { + size += 4; + msgOut[0] = (byte)0x03; + msgOut[1] = (byte)0x0; + msgOut[2] = (byte) (size / 0x100); + msgOut[3] = (byte) (size % 0x100); + iface.write(msgOut, 0, size); + return 0; + } + public static void main(String arg[]){ + System.out.println(0x100); + } + public int exchange(PDU p1) { + int res; + PDU p2; + if ((Nodave.Debug & Nodave.DEBUG_EXCHANGE) != 0) { + System.out.println(" enter TCP.Exchange"); + } + msgOut[4] = (byte)0x02; + msgOut[5] = (byte)0xf0; + msgOut[6] = (byte)0x80; + sendISOPacket(3 + p1.hlen + p1.plen + p1.dlen); + res = readISOPacket(); + return 0; + } + /** + * We have our own connectPLC(), but no disconnect() + * Open connection to a PLC. This assumes that dc is initialized by + * daveNewConnection and is not yet used. + * (or reused for the same PLC ?) + */ + public int connectPLC() { + int res; + byte[] b4 ={ + (byte)0x11, + (byte)0xE0, + (byte)0x00, + (byte)0x00, + (byte)0x00, + (byte)0x01, + (byte)0x00, + (byte)0xC1, + (byte)0x02, + (byte)0x01, + (byte)0x00, + (byte)0xC2, + (byte)0x02, + (byte)0x01, + (byte)0x02, + (byte)0xC0, + (byte)0x01, + (byte)0x09 }; + + if ((Nodave.Debug & Nodave.DEBUG_CONNECT) != 0) + System.out.println("daveConnectPLC() step 1. rack:"+rack+" slot:"+slot); + System.arraycopy(b4, 0, msgOut, 4, b4.length); + msgOut[17]=(byte)(rack+1); + msgOut[18]=(byte)slot; + sendISOPacket(b4.length); + readISOPacket(); + if ((Nodave.Debug & Nodave.DEBUG_CONNECT) != 0) + System.out.println("daveConnectPLC() step 1."); + return negPDUlengthRequest(); + } +} diff --git a/src/org/libnodave/tests/PlcTcpClient.java b/src/org/libnodave/tests/PlcTcpClient.java new file mode 100644 index 0000000..e37ba45 --- /dev/null +++ b/src/org/libnodave/tests/PlcTcpClient.java @@ -0,0 +1,83 @@ +package org.libnodave.tests; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.Date; + +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +public class PlcTcpClient { + int i, j; + long a, b, c; + float d, e, f; + byte buf1[]; + PLCinterface di; + TCPConnection dc; + Socket sock; + PlcTcpClient(String host) { + buf1 = new byte[Nodave.PartnerListSize]; + try { + sock = new Socket(host, 102); + } catch (IOException e) { + System.out.println(e); + } + } + void run() { + OutputStream oStream = null; + InputStream iStream = null; + byte[] by; + if (sock != null) { + try { + oStream = sock.getOutputStream(); + } catch (IOException e) { + } + try { + iStream = sock.getInputStream(); + } catch (IOException e) { + } + di = new PLCinterface( + oStream, + iStream, + "PLCName", + 0, + Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + int res = dc.connectPLC(); + if(di.isConnect){ + while(true){ + dc.readBytes(Nodave.DB, 102, 0, 50, null); + dc.getDINT(22); + System.out.println("111:"+dc.getDINT(22)); + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + } else + System.out.println("Couldn't open connection"); + } + + static boolean doWrite = true; + static boolean doBenchmark = false; + static boolean doLentest = false; + static int useProtocol = Nodave.PROTOCOL_ISOTCP; + static int slot=1; + + public static void main(String[] args) { +// PlcTcpClient tp = new PlcTcpClient("192.168.8.102"); +// tp.run(); + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dqsj; + dqsj= "2019-10-19 22:01:48";//df.format(t); + long longstr1 = Long.valueOf(dqsj.replaceAll("[-\\s:]","")); + System.out.println(longstr1); + System.out.println(longstr1+4043); + System.out.println(dqsj); + } +} \ No newline at end of file diff --git a/src/org/libnodave/tests/TestISOTCP2.java b/src/org/libnodave/tests/TestISOTCP2.java new file mode 100644 index 0000000..704a042 --- /dev/null +++ b/src/org/libnodave/tests/TestISOTCP2.java @@ -0,0 +1,269 @@ +/* + Test and demo program for Libnodave, a free communication libray for Siemens S7. + + ********************************************************************** + * WARNING: This and other test programs overwrite data in your PLC. * + * DO NOT use it on PLC's when anything is connected to their outputs.* + * This is alpha software. Use entirely on your own risk. * + ********************************************************************** + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002, 2004. + + This is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with Visual; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.libnodave.tests; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.util.Date; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import com.wms.dss.ats.customs.abb.utils.Tools; +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +import org.s7.standard.ynuo.WriteDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface.groupPlcObj; + +import com.wms.dss.common.server.form.Logger; +//YAO-2017-09-06 ����ͨ���� +public class TestISOTCP2 { + int i, j; + long a, b, c; + float d, e, f; + byte buf1[]; + String strIp=""; + int iPort = 102; + PLCinterface di; + TCPConnection dc; + Socket sock; + OutputStream oStream = null; + InputStream iStream = null; + protected byte btid = 1; //�Ѷ���� + public Hashtable writePlcHs = null; + TestISOTCP2(String strIp,int iPort) { + buf1 = new byte[Nodave.PartnerListSize]; + this.strIp = strIp; + this.iPort = iPort; + } + public void setIsConnect(boolean bflag){ + if(di!=null){ + di.isConnect = bflag; + } + } + public boolean IsConnect(){ + if(di!=null){ + return di.isConnect; + }else{ + return false; + } + } + void ConnectServer(){ + try { + System.out.println(new Date()+"********��ʼ��IP:"+strIp+" �˿�:"+iPort+"����socket���ӿ�ʼ!************************************"); + sock = new Socket(strIp, iPort); + sock.setSoTimeout(6000); //���ó�ʱʱ��6�� + System.out.println(new Date()+"********��ʼ��IP:"+strIp+" �˿�:"+iPort+"����socket���ӳɹ�!************************************"); + oStream = sock.getOutputStream(); + iStream = sock.getInputStream(); + System.out.println(new Date()+"********��ʼ��IP:"+strIp+" �˿�:"+iPort+"����-������-���ӳɹ�!************************************"); + di = new PLCinterface( + oStream, + iStream, + "PLCName", + 0, + Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + int res = dc.connectPLC(); + if (0 == res) { + setIsConnect(true); + System.out.println(new Date()+"����TCPConnection�������ɹ�! "); + }else{ + System.out.println(new Date()+"����TCPConnection������ʧ��! "); + } + } catch (IOException ioex) { + System.out.println(new Date()+"����ʧ�� "+ioex.getMessage()); + } catch (Exception ex) { + System.out.println(new Date()+"�����쳣 "+ex.getMessage()); + } + } + void closeServer(){ + try + { + setIsConnect(false); + if (iStream != null){ + System.out.println(new Date()+"�������رտ�ʼ "); + iStream.close(); + iStream = null; + System.out.println(new Date()+"�������رս��� "); + } + }catch (IOException e){ + System.out.println(new Date()+"�������ر��쳣 "+e.getMessage()); + } + try + { + if (oStream != null) + { + System.out.println(new Date()+"������رտ�ʼ "); + oStream.close(); + oStream = null; + System.out.println(new Date()+"������رս��� "); + } + }catch (IOException e){ + System.out.println(new Date()+"������ر��쳣 "+e.getMessage()); + } + try + { + if(sock != null) + { + System.out.println(new Date()+"socket�ͻ��˹رտ�ʼ"); + sock.close(); + sock = null; + System.out.println(new Date()+"socket�ͻ��˹رս���"); + } + }catch (IOException e){ + System.out.println(new Date()+"socket�ͻ��˹ر��쳣 "+e.getMessage()); + } + } + void reConnect(){ + closeServer(); + ConnectServer(); + } + public int sendtoCrane(byte btid,int new_cmd, Hashtable hsSysParam) throws Exception + { + //super(hsSysParam); + try{ + + //m_hsSysParam = hsSysParam; + Hashtable hsComParam1 = (Hashtable)hsSysParam.get("hsComParam"); + Hashtable writePlcHs = (Hashtable)hsSysParam.get("writePlcHs"); + WriteDotPlcInterface ddjcmd = (WriteDotPlcInterface)writePlcHs.get("11-1"); + if(btid == 1){ + + /*JSONArray orderEntitys = new JSONArray(); + orderEntitys.add(JsonTool.updateJson(WritePlcCmd.XMCJ2_QQDQ, 1)); + return ddjcmd.Analysis(orderEntitys.toString());*/ + } + }catch(Exception ex){ + Logger.error("��Ѷ������ָ���쳣"+ex.getMessage()); + } + return -1; + } + void run() { + long t1 = 0,t2 = 0; + //List groups = {0,1,1,1,[1,1]}; + List groups = null; + WriteDotPlcInterface.groupPlcObj group = null; + WriteDotPlcInterface plcWVar = null; + Iterator iterW = null; + Map.Entry entry = null; + // + while(true){ + try{ + if(IsConnect()){ + //257-25= + //��ȡDB��510�������ļ� + t1 = System.currentTimeMillis(); + dc.readBytes(Nodave.DB, 101, 0, 40, null); + if(IsConnect()){ + System.out.println(dc.getINT(20)); + System.out.println(dc.getDINT(22)); + }else{ + continue; + } + //��ȡDB��511�������ļ� + //protected byte btid = 0; //�Ѷ���� + +// dc.readBytes(Nodave.DB, 301, 0, 2, null); +// if(IsConnect()){ +// System.out.println(dc.getINT(0)); +// }else{ +// continue; +// } + //�DB��301 + Hashtable hsComParam = new Hashtable();//ͨѶ���� + Hashtable writePlcHs = new Hashtable(); + WriteDotPlcInterface ddjcmd1 = new WriteDotPlcInterface("11",1+"");//11Ϊ�Ѷ��ָ������ + writePlcHs.put(ddjcmd1.cmdtype+"-"+ddjcmd1.cmdvalue, ddjcmd1); + hsComParam.put("writePlcHs", writePlcHs); + + + int iSend = sendtoCrane(btid, 1,hsComParam); + + + iterW = writePlcHs.entrySet().iterator(); + if(iterW != null){ + while (iterW.hasNext()) { + entry = (Map.Entry) iterW.next(); + plcWVar = (WriteDotPlcInterface)entry.getValue(); + groups = plcWVar.lsWriteGroupPlc; + for(i=0;itrue ´«»»³ÉСд¸ñʽ £¬ false ´«»»³É´óд¸ñʽ + * @return Ê®Áù½øÖÆchar[] + */ + public char[] encodeHex(byte[] data, boolean toLowerCase) { + return encodeHex(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); + } + + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·ûÊý×é + * @param data byte[] + * @param toDigits ÓÃÓÚ¿ØÖÆÊä³öµÄchar[] + * @return Ê®Áù½øÖÆchar[] + */ + protected char[] encodeHex(byte[] data, char[] toDigits) { + int l = data.length; + char[] out = new char[l << 1]; + for (int i = 0, j = 0; i < l; i++) { + out[j++] = toDigits[(0xF0 & data[i]) >>> 4]; + out[j++] = toDigits[0x0F & data[i]]; + } + return out; + } + + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·û´® + * @param data byte[] + * @return Ê®Áù½øÖÆString + */ + public String encodeHexStr(byte[] data) { + return encodeHexStr(data, true); + } + + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·û´® + * @param data byte[] + * @param toLowerCase true ´«»»³ÉСд¸ñʽ £¬ false ´«»»³É´óд¸ñʽ + * @return Ê®Áù½øÖÆString + */ + public String encodeHexStr(byte[] data, boolean toLowerCase) { + return encodeHexStr(data, toLowerCase ? DIGITS_LOWER : DIGITS_UPPER); + } + + /** + * ½«×Ö½ÚÊý×éת»»ÎªÊ®Áù½øÖÆ×Ö·û´® + * @param data byte[] + * @param toDigits ÓÃÓÚ¿ØÖÆÊä³öµÄchar[] + * @return Ê®Áù½øÖÆString + */ + protected String encodeHexStr(byte[] data, char[] toDigits) { + return new String(encodeHex(data, toDigits)); + } + + /** + * ½«Ê®Áù½øÖÆ×Ö·ûÊý×éת»»Îª×Ö½ÚÊý×é + * @param data Ê®Áù½øÖÆchar[] + * @return byte[] + * @throws RuntimeException Èç¹ûÔ´Ê®Áù½øÖÆ×Ö·ûÊý×éÊÇÒ»¸öÆæ¹ÖµÄ³¤¶È£¬½«Å׳öÔËÐÐʱÒì³£ + */ + public byte[] decodeHex(char[] data) { + int len = data.length; + if ((len & 0x01) != 0) { + throw new RuntimeException("Odd number of characters."); + } + byte[] out = new byte[len >> 1]; + for (int i = 0, j = 0; j < len; i++) { + int f = toDigit(data[j], j) << 4; + j++; + f = f | toDigit(data[j], j); + j++; + out[i] = (byte) (f & 0xFF); + } + return out; + } + + /** + * ½«Ê®Áù½øÖÆ×Ö·ûת»»³ÉÒ»¸öÕûÊý + * @param chÊ®Áù½øÖÆchar + * @param indexÊ®Áù½øÖÆ×Ö·ûÔÚ×Ö·ûÊý×éÖеÄλÖà + * @return Ò»¸öÕûÊý + * @throws RuntimeException µ±ch²»ÊÇÒ»¸öºÏ·¨µÄÊ®Áù½øÖÆ×Ö·ûʱ£¬Å׳öÔËÐÐʱÒì³£ + */ + protected int toDigit(char ch, int index) { + int digit = Character.digit(ch, 16); + if (digit == -1) { + throw new RuntimeException("Illegal hexadecimal character " + ch + + " at index " + index); + } + return digit; + } + + /** + * ½«byteת»»ÎªÒ»¸ö³¤¶ÈΪ8µÄbyteÊý×飬Êý×éÿ¸öÖµ´ú±íbit + * @param b + * @return + */ + public byte[] getBooleanArray_high_low(byte b) { + byte[] array = new byte[8]; + for (int i = 7; i >= 0; i--) { + array[i] = (byte) (b & 1); + b = (byte) (b >> 1); + } + return array; + } + + public byte[] getBooleanArray_low_high(byte b) { + byte[] array = new byte[8]; + for (int i = 0; i <=7 ; i++) { + array[i] = (byte) (b & 1); + b = (byte) (b >> 1); + } + return array; + } + + /** + * °ÑbyteתΪ×Ö·û´®µÄbit + * @param b + * @return + */ + public String byteToBit(byte b) { + return "" + (byte) ((b >> 7) & 0x1) + (byte) ((b >> 6) & 0x1) + + (byte) ((b >> 5) & 0x1) + (byte) ((b >> 4) & 0x1) + + (byte) ((b >> 3) & 0x1) + (byte) ((b >> 2) & 0x1) + + (byte) ((b >> 1) & 0x1) + (byte) ((b >> 0) & 0x1); + + } + + public String bytesToHexString(byte[] src) { + StringBuilder stringBuilder = new StringBuilder(""); + if (src == null || src.length <= 0) { + return null; + } + for (int i = 0; i < src.length; i++) { + int v = src[i] & 0xFF; + String hv = Integer.toHexString(v); + if (hv.length() < 2) { + stringBuilder.append(0); + } + stringBuilder.append(hv); + } + return stringBuilder.toString(); + } + + + //ÏäÂë²É¼¯ + public abstract void analysisDb50_1(); + public abstract void analysisDb50_2(); + public abstract void analysisDb50_3(); + public abstract void analysisDb50_4(); + public abstract void analysisDb50_5(); + public abstract void analysisDb50_6(); + public abstract void analysisDb50_7(); + public abstract void analysisDb50_8(); + public abstract void analysisDb50_9(); + public abstract void analysisDb50_10(); + public abstract void analysisDb50_11(); + public abstract void analysisDb50_12(); + public abstract void analysisDb50_13(); + public abstract void analysisDb50_14(); + public abstract void analysisDb50_15(); + public abstract void analysisDb50_16(); + + public abstract void analysisDb49_1(); + public abstract void analysisDb49_2(); + public abstract void analysisDb49_3(); + public abstract void analysisDb49_4(); + public abstract void analysisDb49_5(); + public abstract void analysisDb49_6(); + public abstract void analysisDb49_7(); + public abstract void analysisDb49_8(); + public abstract void analysisDb49_9(); + public abstract void analysisDb49_10(); + public abstract void analysisDb49_11(); + public abstract void analysisDb49_12(); + public abstract void analysisDb49_13(); + public abstract void analysisDb49_14(); + public abstract void analysisDb49_15(); + public abstract void analysisDb49_16(); + + + + public abstract void analysisDb48_1(); + public abstract void analysisDb48_2(); + public abstract void analysisDb48_3(); + public abstract void analysisDb48_4(); + public abstract void analysisDb48_5(); + public abstract void analysisDb48_6(); + public abstract void analysisDb48_7(); + public abstract void analysisDb48_8(); + public abstract void analysisDb48_9(); + public abstract void analysisDb48_10(); + public abstract void analysisDb48_11(); + public abstract void analysisDb48_12(); + public abstract void analysisDb48_13(); + public abstract void analysisDb48_14(); + public abstract void analysisDb48_15(); + public abstract void analysisDb48_16(); + + + public abstract void analysisDb47_1(); + public abstract void analysisDb47_2(); + public abstract void analysisDb47_3(); + public abstract void analysisDb47_4(); + public abstract void analysisDb47_5(); + public abstract void analysisDb47_6(); + public abstract void analysisDb47_7(); + public abstract void analysisDb47_8(); + public abstract void analysisDb47_9(); + public abstract void analysisDb47_10(); + public abstract void analysisDb47_11(); + public abstract void analysisDb47_12(); + public abstract void analysisDb47_13(); + public abstract void analysisDb47_14(); + public abstract void analysisDb47_15(); + public abstract void analysisDb47_16(); + + + + public abstract void analysisDb46_1(); + public abstract void analysisDb46_2(); + public abstract void analysisDb46_3(); + public abstract void analysisDb46_4(); + public abstract void analysisDb46_5(); + public abstract void analysisDb46_6(); + public abstract void analysisDb46_7(); + public abstract void analysisDb46_8(); + public abstract void analysisDb46_9(); + public abstract void analysisDb46_10(); + public abstract void analysisDb46_11(); + public abstract void analysisDb46_12(); + public abstract void analysisDb46_13(); + public abstract void analysisDb46_14(); + public abstract void analysisDb46_15(); + public abstract void analysisDb46_16(); + + + public abstract void analysisDb45_1(); + public abstract void analysisDb45_2(); + public abstract void analysisDb45_3(); + public abstract void analysisDb45_4(); + public abstract void analysisDb45_5(); + public abstract void analysisDb45_6(); + public abstract void analysisDb45_7(); + public abstract void analysisDb45_8(); + public abstract void analysisDb45_9(); + public abstract void analysisDb45_10(); + public abstract void analysisDb45_11(); + public abstract void analysisDb45_12(); + public abstract void analysisDb45_13(); + public abstract void analysisDb45_14(); + public abstract void analysisDb45_15(); + public abstract void analysisDb45_16(); + + + public abstract void analysisDb44_1(); + public abstract void analysisDb44_2(); + public abstract void analysisDb44_3(); + public abstract void analysisDb44_4(); + public abstract void analysisDb44_5(); + public abstract void analysisDb44_6(); + public abstract void analysisDb44_7(); + public abstract void analysisDb44_8(); + public abstract void analysisDb44_9(); + public abstract void analysisDb44_10(); + public abstract void analysisDb44_11(); + public abstract void analysisDb44_12(); + public abstract void analysisDb44_13(); + public abstract void analysisDb44_14(); + public abstract void analysisDb44_15(); + public abstract void analysisDb44_16(); + + public abstract void analysisDb43_1(); + public abstract void analysisDb43_2(); + public abstract void analysisDb43_3(); + public abstract void analysisDb43_4(); + public abstract void analysisDb43_5(); + public abstract void analysisDb43_6(); + public abstract void analysisDb43_7(); + public abstract void analysisDb43_8(); + public abstract void analysisDb43_9(); + public abstract void analysisDb43_10(); + public abstract void analysisDb43_11(); + public abstract void analysisDb43_12(); + public abstract void analysisDb43_13(); + public abstract void analysisDb43_14(); + public abstract void analysisDb43_15(); + public abstract void analysisDb43_16(); + + + public abstract void analysisDb42_1(); + public abstract void analysisDb42_2(); + public abstract void analysisDb42_3(); + public abstract void analysisDb42_4(); + public abstract void analysisDb42_5(); + public abstract void analysisDb42_6(); + public abstract void analysisDb42_7(); + public abstract void analysisDb42_8(); + public abstract void analysisDb42_9(); + public abstract void analysisDb42_10(); + public abstract void analysisDb42_11(); + public abstract void analysisDb42_12(); + public abstract void analysisDb42_13(); + public abstract void analysisDb42_14(); + public abstract void analysisDb42_15(); + public abstract void analysisDb42_16(); + + + public abstract void analysisDb41_1(); + public abstract void analysisDb41_2(); + public abstract void analysisDb41_3(); + public abstract void analysisDb41_4(); + public abstract void analysisDb41_5(); + public abstract void analysisDb41_6(); + public abstract void analysisDb41_7(); + public abstract void analysisDb41_8(); + public abstract void analysisDb41_9(); + public abstract void analysisDb41_10(); + public abstract void analysisDb41_11(); + public abstract void analysisDb41_12(); + public abstract void analysisDb41_13(); + public abstract void analysisDb41_14(); + public abstract void analysisDb41_15(); + public abstract void analysisDb41_16(); + + + + + + + public String getSTRING30(int pos) { + return Nodave.SBEString30(msgIn, udata + pos).toString(); + } + +} diff --git a/src/org/s7/standard/ynuo/ReadDotPlcInterface.java b/src/org/s7/standard/ynuo/ReadDotPlcInterface.java new file mode 100644 index 0000000..117787b --- /dev/null +++ b/src/org/s7/standard/ynuo/ReadDotPlcInterface.java @@ -0,0 +1,49 @@ +package org.s7.standard.ynuo; +import java.util.ArrayList; +import java.util.List; +import org.libnodave.Nodave; +/** + * ¶ÁÈ¡db¿éµãÒµÎñ±ê×¼Àà + * @author yao + */ +public abstract class ReadDotPlcInterface implements PlcInterface{ + public List lsReadGroupPlc = new ArrayList(); + /*½«¶ÁÈ¡PLCµÄdb¿éÊý¾ÝÍùÊý¾Ý¿âÖÐдÈë*/ + public abstract void analysisDb(); + public class groupPlcObj { + /*Öµ*/ + public Object obj = null; + /*DB*/ + private int DB=Nodave.DB; + /*¶ÁÈ¡DBµØÖ·*/ + private int DBnum=0; + /*¶ÁÈ¡DBÆðʼλÖà */ + private int start=0; + /*¶ÁÈ¡Êý¾ÝÀàÐÍ*/ + private int dtype = BYTE; + public groupPlcObj(int DB,int DBnum,int start,int dtype){ + this.DB = DB; + this.DBnum = DBnum; + this.start = start; + this.dtype = dtype; + } + public String key(){ + return DB+"-"+DBnum+"-"+start+"-"+dtype; + } + public Object getObj() { + return obj; + } + public int getDB() { + return DB; + } + public int getDBnum() { + return DBnum; + } + public int getStart() { + return start; + } + public int getDtype() { + return dtype; + } + } +} diff --git a/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer101.java b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer101.java new file mode 100644 index 0000000..26c5bc2 --- /dev/null +++ b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer101.java @@ -0,0 +1,248 @@ +package org.s7.standard.ynuo; + +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; +import org.s7.standard.ynuo.client.IsoTcpClient101; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.common.server.config.DSSTabSel; + +/** + * ¸ÃÏ߳̽«´Ó¡¶¶Á»º´æÇø¡·£¨´Óplc¶ÁÈ¡µ½µÄÊý¾Ý´æ·ÅµÄλÖã©¶¨Ê±Ð´µ½Êý¾Ý¿âÖÐ + * + * @author admin + * + */ +public class ReadPlcDBAnalyServer101 implements Runnable { + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHsMD101 = null; + public Hashtable readAreaPlcHsMD102 = null; + public Hashtable readAreaPlcHsMD103 = null; + public Hashtable readAreaPlcHsMD104 = null; + public Hashtable readAreaPlcHsMD105 = null; + public Hashtable readAreaPlcHsMD106 = null; + public Hashtable readAreaPlcHsMD107 = null; + public Hashtable readAreaPlcHsMD108 = null; + public Hashtable readAreaPlcHsMD109 = null; + public Hashtable readAreaPlcHsMD110 = null; +// public Hashtable readAreaPlcHs2 = null; +// public Hashtable readAreaPlcHs3 = null; +// public Hashtable readAreaPlcHs4 = null; +// public Hashtable readAreaPlcHs5 = null; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readDotPlcHs = null; + Hashtable hsSysParam = null; + Hashtable hsComParam = null; + IsoTcpClient101 client = null; + + public EntityDAO dao; + + public ReadPlcDBAnalyServer101(Hashtable hsComParam, IsoTcpClient101 client) { + this.hsComParam = hsComParam; + this.hsSysParam = client.hsSysParam; + this.readAreaPlcHsMD101 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_101"); + this.readAreaPlcHsMD102 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_102"); + this.readAreaPlcHsMD103 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_103"); + this.readAreaPlcHsMD104 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_104"); + this.readAreaPlcHsMD105 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_105"); + this.readAreaPlcHsMD106 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_106"); + this.readAreaPlcHsMD107 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_107"); + this.readAreaPlcHsMD108 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_108"); + this.readAreaPlcHsMD109 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_109"); + this.readAreaPlcHsMD110 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_110"); +// this.readAreaPlcHs2 = (Hashtable) hsComParam.get("readAreaPlcHs1_2"); +// this.readAreaPlcHs3 = (Hashtable) hsComParam.get("readAreaPlcHs1_3"); +// this.readAreaPlcHs4 = (Hashtable) hsComParam.get("readAreaPlcHs1_4"); +// this.readAreaPlcHs5 = (Hashtable) hsComParam.get("readAreaPlcHs1_5"); + this.client = client; + } + + public void run() { + Iterator iterobj; + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.setCaretPosition( + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.getText().length() + - 20); + try { + + if (readAreaPlcHsMD101 != null) { + iterobj = readAreaPlcHsMD101.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb101_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + if (readAreaPlcHsMD102 != null) { + iterobj = readAreaPlcHsMD102.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb102_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + if (readAreaPlcHsMD103 != null) { + iterobj = readAreaPlcHsMD103.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb103_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + if (readAreaPlcHsMD104 != null) { + iterobj = readAreaPlcHsMD104.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb104_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + if (readAreaPlcHsMD105 != null) { + iterobj = readAreaPlcHsMD105.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb105_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + if (readAreaPlcHsMD106 != null) { + iterobj = readAreaPlcHsMD106.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb106_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + if (readAreaPlcHsMD107 != null) { + iterobj = readAreaPlcHsMD107.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb107_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + if (readAreaPlcHsMD108 != null) { + iterobj = readAreaPlcHsMD108.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb108_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHsMD109 != null) { + iterobj = readAreaPlcHsMD109.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb109_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHsMD110 != null) { + iterobj = readAreaPlcHsMD110.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb110_MD(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer102.java b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer102.java new file mode 100644 index 0000000..6cc60f6 --- /dev/null +++ b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer102.java @@ -0,0 +1,247 @@ +package org.s7.standard.ynuo; + +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; + +import org.s7.standard.ynuo.client.IsoTcpClient102; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.common.server.config.DSSTabSel; + +/** + * ¸ÃÏ߳̽«´Ó¡¶¶Á»º´æÇø¡·£¨´Óplc¶ÁÈ¡µ½µÄÊý¾Ý´æ·ÅµÄλÖã©¶¨Ê±Ð´µ½Êý¾Ý¿âÖÐ + * + * @author admin + * + */ +public class ReadPlcDBAnalyServer102 implements Runnable { + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHs101 = null; + public Hashtable readAreaPlcHs102 = null; + public Hashtable readAreaPlcHs104 = null; + public Hashtable readAreaPlcHs105 = null; + public Hashtable readAreaPlcHs106 = null; + public Hashtable readAreaPlcHs107 = null; + public Hashtable readAreaPlcHs103 = null; + public Hashtable readAreaPlcHs105_2 = null; + public Hashtable readAreaPlcHs151 = null; + + public Hashtable readAreaPlcHs108 = null; + + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readDotPlcHs = null; + Hashtable hsSysParam = null; + Hashtable hsComParam = null; + IsoTcpClient102 client = null; + + public EntityDAO dao; + + public ReadPlcDBAnalyServer102(Hashtable hsComParam, IsoTcpClient102 tp2) { + this.hsComParam = hsComParam; + this.hsSysParam = tp2.hsSysParam; + this.readAreaPlcHs101 = (Hashtable) hsComParam.get("readAreaPlcHsDB101"); + this.readAreaPlcHs102 = (Hashtable) hsComParam.get("readAreaPlcHsDB102"); + this.readAreaPlcHs104 = (Hashtable) hsComParam.get("readAreaPlcHsDB104"); + this.readAreaPlcHs105 = (Hashtable) hsComParam.get("readAreaPlcHsDB105"); + this.readAreaPlcHs106 = (Hashtable) hsComParam.get("readAreaPlcHsDB106"); + this.readAreaPlcHs107 = (Hashtable) hsComParam.get("readAreaPlcHsDB107"); + this.readAreaPlcHs103 = (Hashtable) hsComParam.get("readAreaPlcHsDB103"); + this.readAreaPlcHs105_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB105_2"); + this.readAreaPlcHs151 = (Hashtable) hsComParam.get("readAreaPlcHsDB151"); + + + this.readAreaPlcHs108 = (Hashtable) hsComParam.get("readAreaPlcHsDB108"); + this.client = tp2; + } + + public void run() { + + Iterator iterobj; + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.setCaretPosition( + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.getText().length() + - 20); + try { + + if (readAreaPlcHs101 != null) { + iterobj = readAreaPlcHs101.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb101(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs102 != null) { + iterobj = readAreaPlcHs102.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDb102(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs104 != null) { + iterobj = readAreaPlcHs104.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb104(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs105 != null) { + iterobj = readAreaPlcHs105.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb105(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs105_2 != null) { + iterobj = readAreaPlcHs105_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb105_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs106 != null) { + iterobj = readAreaPlcHs106.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb106(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs107 != null) { + iterobj = readAreaPlcHs107.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb107(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs103 != null) { + iterobj = readAreaPlcHs103.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb103(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs151 != null) { + iterobj = readAreaPlcHs151.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb151(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + //2021-2-10 + if (readAreaPlcHs108 != null) { + iterobj = readAreaPlcHs108.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb108(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer103.java b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer103.java new file mode 100644 index 0000000..e7cc15e --- /dev/null +++ b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer103.java @@ -0,0 +1,76 @@ +package org.s7.standard.ynuo; + +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; + +import org.s7.standard.ynuo.client.IsoTcpClient103; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.common.server.config.DSSTabSel; + +/** + * ¸ÃÏ߳̽«´Ó¡¶¶Á»º´æÇø¡·£¨´Óplc¶ÁÈ¡µ½µÄÊý¾Ý´æ·ÅµÄλÖã©¶¨Ê±Ð´µ½Êý¾Ý¿âÖÐ + * + * @author admin + * + */ +public class ReadPlcDBAnalyServer103 implements Runnable { + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + //public Hashtable readAreaPlcHs = null; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + //public Hashtable readDotPlcHs = null; + Hashtable hsSysParam = null; + Hashtable hsComParam = null; + IsoTcpClient103 client = null; + + public EntityDAO dao; + + public ReadPlcDBAnalyServer103(Hashtable hsComParam, IsoTcpClient103 client) { + this.hsComParam = hsComParam; + this.hsSysParam = client.hsSysParam; + //this.readAreaPlcHs = (Hashtable) hsComParam.get("readAreaPlcHs3"); + this.client = client; + } + + public void run() { + Iterator iterobj; + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.setCaretPosition( + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.getText().length() + - 20); + try { + + for (int i = 201, x = 1; i <= 215; i++,x++) { + Hashtable readAreaPlcHs = null; + readAreaPlcHs = (Hashtable) hsComParam.get("readAreaPlcHsDB"+i); + if (readAreaPlcHs != null) { + iterobj = readAreaPlcHs.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + String key = (String) entry.getKey(); + if (client != null && client.IsConnect()) { + try { + plcVar.analysisDbDDJ("21-"+x); + } catch (Exception ex) { + } + } else { + break; + } + } + } + } + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer104.java b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer104.java new file mode 100644 index 0000000..76285bc --- /dev/null +++ b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer104.java @@ -0,0 +1,425 @@ +package org.s7.standard.ynuo; + +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; + +import org.s7.standard.ynuo.client.IsoTcpClient104; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.common.server.config.DSSTabSel; + +/** + * ¸ÃÏ߳̽«´Ó¡¶¶Á»º´æÇø¡·£¨´Óplc¶ÁÈ¡µ½µÄÊý¾Ý´æ·ÅµÄλÖã©¶¨Ê±Ð´µ½Êý¾Ý¿âÖÐ + * + * @author admin + * + */ +public class ReadPlcDBAnalyServer104 implements Runnable { + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHs1 = null; + public Hashtable readAreaPlcHs2 = null; + public Hashtable readAreaPlcHs2s = null; + public Hashtable readAreaPlcHs3 = null; + public Hashtable readAreaPlcHs4 = null; + public Hashtable readAreaPlcHs5 = null; + public Hashtable readAreaPlcHs6 = null; + public Hashtable readAreaPlcHs7 = null; + public Hashtable readAreaPlcHs8 = null; + public Hashtable readAreaPlcHs9 = null; + public Hashtable readAreaPlcHs10 = null; + public Hashtable readAreaPlcHs11 = null; + public Hashtable readAreaPlcHs12 = null; + public Hashtable readAreaPlcHs13 = null; + public Hashtable readAreaPlcHs14 = null; + public Hashtable readAreaPlcHs15 = null; + public Hashtable readAreaPlcHs16 = null; + public Hashtable readAreaPlcHs17 = null; + public Hashtable readAreaPlcHs18 = null; + public Hashtable readAreaPlcHs19 = null; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readDotPlcHs = null; + Hashtable hsSysParam = null; + Hashtable hsComParam = null; + IsoTcpClient104 client = null; + + public EntityDAO dao; + + public ReadPlcDBAnalyServer104(Hashtable hsComParam, IsoTcpClient104 tp2) { + this.hsComParam = hsComParam; + this.hsSysParam = tp2.hsSysParam; + this.readAreaPlcHs1 = (Hashtable) hsComParam.get("readAreaPlcHs4_1"); + this.readAreaPlcHs2 = (Hashtable) hsComParam.get("readAreaPlcHs4_2"); + this.readAreaPlcHs2s = (Hashtable) hsComParam.get("readAreaPlcHs4_2s"); + this.readAreaPlcHs3 = (Hashtable) hsComParam.get("readAreaPlcHs4_3"); + this.readAreaPlcHs4 = (Hashtable) hsComParam.get("readAreaPlcHs4_4"); + this.readAreaPlcHs5 = (Hashtable) hsComParam.get("readAreaPlcHs4_5"); + this.readAreaPlcHs6 = (Hashtable) hsComParam.get("readAreaPlcHs4_6"); + this.readAreaPlcHs7 = (Hashtable) hsComParam.get("readAreaPlcHs4_7"); + this.readAreaPlcHs8 = (Hashtable) hsComParam.get("readAreaPlcHs4_8"); + this.readAreaPlcHs9 = (Hashtable) hsComParam.get("readAreaPlcHs4_9"); + this.readAreaPlcHs10 = (Hashtable) hsComParam.get("readAreaPlcHs4_10"); + this.readAreaPlcHs11 = (Hashtable) hsComParam.get("readAreaPlcHs4_11"); + this.readAreaPlcHs12 = (Hashtable) hsComParam.get("readAreaPlcHs4_12"); + this.readAreaPlcHs13 = (Hashtable) hsComParam.get("readAreaPlcHs4_13"); + this.readAreaPlcHs14 = (Hashtable) hsComParam.get("readAreaPlcHs4_14"); + this.readAreaPlcHs15 = (Hashtable) hsComParam.get("readAreaPlcHs4_15"); + this.readAreaPlcHs16 = (Hashtable) hsComParam.get("readAreaPlcHs4_16"); + this.readAreaPlcHs17 = (Hashtable) hsComParam.get("readAreaPlcHs4_17"); + this.readAreaPlcHs18 = (Hashtable) hsComParam.get("readAreaPlcHs4_18"); + this.readAreaPlcHs19 = (Hashtable) hsComParam.get("readAreaPlcHs4_19"); + this.client = tp2; + } + + public void run() { + Iterator iterobj; + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.setCaretPosition( + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.getText().length() + - 20); + try { + + if (readAreaPlcHs1 != null) { + iterobj = readAreaPlcHs1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs2 != null) { + iterobj = readAreaPlcHs2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs2s != null) { + iterobj = readAreaPlcHs2s.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_2s(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs3 != null) { + iterobj = readAreaPlcHs3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs4 != null) { + iterobj = readAreaPlcHs4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs5 != null) { + iterobj = readAreaPlcHs5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs6 != null) { + iterobj = readAreaPlcHs6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs7 != null) { + iterobj = readAreaPlcHs7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs8 != null) { + iterobj = readAreaPlcHs8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs9 != null) { + iterobj = readAreaPlcHs9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + //System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs10 != null) { + iterobj = readAreaPlcHs10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + //ÒÔÏÂΪ»ñÈ¡²ð¶â»úÐÅÏ¢ + if (readAreaPlcHs11 != null) { + iterobj = readAreaPlcHs11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs12 != null) { + iterobj = readAreaPlcHs12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs13 != null) { + iterobj = readAreaPlcHs13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs14 != null) { + iterobj = readAreaPlcHs14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + }if (readAreaPlcHs15 != null) { + iterobj = readAreaPlcHs15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs16 != null) { + iterobj = readAreaPlcHs16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs17 != null) { + iterobj = readAreaPlcHs17.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_17(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs18 != null) { + iterobj = readAreaPlcHs18.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_18(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs19 != null) { + iterobj = readAreaPlcHs19.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + // System.out.println("------------------·Ö¸îÏß-------------------"); + plcVar.analysisDb4_19(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + // + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer171.java b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer171.java new file mode 100644 index 0000000..34c6120 --- /dev/null +++ b/src/org/s7/standard/ynuo/ReadPlcDBAnalyServer171.java @@ -0,0 +1,3054 @@ +package org.s7.standard.ynuo; + +import java.util.ArrayList; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Map; + +import org.s7.standard.ynuo.client.IsoTcpClient171; + +import com.ricosoft.common.dao.dataSource.EntityDAO; +import com.wms.dss.common.server.config.DSSTabSel; + +/** + * ¸ÃÏ߳̽«´Ó¡¶¶Á»º´æÇø¡·£¨´Óplc¶ÁÈ¡µ½µÄÊý¾Ý´æ·ÅµÄλÖã©¶¨Ê±Ð´µ½Êý¾Ý¿âÖÐ + * + * @author admin + * + */ +public class ReadPlcDBAnalyServer171 implements Runnable { + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + + public Hashtable readAreaPlcHs50_1 = null; + public Hashtable readAreaPlcHs50_2 = null; + public Hashtable readAreaPlcHs50_3 = null; + public Hashtable readAreaPlcHs50_4 = null; + public Hashtable readAreaPlcHs50_5 = null; + public Hashtable readAreaPlcHs50_6 = null; + public Hashtable readAreaPlcHs50_7 = null; + public Hashtable readAreaPlcHs50_8 = null; + public Hashtable readAreaPlcHs50_9 = null; + public Hashtable readAreaPlcHs50_10 = null; + public Hashtable readAreaPlcHs50_11 = null; + public Hashtable readAreaPlcHs50_12 = null; + public Hashtable readAreaPlcHs50_13 = null; + public Hashtable readAreaPlcHs50_14 = null; + public Hashtable readAreaPlcHs50_15 = null; + public Hashtable readAreaPlcHs50_16 = null; + + public Hashtable readAreaPlcHs49_1 = null; + public Hashtable readAreaPlcHs49_2 = null; + public Hashtable readAreaPlcHs49_3 = null; + public Hashtable readAreaPlcHs49_4 = null; + public Hashtable readAreaPlcHs49_5 = null; + public Hashtable readAreaPlcHs49_6 = null; + public Hashtable readAreaPlcHs49_7 = null; + public Hashtable readAreaPlcHs49_8 = null; + public Hashtable readAreaPlcHs49_9 = null; + public Hashtable readAreaPlcHs49_10 = null; + public Hashtable readAreaPlcHs49_11 = null; + public Hashtable readAreaPlcHs49_12 = null; + public Hashtable readAreaPlcHs49_13 = null; + public Hashtable readAreaPlcHs49_14 = null; + public Hashtable readAreaPlcHs49_15 = null; + public Hashtable readAreaPlcHs49_16 = null; + + + public Hashtable readAreaPlcHs48_1 = null; + public Hashtable readAreaPlcHs48_2 = null; + public Hashtable readAreaPlcHs48_3 = null; + public Hashtable readAreaPlcHs48_4 = null; + public Hashtable readAreaPlcHs48_5 = null; + public Hashtable readAreaPlcHs48_6 = null; + public Hashtable readAreaPlcHs48_7 = null; + public Hashtable readAreaPlcHs48_8 = null; + public Hashtable readAreaPlcHs48_9 = null; + public Hashtable readAreaPlcHs48_10 = null; + public Hashtable readAreaPlcHs48_11 = null; + public Hashtable readAreaPlcHs48_12 = null; + public Hashtable readAreaPlcHs48_13 = null; + public Hashtable readAreaPlcHs48_14 = null; + public Hashtable readAreaPlcHs48_15 = null; + public Hashtable readAreaPlcHs48_16 = null; + + + + public Hashtable readAreaPlcHs47_1 = null; + public Hashtable readAreaPlcHs47_2 = null; + public Hashtable readAreaPlcHs47_3 = null; + public Hashtable readAreaPlcHs47_4 = null; + public Hashtable readAreaPlcHs47_5 = null; + public Hashtable readAreaPlcHs47_6 = null; + public Hashtable readAreaPlcHs47_7 = null; + public Hashtable readAreaPlcHs47_8 = null; + public Hashtable readAreaPlcHs47_9 = null; + public Hashtable readAreaPlcHs47_10 = null; + public Hashtable readAreaPlcHs47_11 = null; + public Hashtable readAreaPlcHs47_12 = null; + public Hashtable readAreaPlcHs47_13 = null; + public Hashtable readAreaPlcHs47_14 = null; + public Hashtable readAreaPlcHs47_15 = null; + public Hashtable readAreaPlcHs47_16 = null; + + public Hashtable readAreaPlcHs46_1 = null; + public Hashtable readAreaPlcHs46_2 = null; + public Hashtable readAreaPlcHs46_3 = null; + public Hashtable readAreaPlcHs46_4 = null; + public Hashtable readAreaPlcHs46_5 = null; + public Hashtable readAreaPlcHs46_6 = null; + public Hashtable readAreaPlcHs46_7 = null; + public Hashtable readAreaPlcHs46_8 = null; + public Hashtable readAreaPlcHs46_9 = null; + public Hashtable readAreaPlcHs46_10 = null; + public Hashtable readAreaPlcHs46_11 = null; + public Hashtable readAreaPlcHs46_12 = null; + public Hashtable readAreaPlcHs46_13 = null; + public Hashtable readAreaPlcHs46_14 = null; + public Hashtable readAreaPlcHs46_15 = null; + public Hashtable readAreaPlcHs46_16 = null; + + + public Hashtable readAreaPlcHs45_1 = null; + public Hashtable readAreaPlcHs45_2 = null; + public Hashtable readAreaPlcHs45_3 = null; + public Hashtable readAreaPlcHs45_4 = null; + public Hashtable readAreaPlcHs45_5 = null; + public Hashtable readAreaPlcHs45_6 = null; + public Hashtable readAreaPlcHs45_7 = null; + public Hashtable readAreaPlcHs45_8 = null; + public Hashtable readAreaPlcHs45_9 = null; + public Hashtable readAreaPlcHs45_10 = null; + public Hashtable readAreaPlcHs45_11 = null; + public Hashtable readAreaPlcHs45_12 = null; + public Hashtable readAreaPlcHs45_13 = null; + public Hashtable readAreaPlcHs45_14 = null; + public Hashtable readAreaPlcHs45_15 = null; + public Hashtable readAreaPlcHs45_16 = null; + + public Hashtable readAreaPlcHs44_1 = null; + public Hashtable readAreaPlcHs44_2 = null; + public Hashtable readAreaPlcHs44_3 = null; + public Hashtable readAreaPlcHs44_4 = null; + public Hashtable readAreaPlcHs44_5 = null; + public Hashtable readAreaPlcHs44_6 = null; + public Hashtable readAreaPlcHs44_7 = null; + public Hashtable readAreaPlcHs44_8 = null; + public Hashtable readAreaPlcHs44_9 = null; + public Hashtable readAreaPlcHs44_10 = null; + public Hashtable readAreaPlcHs44_11 = null; + public Hashtable readAreaPlcHs44_12 = null; + public Hashtable readAreaPlcHs44_13 = null; + public Hashtable readAreaPlcHs44_14 = null; + public Hashtable readAreaPlcHs44_15 = null; + public Hashtable readAreaPlcHs44_16 = null; + + public Hashtable readAreaPlcHs43_1 = null; + public Hashtable readAreaPlcHs43_2 = null; + public Hashtable readAreaPlcHs43_3 = null; + public Hashtable readAreaPlcHs43_4 = null; + public Hashtable readAreaPlcHs43_5 = null; + public Hashtable readAreaPlcHs43_6 = null; + public Hashtable readAreaPlcHs43_7 = null; + public Hashtable readAreaPlcHs43_8 = null; + public Hashtable readAreaPlcHs43_9 = null; + public Hashtable readAreaPlcHs43_10 = null; + public Hashtable readAreaPlcHs43_11 = null; + public Hashtable readAreaPlcHs43_12 = null; + public Hashtable readAreaPlcHs43_13 = null; + public Hashtable readAreaPlcHs43_14 = null; + public Hashtable readAreaPlcHs43_15 = null; + public Hashtable readAreaPlcHs43_16 = null; + + + public Hashtable readAreaPlcHs42_1 = null; + public Hashtable readAreaPlcHs42_2 = null; + public Hashtable readAreaPlcHs42_3 = null; + public Hashtable readAreaPlcHs42_4 = null; + public Hashtable readAreaPlcHs42_5 = null; + public Hashtable readAreaPlcHs42_6 = null; + public Hashtable readAreaPlcHs42_7 = null; + public Hashtable readAreaPlcHs42_8 = null; + public Hashtable readAreaPlcHs42_9 = null; + public Hashtable readAreaPlcHs42_10 = null; + public Hashtable readAreaPlcHs42_11 = null; + public Hashtable readAreaPlcHs42_12 = null; + public Hashtable readAreaPlcHs42_13 = null; + public Hashtable readAreaPlcHs42_14 = null; + public Hashtable readAreaPlcHs42_15 = null; + public Hashtable readAreaPlcHs42_16 = null; + + + public Hashtable readAreaPlcHs41_1 = null; + public Hashtable readAreaPlcHs41_2 = null; + public Hashtable readAreaPlcHs41_3 = null; + public Hashtable readAreaPlcHs41_4 = null; + public Hashtable readAreaPlcHs41_5 = null; + public Hashtable readAreaPlcHs41_6 = null; + public Hashtable readAreaPlcHs41_7 = null; + public Hashtable readAreaPlcHs41_8 = null; + public Hashtable readAreaPlcHs41_9 = null; + public Hashtable readAreaPlcHs41_10 = null; + public Hashtable readAreaPlcHs41_11 = null; + public Hashtable readAreaPlcHs41_12 = null; + public Hashtable readAreaPlcHs41_13 = null; + public Hashtable readAreaPlcHs41_14 = null; + public Hashtable readAreaPlcHs41_15 = null; + public Hashtable readAreaPlcHs41_16 = null; + + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readDotPlcHs = null; + Hashtable hsSysParam = null; + Hashtable hsComParam = null; + IsoTcpClient171 client = null; + + public EntityDAO dao; + + public ReadPlcDBAnalyServer171(Hashtable hsComParam, IsoTcpClient171 tp) { + this.hsComParam = hsComParam; + this.hsSysParam = tp.hsSysParam; + + this.readAreaPlcHs50_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_1"); + this.readAreaPlcHs50_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_2"); + this.readAreaPlcHs50_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_3"); + this.readAreaPlcHs50_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_4"); + this.readAreaPlcHs50_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_5"); + this.readAreaPlcHs50_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_6"); + this.readAreaPlcHs50_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_7"); + this.readAreaPlcHs50_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_8"); + this.readAreaPlcHs50_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_9"); + this.readAreaPlcHs50_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_10"); + this.readAreaPlcHs50_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_11"); + this.readAreaPlcHs50_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_12"); + this.readAreaPlcHs50_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_13"); + this.readAreaPlcHs50_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_14"); + this.readAreaPlcHs50_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_15"); + this.readAreaPlcHs50_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_16"); + + this.readAreaPlcHs49_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_1"); + this.readAreaPlcHs49_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_2"); + this.readAreaPlcHs49_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_3"); + this.readAreaPlcHs49_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_4"); + this.readAreaPlcHs49_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_5"); + this.readAreaPlcHs49_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_6"); + this.readAreaPlcHs49_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_7"); + this.readAreaPlcHs49_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_8"); + this.readAreaPlcHs49_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_9"); + this.readAreaPlcHs49_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_10"); + this.readAreaPlcHs49_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_11"); + this.readAreaPlcHs49_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_12"); + this.readAreaPlcHs49_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_13"); + this.readAreaPlcHs49_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_14"); + this.readAreaPlcHs49_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_15"); + this.readAreaPlcHs49_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_16"); + + this.readAreaPlcHs48_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_1"); + this.readAreaPlcHs48_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_2"); + this.readAreaPlcHs48_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_3"); + this.readAreaPlcHs48_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_4"); + this.readAreaPlcHs48_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_5"); + this.readAreaPlcHs48_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_6"); + this.readAreaPlcHs48_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_7"); + this.readAreaPlcHs48_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_8"); + this.readAreaPlcHs48_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_9"); + this.readAreaPlcHs48_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_10"); + this.readAreaPlcHs48_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_11"); + this.readAreaPlcHs48_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_12"); + this.readAreaPlcHs48_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_13"); + this.readAreaPlcHs48_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_14"); + this.readAreaPlcHs48_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_15"); + this.readAreaPlcHs48_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_16"); + + this.readAreaPlcHs47_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_1"); + this.readAreaPlcHs47_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_2"); + this.readAreaPlcHs47_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_3"); + this.readAreaPlcHs47_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_4"); + this.readAreaPlcHs47_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_5"); + this.readAreaPlcHs47_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_6"); + this.readAreaPlcHs47_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_7"); + this.readAreaPlcHs47_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_8"); + this.readAreaPlcHs47_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_9"); + this.readAreaPlcHs47_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_10"); + this.readAreaPlcHs47_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_11"); + this.readAreaPlcHs47_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_12"); + this.readAreaPlcHs47_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_13"); + this.readAreaPlcHs47_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_14"); + this.readAreaPlcHs47_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_15"); + this.readAreaPlcHs47_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_16"); + + + + this.readAreaPlcHs46_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_1"); + this.readAreaPlcHs46_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_2"); + this.readAreaPlcHs46_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_3"); + this.readAreaPlcHs46_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_4"); + this.readAreaPlcHs46_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_5"); + this.readAreaPlcHs46_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_6"); + this.readAreaPlcHs46_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_7"); + this.readAreaPlcHs46_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_8"); + this.readAreaPlcHs46_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_9"); + this.readAreaPlcHs46_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_10"); + this.readAreaPlcHs46_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_11"); + this.readAreaPlcHs46_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_12"); + this.readAreaPlcHs46_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_13"); + this.readAreaPlcHs46_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_14"); + this.readAreaPlcHs46_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_15"); + this.readAreaPlcHs46_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_16"); + + + this.readAreaPlcHs45_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_1"); + this.readAreaPlcHs45_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_2"); + this.readAreaPlcHs45_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_3"); + this.readAreaPlcHs45_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_4"); + this.readAreaPlcHs45_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_5"); + this.readAreaPlcHs45_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_6"); + this.readAreaPlcHs45_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_7"); + this.readAreaPlcHs45_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_8"); + this.readAreaPlcHs45_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_9"); + this.readAreaPlcHs45_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_10"); + this.readAreaPlcHs45_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_11"); + this.readAreaPlcHs45_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_12"); + this.readAreaPlcHs45_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_13"); + this.readAreaPlcHs45_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_14"); + this.readAreaPlcHs45_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_15"); + this.readAreaPlcHs45_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_16"); + + this.readAreaPlcHs44_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_1"); + this.readAreaPlcHs44_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_2"); + this.readAreaPlcHs44_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_3"); + this.readAreaPlcHs44_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_4"); + this.readAreaPlcHs44_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_5"); + this.readAreaPlcHs44_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_6"); + this.readAreaPlcHs44_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_7"); + this.readAreaPlcHs44_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_8"); + this.readAreaPlcHs44_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_9"); + this.readAreaPlcHs44_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_10"); + this.readAreaPlcHs44_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_11"); + this.readAreaPlcHs44_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_12"); + this.readAreaPlcHs44_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_13"); + this.readAreaPlcHs44_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_14"); + this.readAreaPlcHs44_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_15"); + this.readAreaPlcHs44_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_16"); + + + this.readAreaPlcHs43_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_1"); + this.readAreaPlcHs43_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_2"); + this.readAreaPlcHs43_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_3"); + this.readAreaPlcHs43_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_4"); + this.readAreaPlcHs43_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_5"); + this.readAreaPlcHs43_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_6"); + this.readAreaPlcHs43_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_7"); + this.readAreaPlcHs43_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_8"); + this.readAreaPlcHs43_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_9"); + this.readAreaPlcHs43_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_10"); + this.readAreaPlcHs43_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_11"); + this.readAreaPlcHs43_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_12"); + this.readAreaPlcHs43_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_13"); + this.readAreaPlcHs43_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_14"); + this.readAreaPlcHs43_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_15"); + this.readAreaPlcHs43_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_16"); + + + this.readAreaPlcHs42_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_1"); + this.readAreaPlcHs42_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_2"); + this.readAreaPlcHs42_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_3"); + this.readAreaPlcHs42_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_4"); + this.readAreaPlcHs42_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_5"); + this.readAreaPlcHs42_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_6"); + this.readAreaPlcHs42_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_7"); + this.readAreaPlcHs42_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_8"); + this.readAreaPlcHs42_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_9"); + this.readAreaPlcHs42_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_10"); + this.readAreaPlcHs42_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_11"); + this.readAreaPlcHs42_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_12"); + this.readAreaPlcHs42_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_13"); + this.readAreaPlcHs42_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_14"); + this.readAreaPlcHs42_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_15"); + this.readAreaPlcHs42_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_16"); + + this.readAreaPlcHs41_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_1"); + this.readAreaPlcHs41_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_2"); + this.readAreaPlcHs41_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_3"); + this.readAreaPlcHs41_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_4"); + this.readAreaPlcHs41_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_5"); + this.readAreaPlcHs41_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_6"); + this.readAreaPlcHs41_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_7"); + this.readAreaPlcHs41_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_8"); + this.readAreaPlcHs41_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_9"); + this.readAreaPlcHs41_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_10"); + this.readAreaPlcHs41_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_11"); + this.readAreaPlcHs41_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_12"); + this.readAreaPlcHs41_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_13"); + this.readAreaPlcHs41_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_14"); + this.readAreaPlcHs41_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_15"); + this.readAreaPlcHs41_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_16"); + + this.client = tp; + } + + public void run() { + + Iterator iterobj; + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.setCaretPosition( + ((DSSTabSel) (((ArrayList) hsSysParam.get("DSSTabSel")).get(0))).jTextArea.getText().length() + - 20); + try { + + if (readAreaPlcHs50_1 != null) { + iterobj = readAreaPlcHs50_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs50_2 != null) { + iterobj = readAreaPlcHs50_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_3 != null) { + iterobj = readAreaPlcHs50_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs50_4 != null) { + iterobj = readAreaPlcHs50_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_5 != null) { + iterobj = readAreaPlcHs50_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_6 != null) { + iterobj = readAreaPlcHs50_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs50_7 != null) { + iterobj = readAreaPlcHs50_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_8 != null) { + iterobj = readAreaPlcHs50_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_9 != null) { + iterobj = readAreaPlcHs50_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_10 != null) { + iterobj = readAreaPlcHs50_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_11 != null) { + iterobj = readAreaPlcHs50_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_12 != null) { + iterobj = readAreaPlcHs50_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs50_13 != null) { + iterobj = readAreaPlcHs50_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_14 != null) { + iterobj = readAreaPlcHs50_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs50_15 != null) { + iterobj = readAreaPlcHs50_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs50_16 != null) { + iterobj = readAreaPlcHs50_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb50_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + //---------------------------------------- + if (readAreaPlcHs49_1 != null) { + iterobj = readAreaPlcHs49_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs49_2 != null) { + iterobj = readAreaPlcHs49_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_3 != null) { + iterobj = readAreaPlcHs49_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs49_4 != null) { + iterobj = readAreaPlcHs49_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_5 != null) { + iterobj = readAreaPlcHs49_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_6 != null) { + iterobj = readAreaPlcHs49_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs49_7 != null) { + iterobj = readAreaPlcHs49_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_8 != null) { + iterobj = readAreaPlcHs49_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_9 != null) { + iterobj = readAreaPlcHs49_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_10 != null) { + iterobj = readAreaPlcHs49_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_11 != null) { + iterobj = readAreaPlcHs49_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_12 != null) { + iterobj = readAreaPlcHs49_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs49_13 != null) { + iterobj = readAreaPlcHs49_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_14 != null) { + iterobj = readAreaPlcHs49_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs49_15 != null) { + iterobj = readAreaPlcHs49_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs49_16 != null) { + iterobj = readAreaPlcHs49_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb49_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + //=========================================================== + if (readAreaPlcHs48_1 != null) { + iterobj = readAreaPlcHs48_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs48_2 != null) { + iterobj = readAreaPlcHs48_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_3 != null) { + iterobj = readAreaPlcHs48_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs48_4 != null) { + iterobj = readAreaPlcHs48_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_5 != null) { + iterobj = readAreaPlcHs48_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_6 != null) { + iterobj = readAreaPlcHs48_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs48_7 != null) { + iterobj = readAreaPlcHs48_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_8 != null) { + iterobj = readAreaPlcHs48_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_9 != null) { + iterobj = readAreaPlcHs48_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_10 != null) { + iterobj = readAreaPlcHs48_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_11 != null) { + iterobj = readAreaPlcHs48_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_12 != null) { + iterobj = readAreaPlcHs48_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs48_13 != null) { + iterobj = readAreaPlcHs48_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_14 != null) { + iterobj = readAreaPlcHs48_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs48_15 != null) { + iterobj = readAreaPlcHs48_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs48_16 != null) { + iterobj = readAreaPlcHs48_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb48_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + + //=========================================================== + if (readAreaPlcHs47_1 != null) { + iterobj = readAreaPlcHs47_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs47_2 != null) { + iterobj = readAreaPlcHs47_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_3 != null) { + iterobj = readAreaPlcHs47_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs47_4 != null) { + iterobj = readAreaPlcHs47_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_5 != null) { + iterobj = readAreaPlcHs47_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_6 != null) { + iterobj = readAreaPlcHs47_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs47_7 != null) { + iterobj = readAreaPlcHs47_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_8 != null) { + iterobj = readAreaPlcHs47_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_9 != null) { + iterobj = readAreaPlcHs47_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_10 != null) { + iterobj = readAreaPlcHs47_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_11 != null) { + iterobj = readAreaPlcHs47_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_12 != null) { + iterobj = readAreaPlcHs47_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs47_13 != null) { + iterobj = readAreaPlcHs47_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_14 != null) { + iterobj = readAreaPlcHs47_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs47_15 != null) { + iterobj = readAreaPlcHs47_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs47_16 != null) { + iterobj = readAreaPlcHs47_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb47_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + //=========================================================== + if (readAreaPlcHs46_1 != null) { + iterobj = readAreaPlcHs46_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs46_2 != null) { + iterobj = readAreaPlcHs46_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_3 != null) { + iterobj = readAreaPlcHs46_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs46_4 != null) { + iterobj = readAreaPlcHs46_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_5 != null) { + iterobj = readAreaPlcHs46_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_6 != null) { + iterobj = readAreaPlcHs46_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs46_7 != null) { + iterobj = readAreaPlcHs46_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_8 != null) { + iterobj = readAreaPlcHs46_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_9 != null) { + iterobj = readAreaPlcHs46_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_10 != null) { + iterobj = readAreaPlcHs46_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_11 != null) { + iterobj = readAreaPlcHs46_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_12 != null) { + iterobj = readAreaPlcHs46_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs46_13 != null) { + iterobj = readAreaPlcHs46_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_14 != null) { + iterobj = readAreaPlcHs46_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs46_15 != null) { + iterobj = readAreaPlcHs46_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs46_16 != null) { + iterobj = readAreaPlcHs46_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb46_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + + + + //=========================================================== + if (readAreaPlcHs45_1 != null) { + iterobj = readAreaPlcHs45_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs45_2 != null) { + iterobj = readAreaPlcHs45_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_3 != null) { + iterobj = readAreaPlcHs45_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs45_4 != null) { + iterobj = readAreaPlcHs45_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_5 != null) { + iterobj = readAreaPlcHs45_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_6 != null) { + iterobj = readAreaPlcHs45_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs45_7 != null) { + iterobj = readAreaPlcHs45_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_8 != null) { + iterobj = readAreaPlcHs45_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_9 != null) { + iterobj = readAreaPlcHs45_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_10 != null) { + iterobj = readAreaPlcHs45_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_11 != null) { + iterobj = readAreaPlcHs45_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_12 != null) { + iterobj = readAreaPlcHs45_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs45_13 != null) { + iterobj = readAreaPlcHs45_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_14 != null) { + iterobj = readAreaPlcHs45_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs45_15 != null) { + iterobj = readAreaPlcHs45_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs45_16 != null) { + iterobj = readAreaPlcHs45_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb45_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + + + //=========================================================== + if (readAreaPlcHs44_1 != null) { + iterobj = readAreaPlcHs44_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs44_2 != null) { + iterobj = readAreaPlcHs44_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_3 != null) { + iterobj = readAreaPlcHs44_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs44_4 != null) { + iterobj = readAreaPlcHs44_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_5 != null) { + iterobj = readAreaPlcHs44_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_6 != null) { + iterobj = readAreaPlcHs44_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs44_7 != null) { + iterobj = readAreaPlcHs44_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_8 != null) { + iterobj = readAreaPlcHs44_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_9 != null) { + iterobj = readAreaPlcHs44_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_10 != null) { + iterobj = readAreaPlcHs44_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_11 != null) { + iterobj = readAreaPlcHs44_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_12 != null) { + iterobj = readAreaPlcHs44_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs44_13 != null) { + iterobj = readAreaPlcHs44_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_14 != null) { + iterobj = readAreaPlcHs44_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs44_15 != null) { + iterobj = readAreaPlcHs44_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs44_16 != null) { + iterobj = readAreaPlcHs44_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb44_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + + + + //=========================================================== + if (readAreaPlcHs43_1 != null) { + iterobj = readAreaPlcHs43_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs43_2 != null) { + iterobj = readAreaPlcHs43_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_3 != null) { + iterobj = readAreaPlcHs43_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs43_4 != null) { + iterobj = readAreaPlcHs43_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_5 != null) { + iterobj = readAreaPlcHs43_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_6 != null) { + iterobj = readAreaPlcHs43_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs43_7 != null) { + iterobj = readAreaPlcHs43_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_8 != null) { + iterobj = readAreaPlcHs43_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_9 != null) { + iterobj = readAreaPlcHs43_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_10 != null) { + iterobj = readAreaPlcHs43_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_11 != null) { + iterobj = readAreaPlcHs43_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_12 != null) { + iterobj = readAreaPlcHs43_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs43_13 != null) { + iterobj = readAreaPlcHs43_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_14 != null) { + iterobj = readAreaPlcHs43_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs43_15 != null) { + iterobj = readAreaPlcHs43_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs43_16 != null) { + iterobj = readAreaPlcHs43_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb43_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + //=========================================================== + if (readAreaPlcHs42_1 != null) { + iterobj = readAreaPlcHs42_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs42_2 != null) { + iterobj = readAreaPlcHs42_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_3 != null) { + iterobj = readAreaPlcHs42_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs42_4 != null) { + iterobj = readAreaPlcHs42_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_5 != null) { + iterobj = readAreaPlcHs42_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_6 != null) { + iterobj = readAreaPlcHs42_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs42_7 != null) { + iterobj = readAreaPlcHs42_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_8 != null) { + iterobj = readAreaPlcHs42_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_9 != null) { + iterobj = readAreaPlcHs42_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_10 != null) { + iterobj = readAreaPlcHs42_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_11 != null) { + iterobj = readAreaPlcHs42_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_12 != null) { + iterobj = readAreaPlcHs42_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs42_13 != null) { + iterobj = readAreaPlcHs42_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_14 != null) { + iterobj = readAreaPlcHs42_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs42_15 != null) { + iterobj = readAreaPlcHs42_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs42_16 != null) { + iterobj = readAreaPlcHs42_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb42_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + //=========================================================== + if (readAreaPlcHs41_1 != null) { + iterobj = readAreaPlcHs41_1.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_1(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs41_2 != null) { + iterobj = readAreaPlcHs41_2.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_2(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_3 != null) { + iterobj = readAreaPlcHs41_3.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_3(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs41_4 != null) { + iterobj = readAreaPlcHs41_4.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_4(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_5 != null) { + iterobj = readAreaPlcHs41_5.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_5(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_6 != null) { + iterobj = readAreaPlcHs41_6.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_6(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs41_7 != null) { + iterobj = readAreaPlcHs41_7.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_7(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_8 != null) { + iterobj = readAreaPlcHs41_8.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_8(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_9 != null) { + iterobj = readAreaPlcHs41_9.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_9(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_10 != null) { + iterobj = readAreaPlcHs41_10.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_10(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_11 != null) { + iterobj = readAreaPlcHs41_11.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_11(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_12 != null) { + iterobj = readAreaPlcHs41_12.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_12(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs41_13 != null) { + iterobj = readAreaPlcHs41_13.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_13(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_14 != null) { + iterobj = readAreaPlcHs41_14.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_14(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + if (readAreaPlcHs41_15 != null) { + iterobj = readAreaPlcHs41_15.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_15(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + if (readAreaPlcHs41_16 != null) { + iterobj = readAreaPlcHs41_16.entrySet().iterator(); + while (iterobj.hasNext()) { + Map.Entry entry = (Map.Entry) iterobj.next(); + ReadAreaPlcInterface plcVar = (ReadAreaPlcInterface) entry.getValue(); + if (client != null && client.IsConnect()) { + try { + + plcVar.analysisDb41_16(); + } catch (Exception ex) { + } + } else { + break; + } + } + } + + + + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } +} diff --git a/src/org/s7/standard/ynuo/WriteDotPlcInterface.java b/src/org/s7/standard/ynuo/WriteDotPlcInterface.java new file mode 100644 index 0000000..94fd9ba --- /dev/null +++ b/src/org/s7/standard/ynuo/WriteDotPlcInterface.java @@ -0,0 +1,155 @@ +package org.s7.standard.ynuo; + +import java.util.ArrayList; +import java.util.List; +import org.libnodave.Nodave; +import com.ricosoft.common.logger.Logger; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; + +/** + * ½«Êý¾ÝдÈëµ½PLC»º´æÖÐ £¨±ê×¼Àࣩ + * + * @author admin + */ +public class WriteDotPlcInterface implements PlcInterface { + /* ×¢£ºÖ¸ÁîÀàÐÍ+ÀàÐÍÖµ ÊÇΨһµÄ */ + /* Ö¸ÁîÀàÐÍ */ + public String cmdtype = ""; + /* ÀàÐÍÖµ */ + public String cmdvalue = ""; + /* дÈëÍê³É±êʶ */ + public volatile boolean bflag = false; + + /* ½«Êý¾Ý¿âÖеÄÊý¾Ý¶ÁÈ¡µ½Ð´ÈëlsWriteGroupPlcÖÐ Ö»Óе±lsWriteGroupPlc.size()Ϊ0ʱ£¬²ÅÐèÒª´ÓÊý¾Ý¿âÖжÁÈ¡ */ + public List lsWriteGroupPlc = new ArrayList(); + + public WriteDotPlcInterface(String cmdtype, String cmdvalue) { + this.cmdtype = cmdtype; + this.cmdvalue = cmdvalue; + } + + public WriteDotPlcInterface() { + super(); + } + + /* ´ÓÊý¾Ý¿âÖжÁÈ¡Ïà¹ØµÄÖ¸ÁÉú³ÉPLC¿Éʶ±ðµÄÖ¸ÁWritePlcInterface.groupPlcObj£© */ + public int Analysis(String json) { + int back_msg = -1; + if (lsWriteGroupPlc != null && lsWriteGroupPlc.size() < 1) { + try { + JSONArray content = JSONArray.fromObject(json); + if (content != null && content.size() > 0) {// ½âÎöÊý¾ÝÌå + bflag = false;// дÈ뿪ʼ + for (int i = 0; i < content.size(); i++) { + JSONObject jo = content.getJSONObject(i); + WriteDotPlcInterface.groupPlcObj group = new WriteDotPlcInterface.groupPlcObj(); + group.DBnum = jo.getInt("DBnum"); + group.dtype = jo.getInt("dtype"); + group.len = jo.getInt("len"); + group.start = jo.getInt("start"); + group.value = jo.get("value"); + group.buffer = group.getBuffer(group.value, group.dtype, group.len); + lsWriteGroupPlc.add(group); + } + } + back_msg = 1;// ÍÆËͳɹ¦ + } catch (Exception e) { + Logger.error("дÈëÖ¸Áî" + json + "Òì³£" + e.getMessage()); + } finally { + bflag = true;// дÈëÍê³É + } + } + return back_msg; + } + + public class groupPlcObj { + int area = Nodave.DB; + /* DBºÅ */ + public int DBnum; + /* ¿ªÊ¼Î»Öà */ + public int start; + /* ×Ö½Ú³¤¶È */ + public int len; + /* Öµ */ + public Object value; + /* ÊýÖµÀàÐÍ */ + public int dtype; + /* ±äÁ¿Ãû³Æ */ + public String name; + /* ֵתΪ×Ö½Ú */ + public byte[] buffer; + + public groupPlcObj() { + } + + public groupPlcObj(int DBnum, int dtype, int len, int start, Object value) { + this.DBnum = DBnum; + this.dtype = dtype; + this.len = len; + this.start = start; + this.value = value; + this.buffer = getBuffer(value, dtype, len); + } + + public int getArea() { + return area; + } + + public int getDBnum() { + return DBnum; + } + + public int getStart() { + return start; + } + + public int getLen() { + return len; + } + + public Object getValue() { + return value; + } + + public int getDtype() { + return dtype; + } + + public String getName() { + return name; + } + + public byte[] getBuffer() { + return buffer; + } + + /** + * @param value + * ת»»Öµ + * @param dtype + * ÀàÐÍ + * @param len + * ×Ö½ÚÊý + * @return byte[] + */ + public byte[] getBuffer(Object value, int dtype, int len) { + + byte[] buffer = null; + if (dtype == BYTE) { + buffer = Nodave.bswap_8(Byte.parseByte(value.toString())); + } else if (dtype == FLOAT) { + buffer = Nodave.toPLCfloat(Float.parseFloat(value.toString())); + } else if (dtype == INT) { + buffer = Nodave.bswap_16(Integer.parseInt(value.toString())); + } else if (dtype == DINT) { + buffer = Nodave.bswap_32(Integer.parseInt(value.toString())); + } else if (dtype == CHAR) { + buffer = Nodave.bswap_8(Byte.parseByte(value.toString())); + } else if (dtype == STRING) { + buffer = Nodave.bswap_64(Long.parseLong(value.toString())); + } + return buffer; + } + } +} diff --git a/src/org/s7/standard/ynuo/client/IsoTcpClient100.java b/src/org/s7/standard/ynuo/client/IsoTcpClient100.java new file mode 100644 index 0000000..61d4061 --- /dev/null +++ b/src/org/s7/standard/ynuo/client/IsoTcpClient100.java @@ -0,0 +1,776 @@ +package org.s7.standard.ynuo.client; + +import com.ricosoft.common.logger.Logger; +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +import org.s7.standard.ynuo.ReadAreaPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface.groupPlcObj; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.*; + +public class IsoTcpClient100 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHsMD101 = null; + public Hashtable readAreaPlcHsMD102 = null; + public Hashtable readAreaPlcHsMD103 = null; + public Hashtable readAreaPlcHsMD104 = null; + public Hashtable readAreaPlcHsMD105 = null; + public Hashtable readAreaPlcHsMD106 = null; + public Hashtable readAreaPlcHsMD107 = null; + public Hashtable readAreaPlcHsMD108 = null; + public Hashtable readAreaPlcHsMD109 = null; + public Hashtable readAreaPlcHsMD110 = null; +// public Hashtable readAreaPlcHs2 = null; +// public Hashtable readAreaPlcHs3 = null; +// public Hashtable readAreaPlcHs4 = null; +// public Hashtable readAreaPlcHs5 = null; + + /* ´æ·ÅдÈëµÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable writePlcHs = null; + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + + public IsoTcpClient100(Hashtable hsComParam, Hashtable hsSysParam) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + this.readAreaPlcHsMD101 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_101"); + this.readAreaPlcHsMD102 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_102"); + this.readAreaPlcHsMD103 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_103"); + this.readAreaPlcHsMD104 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_104"); + this.readAreaPlcHsMD105 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_105"); + this.readAreaPlcHsMD106 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_106"); + this.readAreaPlcHsMD107 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_107"); + this.readAreaPlcHsMD108 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_108"); + this.readAreaPlcHsMD109 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_109"); + this.readAreaPlcHsMD110 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_110"); +// this.readAreaPlcHs2 = (Hashtable) hsComParam.get("readAreaPlcHs1_2"); +// this.readAreaPlcHs3 = (Hashtable) hsComParam.get("readAreaPlcHs1_3"); +// this.readAreaPlcHs4 = (Hashtable) hsComParam.get("readAreaPlcHs1_4"); +// this.readAreaPlcHs5 = (Hashtable) hsComParam.get("readAreaPlcHs1_5"); + this.writePlcHs = (Hashtable) hsComParam.get("writePlcHs1"); + this.strIp = (String) hsComParam.get("strIp1"); + this.iPort = (Integer) hsComParam.get("iPort1"); + this.slot = (Integer) hsComParam.get("slot1"); + + } + + void ConnectServer() { + try { + sock = new Socket(strIp, iPort); + sock.setSoTimeout(6000); // ÉèÖó¬Ê±Ê±¼ä6Ãë + oStream = sock.getOutputStream(); + iStream = sock.getInputStream(); + + Nodave.Debug = 0x00;// ²»µ÷ʽ + di = new PLCinterface(oStream, iStream, "PLCName", 0, Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + + int res = dc.connectPLC(); + if (0 == res) { + setIsConnect(true); + } else { + } + } catch (IOException ioex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½Óʧ°Ü " + ioex.getMessage()); + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (di != null) { + di.isConnect = bflag; + } + } + + public boolean IsConnect() { + if (di != null) { + return di.isConnect; + } + return false; + } + + void closeServer() { + try { + setIsConnect(false); + clearReadDB(); + if (iStream != null) { + iStream.close(); + iStream = null; + } + } catch (IOException e) { + Logger.info("ÊäÈëÁ÷¹Ø±ÕÒì³£ " + e.getMessage() + strIp + " ¶Ë¿Ú£º" + iPort); + } + try { + if (oStream != null) { + oStream.close(); + oStream = null; + } + } catch (IOException e) { + Logger.error("Êä³öÁ÷¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + " " + e.getMessage()); + } + try { + if (sock != null) { + sock.close(); + sock = null; + } + + } catch (IOException e) { + Logger.error("socket¿Í»§¶Ë¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + e.getMessage()); + } + } + + void clearReadDB() { + if (readAreaPlcHsMD101 != null) { + Iterator iterR = readAreaPlcHsMD101.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD102 != null) { + Iterator iterR = readAreaPlcHsMD102.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD103 != null) { + Iterator iterR = readAreaPlcHsMD103.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD104 != null) { + Iterator iterR = readAreaPlcHsMD104.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD105 != null) { + Iterator iterR = readAreaPlcHsMD105.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD106 != null) { + Iterator iterR = readAreaPlcHsMD106.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD107 != null) { + Iterator iterR = readAreaPlcHsMD107.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD108 != null) { + Iterator iterR = readAreaPlcHsMD108.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD109 != null) { + Iterator iterR = readAreaPlcHsMD109.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHsMD110 != null) { + Iterator iterR = readAreaPlcHsMD110.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + } + + void reConnect() { + closeServer(); + ConnectServer(); + } + + public void run() { + Iterator iterR = null; + Iterator iterW = null; + List groups = null; + groupPlcObj group = null; + WriteDotPlcInterface plcWVar = null; + ReadAreaPlcInterface plcRVar = null; + Map.Entry entry = null; + int i = 0; + int iPrintcount = 5;// 5´Î½øÐдòÓ¡ + int currDecRun = 0;// µ±Ç°Ö´ÐдÎÊý + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + if (IsConnect()) { + // ¶ÁÈ¡DB101¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ + ///Thread.sleep(100); + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd hh:mm:ss.SSS"); + //System.out.println("101:----" + df.format(t)); + + try { + if (readAreaPlcHsMD101 != null) { + iterR = readAreaPlcHsMD101.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try{ + if (readAreaPlcHsMD102 != null) { + iterR = readAreaPlcHsMD102.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + // System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD103 != null) { + iterR = readAreaPlcHsMD103.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD104 != null) { + iterR = readAreaPlcHsMD104.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD105 != null) { + iterR = readAreaPlcHsMD105.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + // System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD106 != null) { + iterR = readAreaPlcHsMD106.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD107 != null) { + iterR = readAreaPlcHsMD107.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD108 != null) { + iterR = readAreaPlcHsMD108.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD109 != null) { + iterR = readAreaPlcHsMD109.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + + } catch (Exception ex) { + reConnect(); + //ex.printStackTrace(); + } + + try{ + if (readAreaPlcHsMD110 != null) { + iterR = readAreaPlcHsMD110.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + + } catch (Exception ex) { + reConnect(); + //ex.printStackTrace(); + } + + + // дÈëµ½DB¿éÖÐÖ¸¶¨µÄλÖà + try { + if (IsConnect()) { + if (writePlcHs != null) { + t1 = System.currentTimeMillis(); + iterW = writePlcHs.entrySet().iterator(); + if (iterW != null) { + while (iterW.hasNext()) { + entry = (Map.Entry) iterW.next(); + plcWVar = (WriteDotPlcInterface) entry.getValue(); + groups = plcWVar.lsWriteGroupPlc; + for (i = 0; i < groups.size(); i++) { + group = groups.get(i); + dc.writeBytes(group.getArea(), group.getDBnum(), group.getStart(), + group.getLen(), group.getBuffer()); + Logger.info(" DB" + group.getDBnum() + ":¿ªÊ¼-" + group.getStart() + " ³¤¶È-" + + group.getLen() + " Ï·¢Öµ-" + group.getValue()); + if (IsConnect()) { + plcWVar.lsWriteGroupPlc.remove(i); + i--; + } else { + Logger.error("дÈëµ½DB101¿éÖÐÖ¸¶¨µÄλÖà ÖжÏ"); + break; + } + } + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + + } else { + reConnect(); + } + Thread.sleep(1000); + } catch (Exception ex) { + reConnect(); + } + // ÿ´ÎÑ­»·´ò¿ª¹Ø±ÕÁ´½Ó + //reConnect(); + } + closeServer(); + } + + // ½«Ö¸¶¨byteÊý×éÒÔ16½øÖƵÄÐÎʽ´òÓ¡µ½¿ØÖÆÌ¨ + public static String printHexString(byte[] b, int length) { + String re = ""; + for (int i = 0; i < length; i++) { + String hex = Integer.toHexString(b[i] & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + re += hex.toUpperCase() + " "; + } + return re; + } + + +} \ No newline at end of file diff --git a/src/org/s7/standard/ynuo/client/IsoTcpClient101.java b/src/org/s7/standard/ynuo/client/IsoTcpClient101.java new file mode 100644 index 0000000..16724f7 --- /dev/null +++ b/src/org/s7/standard/ynuo/client/IsoTcpClient101.java @@ -0,0 +1,804 @@ +package org.s7.standard.ynuo.client; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +import org.s7.standard.ynuo.ReadAreaPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface.groupPlcObj; + +import com.ricosoft.common.logger.Logger; + +public class IsoTcpClient101 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHsMD101 = null; + public Hashtable readAreaPlcHsMD102 = null; + public Hashtable readAreaPlcHsMD103 = null; + public Hashtable readAreaPlcHsMD104 = null; + public Hashtable readAreaPlcHsMD105 = null; + public Hashtable readAreaPlcHsMD106 = null; + public Hashtable readAreaPlcHsMD107 = null; + public Hashtable readAreaPlcHsMD108 = null; + public Hashtable readAreaPlcHsMD109 = null; + public Hashtable readAreaPlcHsMD110 = null; +// public Hashtable readAreaPlcHs2 = null; +// public Hashtable readAreaPlcHs3 = null; +// public Hashtable readAreaPlcHs4 = null; +// public Hashtable readAreaPlcHs5 = null; + + /* ´æ·ÅдÈëµÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable writePlcHs = null; + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + + public IsoTcpClient101(Hashtable hsComParam, Hashtable hsSysParam) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + this.readAreaPlcHsMD101 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_101"); + this.readAreaPlcHsMD102 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_102"); + this.readAreaPlcHsMD103 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_103"); + this.readAreaPlcHsMD104 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_104"); + this.readAreaPlcHsMD105 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_105"); + this.readAreaPlcHsMD106 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_106"); + this.readAreaPlcHsMD107 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_107"); + this.readAreaPlcHsMD108 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_108"); + this.readAreaPlcHsMD109 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_109"); + this.readAreaPlcHsMD110 = (Hashtable) hsComParam.get("readAreaPlcHs1MD_110"); +// this.readAreaPlcHs2 = (Hashtable) hsComParam.get("readAreaPlcHs1_2"); +// this.readAreaPlcHs3 = (Hashtable) hsComParam.get("readAreaPlcHs1_3"); +// this.readAreaPlcHs4 = (Hashtable) hsComParam.get("readAreaPlcHs1_4"); +// this.readAreaPlcHs5 = (Hashtable) hsComParam.get("readAreaPlcHs1_5"); + this.writePlcHs = (Hashtable) hsComParam.get("writePlcHs1"); + this.strIp = (String) hsComParam.get("strIp1"); + this.iPort = (Integer) hsComParam.get("iPort1"); + this.slot = (Integer) hsComParam.get("slot1"); + + } + + void ConnectServer() { + try { + sock = new Socket(strIp, iPort); + sock.setSoTimeout(6000); // ÉèÖó¬Ê±Ê±¼ä6Ãë + oStream = sock.getOutputStream(); + iStream = sock.getInputStream(); + + Nodave.Debug = 0x00;// ²»µ÷ʽ + di = new PLCinterface(oStream, iStream, "PLCName", 0, Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + + int res = dc.connectPLC(); + if (0 == res) { + setIsConnect(true); + } else { + } + } catch (IOException ioex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½Óʧ°Ü " + ioex.getMessage()); + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (di != null) { + di.isConnect = bflag; + } + } + + public boolean IsConnect() { + if (di != null) { + return di.isConnect; + } + return false; + } + + void closeServer() { + try { + setIsConnect(false); + clearReadDB(); + if (iStream != null) { + iStream.close(); + iStream = null; + } + } catch (IOException e) { + Logger.info("ÊäÈëÁ÷¹Ø±ÕÒì³£ " + e.getMessage() + strIp + " ¶Ë¿Ú£º" + iPort); + } + try { + if (oStream != null) { + oStream.close(); + oStream = null; + } + } catch (IOException e) { + Logger.error("Êä³öÁ÷¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + " " + e.getMessage()); + } + try { + if (sock != null) { + sock.close(); + sock = null; + } + + } catch (IOException e) { + Logger.error("socket¿Í»§¶Ë¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + e.getMessage()); + } + } + + void clearReadDB() { + if (readAreaPlcHsMD101 != null) { + Iterator iterR = readAreaPlcHsMD101.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD102 != null) { + Iterator iterR = readAreaPlcHsMD102.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD103 != null) { + Iterator iterR = readAreaPlcHsMD103.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD104 != null) { + Iterator iterR = readAreaPlcHsMD104.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD105 != null) { + Iterator iterR = readAreaPlcHsMD105.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD106 != null) { + Iterator iterR = readAreaPlcHsMD106.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD107 != null) { + Iterator iterR = readAreaPlcHsMD107.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD108 != null) { + Iterator iterR = readAreaPlcHsMD108.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHsMD109 != null) { + Iterator iterR = readAreaPlcHsMD109.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHsMD110 != null) { + Iterator iterR = readAreaPlcHsMD110.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + } + + void reConnect() { + closeServer(); + ConnectServer(); + } + + public void run() { + Iterator iterR = null; + Iterator iterW = null; + List groups = null; + WriteDotPlcInterface.groupPlcObj group = null; + WriteDotPlcInterface plcWVar = null; + ReadAreaPlcInterface plcRVar = null; + Map.Entry entry = null; + int i = 0; + int iPrintcount = 5;// 5´Î½øÐдòÓ¡ + int currDecRun = 0;// µ±Ç°Ö´ÐдÎÊý + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + if (IsConnect()) { + // ¶ÁÈ¡DB101¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ + ///Thread.sleep(100); + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd hh:mm:ss.SSS"); + //System.out.println("101:----" + df.format(t)); + + try { + if (readAreaPlcHsMD101 != null) { + iterR = readAreaPlcHsMD101.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try{ + if (readAreaPlcHsMD102 != null) { + iterR = readAreaPlcHsMD102.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + // System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD103 != null) { + iterR = readAreaPlcHsMD103.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD104 != null) { + iterR = readAreaPlcHsMD104.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD105 != null) { + iterR = readAreaPlcHsMD105.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + // System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD106 != null) { + iterR = readAreaPlcHsMD106.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD107 != null) { + iterR = readAreaPlcHsMD107.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD108 != null) { + iterR = readAreaPlcHsMD108.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + //System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try{ + if (readAreaPlcHsMD109 != null) { + iterR = readAreaPlcHsMD109.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + + } catch (Exception ex) { + reConnect(); + //ex.printStackTrace(); + } + + try{ + if (readAreaPlcHsMD110 != null) { + iterR = readAreaPlcHsMD110.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + + } catch (Exception ex) { + reConnect(); + //ex.printStackTrace(); + } + + + // дÈëµ½DB¿éÖÐÖ¸¶¨µÄλÖà + try { + if (IsConnect()) { + if (writePlcHs != null) { + t1 = System.currentTimeMillis(); + iterW = writePlcHs.entrySet().iterator(); + if (iterW != null) { + while (iterW.hasNext()) { + entry = (Map.Entry) iterW.next(); + plcWVar = (WriteDotPlcInterface) entry.getValue(); + groups = plcWVar.lsWriteGroupPlc; + for (i = 0; i < groups.size(); i++) { + group = groups.get(i); + dc.writeBytes(group.getArea(), group.getDBnum(), group.getStart(), + group.getLen(), group.getBuffer()); + Logger.info(" DB" + group.getDBnum() + ":¿ªÊ¼-" + group.getStart() + " ³¤¶È-" + + group.getLen() + " Ï·¢Öµ-" + group.getValue()); + if (IsConnect()) { + plcWVar.lsWriteGroupPlc.remove(i); + i--; + } else { + Logger.error("дÈëµ½DB101¿éÖÐÖ¸¶¨µÄλÖà ÖжÏ"); + break; + } + } + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + + } else { + reConnect(); + } + Thread.sleep(1000); + } catch (Exception ex) { + reConnect(); + } + // ÿ´ÎÑ­»·´ò¿ª¹Ø±ÕÁ´½Ó + //reConnect(); + } + closeServer(); + } + + // ½«Ö¸¶¨byteÊý×éÒÔ16½øÖƵÄÐÎʽ´òÓ¡µ½¿ØÖÆÌ¨ + public static String printHexString(byte[] b, int length) { + String re = ""; + for (int i = 0; i < length; i++) { + String hex = Integer.toHexString(b[i] & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + re += hex.toUpperCase() + " "; + } + return re; + } + + public static void main(String arg[]) { + byte[] ss = new byte[5]; + ss[0] = 1; + ss[1] = 0; + ss[2] = 16; + ss[3] = 0; + ss[4] = 0; + int length = ss.length; + for (int i = ss.length - 1; i > 0; i--) { + if (ss[i] != 0) { + length = i + 1; + break; + } + } + + // ¶ÁÈ¡Á÷03 00 00 2B 02 F0 80 32 03 00 00 00 00 00 02 00 16 00 00 04 01 FF + // 04 00 90 + // 89 02 00 80 37 01 02 37 01 00 18 5E 03 78 05 02 03 + byte[] ssz = Nodave.bswap_16(6238);// 18 5E ÈÎÎñºÅ + System.out.println(printHexString(ssz, ssz.length)); + byte[] msgIn = new byte[90]; + msgIn[10] = (byte) 0x18; // µÚ36 + msgIn[11] = (byte) 0x5E; // µÚ37 + System.out.println(Nodave.SBEWord(msgIn, 10)); + } +} \ No newline at end of file diff --git a/src/org/s7/standard/ynuo/client/IsoTcpClient102.java b/src/org/s7/standard/ynuo/client/IsoTcpClient102.java new file mode 100644 index 0000000..ee440e3 --- /dev/null +++ b/src/org/s7/standard/ynuo/client/IsoTcpClient102.java @@ -0,0 +1,860 @@ +/* + Test and demo program for Libnodave, a free communication libray for Siemens S7. + + ********************************************************************** + * WARNING: This and other test programs overwrite data in your PLC. * + * DO NOT use it on PLC's when anything is connected to their outputs.* + * This is alpha software. Use entirely on your own risk. * + ********************************************************************** + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002, 2004. + + This is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with Visual; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.s7.standard.ynuo.client; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +import org.s7.standard.ynuo.ReadAreaPlcInterface; +import org.s7.standard.ynuo.ReadDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface.groupPlcObj; + +import com.ricosoft.common.logger.Logger; + +public class IsoTcpClient102 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + // String strIp2 = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + // int iPort2 = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + // int slot2 = 1; + PLCinterface di; + // PLCinterface di2; + TCPConnection dc; + // TCPConnection dc2; + /* socket¿Í»§¶Ë */ + Socket sock; + // Socket sock2; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + // OutputStream oStream2 = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + // InputStream iStream2 = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHs101 = null; + public Hashtable readAreaPlcHs102 = null; + public Hashtable readAreaPlcHs104 = null; + public Hashtable readAreaPlcHs105 = null; + public Hashtable readAreaPlcHs106 = null; + public Hashtable readAreaPlcHs107 = null; + public Hashtable readAreaPlcHs103 = null; + public Hashtable readAreaPlcHs105_2 = null; + public Hashtable readAreaPlcHs151 = null; + + public Hashtable readAreaPlcHs108 = null; + /* ´æ·Å¶ÁÈ¡µÄDBÉ¢×Ö½ÚÐÅÏ¢ */ + + /* ´æ·ÅдÈëµÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable writePlcHs = null; + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + + public IsoTcpClient102(Hashtable hsComParam, Hashtable hsSysParam) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + + this.readAreaPlcHs104 = (Hashtable) hsComParam.get("readAreaPlcHsDB104"); + this.readAreaPlcHs102 = (Hashtable) hsComParam.get("readAreaPlcHsDB102"); + this.readAreaPlcHs101 = (Hashtable) hsComParam.get("readAreaPlcHsDB101"); + + this.readAreaPlcHs106 = (Hashtable) hsComParam.get("readAreaPlcHsDB106"); + this.readAreaPlcHs107 = (Hashtable) hsComParam.get("readAreaPlcHsDB107"); + this.readAreaPlcHs103 = (Hashtable) hsComParam.get("readAreaPlcHsDB103"); + this.readAreaPlcHs105 = (Hashtable) hsComParam.get("readAreaPlcHsDB105"); + this.readAreaPlcHs105_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB105_2"); + + this.readAreaPlcHs151 = (Hashtable) hsComParam.get("readAreaPlcHsDB151"); + + this.readAreaPlcHs108 = (Hashtable) hsComParam.get("readAreaPlcHsDB108"); + + this.writePlcHs = (Hashtable) hsComParam.get("writePlcHs2"); + this.strIp = (String) hsComParam.get("strIp2"); + this.iPort = (Integer) hsComParam.get("iPort2"); + this.slot = (Integer) hsComParam.get("slot2"); + + + } + + void ConnectServer() { + try { + sock = new Socket(strIp, iPort); + sock.setSoTimeout(6000); // ÉèÖó¬Ê±Ê±¼ä6Ãë + oStream = sock.getOutputStream(); + iStream = sock.getInputStream(); + + Nodave.Debug = 0x00;// ²»µ÷ʽ + di = new PLCinterface(oStream, iStream, "PLCName", 0, Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + + int res = dc.connectPLC(); + if (0 == res) { + setIsConnect(true); + } else { + } + } catch (IOException ioex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½Óʧ°Ü " + ioex.getMessage()); + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (di != null) { + di.isConnect = bflag; + } + } + + public boolean IsConnect() { + if (di != null) { + return di.isConnect; + } + return false; + } + + void closeServer() { + try { + setIsConnect(false); + clearReadDB(); + if (iStream != null) { + iStream.close(); + iStream = null; + } + } catch (IOException e) { + Logger.info("ÊäÈëÁ÷¹Ø±ÕÒì³£ " + e.getMessage() + strIp + " ¶Ë¿Ú£º" + iPort); + } + try { + if (oStream != null) { + oStream.close(); + oStream = null; + } + } catch (IOException e) { + Logger.error("Êä³öÁ÷¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + " " + e.getMessage()); + } + try { + if (sock != null) { + sock.close(); + sock = null; + } + + } catch (IOException e) { + Logger.error("socket¿Í»§¶Ë¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + e.getMessage()); + } + } + + @SuppressWarnings("rawtypes") + void clearReadDB() { + + if (readAreaPlcHs101 != null) { + Iterator iterR = readAreaPlcHs101.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs102 != null) { + Iterator iterR = readAreaPlcHs102.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs104 != null) { + + Iterator iterR = readAreaPlcHs104.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs105 != null) { + Iterator iterR = readAreaPlcHs105.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs106 != null) { + Iterator iterR = readAreaPlcHs106.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs107 != null) { + Iterator iterR = readAreaPlcHs107.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs105_2 != null) { + Iterator iterR = readAreaPlcHs105_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs103 != null) { + Iterator iterR = readAreaPlcHs103.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs151 != null) { + Iterator iterR = readAreaPlcHs151.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + //2021-2-10 + if (readAreaPlcHs108 != null) { + Iterator iterR = readAreaPlcHs108.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + } + + void reConnect() { + closeServer(); + ConnectServer(); + } + + public void run() { + Iterator iterR = null; + Iterator iterW = null; + List groups = null; + WriteDotPlcInterface.groupPlcObj group = null; + WriteDotPlcInterface plcWVar = null; + ReadAreaPlcInterface plcRVar = null; + ReadDotPlcInterface plcRDotVar = null; + Map.Entry entry = null; + int i = 0, j = 0; + boolean ReConn = false; + int iPrintcount = 5;// 5´Î½øÐдòÓ¡ + int currDecRun = 0;// µ±Ç°Ö´ÐдÎÊý + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + if (IsConnect()) { + //Thread.sleep(200); + + + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss.SSS"); + //System.out.println("102:----" + df.format(t)); + // ¶ÁÈ¡DB101¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ + + try{ + if (readAreaPlcHs105_2 != null) { + iterR = readAreaPlcHs105_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs107 != null) { + iterR = readAreaPlcHs107.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs103 != null) { + iterR = readAreaPlcHs103.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs106 != null) { + iterR = readAreaPlcHs106.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs101 != null) { + iterR = readAreaPlcHs101.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs102 != null) { + iterR = readAreaPlcHs102.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs104 != null) { + iterR = readAreaPlcHs104.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs105 != null) { + iterR = readAreaPlcHs105.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs105_2 != null) { + iterR = readAreaPlcHs105_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + try{ + if (readAreaPlcHs151 != null) { + iterR = readAreaPlcHs151.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + + } catch (Exception ex) { + reConnect(); + } + + try { + if (IsConnect()) { + if (writePlcHs != null) { + iterW = writePlcHs.entrySet().iterator(); + if (iterW != null) { + while (iterW.hasNext()) { + entry = (Map.Entry) iterW.next(); + plcWVar = (WriteDotPlcInterface) entry.getValue(); + groups = plcWVar.lsWriteGroupPlc; + for (i = 0; i < groups.size(); i++) { + group = groups.get(i); + dc.writeBytes(group.getArea(), group.getDBnum(), group.getStart(), + group.getLen(), group.getBuffer()); + Logger.info(" DB" + group.getDBnum() + ":¿ªÊ¼-" + group.getStart() + " ³¤¶È-" + + group.getLen() + " Ï·¢Öµ-" + group.getValue()); + if (IsConnect()) { + plcWVar.lsWriteGroupPlc.remove(i); + i--; + } else { + Logger.error("дÈëµ½DB"+group.getDBnum()+"¿éÖÐÖ¸¶¨µÄλÖà ÖжÏ"); + break; + } + } + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + + //2021-2-10 + try{ + if (readAreaPlcHs108 != null) { + iterR = readAreaPlcHs108.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + + + + + } else { + reConnect(); + } + Thread.sleep(1000); + } catch (Exception ex) { + reConnect(); + } + //reConnect(); + } + closeServer(); + } + + // ½«Ö¸¶¨byteÊý×éÒÔ16½øÖƵÄÐÎʽ´òÓ¡µ½¿ØÖÆÌ¨ + public static String printHexString(byte[] b, int length) { + String re = ""; + for (int i = 0; i < length; i++) { + String hex = Integer.toHexString(b[i] & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + re += hex.toUpperCase() + " "; + } + return re; + } + + public static void main(String arg[]) { + byte[] ss = new byte[5]; + ss[0] = 1; + ss[1] = 0; + ss[2] = 16; + ss[3] = 0; + ss[4] = 0; + int length = ss.length; + for (int i = ss.length - 1; i > 0; i--) { + if (ss[i] != 0) { + length = i + 1; + break; + } + } + + // ¶ÁÈ¡Á÷03 00 00 2B 02 F0 80 32 03 00 00 00 00 00 02 00 16 00 00 04 01 FF + // 04 00 90 + // 89 02 00 80 37 01 02 37 01 00 18 5E 03 78 05 02 03 + byte[] ssz = Nodave.bswap_16(6238);// 18 5E ÈÎÎñºÅ + System.out.println(printHexString(ssz, ssz.length)); + byte[] msgIn = new byte[90]; + msgIn[10] = (byte) 0x18; // µÚ36 + msgIn[11] = (byte) 0x5E; // µÚ37 + System.out.println(Nodave.SBEWord(msgIn, 10)); + } +} \ No newline at end of file diff --git a/src/org/s7/standard/ynuo/client/IsoTcpClient103.java b/src/org/s7/standard/ynuo/client/IsoTcpClient103.java new file mode 100644 index 0000000..b9d0f63 --- /dev/null +++ b/src/org/s7/standard/ynuo/client/IsoTcpClient103.java @@ -0,0 +1,371 @@ +/* + Test and demo program for Libnodave, a free communication libray for Siemens S7. + + ********************************************************************** + * WARNING: This and other test programs overwrite data in your PLC. * + * DO NOT use it on PLC's when anything is connected to their outputs.* + * This is alpha software. Use entirely on your own risk. * + ********************************************************************** + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002, 2004. + + This is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with Visual; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.s7.standard.ynuo.client; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +import org.s7.standard.ynuo.PlcBus; +import org.s7.standard.ynuo.ReadAreaPlcInterface; +import org.s7.standard.ynuo.ReadDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface.groupPlcObj; + +import com.ricosoft.common.logger.Logger; + +public class IsoTcpClient103 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHs201 = null; + public Hashtable readAreaPlcHs202 = null; + public Hashtable readAreaPlcHs203 = null; + public Hashtable readAreaPlcHs204 = null; + public Hashtable readAreaPlcHs205 = null; + public Hashtable readAreaPlcHs206 = null; + public Hashtable readAreaPlcHs207 = null; + public Hashtable readAreaPlcHs208 = null; + public Hashtable readAreaPlcHs209 = null; + public Hashtable readAreaPlcHs210 = null; + public Hashtable readAreaPlcHs211 = null; + public Hashtable readAreaPlcHs212 = null; + public Hashtable readAreaPlcHs213 = null; + public Hashtable readAreaPlcHs214 = null; + public Hashtable readAreaPlcHs215 = null; + + /* ´æ·ÅдÈëµÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable writePlcHs = null; + // public Hashtable writePlcHs2 = null; + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + + @SuppressWarnings("unchecked") + public IsoTcpClient103(Hashtable hsComParam, Hashtable hsSysParam) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + this.readAreaPlcHs201 = (Hashtable) hsComParam.get("readAreaPlcHsDB201"); + this.readAreaPlcHs202 = (Hashtable) hsComParam.get("readAreaPlcHsDB202"); + this.readAreaPlcHs203 = (Hashtable) hsComParam.get("readAreaPlcHsDB203"); + this.readAreaPlcHs204 = (Hashtable) hsComParam.get("readAreaPlcHsDB204"); + this.readAreaPlcHs205 = (Hashtable) hsComParam.get("readAreaPlcHsDB205"); + this.readAreaPlcHs206 = (Hashtable) hsComParam.get("readAreaPlcHsDB206"); + this.readAreaPlcHs207 = (Hashtable) hsComParam.get("readAreaPlcHsDB207"); + this.readAreaPlcHs208 = (Hashtable) hsComParam.get("readAreaPlcHsDB208"); + this.readAreaPlcHs209 = (Hashtable) hsComParam.get("readAreaPlcHsDB209"); + this.readAreaPlcHs210 = (Hashtable) hsComParam.get("readAreaPlcHsDB210"); + this.readAreaPlcHs211 = (Hashtable) hsComParam.get("readAreaPlcHsDB211"); + this.readAreaPlcHs212 = (Hashtable) hsComParam.get("readAreaPlcHsDB212"); + this.readAreaPlcHs213 = (Hashtable) hsComParam.get("readAreaPlcHsDB213"); + this.readAreaPlcHs214 = (Hashtable) hsComParam.get("readAreaPlcHsDB214"); + this.readAreaPlcHs215 = (Hashtable) hsComParam.get("readAreaPlcHsDB215"); + this.writePlcHs = (Hashtable) hsComParam.get("writePlcHs3"); + this.strIp = (String) hsComParam.get("strIp3"); + this.iPort = (Integer) hsComParam.get("iPort3"); + this.slot = (Integer) hsComParam.get("slot3"); + + } + + void ConnectServer() { + try { + sock = new Socket(strIp, iPort); + sock.setSoTimeout(6000); // ÉèÖó¬Ê±Ê±¼ä6Ãë + oStream = sock.getOutputStream(); + iStream = sock.getInputStream(); + + Nodave.Debug = 0x00;// ²»µ÷ʽ + di = new PLCinterface(oStream, iStream, "PLCName", 0, Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + + int res = dc.connectPLC(); + if (0 == res) { + setIsConnect(true); + } else { + } + } catch (IOException ioex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½Óʧ°Ü " + ioex.getMessage()); + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (di != null) { + di.isConnect = bflag; + } + } + + public boolean IsConnect() { + if (di != null) { + return di.isConnect; + } + return false; + } + + void closeServer() { + try { + setIsConnect(false); + clearReadDB(); + if (iStream != null) { + iStream.close(); + iStream = null; + } + } catch (IOException e) { + Logger.info("ÊäÈëÁ÷¹Ø±ÕÒì³£ " + e.getMessage() + strIp + " ¶Ë¿Ú£º" + iPort); + } + try { + if (oStream != null) { + oStream.close(); + oStream = null; + } + } catch (IOException e) { + Logger.error("Êä³öÁ÷¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + " " + e.getMessage()); + } + try { + if (sock != null) { + sock.close(); + sock = null; + } + + } catch (IOException e) { + Logger.error("socket¿Í»§¶Ë¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + e.getMessage()); + } + } + + void clearReadDB() { + + for (int i = 201; i <= 215; i++) { + Hashtable readAreaPlcHs = null; + readAreaPlcHs = (Hashtable) hsComParam.get("readAreaPlcHsDB"+i); + if (readAreaPlcHs != null) { + Iterator iterR = readAreaPlcHs.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + } + + + } + + void reConnect() { + closeServer(); + ConnectServer(); + } + + public void run() { + Iterator iterR = null; + Iterator iterW = null; + List groups = null; + WriteDotPlcInterface.groupPlcObj group = null; + WriteDotPlcInterface plcWVar = null; + ReadAreaPlcInterface plcRVar = null; + ReadDotPlcInterface plcRDotVar = null; + Map.Entry entry = null; + int i = 0, j = 0; + boolean ReConn = false; + int iPrintcount = 5;// 5´Î½øÐдòÓ¡ + int currDecRun = 0;// µ±Ç°Ö´ÐдÎÊý + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + if (IsConnect()) { + //Thread.sleep(300); + + + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss.SSS"); + //System.out.println("103:----" + df.format(t)); + // ¶ÁÈ¡DB101¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ + try { + for (int dbk =201; dbk <=215; dbk++) { + Hashtable readAreaPlcHs = null; + readAreaPlcHs = (Hashtable) hsComParam.get("readAreaPlcHsDB"+dbk); + try{ + if (readAreaPlcHs != null) { + iterR = readAreaPlcHs.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + // Logger.info("¶ÁÈ¡DB" + + // plcRVar.DBnum + ",start" + + // plcRVar.start + ",len" + // + plcRVar.len + "\n¶ÁÈ¡Á÷" + + // printHexString(dc.getMsgIn(), + // length)); + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + } + } catch (Exception ex) { + reConnect(); + } + + // дÈëµ½DB¿éÖÐÖ¸¶¨µÄλÖà + try { + if (IsConnect()) { + if (writePlcHs != null) { + t1 = System.currentTimeMillis(); + iterW = writePlcHs.entrySet().iterator(); + if (iterW != null) { + while (iterW.hasNext()) { + entry = (Map.Entry) iterW.next(); + plcWVar = (WriteDotPlcInterface) entry.getValue(); + groups = plcWVar.lsWriteGroupPlc; + for (i = 0; i < groups.size(); i++) { + group = groups.get(i); + dc.writeBytes(group.getArea(), group.getDBnum(), group.getStart(), + group.getLen(), group.getBuffer()); + Logger.info(" DB" + group.getDBnum() + ":¿ªÊ¼-" + group.getStart() + " ³¤¶È-" + + group.getLen() + " Ï·¢Öµ-" + group.getValue()); + if (IsConnect()) { + plcWVar.lsWriteGroupPlc.remove(i); + i--; + } else { + Logger.error("дÈëµ½"+ group.getDBnum() +"¿éÖÐÖ¸¶¨µÄλÖà ÖжÏ"); + break; + } + } + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + + } else { + reConnect(); + } + Thread.sleep(1000); + } catch (Exception ex) { + reConnect(); + } + // ÿ´ÎÑ­»·´ò¿ª¹Ø±ÕÁ´½Ó + //reConnect(); + } + closeServer(); + } + + // ½«Ö¸¶¨byteÊý×éÒÔ16½øÖƵÄÐÎʽ´òÓ¡µ½¿ØÖÆÌ¨ + public static String printHexString(byte[] b, int length) { + String re = ""; + for (int i = 0; i < length; i++) { + String hex = Integer.toHexString(b[i] & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + re += hex.toUpperCase() + " "; + } + return re; + } + + public static void main(String arg[]) { + byte[] ss = new byte[5]; + ss[0] = 1; + ss[1] = 0; + ss[2] = 16; + ss[3] = 0; + ss[4] = 0; + int length = ss.length; + for (int i = ss.length - 1; i > 0; i--) { + if (ss[i] != 0) { + length = i + 1; + break; + } + } + + // ¶ÁÈ¡Á÷03 00 00 2B 02 F0 80 32 03 00 00 00 00 00 02 00 16 00 00 04 01 FF + // 04 00 90 + // 89 02 00 80 37 01 02 37 01 00 18 5E 03 78 05 02 03 + byte[] ssz = Nodave.bswap_16(6238);// 18 5E ÈÎÎñºÅ + System.out.println(printHexString(ssz, ssz.length)); + byte[] msgIn = new byte[90]; + msgIn[10] = (byte) 0x18; // µÚ36 + msgIn[11] = (byte) 0x5E; // µÚ37 + System.out.println(Nodave.SBEWord(msgIn, 10)); + } +} \ No newline at end of file diff --git a/src/org/s7/standard/ynuo/client/IsoTcpClient104.java b/src/org/s7/standard/ynuo/client/IsoTcpClient104.java new file mode 100644 index 0000000..3da3a75 --- /dev/null +++ b/src/org/s7/standard/ynuo/client/IsoTcpClient104.java @@ -0,0 +1,1371 @@ +/* + Test and demo program for Libnodave, a free communication libray for Siemens S7. + + ********************************************************************** + * WARNING: This and other test programs overwrite data in your PLC. * + * DO NOT use it on PLC's when anything is connected to their outputs.* + * This is alpha software. Use entirely on your own risk. * + ********************************************************************** + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002, 2004. + + This is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with Visual; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.s7.standard.ynuo.client; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +import org.s7.standard.ynuo.ReadAreaPlcInterface; +import org.s7.standard.ynuo.ReadDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface.groupPlcObj; + +import com.ricosoft.common.logger.Logger; + +public class IsoTcpClient104 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + // Socket sock2; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHs1 = null; + public Hashtable readAreaPlcHs2 = null; + public Hashtable readAreaPlcHs2s = null; + public Hashtable readAreaPlcHs3 = null; + public Hashtable readAreaPlcHs4 = null; + public Hashtable readAreaPlcHs5 = null; + public Hashtable readAreaPlcHs6 = null; + public Hashtable readAreaPlcHs7 = null; + public Hashtable readAreaPlcHs8 = null; + public Hashtable readAreaPlcHs9 = null; + public Hashtable readAreaPlcHs10 = null; + + public Hashtable readAreaPlcHs11 = null; + public Hashtable readAreaPlcHs12 = null; + public Hashtable readAreaPlcHs13 = null; + public Hashtable readAreaPlcHs14 = null; + public Hashtable readAreaPlcHs15 = null; + public Hashtable readAreaPlcHs16 = null; + public Hashtable readAreaPlcHs17 = null; + public Hashtable readAreaPlcHs18 = null; + public Hashtable readAreaPlcHs19 = null; + + /* ´æ·ÅдÈëµÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable writePlcHs = null; + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + + public IsoTcpClient104(Hashtable hsComParam, Hashtable hsSysParam) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + this.readAreaPlcHs1 = (Hashtable) hsComParam.get("readAreaPlcHs4_1"); + this.readAreaPlcHs2 = (Hashtable) hsComParam.get("readAreaPlcHs4_2"); + this.readAreaPlcHs2s = (Hashtable) hsComParam.get("readAreaPlcHs4_2s"); + this.readAreaPlcHs3 = (Hashtable) hsComParam.get("readAreaPlcHs4_3"); + this.readAreaPlcHs4 = (Hashtable) hsComParam.get("readAreaPlcHs4_4"); + this.readAreaPlcHs5 = (Hashtable) hsComParam.get("readAreaPlcHs4_5"); + this.readAreaPlcHs6 = (Hashtable) hsComParam.get("readAreaPlcHs4_6"); + this.readAreaPlcHs7 = (Hashtable) hsComParam.get("readAreaPlcHs4_7"); + this.readAreaPlcHs8 = (Hashtable) hsComParam.get("readAreaPlcHs4_8"); + this.readAreaPlcHs9 = (Hashtable) hsComParam.get("readAreaPlcHs4_9"); + this.readAreaPlcHs10 = (Hashtable) hsComParam.get("readAreaPlcHs4_10"); + this.readAreaPlcHs11 = (Hashtable) hsComParam.get("readAreaPlcHs4_11"); + this.readAreaPlcHs12 = (Hashtable) hsComParam.get("readAreaPlcHs4_12"); + this.readAreaPlcHs13 = (Hashtable) hsComParam.get("readAreaPlcHs4_13"); + this.readAreaPlcHs14 = (Hashtable) hsComParam.get("readAreaPlcHs4_14"); + this.readAreaPlcHs15 = (Hashtable) hsComParam.get("readAreaPlcHs4_15"); + this.readAreaPlcHs16 = (Hashtable) hsComParam.get("readAreaPlcHs4_16"); + this.readAreaPlcHs17 = (Hashtable) hsComParam.get("readAreaPlcHs4_17"); + this.readAreaPlcHs18 = (Hashtable) hsComParam.get("readAreaPlcHs4_18"); + this.readAreaPlcHs19= (Hashtable) hsComParam.get("readAreaPlcHs4_19"); + this.writePlcHs = (Hashtable) hsComParam.get("writePlcHs4"); + this.strIp = (String) hsComParam.get("strIp4"); + this.iPort = (Integer) hsComParam.get("iPort4"); + this.slot = (Integer) hsComParam.get("slot4"); + + } + + void ConnectServer() { + try { + sock = new Socket(strIp, iPort); + sock.setSoTimeout(6000); // ÉèÖó¬Ê±Ê±¼ä6Ãë + oStream = sock.getOutputStream(); + iStream = sock.getInputStream(); + + Nodave.Debug = 0x00;// ²»µ÷ʽ + di = new PLCinterface(oStream, iStream, "PLCName", 0, Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + + int res = dc.connectPLC(); + if (0 == res) { + setIsConnect(true); + } else { + } + } catch (IOException ioex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½Óʧ°Ü " + ioex.getMessage()); + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (di != null) { + di.isConnect = bflag; + } + } + + public boolean IsConnect() { + if (di != null) { + return di.isConnect; + } + return false; + } + + void closeServer() { + try { + setIsConnect(false); + clearReadDB(); + if (iStream != null) { + iStream.close(); + iStream = null; + } + } catch (IOException e) { + Logger.info("ÊäÈëÁ÷¹Ø±ÕÒì³£ " + e.getMessage() + strIp + " ¶Ë¿Ú£º" + iPort); + } + try { + if (oStream != null) { + oStream.close(); + oStream = null; + } + } catch (IOException e) { + Logger.error("Êä³öÁ÷¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + " " + e.getMessage()); + } + try { + if (sock != null) { + sock.close(); + sock = null; + } + + } catch (IOException e) { + Logger.error("socket¿Í»§¶Ë¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + e.getMessage()); + } + } + + void clearReadDB() { + + if (readAreaPlcHs1 != null) { + Iterator iterR = readAreaPlcHs1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs2 != null) { + Iterator iterR = readAreaPlcHs2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs2s != null) { + Iterator iterR = readAreaPlcHs2s.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs3 != null) { + Iterator iterR = readAreaPlcHs3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs4 != null) { + Iterator iterR = readAreaPlcHs4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs5 != null) { + Iterator iterR = readAreaPlcHs5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs6 != null) { + Iterator iterR = readAreaPlcHs6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs7 != null) { + Iterator iterR = readAreaPlcHs7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs8 != null) { + Iterator iterR = readAreaPlcHs8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs9 != null) { + Iterator iterR = readAreaPlcHs9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs10 != null) { + Iterator iterR = readAreaPlcHs10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + /// + if (readAreaPlcHs11 != null) { + Iterator iterR = readAreaPlcHs11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs12 != null) { + Iterator iterR = readAreaPlcHs12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs13 != null) { + Iterator iterR = readAreaPlcHs13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs14 != null) { + Iterator iterR = readAreaPlcHs14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs15 != null) { + Iterator iterR = readAreaPlcHs15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs16 != null) { + Iterator iterR = readAreaPlcHs16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs17 != null) { + Iterator iterR = readAreaPlcHs17.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs18 != null) { + Iterator iterR = readAreaPlcHs18.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs19 != null) { + Iterator iterR = readAreaPlcHs19.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + /// + } + + void reConnect() { +// Date t = new Date(); +// SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss.SSS"); +// System.out.println("104:Òì³£---------------reConnect-----------------------------------" + df.format(t)); + closeServer(); + ConnectServer(); + } + + public void run() { + Iterator iterR = null; + Iterator iterW = null; + List groups = null; + WriteDotPlcInterface.groupPlcObj group = null; + WriteDotPlcInterface plcWVar = null; + ReadAreaPlcInterface plcRVar = null; + ReadDotPlcInterface plcRDotVar = null; + Map.Entry entry = null; + int i = 0, j = 0; + boolean ReConn = false; + int iPrintcount = 5;// 5´Î½øÐдòÓ¡ + int currDecRun = 0;// µ±Ç°Ö´ÐдÎÊý + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + if (IsConnect()) { + //Thread.sleep(400); + + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss.SSS"); + //System.out.println("104:----" + df.format(t)); + try { + if (readAreaPlcHs1 != null) { + iterR = readAreaPlcHs1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs2 != null) { + iterR = readAreaPlcHs2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs2-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try { + if (readAreaPlcHs2s != null) { + iterR = readAreaPlcHs2s.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs2s-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + try { + if (readAreaPlcHs3 != null) { + iterR = readAreaPlcHs3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs3-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs4 != null) { + iterR = readAreaPlcHs4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs4-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs5 != null) { + iterR = readAreaPlcHs5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs5-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs6 != null) { + iterR = readAreaPlcHs6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs6-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + + } + + try { + if (readAreaPlcHs7 != null) { + iterR = readAreaPlcHs7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs7-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs8 != null) { + iterR = readAreaPlcHs8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs8-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs9 != null) { + iterR = readAreaPlcHs9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs9-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs10 != null) { + iterR = readAreaPlcHs10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------10----------------------------------------------" + df.format(t)); + reConnect(); + } + //¶ÁÈ¡²ð¶â»úÐÅÏ¢ + try { + if (readAreaPlcHs11 != null) { + iterR = readAreaPlcHs11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------11----------------------------------------------" + df.format(t)); + reConnect(); + } + try { + if (readAreaPlcHs12 != null) { + iterR = readAreaPlcHs12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------12----------------------------------------------" + df.format(t)); + reConnect(); + } + try { + if (readAreaPlcHs13 != null) { + iterR = readAreaPlcHs13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------13----------------------------------------------" + df.format(t)); + reConnect(); + } + try { + if (readAreaPlcHs14 != null) { + iterR = readAreaPlcHs14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------14----------------------------------------------" + df.format(t)); + reConnect(); + } + try { + if (readAreaPlcHs15 != null) { + iterR = readAreaPlcHs15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------15----------------------------------------------" + df.format(t)); + reConnect(); + } + try { + if (readAreaPlcHs16 != null) { + iterR = readAreaPlcHs16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------16----------------------------------------------" + df.format(t)); + reConnect(); + } + try { + if (readAreaPlcHs17 != null) { + iterR = readAreaPlcHs17.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------17----------------------------------------------" + df.format(t)); + reConnect(); + } + try { + if (readAreaPlcHs18 != null) { + iterR = readAreaPlcHs18.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------18----------------------------------------------" + df.format(t)); + reConnect(); + } + // + try { + if (readAreaPlcHs19 != null) { + iterR = readAreaPlcHs19.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£-------18----------------------------------------------" + df.format(t)); + reConnect(); + } + // + try { + if (IsConnect()) { + if (writePlcHs != null) { + t1 = System.currentTimeMillis(); + iterW = writePlcHs.entrySet().iterator(); + if (iterW != null) { + while (iterW.hasNext()) { + entry = (Map.Entry) iterW.next(); + plcWVar = (WriteDotPlcInterface) entry.getValue(); + groups = plcWVar.lsWriteGroupPlc; + for (i = 0; i < groups.size(); i++) { + group = groups.get(i); + dc.writeBytes(group.getArea(), group.getDBnum(), group.getStart(), + group.getLen(), group.getBuffer()); + Logger.info(" DB" + group.getDBnum() + ":¿ªÊ¼-" + group.getStart() + " ³¤¶È-" + + group.getLen() + " Ï·¢Öµ-" + group.getValue()); + if (IsConnect()) { + plcWVar.lsWriteGroupPlc.remove(i); + i--; + } else { + Logger.error("дÈëµ½DB1¿éÖÐÖ¸¶¨µÄλÖà ÖжÏ"); + break; + } + } + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------writePlcHs-----------------------------------" + df.format(t)); + reConnect(); + } + } else { + reConnect(); + } + Thread.sleep(1000); + } catch (Exception ex) { + reConnect(); + } + //reConnect(); + } + closeServer(); + } + + // ½«Ö¸¶¨byteÊý×éÒÔ16½øÖƵÄÐÎʽ´òÓ¡µ½¿ØÖÆÌ¨ + public static String printHexString(byte[] b, int length) { + String re = ""; + for (int i = 0; i < length; i++) { + String hex = Integer.toHexString(b[i] & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + re += hex.toUpperCase() + " "; + } + return re; + } + + public static void main(String arg[]) { + byte[] ss = new byte[5]; + ss[0] = 1; + ss[1] = 0; + ss[2] = 16; + ss[3] = 0; + ss[4] = 0; + int length = ss.length; + for (int i = ss.length - 1; i > 0; i--) { + if (ss[i] != 0) { + length = i + 1; + break; + } + } + + // ¶ÁÈ¡Á÷03 00 00 2B 02 F0 80 32 03 00 00 00 00 00 02 00 16 00 00 04 01 FF + // 04 00 90 + // 89 02 00 80 37 01 02 37 01 00 18 5E 03 78 05 02 03 + byte[] ssz = Nodave.bswap_16(6238);// 18 5E ÈÎÎñºÅ + System.out.println(printHexString(ssz, ssz.length)); + byte[] msgIn = new byte[90]; + msgIn[10] = (byte) 0x18; // µÚ36 + msgIn[11] = (byte) 0x5E; // µÚ37 + System.out.println(Nodave.SBEWord(msgIn, 10)); + } +} \ No newline at end of file diff --git a/src/org/s7/standard/ynuo/client/IsoTcpClient171.java b/src/org/s7/standard/ynuo/client/IsoTcpClient171.java new file mode 100644 index 0000000..5d6e92d --- /dev/null +++ b/src/org/s7/standard/ynuo/client/IsoTcpClient171.java @@ -0,0 +1,9204 @@ +/* + Test and demo program for Libnodave, a free communication libray for Siemens S7. + + ********************************************************************** + * WARNING: This and other test programs overwrite data in your PLC. * + * DO NOT use it on PLC's when anything is connected to their outputs.* + * This is alpha software. Use entirely on your own risk. * + ********************************************************************** + + (C) Thomas Hergenhahn (thomas.hergenhahn@web.de) 2002, 2004. + + This is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with Visual; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +package org.s7.standard.ynuo.client; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.Socket; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.libnodave.Nodave; +import org.libnodave.PLCinterface; +import org.libnodave.TCPConnection; +import org.s7.standard.ynuo.ReadAreaPlcInterface; +import org.s7.standard.ynuo.ReadDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface; +import org.s7.standard.ynuo.WriteDotPlcInterface.groupPlcObj; + +import com.ricosoft.common.logger.Logger; + +public class IsoTcpClient171 extends Thread { + /* ʱ¼ä´Á */ + long t1, t2; + /* ipµØÖ· */ + String strIp = ""; + /* ¶Ë¿ÚºÅ */ + int iPort = 102; + /* ²Û¿ÚºÅ */ + int slot = 1; + PLCinterface di; + TCPConnection dc; + /* socket¿Í»§¶Ë */ + Socket sock; + // Socket sock2; + /* Êä³öÁ÷ */ + OutputStream oStream = null; + /* ÊäÈëÁ÷ */ + InputStream iStream = null; + /* дÈ뻺´æÊý¾Ý */ + byte[] by; + /* ´æ·Å¶ÁÈ¡µÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable readAreaPlcHs50_1 = null; + public Hashtable readAreaPlcHs50_2 = null; + public Hashtable readAreaPlcHs50_3 = null; + public Hashtable readAreaPlcHs50_4 = null; + public Hashtable readAreaPlcHs50_5 = null; + public Hashtable readAreaPlcHs50_6 = null; + public Hashtable readAreaPlcHs50_7 = null; + public Hashtable readAreaPlcHs50_8 = null; + public Hashtable readAreaPlcHs50_9 = null; + public Hashtable readAreaPlcHs50_10 = null; + public Hashtable readAreaPlcHs50_11 = null; + public Hashtable readAreaPlcHs50_12 = null; + public Hashtable readAreaPlcHs50_13 = null; + public Hashtable readAreaPlcHs50_14 = null; + public Hashtable readAreaPlcHs50_15 = null; + public Hashtable readAreaPlcHs50_16 = null; + + public Hashtable readAreaPlcHs49_1 = null; + public Hashtable readAreaPlcHs49_2 = null; + public Hashtable readAreaPlcHs49_3 = null; + public Hashtable readAreaPlcHs49_4 = null; + public Hashtable readAreaPlcHs49_5 = null; + public Hashtable readAreaPlcHs49_6 = null; + public Hashtable readAreaPlcHs49_7 = null; + public Hashtable readAreaPlcHs49_8 = null; + public Hashtable readAreaPlcHs49_9 = null; + public Hashtable readAreaPlcHs49_10 = null; + public Hashtable readAreaPlcHs49_11 = null; + public Hashtable readAreaPlcHs49_12 = null; + public Hashtable readAreaPlcHs49_13 = null; + public Hashtable readAreaPlcHs49_14 = null; + public Hashtable readAreaPlcHs49_15 = null; + public Hashtable readAreaPlcHs49_16 = null; + + + + public Hashtable readAreaPlcHs48_1 = null; + public Hashtable readAreaPlcHs48_2 = null; + public Hashtable readAreaPlcHs48_3 = null; + public Hashtable readAreaPlcHs48_4 = null; + public Hashtable readAreaPlcHs48_5 = null; + public Hashtable readAreaPlcHs48_6 = null; + public Hashtable readAreaPlcHs48_7 = null; + public Hashtable readAreaPlcHs48_8 = null; + public Hashtable readAreaPlcHs48_9 = null; + public Hashtable readAreaPlcHs48_10 = null; + public Hashtable readAreaPlcHs48_11 = null; + public Hashtable readAreaPlcHs48_12 = null; + public Hashtable readAreaPlcHs48_13 = null; + public Hashtable readAreaPlcHs48_14 = null; + public Hashtable readAreaPlcHs48_15 = null; + public Hashtable readAreaPlcHs48_16 = null; + + + + + public Hashtable readAreaPlcHs47_1 = null; + public Hashtable readAreaPlcHs47_2 = null; + public Hashtable readAreaPlcHs47_3 = null; + public Hashtable readAreaPlcHs47_4 = null; + public Hashtable readAreaPlcHs47_5 = null; + public Hashtable readAreaPlcHs47_6 = null; + public Hashtable readAreaPlcHs47_7 = null; + public Hashtable readAreaPlcHs47_8 = null; + public Hashtable readAreaPlcHs47_9 = null; + public Hashtable readAreaPlcHs47_10 = null; + public Hashtable readAreaPlcHs47_11 = null; + public Hashtable readAreaPlcHs47_12 = null; + public Hashtable readAreaPlcHs47_13 = null; + public Hashtable readAreaPlcHs47_14 = null; + public Hashtable readAreaPlcHs47_15 = null; + public Hashtable readAreaPlcHs47_16 = null; + + + + public Hashtable readAreaPlcHs46_1 = null; + public Hashtable readAreaPlcHs46_2 = null; + public Hashtable readAreaPlcHs46_3 = null; + public Hashtable readAreaPlcHs46_4 = null; + public Hashtable readAreaPlcHs46_5 = null; + public Hashtable readAreaPlcHs46_6 = null; + public Hashtable readAreaPlcHs46_7 = null; + public Hashtable readAreaPlcHs46_8 = null; + public Hashtable readAreaPlcHs46_9 = null; + public Hashtable readAreaPlcHs46_10 = null; + public Hashtable readAreaPlcHs46_11 = null; + public Hashtable readAreaPlcHs46_12 = null; + public Hashtable readAreaPlcHs46_13 = null; + public Hashtable readAreaPlcHs46_14 = null; + public Hashtable readAreaPlcHs46_15 = null; + public Hashtable readAreaPlcHs46_16 = null; + + + + public Hashtable readAreaPlcHs45_1 = null; + public Hashtable readAreaPlcHs45_2 = null; + public Hashtable readAreaPlcHs45_3 = null; + public Hashtable readAreaPlcHs45_4 = null; + public Hashtable readAreaPlcHs45_5 = null; + public Hashtable readAreaPlcHs45_6 = null; + public Hashtable readAreaPlcHs45_7 = null; + public Hashtable readAreaPlcHs45_8 = null; + public Hashtable readAreaPlcHs45_9 = null; + public Hashtable readAreaPlcHs45_10 = null; + public Hashtable readAreaPlcHs45_11 = null; + public Hashtable readAreaPlcHs45_12 = null; + public Hashtable readAreaPlcHs45_13 = null; + public Hashtable readAreaPlcHs45_14 = null; + public Hashtable readAreaPlcHs45_15 = null; + public Hashtable readAreaPlcHs45_16 = null; + + + + + public Hashtable readAreaPlcHs44_1 = null; + public Hashtable readAreaPlcHs44_2 = null; + public Hashtable readAreaPlcHs44_3 = null; + public Hashtable readAreaPlcHs44_4 = null; + public Hashtable readAreaPlcHs44_5 = null; + public Hashtable readAreaPlcHs44_6 = null; + public Hashtable readAreaPlcHs44_7 = null; + public Hashtable readAreaPlcHs44_8 = null; + public Hashtable readAreaPlcHs44_9 = null; + public Hashtable readAreaPlcHs44_10 = null; + public Hashtable readAreaPlcHs44_11 = null; + public Hashtable readAreaPlcHs44_12 = null; + public Hashtable readAreaPlcHs44_13 = null; + public Hashtable readAreaPlcHs44_14 = null; + public Hashtable readAreaPlcHs44_15 = null; + public Hashtable readAreaPlcHs44_16 = null; + + + + public Hashtable readAreaPlcHs43_1 = null; + public Hashtable readAreaPlcHs43_2 = null; + public Hashtable readAreaPlcHs43_3 = null; + public Hashtable readAreaPlcHs43_4 = null; + public Hashtable readAreaPlcHs43_5 = null; + public Hashtable readAreaPlcHs43_6 = null; + public Hashtable readAreaPlcHs43_7 = null; + public Hashtable readAreaPlcHs43_8 = null; + public Hashtable readAreaPlcHs43_9 = null; + public Hashtable readAreaPlcHs43_10 = null; + public Hashtable readAreaPlcHs43_11 = null; + public Hashtable readAreaPlcHs43_12 = null; + public Hashtable readAreaPlcHs43_13 = null; + public Hashtable readAreaPlcHs43_14 = null; + public Hashtable readAreaPlcHs43_15 = null; + public Hashtable readAreaPlcHs43_16 = null; + + + + public Hashtable readAreaPlcHs42_1 = null; + public Hashtable readAreaPlcHs42_2 = null; + public Hashtable readAreaPlcHs42_3 = null; + public Hashtable readAreaPlcHs42_4 = null; + public Hashtable readAreaPlcHs42_5 = null; + public Hashtable readAreaPlcHs42_6 = null; + public Hashtable readAreaPlcHs42_7 = null; + public Hashtable readAreaPlcHs42_8 = null; + public Hashtable readAreaPlcHs42_9 = null; + public Hashtable readAreaPlcHs42_10 = null; + public Hashtable readAreaPlcHs42_11 = null; + public Hashtable readAreaPlcHs42_12 = null; + public Hashtable readAreaPlcHs42_13 = null; + public Hashtable readAreaPlcHs42_14 = null; + public Hashtable readAreaPlcHs42_15 = null; + public Hashtable readAreaPlcHs42_16 = null; + + + + public Hashtable readAreaPlcHs41_1 = null; + public Hashtable readAreaPlcHs41_2 = null; + public Hashtable readAreaPlcHs41_3 = null; + public Hashtable readAreaPlcHs41_4 = null; + public Hashtable readAreaPlcHs41_5 = null; + public Hashtable readAreaPlcHs41_6 = null; + public Hashtable readAreaPlcHs41_7 = null; + public Hashtable readAreaPlcHs41_8 = null; + public Hashtable readAreaPlcHs41_9 = null; + public Hashtable readAreaPlcHs41_10 = null; + public Hashtable readAreaPlcHs41_11 = null; + public Hashtable readAreaPlcHs41_12 = null; + public Hashtable readAreaPlcHs41_13 = null; + public Hashtable readAreaPlcHs41_14 = null; + public Hashtable readAreaPlcHs41_15 = null; + public Hashtable readAreaPlcHs41_16 = null; + + + + + /* ´æ·ÅдÈëµÄDB×Ö½ÚÐÅÏ¢ */ + public Hashtable writePlcHs = null; + public Hashtable hsSysParam = null; + public Hashtable hsComParam = null; + + public IsoTcpClient171(Hashtable hsComParam, Hashtable hsSysParam) { + this.hsComParam = hsComParam; + this.hsSysParam = hsSysParam; + + this.readAreaPlcHs50_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_1"); + this.readAreaPlcHs50_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_2"); + this.readAreaPlcHs50_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_3"); + this.readAreaPlcHs50_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_4"); + this.readAreaPlcHs50_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_5"); + this.readAreaPlcHs50_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_6"); + this.readAreaPlcHs50_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_7"); + this.readAreaPlcHs50_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_8"); + this.readAreaPlcHs50_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_9"); + this.readAreaPlcHs50_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_10"); + this.readAreaPlcHs50_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_11"); + this.readAreaPlcHs50_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_12"); + this.readAreaPlcHs50_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_13"); + this.readAreaPlcHs50_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_14"); + this.readAreaPlcHs50_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_15"); + this.readAreaPlcHs50_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB50_16"); + + this.readAreaPlcHs49_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_1"); + this.readAreaPlcHs49_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_2"); + this.readAreaPlcHs49_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_3"); + this.readAreaPlcHs49_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_4"); + this.readAreaPlcHs49_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_5"); + this.readAreaPlcHs49_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_6"); + this.readAreaPlcHs49_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_7"); + this.readAreaPlcHs49_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_8"); + this.readAreaPlcHs49_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_9"); + this.readAreaPlcHs49_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_10"); + this.readAreaPlcHs49_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_11"); + this.readAreaPlcHs49_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_12"); + this.readAreaPlcHs49_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_13"); + this.readAreaPlcHs49_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_14"); + this.readAreaPlcHs49_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_15"); + this.readAreaPlcHs49_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB49_16"); + + this.readAreaPlcHs48_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_1"); + this.readAreaPlcHs48_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_2"); + this.readAreaPlcHs48_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_3"); + this.readAreaPlcHs48_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_4"); + this.readAreaPlcHs48_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_5"); + this.readAreaPlcHs48_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_6"); + this.readAreaPlcHs48_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_7"); + this.readAreaPlcHs48_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_8"); + this.readAreaPlcHs48_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_9"); + this.readAreaPlcHs48_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_10"); + this.readAreaPlcHs48_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_11"); + this.readAreaPlcHs48_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_12"); + this.readAreaPlcHs48_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_13"); + this.readAreaPlcHs48_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_14"); + this.readAreaPlcHs48_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_15"); + this.readAreaPlcHs48_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB48_16"); + + this.readAreaPlcHs47_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_1"); + this.readAreaPlcHs47_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_2"); + this.readAreaPlcHs47_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_3"); + this.readAreaPlcHs47_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_4"); + this.readAreaPlcHs47_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_5"); + this.readAreaPlcHs47_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_6"); + this.readAreaPlcHs47_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_7"); + this.readAreaPlcHs47_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_8"); + this.readAreaPlcHs47_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_9"); + this.readAreaPlcHs47_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_10"); + this.readAreaPlcHs47_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_11"); + this.readAreaPlcHs47_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_12"); + this.readAreaPlcHs47_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_13"); + this.readAreaPlcHs47_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_14"); + this.readAreaPlcHs47_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_15"); + this.readAreaPlcHs47_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB47_16"); + + this.readAreaPlcHs46_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_1"); + this.readAreaPlcHs46_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_2"); + this.readAreaPlcHs46_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_3"); + this.readAreaPlcHs46_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_4"); + this.readAreaPlcHs46_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_5"); + this.readAreaPlcHs46_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_6"); + this.readAreaPlcHs46_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_7"); + this.readAreaPlcHs46_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_8"); + this.readAreaPlcHs46_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_9"); + this.readAreaPlcHs46_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_10"); + this.readAreaPlcHs46_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_11"); + this.readAreaPlcHs46_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_12"); + this.readAreaPlcHs46_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_13"); + this.readAreaPlcHs46_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_14"); + this.readAreaPlcHs46_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_15"); + this.readAreaPlcHs46_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB46_16"); + + this.readAreaPlcHs45_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_1"); + this.readAreaPlcHs45_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_2"); + this.readAreaPlcHs45_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_3"); + this.readAreaPlcHs45_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_4"); + this.readAreaPlcHs45_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_5"); + this.readAreaPlcHs45_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_6"); + this.readAreaPlcHs45_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_7"); + this.readAreaPlcHs45_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_8"); + this.readAreaPlcHs45_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_9"); + this.readAreaPlcHs45_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_10"); + this.readAreaPlcHs45_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_11"); + this.readAreaPlcHs45_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_12"); + this.readAreaPlcHs45_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_13"); + this.readAreaPlcHs45_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_14"); + this.readAreaPlcHs45_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_15"); + this.readAreaPlcHs45_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB45_16"); + + this.readAreaPlcHs44_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_1"); + this.readAreaPlcHs44_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_2"); + this.readAreaPlcHs44_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_3"); + this.readAreaPlcHs44_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_4"); + this.readAreaPlcHs44_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_5"); + this.readAreaPlcHs44_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_6"); + this.readAreaPlcHs44_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_7"); + this.readAreaPlcHs44_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_8"); + this.readAreaPlcHs44_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_9"); + this.readAreaPlcHs44_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_10"); + this.readAreaPlcHs44_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_11"); + this.readAreaPlcHs44_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_12"); + this.readAreaPlcHs44_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_13"); + this.readAreaPlcHs44_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_14"); + this.readAreaPlcHs44_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_15"); + this.readAreaPlcHs44_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB44_16"); + + this.readAreaPlcHs43_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_1"); + this.readAreaPlcHs43_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_2"); + this.readAreaPlcHs43_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_3"); + this.readAreaPlcHs43_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_4"); + this.readAreaPlcHs43_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_5"); + this.readAreaPlcHs43_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_6"); + this.readAreaPlcHs43_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_7"); + this.readAreaPlcHs43_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_8"); + this.readAreaPlcHs43_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_9"); + this.readAreaPlcHs43_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_10"); + this.readAreaPlcHs43_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_11"); + this.readAreaPlcHs43_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_12"); + this.readAreaPlcHs43_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_13"); + this.readAreaPlcHs43_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_14"); + this.readAreaPlcHs43_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_15"); + this.readAreaPlcHs43_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB43_16"); + + this.readAreaPlcHs42_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_1"); + this.readAreaPlcHs42_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_2"); + this.readAreaPlcHs42_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_3"); + this.readAreaPlcHs42_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_4"); + this.readAreaPlcHs42_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_5"); + this.readAreaPlcHs42_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_6"); + this.readAreaPlcHs42_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_7"); + this.readAreaPlcHs42_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_8"); + this.readAreaPlcHs42_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_9"); + this.readAreaPlcHs42_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_10"); + this.readAreaPlcHs42_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_11"); + this.readAreaPlcHs42_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_12"); + this.readAreaPlcHs42_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_13"); + this.readAreaPlcHs42_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_14"); + this.readAreaPlcHs42_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_15"); + this.readAreaPlcHs42_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB42_16"); + + + this.readAreaPlcHs41_1 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_1"); + this.readAreaPlcHs41_2 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_2"); + this.readAreaPlcHs41_3 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_3"); + this.readAreaPlcHs41_4 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_4"); + this.readAreaPlcHs41_5 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_5"); + this.readAreaPlcHs41_6 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_6"); + this.readAreaPlcHs41_7 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_7"); + this.readAreaPlcHs41_8 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_8"); + this.readAreaPlcHs41_9 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_9"); + this.readAreaPlcHs41_10 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_10"); + this.readAreaPlcHs41_11 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_11"); + this.readAreaPlcHs41_12 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_12"); + this.readAreaPlcHs41_13 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_13"); + this.readAreaPlcHs41_14 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_14"); + this.readAreaPlcHs41_15 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_15"); + this.readAreaPlcHs41_16 = (Hashtable) hsComParam.get("readAreaPlcHsDB41_16"); + + + + + this.writePlcHs = (Hashtable) hsComParam.get("writePlcHs5"); + this.strIp = (String) hsComParam.get("strIp5"); + this.iPort = (Integer) hsComParam.get("iPort5"); + this.slot = (Integer) hsComParam.get("slot5"); + + } + + void ConnectServer() { + try { + sock = new Socket(strIp, iPort); + sock.setSoTimeout(6000); // ÉèÖó¬Ê±Ê±¼ä6Ãë + oStream = sock.getOutputStream(); + iStream = sock.getInputStream(); + + Nodave.Debug = 0x00;// ²»µ÷ʽ + di = new PLCinterface(oStream, iStream, "PLCName", 0, Nodave.PROTOCOL_ISOTCP); + dc = new TCPConnection(di, 0, slot); + + int res = dc.connectPLC(); + if (0 == res) { + setIsConnect(true); + } else { + } + } catch (IOException ioex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½Óʧ°Ü " + ioex.getMessage()); + } catch (Exception ex) { + Logger.info("********IP:" + strIp + " ¶Ë¿Ú:" + iPort + "Á¬½ÓÒì³£ " + ex.getMessage()); + } + } + + public void setIsConnect(boolean bflag) { + if (di != null) { + di.isConnect = bflag; + } + } + + public boolean IsConnect() { + if (di != null) { + return di.isConnect; + } + return false; + } + + void closeServer() { + try { + setIsConnect(false); + clearReadDB(); + if (iStream != null) { + iStream.close(); + iStream = null; + } + } catch (IOException e) { + Logger.info("ÊäÈëÁ÷¹Ø±ÕÒì³£ " + e.getMessage() + strIp + " ¶Ë¿Ú£º" + iPort); + } + try { + if (oStream != null) { + oStream.close(); + oStream = null; + } + } catch (IOException e) { + Logger.error("Êä³öÁ÷¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + " " + e.getMessage()); + } + try { + if (sock != null) { + sock.close(); + sock = null; + } + + } catch (IOException e) { + Logger.error("socket¿Í»§¶Ë¹Ø±ÕÒì³£ IP£º" + strIp + " ¶Ë¿Ú£º" + iPort + e.getMessage()); + } + } + + void clearReadDB() { + + if (readAreaPlcHs49_1 != null) { + Iterator iterR = readAreaPlcHs49_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs49_2 != null) { + Iterator iterR = readAreaPlcHs49_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_3 != null) { + Iterator iterR = readAreaPlcHs49_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_4 != null) { + Iterator iterR = readAreaPlcHs49_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs49_5 != null) { + Iterator iterR = readAreaPlcHs49_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_6 != null) { + Iterator iterR = readAreaPlcHs49_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_7 != null) { + Iterator iterR = readAreaPlcHs49_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_8 != null) { + Iterator iterR = readAreaPlcHs49_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_9 != null) { + Iterator iterR = readAreaPlcHs49_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_10 != null) { + Iterator iterR = readAreaPlcHs49_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_11 != null) { + Iterator iterR = readAreaPlcHs49_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_12 != null) { + Iterator iterR = readAreaPlcHs49_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_13 != null) { + Iterator iterR = readAreaPlcHs49_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_14 != null) { + Iterator iterR = readAreaPlcHs49_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_15 != null) { + Iterator iterR = readAreaPlcHs49_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs49_16 != null) { + Iterator iterR = readAreaPlcHs49_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + //========================================================================== + + if (readAreaPlcHs48_1 != null) { + Iterator iterR = readAreaPlcHs48_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs48_2 != null) { + Iterator iterR = readAreaPlcHs48_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_3 != null) { + Iterator iterR = readAreaPlcHs48_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_4 != null) { + Iterator iterR = readAreaPlcHs48_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs48_5 != null) { + Iterator iterR = readAreaPlcHs48_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_6 != null) { + Iterator iterR = readAreaPlcHs48_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_7 != null) { + Iterator iterR = readAreaPlcHs48_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_8 != null) { + Iterator iterR = readAreaPlcHs48_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_9 != null) { + Iterator iterR = readAreaPlcHs48_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_10 != null) { + Iterator iterR = readAreaPlcHs48_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_11 != null) { + Iterator iterR = readAreaPlcHs48_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_12 != null) { + Iterator iterR = readAreaPlcHs48_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_13 != null) { + Iterator iterR = readAreaPlcHs48_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_14 != null) { + Iterator iterR = readAreaPlcHs48_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_15 != null) { + Iterator iterR = readAreaPlcHs48_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs48_16 != null) { + Iterator iterR = readAreaPlcHs48_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + + //========================================================================== + if (readAreaPlcHs47_1 != null) { + Iterator iterR = readAreaPlcHs47_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs47_2 != null) { + Iterator iterR = readAreaPlcHs47_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_3 != null) { + Iterator iterR = readAreaPlcHs47_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_4 != null) { + Iterator iterR = readAreaPlcHs47_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs47_5 != null) { + Iterator iterR = readAreaPlcHs47_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_6 != null) { + Iterator iterR = readAreaPlcHs47_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_7 != null) { + Iterator iterR = readAreaPlcHs47_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_8 != null) { + Iterator iterR = readAreaPlcHs47_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_9 != null) { + Iterator iterR = readAreaPlcHs47_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_10 != null) { + Iterator iterR = readAreaPlcHs47_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_11 != null) { + Iterator iterR = readAreaPlcHs47_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_12 != null) { + Iterator iterR = readAreaPlcHs47_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_13 != null) { + Iterator iterR = readAreaPlcHs47_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_14 != null) { + Iterator iterR = readAreaPlcHs47_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_15 != null) { + Iterator iterR = readAreaPlcHs47_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs47_16 != null) { + Iterator iterR = readAreaPlcHs47_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + //========================================================================== + if (readAreaPlcHs46_1 != null) { + Iterator iterR = readAreaPlcHs46_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs46_2 != null) { + Iterator iterR = readAreaPlcHs46_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_3 != null) { + Iterator iterR = readAreaPlcHs46_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_4 != null) { + Iterator iterR = readAreaPlcHs46_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs46_5 != null) { + Iterator iterR = readAreaPlcHs46_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_6 != null) { + Iterator iterR = readAreaPlcHs46_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_7 != null) { + Iterator iterR = readAreaPlcHs46_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_8 != null) { + Iterator iterR = readAreaPlcHs46_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_9 != null) { + Iterator iterR = readAreaPlcHs46_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_10 != null) { + Iterator iterR = readAreaPlcHs46_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_11 != null) { + Iterator iterR = readAreaPlcHs46_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_12 != null) { + Iterator iterR = readAreaPlcHs46_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_13 != null) { + Iterator iterR = readAreaPlcHs46_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_14 != null) { + Iterator iterR = readAreaPlcHs46_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_15 != null) { + Iterator iterR = readAreaPlcHs46_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs46_16 != null) { + Iterator iterR = readAreaPlcHs46_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + + //========================================================================== + if (readAreaPlcHs45_1 != null) { + Iterator iterR = readAreaPlcHs45_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs45_2 != null) { + Iterator iterR = readAreaPlcHs45_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_3 != null) { + Iterator iterR = readAreaPlcHs45_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_4 != null) { + Iterator iterR = readAreaPlcHs45_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs45_5 != null) { + Iterator iterR = readAreaPlcHs45_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_6 != null) { + Iterator iterR = readAreaPlcHs45_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_7 != null) { + Iterator iterR = readAreaPlcHs45_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_8 != null) { + Iterator iterR = readAreaPlcHs45_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_9 != null) { + Iterator iterR = readAreaPlcHs45_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_10 != null) { + Iterator iterR = readAreaPlcHs45_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_11 != null) { + Iterator iterR = readAreaPlcHs45_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_12 != null) { + Iterator iterR = readAreaPlcHs45_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_13 != null) { + Iterator iterR = readAreaPlcHs45_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_14 != null) { + Iterator iterR = readAreaPlcHs45_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_15 != null) { + Iterator iterR = readAreaPlcHs45_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs45_16 != null) { + Iterator iterR = readAreaPlcHs45_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + //========================================================================== + if (readAreaPlcHs44_1 != null) { + Iterator iterR = readAreaPlcHs44_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs44_2 != null) { + Iterator iterR = readAreaPlcHs44_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_3 != null) { + Iterator iterR = readAreaPlcHs44_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_4 != null) { + Iterator iterR = readAreaPlcHs44_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs44_5 != null) { + Iterator iterR = readAreaPlcHs44_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_6 != null) { + Iterator iterR = readAreaPlcHs44_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_7 != null) { + Iterator iterR = readAreaPlcHs44_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_8 != null) { + Iterator iterR = readAreaPlcHs44_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_9 != null) { + Iterator iterR = readAreaPlcHs44_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_10 != null) { + Iterator iterR = readAreaPlcHs44_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_11 != null) { + Iterator iterR = readAreaPlcHs44_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_12 != null) { + Iterator iterR = readAreaPlcHs44_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_13 != null) { + Iterator iterR = readAreaPlcHs44_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_14 != null) { + Iterator iterR = readAreaPlcHs44_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_15 != null) { + Iterator iterR = readAreaPlcHs44_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs44_16 != null) { + Iterator iterR = readAreaPlcHs44_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + + + + //========================================================================== + if (readAreaPlcHs43_1 != null) { + Iterator iterR = readAreaPlcHs43_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs43_2 != null) { + Iterator iterR = readAreaPlcHs43_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_3 != null) { + Iterator iterR = readAreaPlcHs43_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_4 != null) { + Iterator iterR = readAreaPlcHs43_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs43_5 != null) { + Iterator iterR = readAreaPlcHs43_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_6 != null) { + Iterator iterR = readAreaPlcHs43_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_7 != null) { + Iterator iterR = readAreaPlcHs43_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_8 != null) { + Iterator iterR = readAreaPlcHs43_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_9 != null) { + Iterator iterR = readAreaPlcHs43_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_10 != null) { + Iterator iterR = readAreaPlcHs43_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_11 != null) { + Iterator iterR = readAreaPlcHs43_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_12 != null) { + Iterator iterR = readAreaPlcHs43_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_13 != null) { + Iterator iterR = readAreaPlcHs43_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_14 != null) { + Iterator iterR = readAreaPlcHs43_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_15 != null) { + Iterator iterR = readAreaPlcHs43_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs43_16 != null) { + Iterator iterR = readAreaPlcHs43_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + + //========================================================================== + if (readAreaPlcHs42_1 != null) { + Iterator iterR = readAreaPlcHs42_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs42_2 != null) { + Iterator iterR = readAreaPlcHs42_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_3 != null) { + Iterator iterR = readAreaPlcHs42_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_4 != null) { + Iterator iterR = readAreaPlcHs42_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs42_5 != null) { + Iterator iterR = readAreaPlcHs42_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_6 != null) { + Iterator iterR = readAreaPlcHs42_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_7 != null) { + Iterator iterR = readAreaPlcHs42_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_8 != null) { + Iterator iterR = readAreaPlcHs42_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_9 != null) { + Iterator iterR = readAreaPlcHs42_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_10 != null) { + Iterator iterR = readAreaPlcHs42_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_11 != null) { + Iterator iterR = readAreaPlcHs42_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_12 != null) { + Iterator iterR = readAreaPlcHs42_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_13 != null) { + Iterator iterR = readAreaPlcHs42_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_14 != null) { + Iterator iterR = readAreaPlcHs42_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_15 != null) { + Iterator iterR = readAreaPlcHs42_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs42_16 != null) { + Iterator iterR = readAreaPlcHs42_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + //========================================================================== + if (readAreaPlcHs41_1 != null) { + Iterator iterR = readAreaPlcHs41_1.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs41_2 != null) { + Iterator iterR = readAreaPlcHs41_2.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_3 != null) { + Iterator iterR = readAreaPlcHs41_3.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_4 != null) { + Iterator iterR = readAreaPlcHs41_4.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + if (readAreaPlcHs41_5 != null) { + Iterator iterR = readAreaPlcHs41_5.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_6 != null) { + Iterator iterR = readAreaPlcHs41_6.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_7 != null) { + Iterator iterR = readAreaPlcHs41_7.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_8 != null) { + Iterator iterR = readAreaPlcHs41_8.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_9 != null) { + Iterator iterR = readAreaPlcHs41_9.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_10 != null) { + Iterator iterR = readAreaPlcHs41_10.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_11 != null) { + Iterator iterR = readAreaPlcHs41_11.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_12 != null) { + Iterator iterR = readAreaPlcHs41_12.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_13 != null) { + Iterator iterR = readAreaPlcHs41_13.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_14 != null) { + Iterator iterR = readAreaPlcHs41_14.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_15 != null) { + Iterator iterR = readAreaPlcHs41_15.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + if (readAreaPlcHs41_16 != null) { + Iterator iterR = readAreaPlcHs41_16.entrySet().iterator(); + Map.Entry entry = null; + ReadAreaPlcInterface plcRVar = null; + if (iterR != null) { + byte[] nByte = new byte[2048]; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + plcRVar.udata = 0; + System.arraycopy(nByte, 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + } + } + } + + + } + + void reConnect() { +// Date t = new Date(); +// SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss.SSS"); +// System.out.println("104:Òì³£---------------reConnect-----------------------------------" + df.format(t)); + closeServer(); + ConnectServer(); + } + + public void run() { + Iterator iterR = null; + Iterator iterW = null; + List groups = null; + WriteDotPlcInterface.groupPlcObj group = null; + WriteDotPlcInterface plcWVar = null; + ReadAreaPlcInterface plcRVar = null; + ReadDotPlcInterface plcRDotVar = null; + Map.Entry entry = null; + int i = 0, j = 0; + boolean ReConn = false; + int iPrintcount = 5;// 5´Î½øÐдòÓ¡ + int currDecRun = 0;// µ±Ç°Ö´ÐдÎÊý + while (!Boolean.valueOf((String) hsSysParam.get("bStopFlag"))) { + try { + if (IsConnect()) { + //Thread.sleep(400); + + Date t = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss.SSS"); + System.out.println("171:----" + df.format(t)); + + + //System.out.println(currDecRun); + //============================================================= + try { + if (readAreaPlcHs50_1 != null) { + iterR = readAreaPlcHs50_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_2 != null) { + iterR = readAreaPlcHs50_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_3 != null) { + iterR = readAreaPlcHs50_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_4 != null) { + iterR = readAreaPlcHs50_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_5 != null) { + iterR = readAreaPlcHs50_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_6 != null) { + iterR = readAreaPlcHs50_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs50_7 != null) { + iterR = readAreaPlcHs50_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs50_8 != null) { + iterR = readAreaPlcHs50_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_9 != null) { + iterR = readAreaPlcHs50_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_10 != null) { + iterR = readAreaPlcHs50_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs50_11 != null) { + iterR = readAreaPlcHs50_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs50_12 != null) { + iterR = readAreaPlcHs50_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_13 != null) { + iterR = readAreaPlcHs50_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_14 != null) { + iterR = readAreaPlcHs50_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_15 != null) { + iterR = readAreaPlcHs50_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs50_16 != null) { + iterR = readAreaPlcHs50_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + //------------ + try { + if (readAreaPlcHs49_1 != null) { + iterR = readAreaPlcHs49_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_2 != null) { + iterR = readAreaPlcHs49_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_3 != null) { + iterR = readAreaPlcHs49_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_4 != null) { + iterR = readAreaPlcHs49_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_5 != null) { + iterR = readAreaPlcHs49_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_6 != null) { + iterR = readAreaPlcHs49_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs49_7 != null) { + iterR = readAreaPlcHs49_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs49_8 != null) { + iterR = readAreaPlcHs49_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_9 != null) { + iterR = readAreaPlcHs49_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_10 != null) { + iterR = readAreaPlcHs49_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs49_11 != null) { + iterR = readAreaPlcHs49_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs49_12 != null) { + iterR = readAreaPlcHs49_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_13 != null) { + iterR = readAreaPlcHs49_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_14 != null) { + iterR = readAreaPlcHs49_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_15 != null) { + iterR = readAreaPlcHs49_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs49_16 != null) { + iterR = readAreaPlcHs49_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + //============================================================= + try { + if (readAreaPlcHs48_1 != null) { + iterR = readAreaPlcHs48_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_2 != null) { + iterR = readAreaPlcHs48_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_3 != null) { + iterR = readAreaPlcHs48_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_4 != null) { + iterR = readAreaPlcHs48_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_5 != null) { + iterR = readAreaPlcHs48_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_6 != null) { + iterR = readAreaPlcHs48_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs48_7 != null) { + iterR = readAreaPlcHs48_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs48_8 != null) { + iterR = readAreaPlcHs48_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_9 != null) { + iterR = readAreaPlcHs48_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_10 != null) { + iterR = readAreaPlcHs48_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs48_11 != null) { + iterR = readAreaPlcHs48_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs48_12 != null) { + iterR = readAreaPlcHs48_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_13 != null) { + iterR = readAreaPlcHs48_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_14 != null) { + iterR = readAreaPlcHs48_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_15 != null) { + iterR = readAreaPlcHs48_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs48_16 != null) { + iterR = readAreaPlcHs48_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + //============================================================= + try { + if (readAreaPlcHs47_1 != null) { + iterR = readAreaPlcHs47_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_2 != null) { + iterR = readAreaPlcHs47_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_3 != null) { + iterR = readAreaPlcHs47_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_4 != null) { + iterR = readAreaPlcHs47_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_5 != null) { + iterR = readAreaPlcHs47_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_6 != null) { + iterR = readAreaPlcHs47_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs47_7 != null) { + iterR = readAreaPlcHs47_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs47_8 != null) { + iterR = readAreaPlcHs47_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_9 != null) { + iterR = readAreaPlcHs47_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_10 != null) { + iterR = readAreaPlcHs47_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs47_11 != null) { + iterR = readAreaPlcHs47_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs47_12 != null) { + iterR = readAreaPlcHs47_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_13 != null) { + iterR = readAreaPlcHs47_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_14 != null) { + iterR = readAreaPlcHs47_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_15 != null) { + iterR = readAreaPlcHs47_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs47_16 != null) { + iterR = readAreaPlcHs47_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + + + //============================================================= + try { + if (readAreaPlcHs46_1 != null) { + iterR = readAreaPlcHs46_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_2 != null) { + iterR = readAreaPlcHs46_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_3 != null) { + iterR = readAreaPlcHs46_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_4 != null) { + iterR = readAreaPlcHs46_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_5 != null) { + iterR = readAreaPlcHs46_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_6 != null) { + iterR = readAreaPlcHs46_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs46_7 != null) { + iterR = readAreaPlcHs46_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs46_8 != null) { + iterR = readAreaPlcHs46_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_9 != null) { + iterR = readAreaPlcHs46_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_10 != null) { + iterR = readAreaPlcHs46_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs46_11 != null) { + iterR = readAreaPlcHs46_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs46_12 != null) { + iterR = readAreaPlcHs46_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_13 != null) { + iterR = readAreaPlcHs46_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_14 != null) { + iterR = readAreaPlcHs46_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_15 != null) { + iterR = readAreaPlcHs46_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs46_16 != null) { + iterR = readAreaPlcHs46_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + + //============================================================= + try { + if (readAreaPlcHs45_1 != null) { + iterR = readAreaPlcHs45_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_2 != null) { + iterR = readAreaPlcHs45_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_3 != null) { + iterR = readAreaPlcHs45_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_4 != null) { + iterR = readAreaPlcHs45_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_5 != null) { + iterR = readAreaPlcHs45_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_6 != null) { + iterR = readAreaPlcHs45_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs45_7 != null) { + iterR = readAreaPlcHs45_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs45_8 != null) { + iterR = readAreaPlcHs45_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_9 != null) { + iterR = readAreaPlcHs45_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_10 != null) { + iterR = readAreaPlcHs45_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs45_11 != null) { + iterR = readAreaPlcHs45_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs45_12 != null) { + iterR = readAreaPlcHs45_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_13 != null) { + iterR = readAreaPlcHs45_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_14 != null) { + iterR = readAreaPlcHs45_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_15 != null) { + iterR = readAreaPlcHs45_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs45_16 != null) { + iterR = readAreaPlcHs45_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + //============================================================= + try { + if (readAreaPlcHs44_1 != null) { + iterR = readAreaPlcHs44_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_2 != null) { + iterR = readAreaPlcHs44_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_3 != null) { + iterR = readAreaPlcHs44_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_4 != null) { + iterR = readAreaPlcHs44_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_5 != null) { + iterR = readAreaPlcHs44_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_6 != null) { + iterR = readAreaPlcHs44_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs44_7 != null) { + iterR = readAreaPlcHs44_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs44_8 != null) { + iterR = readAreaPlcHs44_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_9 != null) { + iterR = readAreaPlcHs44_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_10 != null) { + iterR = readAreaPlcHs44_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs44_11 != null) { + iterR = readAreaPlcHs44_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs44_12 != null) { + iterR = readAreaPlcHs44_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_13 != null) { + iterR = readAreaPlcHs44_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_14 != null) { + iterR = readAreaPlcHs44_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_15 != null) { + iterR = readAreaPlcHs44_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs44_16 != null) { + iterR = readAreaPlcHs44_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + + //============================================================= + try { + if (readAreaPlcHs43_1 != null) { + iterR = readAreaPlcHs43_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_2 != null) { + iterR = readAreaPlcHs43_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_3 != null) { + iterR = readAreaPlcHs43_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_4 != null) { + iterR = readAreaPlcHs43_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_5 != null) { + iterR = readAreaPlcHs43_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_6 != null) { + iterR = readAreaPlcHs43_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs43_7 != null) { + iterR = readAreaPlcHs43_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs43_8 != null) { + iterR = readAreaPlcHs43_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_9 != null) { + iterR = readAreaPlcHs43_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_10 != null) { + iterR = readAreaPlcHs43_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs43_11 != null) { + iterR = readAreaPlcHs43_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs43_12 != null) { + iterR = readAreaPlcHs43_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_13 != null) { + iterR = readAreaPlcHs43_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_14 != null) { + iterR = readAreaPlcHs43_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_15 != null) { + iterR = readAreaPlcHs43_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs43_16 != null) { + iterR = readAreaPlcHs43_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + + + //============================================================= + try { + if (readAreaPlcHs42_1 != null) { + iterR = readAreaPlcHs42_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_2 != null) { + iterR = readAreaPlcHs42_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_3 != null) { + iterR = readAreaPlcHs42_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_4 != null) { + iterR = readAreaPlcHs42_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_5 != null) { + iterR = readAreaPlcHs42_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_6 != null) { + iterR = readAreaPlcHs42_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs42_7 != null) { + iterR = readAreaPlcHs42_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs42_8 != null) { + iterR = readAreaPlcHs42_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_9 != null) { + iterR = readAreaPlcHs42_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_10 != null) { + iterR = readAreaPlcHs42_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs42_11 != null) { + iterR = readAreaPlcHs42_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs42_12 != null) { + iterR = readAreaPlcHs42_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_13 != null) { + iterR = readAreaPlcHs42_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_14 != null) { + iterR = readAreaPlcHs42_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_15 != null) { + iterR = readAreaPlcHs42_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs42_16 != null) { + iterR = readAreaPlcHs42_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + + + + + //============================================================= + try { + if (readAreaPlcHs41_1 != null) { + iterR = readAreaPlcHs41_1.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_2 != null) { + iterR = readAreaPlcHs41_2.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_3 != null) { + iterR = readAreaPlcHs41_3.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_4 != null) { + iterR = readAreaPlcHs41_4.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_5 != null) { + iterR = readAreaPlcHs41_5.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_6 != null) { + iterR = readAreaPlcHs41_6.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + + try { + if (readAreaPlcHs41_7 != null) { + iterR = readAreaPlcHs41_7.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs41_8 != null) { + iterR = readAreaPlcHs41_8.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_9 != null) { + iterR = readAreaPlcHs41_9.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_10 != null) { + iterR = readAreaPlcHs41_10.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs41_11 != null) { + iterR = readAreaPlcHs41_11.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + + try { + if (readAreaPlcHs41_12 != null) { + iterR = readAreaPlcHs41_12.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_13 != null) { + iterR = readAreaPlcHs41_13.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_14 != null) { + iterR = readAreaPlcHs41_14.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_15 != null) { + iterR = readAreaPlcHs41_15.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + try { + if (readAreaPlcHs41_16 != null) { + iterR = readAreaPlcHs41_16.entrySet().iterator(); + if (iterR != null) { + boolean isprint = false; + currDecRun = currDecRun % iPrintcount; + if (currDecRun == 0) { + isprint = true; + } + currDecRun++; + while (iterR.hasNext()) { + entry = (Map.Entry) iterR.next(); + plcRVar = (ReadAreaPlcInterface) entry.getValue(); + dc.readBytes(plcRVar.DB, plcRVar.DBnum, plcRVar.start, plcRVar.len, null); + if (IsConnect()) { + plcRVar.udata = dc.getUdata(); + System.arraycopy(dc.getMsgIn(), 0, plcRVar.msgIn, 0, plcRVar.msgIn.length); + if (isprint) { + int length = plcRVar.msgIn.length; + for (int k = plcRVar.msgIn.length - 1; k > 0; k--) { + if (plcRVar.msgIn[k] != 0) { + length = k + 1; + break; + } + } + } + } else { + Logger.error("¶ÁÈ¡DB¿éÖÐÁ¬ÐøÇøÓòÐÅÏ¢ ÖжÏ"); + break; + } + } + } + } + } catch (Exception ex) { + System.out.println("104:Òì³£---------------readAreaPlcHs1-----------------------------------" + df.format(t)); + + //ex.printStackTrace(); + reConnect(); + } + + // дÈëµ½DB¿éÖÐÖ¸¶¨µÄλÖà + try { + if (IsConnect()) { + if (writePlcHs != null) { + t1 = System.currentTimeMillis(); + iterW = writePlcHs.entrySet().iterator(); + if (iterW != null) { + while (iterW.hasNext()) { + entry = (Map.Entry) iterW.next(); + plcWVar = (WriteDotPlcInterface) entry.getValue(); + groups = plcWVar.lsWriteGroupPlc; + for (i = 0; i < groups.size(); i++) { + group = groups.get(i); + dc.writeBytes(group.getArea(), group.getDBnum(), group.getStart(), + group.getLen(), group.getBuffer()); + Logger.info(" DB" + group.getDBnum() + ":¿ªÊ¼-" + group.getStart() + " ³¤¶È-" + + group.getLen() + " Ï·¢Öµ-" + group.getValue()); + if (IsConnect()) { + plcWVar.lsWriteGroupPlc.remove(i); + i--; + } else { + Logger.error("дÈëµ½DB101¿éÖÐÖ¸¶¨µÄλÖà ÖжÏ"); + break; + } + } + } + } + } + } + } catch (Exception ex) { + reConnect(); + } + + } else { + reConnect(); + } + Thread.sleep(1000); + } catch (Exception ex) { + reConnect(); + } + //reConnect(); + } + closeServer(); + } + + // ½«Ö¸¶¨byteÊý×éÒÔ16½øÖƵÄÐÎʽ´òÓ¡µ½¿ØÖÆÌ¨ + public static String printHexString(byte[] b, int length) { + String re = ""; + for (int i = 0; i < length; i++) { + String hex = Integer.toHexString(b[i] & 0xFF); + if (hex.length() == 1) { + hex = '0' + hex; + } + re += hex.toUpperCase() + " "; + } + return re; + } + + public static void main(String arg[]) { + byte[] ss = new byte[5]; + ss[0] = 1; + ss[1] = 0; + ss[2] = 16; + ss[3] = 0; + ss[4] = 0; + int length = ss.length; + for (int i = ss.length - 1; i > 0; i--) { + if (ss[i] != 0) { + length = i + 1; + break; + } + } + + // ¶ÁÈ¡Á÷03 00 00 2B 02 F0 80 32 03 00 00 00 00 00 02 00 16 00 00 04 01 FF + // 04 00 90 + // 89 02 00 80 37 01 02 37 01 00 18 5E 03 78 05 02 03 + byte[] ssz = Nodave.bswap_16(6238);// 18 5E ÈÎÎñºÅ + System.out.println(printHexString(ssz, ssz.length)); + byte[] msgIn = new byte[90]; + msgIn[10] = (byte) 0x18; // µÚ36 + msgIn[11] = (byte) 0x5E; // µÚ37 + System.out.println(Nodave.SBEWord(msgIn, 10)); + } +} \ No newline at end of file diff --git a/wmsdssconfig/abb/actionRelation.xml b/wmsdssconfig/abb/actionRelation.xml new file mode 100644 index 0000000..fc6e50c --- /dev/null +++ b/wmsdssconfig/abb/actionRelation.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/wmsdssconfig/abb/carcommand31.dat b/wmsdssconfig/abb/carcommand31.dat new file mode 100644 index 0000000000000000000000000000000000000000..fafc4f3b042ef346d262a267ce84ed591d917112 GIT binary patch literal 5 McmZ4UmVvbZ00)l(4*&oF literal 0 HcmV?d00001 diff --git a/wmsdssconfig/abb/cranecommand1.dat b/wmsdssconfig/abb/cranecommand1.dat new file mode 100644 index 0000000000000000000000000000000000000000..fafc4f3b042ef346d262a267ce84ed591d917112 GIT binary patch literal 5 McmZ4UmVvbZ00)l(4*&oF literal 0 HcmV?d00001 diff --git a/wmsdssconfig/abb/cranecommand2.dat b/wmsdssconfig/abb/cranecommand2.dat new file mode 100644 index 0000000000000000000000000000000000000000..fafc4f3b042ef346d262a267ce84ed591d917112 GIT binary patch literal 5 McmZ4UmVvbZ00)l(4*&oF literal 0 HcmV?d00001 diff --git a/wmsdssconfig/abb/exectask1.dat b/wmsdssconfig/abb/exectask1.dat new file mode 100644 index 0000000000000000000000000000000000000000..0581a716ab9760f69fd8a0a0c336ee70510fd3c1 GIT binary patch literal 84 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&m*xoqa-mYCslYizpA3wlO4 + + + + + + + + org.hibernate.dialect.MySQLInnoDBDialect + + com.mysql.cj.jdbc.Driver + jdbc:mysql://10.214.18.64:3306/FT465-2 + root + root@123 + 10 + + + false + true + 50 + + + + + + + + + + + + diff --git a/wmsdssconfig/abb/opcItemconfig.xml b/wmsdssconfig/abb/opcItemconfig.xml new file mode 100644 index 0000000..a3ba846 --- /dev/null +++ b/wmsdssconfig/abb/opcItemconfig.xml @@ -0,0 +1,442 @@ + + + + + + + + + + Yld.yldDevice.XC1.fromcar.RWH + Yld.yldDevice.XC1.fromcar.CZFS + Yld.yldDevice.XC1.fromcar.DQZT + Yld.yldDevice.XC1.fromcar.JDBZ + Yld.yldDevice.XC1.fromcar.ZYFS + Yld.yldDevice.XC1.fromcar.DQLH + Yld.yldDevice.XC1.fromcar.SSDJCS + Yld.yldDevice.XC1.fromcar.SSDJ + Yld.yldDevice.XC1.fromcar.WXBJ + + Yld.yldDevice.XC1.fromcar.CJCW + Yld.yldDevice.XC1.fromcar.YXJPCW + Yld.yldDevice.XC1.fromcar.YXBPBJ + Yld.yldDevice.XC1.fromcar.YXCS + Yld.yldDevice.XC1.fromcar.YXCJ + Yld.yldDevice.XC1.fromcar.SSBPBJ + Yld.yldDevice.XC1.fromcar.SSCS + Yld.yldDevice.XC1.fromcar.KGYW + Yld.yldDevice.XC1.fromcar.WXBJ + Yld.yldDevice.XC1.fromcar.QCCBJ + Yld.yldDevice.XC1.fromcar.HCCBJ + Yld.yldDevice.XC1.fromcar.CGBJ + Yld.yldDevice.XC1.fromcar.ZCKBJ + Yld.yldDevice.XC1.fromcar.YCKBJ + Yld.yldDevice.XC1.fromcar.QHWBWH + Yld.yldDevice.XC1.fromcar.FHWBYH + Yld.yldDevice.XC1.fromcar.SDCX + + + Yld.yldDevice.XC1.tocar.XCRWH + Yld.yldDevice.XC1.tocar.XCZLGS + Yld.yldDevice.XC1.tocar.XCYLH + Yld.yldDevice.XC1.tocar.XCMLH + Yld.yldDevice.XC1.tocar.XCZLXDBZ + Yld.yldDevice.XC1.tocar.XCJYM + + + + + + + + + Yld.yldDevice.DDJ1.fromddj.RWH + Yld.yldDevice.DDJ1.fromddj.CZFS + Yld.yldDevice.DDJ1.fromddj.DQZT + Yld.yldDevice.DDJ1.fromddj.JDBZ + Yld.yldDevice.DDJ1.fromddj.ZYFS + Yld.yldDevice.DDJ1.fromddj.DQPH + Yld.yldDevice.DDJ1.fromddj.DQLH + Yld.yldDevice.DDJ1.fromddj.DQCH + Yld.yldDevice.DDJ1.fromddj.QHWH + Yld.yldDevice.DDJ1.fromddj.FHYH + + Yld.yldDevice.DDJ1.fromddj.YXCJCW + Yld.yldDevice.DDJ1.fromddj.YXJPCW + Yld.yldDevice.DDJ1.fromddj.YXBPBJ + Yld.yldDevice.DDJ1.fromddj.YXCSBJ + Yld.yldDevice.DDJ1.fromddj.YXCJBJ + Yld.yldDevice.DDJ1.fromddj.QSCJCW + Yld.yldDevice.DDJ1.fromddj.QSJPCW + Yld.yldDevice.DDJ1.fromddj.QSBPBJ + Yld.yldDevice.DDJ1.fromddj.QSCSBJ + Yld.yldDevice.DDJ1.fromddj.QSCJBJ + Yld.yldDevice.DDJ1.fromddj.HCBMCW + Yld.yldDevice.DDJ1.fromddj.HCXHYW + Yld.yldDevice.DDJ1.fromddj.HCBPBJ + Yld.yldDevice.DDJ1.fromddj.HCCSBJ + Yld.yldDevice.DDJ1.fromddj.HCBZZW + Yld.yldDevice.DDJ1.fromddj.HWWXBJ + Yld.yldDevice.DDJ1.fromddj.FWWBYH + Yld.yldDevice.DDJ1.fromddj.QHWBWH + Yld.yldDevice.DDJ1.fromddj.SSGZ + + + Yld.yldDevice.DDJ1.toddj.DDJ01RWH + Yld.yldDevice.DDJ1.toddj.DDJ01ZLGS + Yld.yldDevice.DDJ1.toddj.DDJ01MBP + Yld.yldDevice.DDJ1.toddj.DDJ01MBL + Yld.yldDevice.DDJ1.toddj.DDJ01MBC + Yld.yldDevice.DDJ1.toddj.DDJ01ZLXDBZ + Yld.yldDevice.DDJ1.toddj.DDJ01JYM + + + + + Yld.yldDevice.DDJ2.fromddj.RWH + Yld.yldDevice.DDJ2.fromddj.CZFS + Yld.yldDevice.DDJ2.fromddj.DQZT + Yld.yldDevice.DDJ2.fromddj.JDBZ + Yld.yldDevice.DDJ2.fromddj.ZYFS + Yld.yldDevice.DDJ2.fromddj.DQPH + Yld.yldDevice.DDJ2.fromddj.DQLH + Yld.yldDevice.DDJ2.fromddj.DQCH + Yld.yldDevice.DDJ2.fromddj.QHWH + Yld.yldDevice.DDJ2.fromddj.FHYH + + Yld.yldDevice.DDJ2.fromddj.YXCJCW + Yld.yldDevice.DDJ2.fromddj.YXJPCW + Yld.yldDevice.DDJ2.fromddj.YXBPBJ + Yld.yldDevice.DDJ2.fromddj.YXCSBJ + Yld.yldDevice.DDJ2.fromddj.YXCJBJ + Yld.yldDevice.DDJ2.fromddj.QSCJCW + Yld.yldDevice.DDJ2.fromddj.QSJPCW + Yld.yldDevice.DDJ2.fromddj.QSBPBJ + Yld.yldDevice.DDJ2.fromddj.QSCSBJ + Yld.yldDevice.DDJ2.fromddj.QSCJBJ + Yld.yldDevice.DDJ2.fromddj.HCBMCW + Yld.yldDevice.DDJ2.fromddj.HCXHYW + Yld.yldDevice.DDJ2.fromddj.HCBPBJ + Yld.yldDevice.DDJ2.fromddj.HCCSBJ + Yld.yldDevice.DDJ2.fromddj.HCBZZW + Yld.yldDevice.DDJ2.fromddj.HWWXBJ + Yld.yldDevice.DDJ2.fromddj.FWWBYH + Yld.yldDevice.DDJ2.fromddj.QHWBWH + Yld.yldDevice.DDJ2.fromddj.SSGZ + + + Yld.yldDevice.DDJ2.toddj.DDJ02RWH + Yld.yldDevice.DDJ2.toddj.DDJ02ZLGS + Yld.yldDevice.DDJ2.toddj.DDJ02MBP + Yld.yldDevice.DDJ2.toddj.DDJ02MBL + Yld.yldDevice.DDJ2.toddj.DDJ02MBC + Yld.yldDevice.DDJ2.toddj.DDJ02ZLXDBZ + Yld.yldDevice.DDJ2.toddj.DDJ02JYM + + + + + + + + + Yld.yldDevice.SSJ.SSJI.SS1RKDW + Yld.yldDevice.SSJ.SSJI.SS1KXBZ + Yld.yldDevice.SSJ.SSJI.SS1TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS2RKDW + Yld.yldDevice.SSJ.SSJI.SS2KXBZ + Yld.yldDevice.SSJ.SSJI.SS2TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS3RKDW + Yld.yldDevice.SSJ.SSJI.SS3KXBZ + Yld.yldDevice.SSJ.SSJI.SS3TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS4RKDW + Yld.yldDevice.SSJ.SSJI.SS4KXBZ + Yld.yldDevice.SSJ.SSJI.SS4TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS5RKDW + Yld.yldDevice.SSJ.SSJI.SS5KXBZ + Yld.yldDevice.SSJ.SSJI.SS5TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS6RKDW + Yld.yldDevice.SSJ.SSJI.SS6KXBZ + Yld.yldDevice.SSJ.SSJI.SS6TASK + + + + + + + Yld.yldDevice.SSJ.SSJI.SS16DDBZ + Yld.yldDevice.SSJ.SSJI.SS16TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS18DDBZ + Yld.yldDevice.SSJ.SSJI.SS18TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS20DDBZ + Yld.yldDevice.SSJ.SSJI.SS20TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS22DDBZ + Yld.yldDevice.SSJ.SSJI.SS22TASK + + + + + + + Yld.yldDevice.SSJ.SSJI.SS24DDBZ + Yld.yldDevice.SSJ.SSJI.SS24TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS26DDBZ + Yld.yldDevice.SSJ.SSJI.SS26TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS28DDBZ + Yld.yldDevice.SSJ.SSJI.SS28TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS30DDBZ + Yld.yldDevice.SSJ.SSJI.SS30TASK + + + + + + + Yld.yldDevice.SSJ.SSJI.SS9RKDW + Yld.yldDevice.SSJ.SSJI.SS9TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS13RKDW + Yld.yldDevice.SSJ.SSJI.SS13TASK + + + + + + + Yld.yldDevice.SSJ.SSJI.SS15RKDW + Yld.yldDevice.SSJ.SSJI.SS15TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS17RKDW + Yld.yldDevice.SSJ.SSJI.SS17TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS19RKDW + Yld.yldDevice.SSJ.SSJI.SS19TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS21RKDW + Yld.yldDevice.SSJ.SSJI.SS21TASK + + + + + + + Yld.yldDevice.SSJ.SSJI.SS23RKDW + Yld.yldDevice.SSJ.SSJI.SS23TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS25RKDW + Yld.yldDevice.SSJ.SSJI.SS25TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS27RKDW + Yld.yldDevice.SSJ.SSJI.SS27TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS29RKDW + Yld.yldDevice.SSJ.SSJI.SS29TASK + + + + + + + Yld.yldDevice.SSJ.SSJI.SS10KXBZ + + + + + Yld.yldDevice.SSJ.SSJI.SS14KXBZ + + + + + + + Yld.yldDevice.SSJ.SSJI.SS7KXBZ + + + + + Yld.yldDevice.SSJ.SSJI.SS11KXBZ + + + + + + + Yld.yldDevice.SSJ.SSJI.SS15KXBZ + + + + + Yld.yldDevice.SSJ.SSJI.SS19KXBZ + + + + + + + Yld.yldDevice.SSJ.SSJI.SS23KXBZ + + + + + Yld.yldDevice.SSJ.SSJI.SS27KXBZ + + + + + + + Yld.yldDevice.SSJ.SSJI.SS8CKDW + Yld.yldDevice.SSJ.SSJI.SS8TASK + + + + + Yld.yldDevice.SSJ.SSJI.SS12CKDW + Yld.yldDevice.SSJ.SSJI.SS12TASK + + + + + + + Yld.yldDevice.XC1.tocar.JSSWQCSSDJ + + + + + + + Yld.yldDevice.SSJ.SSJI.SS16RWH + Yld.yldDevice.SSJ.SSJI.SS16XFBZ + Yld.yldDevice.SSJ.SSJI.SS16CRC + + + + + Yld.yldDevice.SSJ.SSJI.SS18RWH + Yld.yldDevice.SSJ.SSJI.SS18XFBZ + Yld.yldDevice.SSJ.SSJI.SS18CRC + + + + + Yld.yldDevice.SSJ.SSJI.SS20RWH + Yld.yldDevice.SSJ.SSJI.SS20XFBZ + Yld.yldDevice.SSJ.SSJI.SS20CRC + + + + + Yld.yldDevice.SSJ.SSJI.SS22RWH + Yld.yldDevice.SSJ.SSJI.SS22XFBZ + Yld.yldDevice.SSJ.SSJI.SS22CRC + + + + + + + Yld.yldDevice.SSJ.SSJI.SS24RWH + Yld.yldDevice.SSJ.SSJI.SS24XFBZ + Yld.yldDevice.SSJ.SSJI.SS24CRC + + + + + Yld.yldDevice.SSJ.SSJI.SS26RWH + Yld.yldDevice.SSJ.SSJI.SS26XFBZ + Yld.yldDevice.SSJ.SSJI.SS26CRC + + + + + Yld.yldDevice.SSJ.SSJI.SS28RWH + Yld.yldDevice.SSJ.SSJI.SS28XFBZ + Yld.yldDevice.SSJ.SSJI.SS28CRC + + + + + Yld.yldDevice.SSJ.SSJI.SS30RWH + Yld.yldDevice.SSJ.SSJI.SS30XFBZ + Yld.yldDevice.SSJ.SSJI.SS30CRC + + + + + + + diff --git a/wmsdssconfig/abb/ssxcommand1.dat b/wmsdssconfig/abb/ssxcommand1.dat new file mode 100644 index 0000000000000000000000000000000000000000..fafc4f3b042ef346d262a267ce84ed591d917112 GIT binary patch literal 5 McmZ4UmVvbZ00)l(4*&oF literal 0 HcmV?d00001 diff --git a/wmsdssconfig/abb/ssxcommand2.dat b/wmsdssconfig/abb/ssxcommand2.dat new file mode 100644 index 0000000000000000000000000000000000000000..0581a716ab9760f69fd8a0a0c336ee70510fd3c1 GIT binary patch literal 84 zcmZ4UmVvdnh(S0ju`E%qv?Mb}&m*xoqa-mYCslYizpA3wlO4 + + + + + + hzDsTest3 + + + + hzDs1 + + oracle.jdbc.driver.OracleDriver + jdbc:oracle:thin:@ + 192.168.8.172 + 1521 + orcl + zsjr + root + 50 + 5000 + select sysdate from dual + + + + + hzDs2 + + com.microsoft.sqlserver.jdbc.SQLServerDriver + jdbc:sqlserver:// + 192.168.10.180 + + 1433 + + DatabaseName=FT321 + sa + 123456 + 10 + 9000 + + + + + + hzDs99 + + com.microsoft.jdbc.sqlserver.SQLServerDriver + jdbc:microsoft:sqlserver:// + localhost + 1433 + DatabaseName=FT321 + sa + root + 30 + 9000 + select 1 + + + + + + hzDs3 + + com.microsoft.jdbc.sqlserver.SQLServerDriver + jdbc:microsoft:sqlserver:// + 172.16.2.170 + 1433 + DatabaseName=FT460 + sa + Flrd0914. + 30 + 9000 + select 1 + + + + + hzDsTest3 + + com.mysql.cj.jdbc.Driver + jdbc:mysql:// + 10.214.18.64 + 3306 + FT465-2 + root + root@123 + 30 + 9000 + SELECT 1 + + + + + + + hzDs8 + + com.microsoft.jdbc.sqlserver.SQLServerDriver + jdbc:microsoft:sqlserver:// + 127.0.0.1 + 1433 + DatabaseName=work + sa + 123456 + 30 + 9000 + select 1 + + + + + hzDs4 + + oracle.jdbc.driver.OracleDriver + jdbc:oracle:thin:@ + 192.168.8.26 + 1521 + zsjr2 + zsjr + zsjr123456 + 50 + 5000 + select sysdate from dual + + + + + hzDs5 + + oracle.jdbc.driver.OracleDriver + jdbc:oracle:thin:@ + 127.0.0.1 + 1521 + orcl + system + 123456 + 50 + 5000 + select sysdate from dual + + + + + + actionRelation.xml + opcItemconfig.xml + + + + + 9003 + 50 + 5 + 20 + 50 + 6000 + + + + + 172.20.21.201 + 102 + 1 + + + + + + WORKÉ豸ͨÐŵ÷¶Èϵͳ + images\\1.gif + 850 + 600 +

+ + É豸ͨÐÅ + 1 + + 16 + + Æô¡¡¡¡¶¯ + 1 + + 12 + 0 + com.wms.dss.ats.customs.abb.form.StartCorrespond + com.wms.dss.ats.customs.abb.plc.PLCCorrespondService + + + ·Ö¸ôÏß + + + + 1 + + + + Í£¡¡¡¡Ö¹ + 0 + + 14 + 0 + com.wms.dss.ats.customs.yld.form.StopCorrespond + + + + É豸µ÷¶È + 1 + + 16 + + Æô¡¡¡¡¶¯ + 1 + + 12 + 0 + com.wms.dss.common.server.form.StartSchedule + com.wms.dss.ats.customs.abb.schedule.ABBThreadSchedule + + + ·Ö¸ôÏß + + + + 1 + + + + Í£¡¡¡¡Ö¹ + 0 + + 14 + 0 + com.wms.dss.common.server.form.StopSchedule + + + + + + + ÊäËÍ»úͨÐÅÈÕÖ¾ + 16 + images\\now.gif + ÊäËÍ»úͨÐÅÈÕÖ¾ + 0 + + + ÊäËÍ»úµ÷¶ÈÈÕÖ¾ + 16 + images\\now.gif + ÊäËÍ»úµ÷¶ÈÈÕÖ¾ + 2 + + + + diff --git a/wmsdssconfig/abb/wmsdssconfig_1.xml b/wmsdssconfig/abb/wmsdssconfig_1.xml new file mode 100644 index 0000000..f46606c --- /dev/null +++ b/wmsdssconfig/abb/wmsdssconfig_1.xml @@ -0,0 +1,255 @@ + + + + + + + hzDsTest3 + + + + hzDs1 + + oracle.jdbc.driver.OracleDriver + jdbc:oracle:thin:@ + 192.168.8.172 + 1521 + orcl + zsjr + root + 50 + 5000 + select sysdate from dual + + + + + hzDs2 + + com.microsoft.sqlserver.jdbc.SQLServerDriver + jdbc:sqlserver:// + 192.168.10.180 + + 1433 + + DatabaseName=FT321 + sa + 123456 + 10 + 9000 + + + + + + hzDs99 + + com.microsoft.jdbc.sqlserver.SQLServerDriver + jdbc:microsoft:sqlserver:// + localhost + 1433 + DatabaseName=FT321 + sa + root + 30 + 9000 + select 1 + + + + + + hzDs3 + + com.microsoft.jdbc.sqlserver.SQLServerDriver + jdbc:microsoft:sqlserver:// + 172.16.2.170 + 1433 + DatabaseName=FT460 + sa + Flrd0914. + 30 + 9000 + select 1 + + + + + hzDsTest3 + + com.mysql.cj.jdbc.Driver + jdbc:mysql:// + 172.16.2.170 + 3306 + FT465-2 + root + Flrd0914. + 30 + 9000 + SELECT 1 + + + + + + + hzDs8 + + com.microsoft.jdbc.sqlserver.SQLServerDriver + jdbc:microsoft:sqlserver:// + 127.0.0.1 + 1433 + DatabaseName=work + sa + 123456 + 30 + 9000 + select 1 + + + + + hzDs4 + + oracle.jdbc.driver.OracleDriver + jdbc:oracle:thin:@ + 192.168.8.26 + 1521 + zsjr2 + zsjr + zsjr123456 + 50 + 5000 + select sysdate from dual + + + + + hzDs5 + + oracle.jdbc.driver.OracleDriver + jdbc:oracle:thin:@ + 127.0.0.1 + 1521 + orcl + system + 123456 + 50 + 5000 + select sysdate from dual + + + + + + actionRelation.xml + opcItemconfig.xml + + + + + 9003 + 50 + 5 + 20 + 50 + 6000 + + + + + 172.20.21.201 + 102 + 1 + + + + + + WORKÉ豸ͨÐŵ÷¶Èϵͳ + images\\1.gif + 850 + 600 + + + É豸ͨÐÅ + 1 + + 16 + + Æô¡¡¡¡¶¯ + 1 + + 12 + 0 + com.wms.dss.ats.customs.abb.form.StartCorrespond + com.wms.dss.ats.customs.abb.plc.PLCCorrespondService + + + ·Ö¸ôÏß + + + + 1 + + + + Í£¡¡¡¡Ö¹ + 0 + + 14 + 0 + com.wms.dss.ats.customs.yld.form.StopCorrespond + + + + É豸µ÷¶È + 1 + + 16 + + Æô¡¡¡¡¶¯ + 1 + + 12 + 0 + com.wms.dss.common.server.form.StartSchedule + com.wms.dss.ats.customs.abb.schedule.ABBThreadSchedule + + + ·Ö¸ôÏß + + + + 1 + + + + Í£¡¡¡¡Ö¹ + 0 + + 14 + 0 + com.wms.dss.common.server.form.StopSchedule + + + + + + + ÊäËÍ»úͨÐÅÈÕÖ¾ + 16 + images\\now.gif + ÊäËÍ»úͨÐÅÈÕÖ¾ + 0 + + + ÊäËÍ»úµ÷¶ÈÈÕÖ¾ + 16 + images\\now.gif + ÊäËÍ»úµ÷¶ÈÈÕÖ¾ + 2 + + + + diff --git a/wmsdssconfig/dssconfig.properties b/wmsdssconfig/dssconfig.properties new file mode 100644 index 0000000..720aa3f --- /dev/null +++ b/wmsdssconfig/dssconfig.properties @@ -0,0 +1,4 @@ +#Copyright (c) ricosoft +#2011-04-19 +wmsdssconfig=abb +wmsdssconfigxml=wmsdssconfig.xml