PlcMXComponent.cs 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305
  1. using System;
  2. using System.Collections.Generic;
  3. using Newtonsoft.Json.Linq;
  4. using ProjectBase.Data.Logs;
  5. using ProjectBase.Data.Redis;
  6. using SIMDP.Model;
  7. using System.Reflection;
  8. using ACTMULTILib;
  9. using System.Text;
  10. using System.Net.NetworkInformation;
  11. using ProjectBase.Util;
  12. namespace SIMDP.Device
  13. {
  14. public class PlcMXComponent : AbstractBaseDevice
  15. {
  16. #region 数据定义
  17. protected ActEasyIFClass actEasyIF = null;
  18. public int actLogicalStationNumber = -1;
  19. public string CPUIP = "";//password
  20. public bool isConnect = false;
  21. protected Dictionary<string, MXComponentDataPointInfo> allPoints = new Dictionary<string, MXComponentDataPointInfo>();
  22. protected List<MXComponentDataPointInfo> monitorPoints = new List<MXComponentDataPointInfo>();
  23. public class MXComponentPLCInfo
  24. {
  25. public MXComponentPLCInfo(string json)
  26. {
  27. JObject jObject = JObject.Parse(json);
  28. JToken token = jObject["ActLogicalStationNumber"];
  29. if (token != null) ActLogicalStationNumber = Convert.ToInt16(token);
  30. token = jObject["ActPassword"];
  31. if (token != null) CpuIp = token.ToString();
  32. }
  33. public int ActLogicalStationNumber { get; set; }
  34. public string CpuIp { get; set; }
  35. public double TIMER { get; set; } = 1000;
  36. }
  37. public class MXComponentDataPointInfo
  38. {
  39. public MXComponentDataPointInfo(MoDataPoint _mo)
  40. {
  41. mo = _mo;
  42. Device = mo.DataPointSource;
  43. Type = Convert.ToInt32(mo.DataPointType);
  44. }
  45. public MoDataPoint mo;
  46. public string Device { get; set; }
  47. public int Type { get; set; }
  48. public object value = null;
  49. public MethodInfo proc = null;
  50. }
  51. #endregion
  52. #region 接口实现
  53. public override void Start(MoPlcInfo _plcInfo, List<MoDataPoint> _dataPoints)
  54. {
  55. plcInfo = _plcInfo;
  56. MXComponentPLCInfo plcConfig = new MXComponentPLCInfo(plcInfo.LinkConfig);
  57. actEasyIF = new ActEasyIFClass();
  58. actLogicalStationNumber = plcConfig.ActLogicalStationNumber;
  59. actEasyIF.ActLogicalStationNumber = actLogicalStationNumber;
  60. CPUIP = plcConfig.CpuIp;//actEasyIF.ActPassword = (plcConfig.CpuIp).ToString();
  61. CreateDataPointList(_dataPoints, plcInfo.PlcName);
  62. actionStart();
  63. timer.Interval = plcConfig.TIMER;
  64. timerStopped = false;
  65. //timer.Elapsed += timer_Elapsed;//20220606! 绑定了两次!
  66. timer.AutoReset = false;
  67. timer.Start();
  68. }
  69. public override bool isConnected()
  70. {
  71. return isConnect;
  72. }
  73. public override void Stop()
  74. {
  75. actionStop();
  76. timerStopped = true;
  77. }
  78. private bool PingCPU(string host)
  79. {
  80. if (string.IsNullOrEmpty(CPUIP)) return true;
  81. try
  82. {
  83. Ping p1 = new Ping();
  84. PingReply reply = p1.Send(host);
  85. if (reply.Status == IPStatus.Success) return true;
  86. }
  87. catch { }
  88. return false;
  89. }
  90. protected override bool Connect()
  91. {
  92. if (!PingCPU(CPUIP))
  93. {
  94. isConnect = false;
  95. SetRedisPlcDisConnect();
  96. }
  97. try
  98. {
  99. actEasyIF.Close();
  100. int res = actEasyIF.Open();
  101. if (res == 0)
  102. {
  103. isConnect = true;
  104. SetRedisPlcConnected();
  105. LogHelper.log.Info($"逻辑站号: {actLogicalStationNumber} 已连接到PLC!");
  106. actionConnected();
  107. }
  108. else
  109. {
  110. isConnect = false;
  111. SetRedisPlcDisConnect();
  112. LogHelper.log.Error($"逻辑站号: {actLogicalStationNumber} 连接失败:" + GetErrInfo((uint)res));
  113. }
  114. }
  115. catch (Exception ex)
  116. {
  117. isConnect = false;
  118. SetRedisPlcDisConnect();
  119. LogHelper.log.Error($"逻辑站号:{actLogicalStationNumber} 连接出现问题:" + ex.Message);
  120. }
  121. return isConnect;
  122. }
  123. protected override void Disconnect()
  124. {
  125. if (actEasyIF != null)
  126. actEasyIF.Close();
  127. isConnect = false;
  128. SetRedisPlcDisConnect();
  129. LogHelper.log.Info($"逻辑站号:{actLogicalStationNumber} PLC已断开!");
  130. }
  131. private void CreateDataPointList(List<MoDataPoint> dataPoints, string plcname)
  132. {
  133. if (redis == null)
  134. redis = new RedisHelper();
  135. Type t = this.GetType();
  136. foreach (MoDataPoint dataPoint in dataPoints)
  137. {
  138. MXComponentDataPointInfo dataPointInfo = new MXComponentDataPointInfo(dataPoint);
  139. allPoints.Add(dataPoint.DataPointName, dataPointInfo);
  140. // redis.SetString(dataPoint.DataPointId.ToString() + dataPoint.DataPointName, "");
  141. redis.SetString(SysEnvironment.PlcPointsPrefix + ":" + plcname + ":" + dataPoint.DataPointId.ToString() + dataPoint.DataPointName, "");
  142. //不再按照信号组类型区分是否为监控节点,只按照是否有执行逻辑
  143. if (dataPoint.DataProc.Trim() != "")
  144. {
  145. dataPointInfo.proc = t.GetMethod(dataPoint.DataProc);
  146. monitorPoints.Add(dataPointInfo);
  147. }
  148. }
  149. }
  150. #endregion
  151. #region 读写操作
  152. public bool Read(string dataPointName, out object value)
  153. {
  154. value = null;
  155. if (!allPoints.ContainsKey(dataPointName))
  156. {
  157. return false;
  158. }
  159. MXComponentDataPointInfo p = allPoints[dataPointName];
  160. return Read(p, out value);
  161. }
  162. public bool Read(MXComponentDataPointInfo p, out object value)
  163. {
  164. bool res = false;
  165. switch (p.Type)
  166. {
  167. case 1:
  168. res= Read(p, out bool value1);
  169. value = Convert.ToBoolean(value1);
  170. break;
  171. case 3:
  172. res = Read(p, out short value2);
  173. value = Convert.ToInt16(value2);
  174. break;
  175. case 5:
  176. res = Read(p, out int value3);
  177. value = Convert.ToInt32(value3);
  178. break;
  179. case 7:
  180. res = Read(p, out float value4);
  181. value = Convert.ToSingle(value4);
  182. break;
  183. case 9:
  184. res = Read(p,10, out string value5);
  185. value = Convert.ToString(value5);
  186. break;
  187. default:
  188. value = null;
  189. break;
  190. }
  191. return res;
  192. }
  193. /// <summary>
  194. /// 读取位软元件 M0
  195. /// </summary>
  196. /// <param name="dataPointName"></param>
  197. /// <param name="value"></param>
  198. /// <returns></returns>
  199. public bool Read(string dataPointName, out bool value)
  200. {
  201. value = false;
  202. if (!allPoints.ContainsKey(dataPointName)) return false;
  203. MXComponentDataPointInfo p = allPoints[dataPointName];
  204. return Read(p, out value);
  205. }
  206. /// <summary>
  207. /// 读取字软元件 D0
  208. /// </summary>
  209. /// <param name="dataPointName"></param>
  210. /// <param name="value"></param>
  211. /// <returns></returns>
  212. public bool Read(string dataPointName, out short value)
  213. {
  214. value = 0;
  215. if (!allPoints.ContainsKey(dataPointName)) return false;
  216. MXComponentDataPointInfo p = allPoints[dataPointName];
  217. return Read(p, out value);
  218. }
  219. /// <summary>
  220. /// 读取双字软元件 D0~D1(D0低位,D1高位)
  221. /// </summary>
  222. /// <param name="dataPointName"></param>
  223. /// <param name="value"></param>
  224. /// <returns></returns>
  225. public bool Read(string dataPointName, out int value)
  226. {
  227. value = 0;
  228. if (!allPoints.ContainsKey(dataPointName)) return false;
  229. MXComponentDataPointInfo p = allPoints[dataPointName];
  230. return Read(p, out value);
  231. }
  232. /// <summary>
  233. /// 读取单精度浮点数 D0~D1
  234. /// </summary>
  235. /// <param name="dataPointName"></param>
  236. /// <param name="value"></param>
  237. /// <returns></returns>
  238. public bool Read(string dataPointName, out float value)
  239. {
  240. value = 0;
  241. if (!allPoints.ContainsKey(dataPointName)) return false;
  242. MXComponentDataPointInfo p = allPoints[dataPointName];
  243. return Read(p, out value);
  244. }
  245. /// <summary>
  246. /// 读取字软元件构成的字符串,默认占用10个D
  247. /// </summary>
  248. /// <param name="dataPointName"></param>
  249. /// <param name="Dlength">连续字软元件的个数</param>
  250. /// <param name="value"></param>
  251. /// <returns></returns>
  252. public bool Read(string dataPointName, out string value, int Dlength = 10)
  253. {
  254. value = "";
  255. if (!allPoints.ContainsKey(dataPointName)) return false;
  256. MXComponentDataPointInfo p = allPoints[dataPointName];
  257. return Read(p, Dlength, out value);
  258. }
  259. public bool Read(MXComponentDataPointInfo p, out bool value)
  260. {
  261. value = false;
  262. int Result = actEasyIF.GetDevice2(p.Device, out short value1);
  263. if (Result != 0)
  264. {
  265. LogHelper.log.Error($"读取逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  266. return false;
  267. }
  268. else
  269. {
  270. value = Convert.ToBoolean(value1);
  271. UpdataRedisDataPoint(p.mo, value.ToString());
  272. return true;
  273. }
  274. }
  275. public bool Read(MXComponentDataPointInfo p, out short value)
  276. {
  277. int Result = actEasyIF.GetDevice2(p.Device, out value);
  278. if (Result != 0)
  279. {
  280. LogHelper.log.Error($"读取逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  281. return false;
  282. }
  283. else
  284. {
  285. UpdataRedisDataPoint(p.mo, value.ToString());
  286. return true;
  287. }
  288. }
  289. public bool Read(MXComponentDataPointInfo p, out int value)
  290. {
  291. value = 0;
  292. int[] ii = new int[2];
  293. //仅针对连续两个字软元件作为双字软元件时封装(如当device为D0时,读取的是D1D0构成的双字),必须不能用ReadDeviceBlock2
  294. int Result = actEasyIF.ReadDeviceBlock(p.Device, 2, out ii[0]);
  295. if (Result != 0)
  296. {
  297. LogHelper.log.Error($"读取逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  298. return false;
  299. }
  300. else
  301. {
  302. value = ii[1] * 65536 + ii[0];
  303. UpdataRedisDataPoint(p.mo, value.ToString());
  304. return true;
  305. }
  306. }
  307. public bool Read(MXComponentDataPointInfo p, out float value)
  308. {
  309. value = 0;
  310. int[] ii = new int[2];
  311. //仅针对连续两个字软元件作为双字软元件时封装(如当device为D0时,读取的是D1D0构成的双字),必须不能用ReadDeviceBlock2
  312. int Result = actEasyIF.ReadDeviceBlock(p.Device, 2, out ii[0]);
  313. if (Result != 0)
  314. {
  315. LogHelper.log.Error($"读取逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  316. return false;
  317. }
  318. else
  319. {
  320. int ivalue = ii[1] * 65536 + ii[0];
  321. value = BinaryToFloat(Convert.ToString(ivalue, 2).PadLeft(32, '0'));
  322. UpdataRedisDataPoint(p.mo, value.ToString());
  323. return true;
  324. }
  325. }
  326. public bool Read(MXComponentDataPointInfo p, int Dlength, out string value)
  327. {
  328. value = "";
  329. int[] ii = new int[10];
  330. int Result = actEasyIF.ReadDeviceBlock(p.Device, Dlength, out ii[0]);//连读10个字软元件 如D0~D9
  331. if (Result != 0)
  332. {
  333. LogHelper.log.Error($"读取逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  334. return false;
  335. }
  336. else
  337. {
  338. value = Ints2String(ii);
  339. UpdataRedisDataPoint(p.mo, value.ToString());
  340. return true;
  341. }
  342. }
  343. /// <summary>
  344. /// 自动根据类型写入
  345. /// </summary>
  346. /// <param name="dataPointName"></param>
  347. /// <param name="value"></param>
  348. /// <returns></returns>
  349. public bool Write(string dataPointName, object value, int Dlength = 10)
  350. {
  351. if (!allPoints.ContainsKey(dataPointName)) return false;
  352. MXComponentDataPointInfo p = allPoints[dataPointName];
  353. try
  354. {
  355. switch (p.Type)
  356. {
  357. case 1:
  358. Write(dataPointName, Convert.ToBoolean(value));
  359. break;
  360. case 3:
  361. Write(dataPointName, Convert.ToInt16(value));
  362. break;
  363. case 5:
  364. Write(dataPointName, Convert.ToInt32(value));
  365. break;
  366. case 7:
  367. Write(dataPointName, Convert.ToSingle(value));
  368. break;
  369. case 9:
  370. Write(dataPointName, Convert.ToString(value), Dlength);
  371. break;
  372. default:
  373. Write(dataPointName, Convert.ToInt16(value));
  374. break;
  375. }
  376. return true;
  377. }
  378. catch (Exception ex)
  379. {
  380. LogHelper.log.Error("Write()出错:" + ex.Message);
  381. return false;
  382. }
  383. }
  384. /// <summary>
  385. /// 设置位软元件
  386. /// </summary>
  387. /// <param name="dataPointName"></param>
  388. /// <param name="value"></param>
  389. /// <returns></returns>
  390. private bool Write(string dataPointName, bool value)
  391. {
  392. if (!allPoints.ContainsKey(dataPointName)) return false;
  393. MXComponentDataPointInfo p = allPoints[dataPointName];
  394. int Result = actEasyIF.SetDevice2(p.Device, Convert.ToInt16(value));
  395. if (Result != 0)
  396. {
  397. LogHelper.log.Error($"写入逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  398. return false;
  399. }
  400. else
  401. {
  402. UpdataRedisDataPoint(p.mo, value.ToString());
  403. return true;
  404. }
  405. }
  406. /// <summary>
  407. /// 设置字软元件
  408. /// </summary>
  409. /// <param name="dataPointName"></param>
  410. /// <param name="value"></param>
  411. /// <returns></returns>
  412. private bool Write(string dataPointName, short value)
  413. {
  414. if (!allPoints.ContainsKey(dataPointName)) return false;
  415. MXComponentDataPointInfo p = allPoints[dataPointName];
  416. int Result = actEasyIF.SetDevice2(p.Device, Convert.ToInt16(value));
  417. if (Result != 0)
  418. {
  419. LogHelper.log.Error($"写入逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  420. return false;
  421. }
  422. else
  423. {
  424. UpdataRedisDataPoint(p.mo, value.ToString());
  425. return true;
  426. }
  427. }
  428. /// <summary>
  429. /// 设置双字软元件
  430. /// </summary>
  431. /// <param name="dataPointName"></param>
  432. /// <param name="value"></param>
  433. /// <returns></returns>
  434. private bool Write(string dataPointName, int value)
  435. {
  436. if (!allPoints.ContainsKey(dataPointName)) return false;
  437. MXComponentDataPointInfo p = allPoints[dataPointName];
  438. int Result = actEasyIF.WriteDeviceBlock(p.Device, 2, ref Int3222Int32(value)[0]);
  439. if (Result != 0)
  440. {
  441. LogHelper.log.Error($"写入逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  442. return false;
  443. }
  444. else
  445. {
  446. UpdataRedisDataPoint(p.mo, value.ToString());
  447. return true;
  448. }
  449. }
  450. /// <summary>
  451. /// 设置单精度浮点数
  452. /// </summary>
  453. /// <param name="dataPointName"></param>
  454. /// <param name="value"></param>
  455. /// <returns></returns>
  456. private bool Write(string dataPointName, float value)
  457. {
  458. if (!allPoints.ContainsKey(dataPointName)) return false;
  459. MXComponentDataPointInfo p = allPoints[dataPointName];
  460. string sbinary = FloatToBinary(value);
  461. int ivalue = Convert.ToInt32(sbinary.Replace(" ", ""), 2);
  462. int Result = actEasyIF.WriteDeviceBlock(p.Device, 2, ref Int3222Int32(ivalue)[0]);
  463. if (Result != 0)
  464. {
  465. LogHelper.log.Error($"写入逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  466. return false;
  467. }
  468. else
  469. {
  470. UpdataRedisDataPoint(p.mo, value.ToString());
  471. return true;
  472. }
  473. }
  474. /// <summary>
  475. /// 写入字符串
  476. /// </summary>
  477. /// <param name="dataPointName"></param>
  478. /// <param name="value"></param>
  479. /// <returns></returns>
  480. private bool Write(string dataPointName, string value, int Dlength = 10)
  481. {
  482. if (!allPoints.ContainsKey(dataPointName)) return false;
  483. MXComponentDataPointInfo p = allPoints[dataPointName];
  484. int Result = actEasyIF.WriteDeviceBlock(p.Device, Dlength, ref String2Ints(value)[0]);
  485. if (Result != 0)
  486. {
  487. LogHelper.log.Error($"写入逻辑站号{actLogicalStationNumber}的软元件{p.Device}值失败:" + GetErrInfo((uint)Result));
  488. return false;
  489. }
  490. else
  491. {
  492. UpdataRedisDataPoint(p.mo, value.ToString());
  493. return true;
  494. }
  495. }
  496. public int[] Int3222Int32(int value)
  497. {
  498. int[] ii = new int[] { 0, 0 };
  499. string ss = Convert.ToString(value, 16);
  500. if (ss.Length < 4)
  501. {
  502. int a = Convert.ToInt32(value);
  503. ii[0] = a;
  504. ii[1] = 0;
  505. return ii;
  506. }
  507. else
  508. {
  509. int a = Convert.ToInt32(Convert.ToString((ss.Substring(ss.Length - 4, 4))), 16);
  510. int b = Convert.ToInt32(Convert.ToString((ss.Substring(0, ss.Length - 4))), 16);
  511. ii[0] = a;
  512. ii[1] = b;
  513. return ii;
  514. }
  515. }
  516. /// <summary>
  517. /// int数组转string
  518. /// </summary>
  519. /// <param name="aa"></param>
  520. /// <returns></returns>
  521. public string Ints2String(int[] aa)
  522. {
  523. string bb = "";
  524. foreach (int i in aa)
  525. {
  526. bb += Int1622Chars(i)[0];
  527. bb += Int1622Chars(i)[1];
  528. }
  529. return bb.Replace("\\u0000", "").Trim('\0');
  530. }
  531. /// <summary>
  532. /// 将单字元件的值拆成两个字符
  533. /// </summary>
  534. /// <param name="value"></param>
  535. /// <returns></returns>
  536. public char[] Int1622Chars(int value)
  537. {
  538. char[] ii = new char[] { ' ', ' ' };
  539. string ss = Convert.ToString(value, 16);
  540. if (ss.Length < 2)
  541. {
  542. char a = (char)Convert.ToInt32(value);
  543. ii[0] = a;
  544. ii[1] = '\0';
  545. return ii;
  546. }
  547. else
  548. {
  549. char a = (char)Convert.ToInt32(Convert.ToString((ss.Substring(ss.Length - 2, 2))), 16);
  550. string ssss = Convert.ToString((ss.Substring(0, ss.Length - 2)));
  551. char b = ssss == "" ? '\0' : (char)Convert.ToInt32(Convert.ToString((ss.Substring(0, ss.Length - 2))), 16);
  552. ii[0] = a;
  553. ii[1] = b;
  554. return ii;
  555. }
  556. }
  557. /// <summary>
  558. /// string 转int数组
  559. /// </summary>
  560. /// <param name="ss"></param>
  561. /// <returns></returns>
  562. public int[] String2Ints(string ss)
  563. {
  564. char[] cc = ss.ToCharArray();
  565. int[] ii = new int[cc.Length];
  566. for (int i = 0; i < cc.Length; i += 2)
  567. {
  568. if (i + 1 == cc.Length)
  569. ii[i / 2] = (int)cc[i];
  570. else
  571. ii[i / 2] = (int)cc[i + 1] * 256 + (int)cc[i];
  572. }
  573. return ii;
  574. }
  575. //二进制转folat
  576. public static float BinaryToFloat(string str)
  577. {
  578. str = str.Replace(" ", string.Empty);
  579. if (str.Length != 32)
  580. {
  581. // Console.WriteLine("数据长度错误");
  582. return float.NaN;
  583. }
  584. byte[] intBuffer = new byte[4];
  585. // 将二进制串按字节逆序化(一个字节8位)
  586. for (int i = 0; i < 4; i++)
  587. {
  588. string hex = str.Substring(24 - 8 * i, 8);
  589. intBuffer[i] = Convert.ToByte(hex, 2);
  590. }
  591. return BitConverter.ToSingle(intBuffer, 0);
  592. }
  593. //FLOAT转二进制
  594. private static string FloatToBinary(float value)
  595. {
  596. byte[] bytes = BitConverter.GetBytes(value);
  597. StringBuilder stringBuffer = new StringBuilder();
  598. for (int i = 0; i < bytes.Length; i++)
  599. {
  600. if (i != 0)
  601. {
  602. stringBuffer.Insert(0, " ");
  603. }
  604. string hex = Convert.ToString(bytes[i], 2);
  605. stringBuffer.Insert(0, hex);
  606. // 位数不够补0
  607. for (int j = hex.Length; j < 8; j++)
  608. {
  609. stringBuffer.Insert(0, "0");
  610. }
  611. }
  612. return stringBuffer.ToString();
  613. }
  614. /// <summary>
  615. /// 根据错误代码返回错误信息
  616. /// </summary>
  617. /// <param name="errCode"></param>
  618. /// <returns></returns>
  619. private string GetErrInfo(uint errCode)
  620. {
  621. switch (errCode)
  622. {
  623. case 0x01809001: return "GX Simulator2 未启动。";//测试模拟PLC用
  624. case 0x0000: return "Success";
  625. case 0x01010002: return "超时出错。";
  626. case 0x01010005: return "信息出错。";
  627. case 0x01010010: return "PLC 站号出错,无法与指定站号正常通讯。";
  628. case 0x01010011: return "模式出错不支持命令。";
  629. case 0x01010012: return "特殊单元配置出错。";
  630. case 0x01010013: return "其它数据出错某些原因而导致无法通讯。";
  631. case 0x01010018: return "远程请求出错在非通讯路径执行远程操作。";
  632. case 0x01010020: return "链接出错无法执行链接通讯。";
  633. case 0x01010021: return "特殊单元总线出错。特殊单元无反应。";
  634. case 0x01800001: return "无指令出错函数不支持。";
  635. case 0x01800002: return "存储锁定出错。";
  636. case 0x01800003: return "存储安全出错。";
  637. case 0x01800004: return "DLL 加载出错。";
  638. case 0x01800005: return "资源安全出错";
  639. case 0x01801001: return "资源超时出错。在指定时间内未检索到资源。";
  640. case 0x01801002: return "在指定时间内未检索到资源。";
  641. case 0x01801003: return "未执行打开命令。";
  642. case 0x01801004: return "打开类型出错。";
  643. case 0x01801005: return "指定端口出错。";
  644. case 0x01801006: return "指定模块出错。";
  645. case 0x01801007: return "指定CPU 出错。";
  646. case 0x01801008: return "访问目标站出错。";
  647. case 0x01801009: return "注册失败。打开注册数据失败。";
  648. case 0x0180100A: return "数据包类型出错。指定数据包类型不正确。";
  649. case 0x0180100B: return "协议类型出错。指定协议不正确。";
  650. case 0x0180100C: return "搜索注册失败。";
  651. case 0x0180100D: return "GetProcAddress 失败。";
  652. case 0x0180100E: return "DLL 未加载出错。";
  653. case 0x0180100F: return "另一个对象在执行中,由于专用控制正在运行因而无法执行函数。";
  654. case 0x01802001: return "软元件出错,函数中指定的软元件字符串未经批准。";
  655. case 0x01802002: return "软元件号出错,函数中指定的软元件字符串号未经批准。";
  656. case 0x01802003: return "程序类型出错。";
  657. case 0x01802004: return "和检验出错,接收到数据的和检验值异常。";
  658. case 0x01802005: return "大小出错,函数中指定的点数未经批准。";
  659. case 0x01802006: return "批号出错,函数的软元件字符串中指定的批号未经批准。";
  660. case 0x01802007: return "接收数据出错,接收到的数据异常。";
  661. case 0x01802008: return "写保护出错。";
  662. case 0x01802009: return "读参数出错。";
  663. case 0x0180200A: return "写参数出错。";
  664. case 0x0180200B: return "PLC类型不匹配,属性中设置的CPU型号和communication,settings utility中设置的CPU型号与另一通讯端不匹配。";
  665. case 0x0180200C: return "取消请求出错,处理进行中取消请求。";
  666. case 0x0180200D: return "驱动器名出错,指定驱动器名不正确。";
  667. case 0x0180200E: return "开始步骤出错,指定开始步骤不正确。";
  668. case 0x0180200F: return "参数类型出错,参数类型不正确。";
  669. case 0x01802010: return "文件名出错,文件名不正确。";
  670. case 0x01802011: return "状态出错,注册/取消/设置的状态不正确。";
  671. case 0x01802012: return "详细条件域出错。";
  672. case 0x01802013: return "步条件出错。";
  673. case 0x01802014: return "位软元件出错。";
  674. case 0x01802015: return "参数设置出错。";
  675. case 0x01802016: return "指定电话局号出错,函数不支持指定电话局号的通讯操作。";
  676. case 0x01802017: return "关键字出错。";
  677. case 0x01802018: return "读/写出错。";
  678. case 0x01802019: return "刷新函数出错。";
  679. case 0x0180201A: return "缓冲器存取函数出错。";
  680. case 0x0180201B: return "启动模式/结束模式出错。";
  681. case 0x0180201C: return "时钟数据写入出错,由于数据错误,指定的时钟数据无法正确写入。";
  682. case 0x0180201D: return "联机时钟数据写入出错,时钟数据写入失败。由于PLC CPU 处于RUN状态时钟数据无法写入。";
  683. case 0x0180201E: return "ROM驱动器出错。";
  684. case 0x0180201F: return "记录过程中出错,在记录中执行了无效操作。";
  685. case 0x01802020: return "起始I/O编号出错,函数中指定的起始I/O编号值未经批准。";
  686. case 0x01802021: return "首地址出错,函数中指定的缓冲器地址未经批准。";
  687. case 0x01802022: return "模式出错。";
  688. case 0x01802023: return "SFC 块号出错。";
  689. case 0x01802024: return "SFC 步号出错。";
  690. case 0x01802025: return "步号出错。";
  691. case 0x01802026: return "数据出错。";
  692. case 0x01802027: return "系统数据出错。";
  693. case 0x01802028: return "TC 设置数值出错。";
  694. case 0x01802029: return "清除模式出错。";
  695. case 0x0180202A: return "信号流程出错。";
  696. case 0x0180202B: return "版本控制出错。";
  697. case 0x0180202C: return "未注册监视出错。";
  698. case 0x0180202D: return "PI 类型出错。";
  699. case 0x0180202E: return "PI 号出错。";
  700. case 0x0180202F: return "PI 数目出错。";
  701. case 0x01802030: return "移位出错。";
  702. case 0x01802031: return "文件类型出错。";
  703. case 0x01802032: return "指定单元出错。";
  704. case 0x01802033: return "出错检查标志符出错。";
  705. case 0x01802034: return "分步RUN 操作出错。";
  706. case 0x01802035: return "分步RUN 数据出错。";
  707. case 0x01802036: return "分步RUN 过程中出错。";
  708. case 0x01802037: return "运行程序执行通讯过程中写入错误至E2PROM。";
  709. case 0x01802038: return "时钟数据读/写出错,无时钟软元件的PLC CPU执行时钟数据读/写函数。";
  710. case 0x01802039: return "记录未完成出错。";
  711. case 0x0180203A: return "注册清除标志符出错。";
  712. case 0x0180203B: return "操作出错。";
  713. case 0x0180203C: return "交换次数出错。";
  714. case 0x0180203D: return "指定循环数出错。";
  715. case 0x0180203E: return "重获选定数据。";
  716. case 0x0180203F: return "SFC 循环次数出错。";
  717. case 0x01802040: return "Motion PLC 出错。";
  718. case 0x01802041: return "Motion PLC 通讯出错。";
  719. case 0x01802042: return "固定执行时间设置出错。";
  720. case 0x01802043: return "各函数编号出错。";
  721. case 0x01802044: return "系统信息说明出错。";
  722. case 0x01802045: return "未确定注册条件出错。";
  723. case 0x01802046: return "函数号出错。";
  724. case 0x01802047: return "RAM驱动器出错。";
  725. case 0x01802048: return "引导程序端ROM驱动器出错。";
  726. case 0x01802049: return "引导程序端传输模式规格出错。";
  727. case 0x0180204A: return "内存不足出错。";
  728. case 0x0180204B: return "备份驱动器ROM 出错。";
  729. case 0x0180204C: return "块大小出错。";
  730. case 0x0180204D: return "在RUN状态下分离出错。";
  731. case 0x0180204E: return "单元已经注册出错。";
  732. case 0x0180204F: return "密码注册数据已满出错。";
  733. case 0x01802050: return "未注册密码出错。";
  734. case 0x01802051: return "远程密码出错。";
  735. case 0x01802052: return "IP 地址出错。";
  736. case 0x01802053: return "超时值超超越范围出错。";
  737. case 0x01802054: return "未检索到命令出错。";
  738. case 0x01802055: return "执行记录类型出错";
  739. case 0x01802056: return "版本出错";
  740. case 0x01802057: return "跟踪电缆出错,跟踪电缆有故障。PLC CPU处于error 状态。";
  741. case 0x01808001: return "多次打开出错,打开之后再次执行打开函数。";
  742. case 0x01808002: return "通道号指定出错,属性中及communication settings utility中设置的端口号数值未经批准。";
  743. case 0x01808003: return "驱动程序没有运行,网络板驱动程序没有运行。";
  744. case 0x01808004: return "生成重叠事件出错。";
  745. case 0x01808005: return "生成MUTEX 出错创建MUTEX进行专用控制失败。";
  746. case 0x01808006: return "生成网络界面程序错误,无法创建网络界面程序";
  747. case 0x01808007: return "生成网络界面程序出错,创建网络界面程序失败。";
  748. case 0x01808008: return "端口连接出错,建立连接失败。另一端无反应。";
  749. case 0x01808009: return "COM 端口控制关闭出错,无法操作COM 端口。无法复制COM 端口号。无法复制SOCKET 端口号。";
  750. case 0x0180800A: return "缓冲器大小设置出错,设置COM端口缓冲器大小失败。";
  751. case 0x0180800B: return "获得DCB 值出错,获得COM端口DCB 值失败。";
  752. case 0x0180800C: return "DCB 设置出错设置COM端口DCB 值失败。";
  753. case 0x0180800D: return "超时值设置出错,设置COM 端口超时值失败。";
  754. case 0x0180800E: return "打开共享存储器出错,打开共享存储器失败。";
  755. case 0x01808101: return "重复关闭出错。";
  756. case 0x01808102: return "关闭控制出错,关闭COM 端口控制失败。";
  757. case 0x01808103: return "驱动程序关闭出错,关闭驱动程序控制失败。";
  758. case 0x01808104: return "重叠事件关闭出错。";
  759. case 0x01808105: return "Mutex 控制关闭出错。";
  760. case 0x01808106: return "COM 端口控制关闭出错。";
  761. case 0x01808201: return "发送出错,发送数据失败。";
  762. case 0x01808202: return "发送数据大小出错,数据发送失败。";
  763. case 0x01808203: return "清除队列出错,清除COM端口队列失败。";
  764. case 0x01808301: return "接收出错,接收数据失败。";
  765. case 0x01808302: return "未发送错误。";
  766. case 0x01808303: return "重获重叠事件中错误。";
  767. case 0x01808304: return "接收缓冲器容量不足,收到的数据超过系统准备的接收缓冲器容量。";
  768. case 0x01808401: return "控制出错,COM端口通讯控制更改失败。";
  769. case 0x01808402: return "信号线控制出错。";
  770. case 0x01808403: return "信号线指定出错,COM端口通讯控制更改失败。";
  771. case 0x01808404: return "打开命令未执行。";
  772. case 0x01808405: return "通讯参数出错,属性中数据位和停止位结合未经批准。";
  773. case 0x01808406: return "指定传输速率值出错,属性中传输速率未经批准。";
  774. case 0x01808407: return "数据长度出错,属性中数据位值未经批准。";
  775. case 0x01808408: return "指定奇偶校验出错,属性中奇偶校验值未经批准。";
  776. case 0x01808409: return "指定停止位出错,属性中停止位数值未经批准。";
  777. case 0x0180840A: return "通讯控制设置出错,属性中控制值未经批准。";
  778. case 0x0180840B: return "超时出错,经过超时期间之后,数据仍未接收到。";
  779. case 0x0180840C: return "连接出错。";
  780. case 0x0180840D: return "重复连接出错。";
  781. case 0x0180840E: return "连接失败,网络界面程序连接失败。";
  782. case 0x0180840F: return "获得信号线状态失败,获得COM 端口信号线状态失败。";
  783. case 0x01808410: return "CD信号线OFF,CD信号在另一通讯端处于OFF 状态。";
  784. case 0x01808411: return "密码不匹配出错。";
  785. case 0x01808412: return "TEL 通讯出错。";
  786. case 0x01808501: return "USB驱动程序加载出错,加载USB 驱动程序失败。";
  787. case 0x01808502: return "USB驱动程序连接出错,连接USB 驱动程序失败。";
  788. case 0x01808503: return "USB驱动程序发送出错,数据发送失败";
  789. case 0x01808504: return "USB驱动程序接收出错,数据接收失败。";
  790. case 0x01808505: return "USB 驱动程序超时出错。";
  791. case 0x01808506: return "USB驱动程序初始化出错,USB驱动程序初始化失败。";
  792. case 0x01808507: return "USB 其它出错,有关数据发送/接收发生的错误。";
  793. case 0x02000001: return "点数超越范围出错,注册在监视服务器中的点数太高。";
  794. case 0x02000002: return "创建共享内存出错,创建共享内存失败。";
  795. case 0x02000003: return "访问共享内存出错。";
  796. case 0x02000004: return "保护内存出错,保护监视服务器内存失败。";
  797. case 0x02000005: return "设备未注册出错,监视器未注册。";
  798. case 0x02000006: return "监视服务器启动出错,监视服务器未启动。";
  799. case 0x02000010: return "检索设备值出错,监视未完成。";
  800. case 0x03000001: return "不支持命令出错,不支持命令。";
  801. case 0x03000002: return "锁定内存出错,锁定内存失败。";
  802. case 0x03000003: return "保护内存出错,保护内存失败。";
  803. case 0x03000004: return "读取DLL 出错,读取DLL 时失败。";
  804. case 0x03000005: return "保护资源出错,保护资源时失败。";
  805. case 0x03010001: return "创建文件出错,创建文件失败。";
  806. case 0x03010002: return "打开文件出错,打开文件失败。";
  807. case 0x03010003: return "缓冲器大小出错,指定缓冲器大小不正确或不够大。";
  808. case 0x03010004: return "SIL语句格式出错,SIL语句格式不正确。";
  809. case 0x03010005: return "文件名出错,指定文件名太长。";
  810. case 0x03010006: return "文件不存在出错,指定的文件不存在。";
  811. case 0x03010007: return "文件结构出错,指定文件中的数据结构不正确。";
  812. case 0x03010008: return "文件已存在出错,指定文件已经存在。";
  813. case 0x03010009: return "文件不存在出错,指定的文件不存在。";
  814. case 0x0301000A: return "文件删除出错,指定文件无法删除。";
  815. case 0x0301000B: return "重复打开出错,指定工程已经打开两次。";
  816. case 0x0301000C: return "文件名出错,指定文件名不正确。";
  817. case 0x0301000D: return "读取文件出错,读取文件失败。";
  818. case 0x0301000E: return "写入文件出错,写入文件失败。";
  819. case 0x0301000F: return "查找文件出错,查找文件失败。";
  820. case 0x03010010: return "关闭文件出错,关闭文件失败。";
  821. case 0x03010011: return "创建文件夹出错,创建文件夹失败。";
  822. case 0x03010012: return "复制文件出错,复制文件失败。";
  823. case 0x03010013: return "工程路径出错,工程路径长度不正确。";
  824. case 0x03010014: return "工程类型出错,工程类型不正确。";
  825. case 0x03010015: return "文件类型出错,文件类型不正确。";
  826. case 0x03010016: return "子文件类型出错,子文件类型不正确。";
  827. case 0x03010017: return "磁盘空间不足出错,磁盘空间不足。";
  828. case 0x03020002: return "重复打开出错,多次打开数据库产品。";
  829. case 0x03020003: return "未打开出错,数据库产品未打开。";
  830. case 0x03020004: return "解压缩出错,数据库产品不能解压缩。";
  831. case 0x03020010: return "参数出错,数据库产品的参数不正确。";
  832. case 0x03020011: return "代码出错,代码参数不正确。";
  833. case 0x03020012: return "指定制造商出错,制造商参数不正确。";
  834. case 0x03020013: return "指定单元出错,单元参数不正确。";
  835. case 0x03020014: return "SQL 参数出错,数据库产品的SIL、SQL 参数不正确。";
  836. case 0x03020015: return "SIL语句格式出错,SIL语句格式不正确。";
  837. case 0x03020016: return "输入字段出错,输入字段不正确。";
  838. case 0x03020050: return "建立记录数据出错,重建数据库产品记录数据失败。";
  839. case 0x03020060: return "检索记录数据出错,检索数据库产品记录数据失败。";
  840. case 0x03020061: return "末尾记录出错,当前记录为末尾记录时,无法检索到下一条。";
  841. case 0x03FF0000: return "初始化出错。";
  842. case 0x03FF0001: return "未初始化出错。";
  843. case 0x03FF0002: return "重复初始化出错。";
  844. case 0x03FF0003: return "工作空间初始化出错。";
  845. case 0x03FF0004: return "数据库初始化出错。";
  846. case 0x03FF0005: return "记录装置初始化出错。";
  847. case 0x03FF0006: return "关闭数据库出错。";
  848. case 0x03FF0007: return "关闭记录装置出错";
  849. case 0x03FF0008: return "未打开数据库出错,数据库没有打开。";
  850. case 0x03FF0009: return "未打开记录装置出错,记录装置没有打开。";
  851. case 0x03FF000A: return "初始化表出错,初始化TtableInformation 表失败。";
  852. case 0x03FF000B: return "初始化表出错,初始化TfieldInformation 表失败。";
  853. case 0x03FF000C: return "初始化表出错,初始化TrelationInformation 表失败。";
  854. case 0x03FF000D: return "初始化表出错,初始化Tlanguage 表失败。";
  855. case 0x03FF000E: return "初始化表出错,初始化Tmaker表失败。";
  856. case 0x03FF000F: return "初始化表出错,初始化TOpenDatabase 表失败。";
  857. case 0x03FF0010: return "区段值出错。";
  858. case 0x03FF0011: return "区段值出错。";
  859. case 0x03FF0012: return "退出出错,退出数据库失败。";
  860. case 0x03FF0100: return "移动记录出错,移动记录失败。";
  861. case 0x03FF0101: return "检索记录数出错,检索记录数失败。";
  862. case 0x03FF0110: return "检索区段值出错,检索区段值失败";
  863. case 0x03FF0111: return "设置区段值出错,设置区段值失败。";
  864. case 0x03FFFFFF: return "其它出错。";
  865. case 0x04000001: return "无命令出错,指定的CPU型号不能用于处理。";
  866. case 0x04000002: return "锁定内存出错,锁定内存失败。";
  867. case 0x04000003: return "保护内存出错,保护内存失败。";
  868. case 0x04000004: return "内部服务器加载DLL 出错启动内部服务器失败。";
  869. case 0x04000005: return "保护资源出错,保护资源失败。";
  870. case 0x04000006: return "加载主对象出错,读取文件失败。";
  871. case 0x04000007: return "加载换算表出错,读取表格数据失败。";
  872. case 0x04000100: return "不正确的中间码大小出错。";
  873. case 0x04010001: return "中间码未转换出错,转换一命令为机器代码超过256字节。";
  874. case 0x04010002: return "中间码完成出错,代码的中间码转换突然终止。";
  875. case 0x04010003: return "中间码不充分出错,代码的中间码转换不充分。";
  876. case 0x04010004: return "中间码数据出错,中间码转换不正确。";
  877. case 0x04010005: return "中间码结构出错,中间码中的步骤数不正确。";
  878. case 0x04010006: return "步骤数出错,说明中间码的步骤数不正确。";
  879. case 0x04010007: return "机器代码的存储空间不足出错,机器代码的存储空间不足。";
  880. case 0x04010008: return "其它出错,(由中间码转换成机器代码时产生的其它错误。)";
  881. case 0x04011001: return "机器代码未转换出错,转换一命令为中间码超过256字节。";
  882. case 0x04011002: return "机器代码完成出错,机器代码转换突然终止。";
  883. case 0x04011003: return "异常机器代码出错,转换机器代码异常,不能转换。";
  884. case 0x04011004: return "中间码存储空间不足出错,中间码存储区域不足出错";
  885. case 0x04011005: return "其它出错,机器代码转换成中间码产生的其它错误。";
  886. case 0x04020001: return "机器代码转换成中间码产生的其它错误。转换一命令为中间码超过256字节。";
  887. case 0x04020002: return "无输入出错,输入代码列表不足。";
  888. case 0x04020003: return "命令出错,转换代码列表的命令名不正确。";
  889. case 0x04020004: return "软元件出错,转换代码列表的软元件名不正确。";
  890. case 0x04020005: return "软元件号出错,转换代码列表的软元件号超越范围。";
  891. case 0x04020006: return "转换出错,不可识别转换的代码列表。";
  892. case 0x04020007: return "文本数据出错,代码列表转换不正确。";
  893. case 0x04020008: return "SFC输出操作出错,操作SFC的输出命令不正确。";
  894. case 0x04020009: return "SFC移位条件出错,SFC移动条件命令不正确。";
  895. case 0x0402000A: return "行间语句出错,程序行之间输入的语句不正确。";
  896. case 0x0402000B: return "P.I语句出错,输入的P.I语句不正确。";
  897. case 0x0402000C: return "注释出错,输入的注释不正确。";
  898. case 0x0402000D: return "注释出错,输入的注释不正确。";
  899. case 0x0402000E: return "其它出错,(列表转换成中间码时产生的其它错误。)";
  900. case 0x04021001: return "中间码未转换出错,转换一命令为代码列表超过256字节。";
  901. case 0x04021002: return "中间码区域已满出错,转换的中间码区域已满。";
  902. case 0x04021003: return "命令出错,通过转换的中间码指定的命令不正确。";
  903. case 0x04021004: return "软元件出错,转换的中间码中指定的软元件不正确。";
  904. case 0x04021005: return "中间码出错,转换的中间码结构不正确。";
  905. case 0x04021006: return "列表存储空间不足出错,存储转换代码列表的空间不足。";
  906. case 0x04021007: return "其它出错,(中间码转换为列表成时产生的其它错误。)";
  907. case 0x04030001: return "未转换出错,转换中间码的存储空间不足。";
  908. case 0x04030002: return "创建错误电路出错,在一顺控程序中未完成字符存储器电路。";
  909. case 0x04030003: return "指定电路大小超出范围,指定电路大小太大。";
  910. case 0x04030004: return "不正确返回电路出错,在返回电路前后无一致性。设置的返回电路太高。";
  911. case 0x04030005: return "其它出错,(字符存储器转换成中间码时产生的其它错误。)";
  912. case 0x04031001: return "未转换出错,指定字符存储器大小(纵向/横向)不正确。";
  913. case 0x04031002: return "异常命令码出错,转换的命令中间码不正确。";
  914. case 0x04031003: return "创建错误电路出错,无法转换成顺控程序电路。没有END 命令。";
  915. case 0x04031004: return "指定电路大小超出范围出错,指定电路大小太大。";
  916. case 0x04031005: return "重大出错,发生重大出错。";
  917. case 0x04031006: return "存储块数目不足出错,存储转换字符存储器电路块的空间不足。";
  918. case 0x04031007: return "查找电路块出错,电路块中数据中断。";
  919. case 0x04031008: return "其它出错,(中间码转换成字符存储器时产生的其它错误。)";
  920. case 0x04040001: return "CAD 数据出错没有CAD数据要转换。CAD数据格式不正确。";
  921. case 0x04040002: return "输出数据出错,输入CAD数据和输出CAD数据类型不匹配。";
  922. case 0x04040003: return "加载库差错,加载程序库失败。";
  923. case 0x04040004: return "存储空间保护差错,存储转换数据的受保护空间不足。";
  924. case 0x04040005: return "无END 命令出错,在CAD数据转换时无END 命令。";
  925. case 0x04040006: return "异常命令代码出错,在CAD数据转换中命令代码异常。";
  926. ////////////////////////////////////////////////////////////////////////////////
  927. case 0x04040007: return "软元件号出错,软元件号超出范围。";
  928. case 0x04040008: return "步骤号出错,步骤号超出范围。";
  929. case 0x04040009: return "指定电路大小超出范围出错,一个电路块太大。";
  930. case 0x0404000A: return "返回电路出错,返回电路不正确。";
  931. case 0x0404000: return "b创建错误电路出错,电路数据不正确。";
  932. case 0x0404000C: return "SFC 数据出错,转换SFC 数据不正确。";
  933. case 0x0404000D: return "列表数据出错,转换列表数据不正确。";
  934. case 0x0404000E: return "注释数据出错,转换注释数据不正确。";
  935. case 0x0404000F: return "声明出错,转换声明数据不正确。";
  936. case 0x04040010: return "其它出错,(CAD代码转换成中间码时产生的其它错误。)";
  937. case 0x04041001: return "中间码数据出错,没有中间码要转换。";
  938. case 0x04041002: return "CAD 数据类型出错,输入CAD数据和输出CAD数据类型不匹配。";
  939. case 0x04041003: return "库出错,加载程序库失败。";
  940. case 0x04041004: return "输入数据不足出错,转换的数据不足。";
  941. case 0x04041005: return "存储空间不足出错,没有足够的空间存储要转换的CAD 数据。";
  942. case 0x04041006: return "无END 命令出错,在要转换的CAD数据中没有END 命令。";
  943. case 0x04041007: return "异常命令代码出错,在要转换的CAD数据中存在异常命令代码。";
  944. case 0x04041008: return "软元件号出错,软元件号超出范围。";
  945. case 0x04041009: return "步号出错,步号超出范围。";
  946. case 0x0404100A: return "指定电路大小超出范围出错,1电路块太大。";
  947. case 0x0404100: return "b返回电路出错,返回电路不正确。";
  948. case 0x0404100C: return "创建错误电路出错,电路数据不正确。";
  949. case 0x0404100D: return "SFC 数据出错,要转换的SFC 数据不正确。";
  950. case 0x0404100E: return "列表数据出错,要转换的列表数据不正确。";
  951. case 0x0404100F: return "注释数据出错,转换注释数据不正确。";
  952. case 0x04041010: return "声明出错,转换声明数据不正确。";
  953. case 0x04041011: return "其它出错,(CAD代码转换成中间码时产生的其它错误。)";
  954. case 0x040A0001: return "中间码存储空间不足出错,存储转换后的数据空间不足。";
  955. case 0x040A0002: return "存储补充的SFC信息空间不足";
  956. case 0x040A0003: return "转换出错";
  957. case 0x040A0004: return "无SFC 程序出错";
  958. case 0x040A1001: return "未使用步/无输出出错";
  959. case 0x040A1002: return "步号超出范围出错";
  960. case 0x040A1003: return "未使用步/无输出出错";
  961. case 0x040A1004: return "传输号超出范围";
  962. case 0x040A1005: return "超出最大号出错";
  963. case 0x040A1006: return "宏控制器程序空间出错";
  964. case 0x040A1007: return "无SFC 程序出错";
  965. case 0x040B0001: return "中间码存储空间不足出错,存储转换后的数据空间不足。";
  966. case 0x040B0002: return "转换出错";
  967. case 0x040B1001: return "创建步启始位表失败";
  968. case 0x040B1002: return "读取步信息出错";
  969. case 0x040B1003: return "步号出错";
  970. case 0x040B1004: return "读取操作输出失败/传输中间码状态出错";
  971. case 0x040B1005: return "保护内部工作区域失败出错";
  972. case 0x040B1006: return "设定字符存储器中X方向最大值出错";
  973. case 0x040B1007: return "内部工作区域不足出错";
  974. case 0x040B1008: return "堆栈溢出、异常字符存储器";
  975. case 0x040B1009: return "存储块数不足出错";
  976. case 0x040B100A: return "无SFC 程序出错";
  977. case 0x04050001: return "指定字符串异常出错,指定软元件字符串不正确。";
  978. case 0x04050002: return "软元件点数出错,软元件点数超出范围。";
  979. case 0x04050003: return "其它出错,(软元件字符串转换成软元件中间码时产生的其";
  980. case 0x04051001: return "软元件名出错,指定的软元件中间码分类不正确。";
  981. case 0x04051002: return "软元件名出错,指定的扩展规格软元件中间码分类不正确。";
  982. case 0x04051003: return "其它出错,(软元件中间码转换成软元件字符串时产生的其";
  983. case 0x04052001: return "指定字符串异常出错,指定软元件字符串不正确。";
  984. case 0x04052002: return "软元件点数出错,软元件点数超出范围。";
  985. case 0x04052003: return "其它出错,(软元件字符串转换成软元件继承码时产生的其";
  986. case 0x04053001: return "软元件继承出错,指定的软元件中间码分类不正确。";
  987. case 0x04053002: return "软元件继承出错,指定的扩展规格软元件中间码分类不正确。";
  988. case 0x04053003: return "软元件继承出错,设备指定部件整流不正确。";
  989. case 0x04053004: return "软元件继承出错,补充设备指定部件整流不正确。";
  990. case 0x04053005: return "其它出错,(软元件继承码转换成软元件字符串时产生的其";
  991. case 0x04064001: return "软元件中间码异常出错,软元件的中间码不正确。";
  992. case 0x04064002: return "其它出错,(软元件中间码转换成软元件名时产生的其它错";
  993. case 0x04065001: return "软元件名异常出错,指定的软元件中间码分类不正确。";
  994. case 0x04065002: return "软元件名异常出错,指定的扩展规格软元件中间码分类不正确。";
  995. case 0x04065003: return "其它出错,(软元件名转换成中间码时产生的其它错误。)";
  996. case 0x04066001: return "软元件中间码出错,软元件的中间码不正确。";
  997. case 0x04066002: return "其它出错,(软元件中间码转换成软元件继承码时产生的其";
  998. case 0x04067001: return "软元件继承出错,指定的软元件中间码分类不正确。";
  999. case 0x04067002: return "软元件继承出错,指定的扩展规格软元件中间码分类不正确。";
  1000. case 0x04067003: return "软元件继承出错,指定软元件的校正部分不正确。";
  1001. case 0x04067004: return "软元件继承出错,指定扩展软元件的校正部分不正确。";
  1002. case 0x04067005: return "其它出错,(设备表现码转换成设备中间码时产生其它错";
  1003. case 0x04070001: return "公共数据转换出错,输入的软元件注释数据不正确。";
  1004. case 0x04070002: return "公共数据不足,转换数据不充分。";
  1005. case 0x04070003: return "存储区域不足,转换数据存储区域不足。";
  1006. case 0x04071001: return "转换PLC 数据出错,输入的软元件注释数据不正确。";
  1007. case 0x04071002: return "PLC数据不足出错,要转换的数据不足。";
  1008. case 0x04071003: return "存储区域不足,转换数据存储区域不足。";
  1009. case 0x04072001: return "打开出错,创建转换目标失败。";
  1010. case 0x04072002: return "PLC 类型出错,指定的PLC 类型不存在。";
  1011. case 0x04072003: return "未转换出错,转换目标不存在。";
  1012. case 0x04072004: return "输入数据出错,输入数据不正确。";
  1013. case 0x04073001: return "公共程序数据转换出错";
  1014. case 0x04073002: return "公共程序数据转换出错";
  1015. case 0x04073101: return "PLC程序数据转换出错";
  1016. case 0x04074001: return "公共数据参数出错";
  1017. case 0x04074002: return "公共网络参数数据出错,参数块存在,但其内部数据未设置。";
  1018. case 0x04074101: return "PLC 参数数据出错";
  1019. case 0x04074102: return "PLC 网络参数数据出错,参数块存在,但其内部数据未设置。";
  1020. case 0x04074103: return "误差出错";
  1021. case 0x04074201: return "指定网络类型出错,指定的PLC不支持该网络类型。";
  1022. case 0x04074202: return "参数块号出错,与指定参数块号相应的块不存在。";
  1023. case 0x04074203: return "参数块内容出错,与指定获支持的内容不同。";
  1024. case 0x04074204: return "参数块信息出错,指定块号不存在。";
  1025. case 0x04074205: return "默认参数块异常,指定块号不存在。";
  1026. case 0x04074301: return "转换公共参数块时出错";
  1027. case 0x04074302: return "1001号公共参数块中出错,RUN-PAUSE设置值存在标记不正确。";
  1028. case 0x04074303: return "1003号公共参数块中出错";
  1029. case 0x04074304: return "1008号公共参数块中出错";
  1030. case 0x04074305: return "1100号公共参数块中出错";
  1031. case 0x04074306: return "2001号公共参数块中出错,指定设备中间码不存在。";
  1032. case 0x04074307: return "3000号公共参数块中出错";
  1033. case 0x04074308: return "3002号公共参数块中出错";
  1034. case 0x04074309: return "3004号公共参数块中出错,报警器显示模式设置不正确。";
  1035. case 0x0407430A: return "4000号公共参数块中出错,未创建I/O分配数据。";
  1036. case 0x0407430: return "b5000号公共参数块中出错,不支持指定网络。";
  1037. case 0x0407430C: return "5001号公共参数块中出错,访问其它交换时,有效单元编号未设置。";
  1038. case 0x0407430D: return "5002号公共参数块中出错";
  1039. case 0x0407430E: return "5003号公共参数块中出错";
  1040. case 0x0407430F: return "5NM0号公共参数块中出错";
  1041. case 0x04074310: return "5NM1号公共参数块中出错";
  1042. case 0x04074311: return "5NM2号公共参数块中出错";
  1043. case 0x04074312: return "5NM3号公共参数块中出错";
  1044. case 0x04074313: return "6000号公共参数块中出错";
  1045. case 0x04074314: return "FF18号公共参数块中出错,链接参数容量未设置。";
  1046. case 0x04074315: return "FF25号公共参数块中出错,计算检查电路未设置。";
  1047. case 0x04074316: return "FF30号公共参数块中出错,范例数据路径未创建。";
  1048. case 0x04074317: return "FF31号公共参数块中出错,状态锁存数据未创建。";
  1049. case 0x04074318: return "FF42号公共参数块中出错,计时器处理点数未设置。";
  1050. case 0x04074319: return "FF30号公共参数块中出错,为指定的扩展计时器设置的软元件值不存在。";
  1051. case 0x0407431A: return "FF44号公共参数块中出错";
  1052. case 0x0407431: return "bFF45号公共参数块中出错";
  1053. case 0x0407431C: return "FF60号公共参数块中出错,未设置终端设置。";
  1054. case 0x0407431D: return "FF70号公共参数块中出错,用户释放区域未设置。";
  1055. case 0x04074401: return "转换PLC 参数块出错";
  1056. case 0x04074402: return "1001号PLC 参数块中出错";
  1057. case 0x04074403: return "1003号PLC 参数块中出错";
  1058. case 0x04074404: return "1008号PLC 参数块中出错";
  1059. case 0x04074405: return "1100号PLC 参数块中出错";
  1060. case 0x04074406: return "2001号PLC 参数块中出错";
  1061. case 0x04074407: return "3000号PLC 参数块中出错";
  1062. case 0x04074408: return "3002号PLC 参数块中出错";
  1063. case 0x04074409: return "3004号PLC 参数块中出错";
  1064. case 0x0407440A: return "4000号PLC 参数块中出错";
  1065. case 0x0407440: return "b5000号PLC 参数块中出错,不支持指定的网络类型。";
  1066. case 0x0407440C: return "5001号PLC 参数块中出错";
  1067. case 0x0407440D: return "5002号PLC 参数块中出错";
  1068. case 0x0407440E: return "5003号PLC 参数块中出错";
  1069. case 0x0407440F: return "5NM0号PLC 参数块中出错,不支持指定的网络类型。";
  1070. case 0x04074410: return "5NM1号PLC 参数块中出错";
  1071. case 0x04074411: return "5NM2号PLC 参数块中出错,不支持指定的网络类型。";
  1072. case 0x04074412: return "5NM3号PLC 参数块中出错";
  1073. case 0x04074413: return "6000号PLC 参数块中出错";
  1074. case 0x04074414: return "FF18号PLC 参数块中出错";
  1075. case 0x04074415: return "FF25号PLC 参数块中出错";
  1076. case 0x04074416: return "FF30号PLC 参数块中出错";
  1077. case 0x04074417: return "FF31号PLC 参数块中出错";
  1078. case 0x04074418: return "FF42号PLC 参数块中出错";
  1079. case 0x04074419: return "FF43号PLC 参数块中出错";
  1080. case 0x0407441A: return "FF44号PLC 参数块中出错";
  1081. case 0x0407441: return "bFF45号PLC 参数块中出错";
  1082. case 0x0407441C: return "FF60号PLC 参数块中出错";
  1083. case 0x0407441D: return "FF70号PLC 参数块中出错";
  1084. case 0x04075001: return "公共数据转换出错,转换软元件存储器的设置部分时失败。";
  1085. case 0x04075002: return "公共数据转换出错,转换软元件存储器的数据部分时失败。";
  1086. case 0x04075003: return "公共数据转换出错,软元件存储器的数据部分不存在。";
  1087. case 0x04075101: return "PLC数据转换出错,转换软元件存储器的设置部分时失败。";
  1088. case 0x04075102: return "PLC数据转换出错,转换软元件存储器的数据部分时失败。";
  1089. case 0x04076001: return "公共数据转换出错,转换软元件注释的设置部分时失败。";
  1090. case 0x04076002: return "公共数据转换出错,转换软元件注释的数据部分时失败。";
  1091. case 0x04076101: return "PLC数据转换出错,转换软元件注释的设置部分时失败。";
  1092. case 0x04076102: return "PLC数据转换出错,转换软元件注释的设置部分时失败。";
  1093. case 0x04077001: return "公共数据转换出错,转换范例路径的设置部分时失败。";
  1094. case 0x04077002: return "公共数据转换出错,转换范例路径的数据部分时失败。";
  1095. case 0x04077101: return "PLC数据转换出错,转换范例路径的设置部分时失败。";
  1096. case 0x04077102: return "PLC数据转换出错,转换范例路径的数据部分时失败。";
  1097. case 0x04078001: return "公共数据转换出错,转换状态锁存的设置部分时失败。";
  1098. case 0x04078002: return "公共数据转换出错,转换状态锁存的数据部分时失败。";
  1099. case 0x04078101: return "PLC数据转换出错,转换状态锁存的设置部分时失败。";
  1100. case 0x04078102: return "PLC数据转换出错,转换状态锁存的数据部分时失败。";
  1101. case 0x04079101: return "PLC数据转换失败历史记录出错";
  1102. case 0x0407A101: return "PLC 文件列表数据转换出错";
  1103. case 0x0407B101: return "PLC数据转换信息出错";
  1104. case 0x0407C001: return "间接地址转换为软元件名出错,软元件名存储区未保护。";
  1105. case 0x0407C002: return "软元件名转换为间接地址出错,间接地址存储区未保护。";
  1106. case 0x0407C003: return "间接地址转换为软元件请求出错,没有保护设备显示存储区。";
  1107. case 0x0407C004: return "软元件请求转换为间接地址出错,间接地址存储区未保护。";
  1108. case 0x0407C005: return "间接地址转换为软元件字符串出错,软元件字符串存储区未保护。";
  1109. case 0x0407C006: return "软元件字符串转换为中间码出错,间接地址存储区未保护。";
  1110. case 0x0407C007: return "中间码转换为软元件名出错,软元件名存储区未保护。";
  1111. case 0x0407C008: return "软元件名转换为中间码出错,中间码存储区未保护。";
  1112. case 0x0407C009: return "中间码转换为软元件请求时出错,未保护软元件请求存储区。";
  1113. case 0x0407C00A: return "Device Representation 转换为中间码出错,中间码存储区未保护。";
  1114. case 0x0407C00: return "b中间码转换为间接地址出错,间接地址存储区未保护。";
  1115. case 0x0407C00C: return "间接地址转换为中间码出错,中间码存储区未保护。";
  1116. case 0x0407C00D: return "PLC 类型出错,不支持指定的PLC 类型。";
  1117. case 0x0407C00E: return "软元件字符串出错,不支持指定的软元件。";
  1118. case 0x0407C00F: return "软元件字符串出错,指定软元件字符串、类型不正确。";
  1119. case 0x0407C010: return "软元件出错,指定PLC 不支持指定软元件。";
  1120. case 0x0407C011: return "PLC 类型出错,不支持指定的PLC 类型。";
  1121. case 0x0407C012: return "软元件超出范围出错,对于AnA系统,指定的软元件超出AnA系统范";
  1122. case 0x0407D001: return "公共数据转换出错,转换SFC路径条件设置部分出错。";
  1123. case 0x0407D002: return "公共数据转换出错,转换SFC路径条件数据部分出错。";
  1124. case 0x0407D101: return "PLC数据转换出错,转换SFC路径条件设置部分出错。";
  1125. case 0x0407D102: return "PLC数据转换出错,转换SFC路径条件数据部分出错。";
  1126. case 0x04080001: return "中间码分类超出范围出错,指定中间码分类超出范围。";
  1127. case 0x04080002: return "扩展规格中间码分类超出范围出错,指定的扩展规格中间码超出范围。";
  1128. case 0x04080003: return "缺少检查软元件点数出错,未检查软元件点数。";
  1129. case 0x04090001: return "GPP工程出错,指定的PLC类型与GPP 工程类型不匹配。";
  1130. case 0x04090002: return "文件类型出错,指定的GPP 工程类型与文件类型不匹配。";
  1131. case 0x04090010: return "转换的GPP数据不足,没有数据可以转换。指定数据大小不正确。";
  1132. case 0x04090011: return "存储转换数据的空间不足,存储转换数据的空间不足。";
  1133. case 0x04090012: return "转换GPP 数据出错,转换的GPP 数据不正确。";
  1134. case 0x04090110: return "转换的GPP数据不足,没有数据可以转换。指定数据大小不正确。";
  1135. case 0x04090111: return "存储转换数据的空间不足,存储转换数据的空间不足。";
  1136. case 0x04090112: return "转换数据出错,要转换的数据不正确。";
  1137. case 0x04FFFFFF: return "其它出错";
  1138. case 0x10000001: return "无命令出错";
  1139. case 0x10000002: return "运行MX Component的DLL 通讯失败";
  1140. case 0x10000003: return "打开失败(DiskDrive)";
  1141. case 0x10000004: return "重复打开出错 退出程序并重启IBM-PC/AT 兼容计算机。";
  1142. case 0x10000005: return "存取文件出错";
  1143. case 0x10000006: return "文件夹名出错";
  1144. case 0x10000007: return "拒绝存取文件出错";
  1145. case 0x10000008: return "磁盘已满出错";
  1146. case 0x10000009: return "删除文件出错";
  1147. case 0x1000000A: return "文件名出错";
  1148. case 0x1000000C: return "由于另一个程序或线程在发送请求导致运行失,败。";
  1149. case 0x1000000D: return "创建文件夹出错";
  1150. case 0x1000000E: return "文件夹/文件类型出错";
  1151. case 0x1000000F: return "地址偏移量出错";
  1152. case 0x10000010: return "取消请求,发生取消处理。";
  1153. case 0x10000011: return "保护存储器出错";
  1154. case 0x10000012: return "未执行打开 退出程序并重启IBM-PC/AT 兼容计算机。";
  1155. case 0x10000013: return "未执行连接出错";
  1156. case 0x10000014: return "无效目标出错";
  1157. case 0x10000015: return "取消请求失败出错";
  1158. case 0x10000016: return "读取状态失败出错";
  1159. case 0x10000017: return "指定大小(软元件数目)未经批准。";
  1160. case 0x10000018: return "没有注册的软元件 退出程序并重启IBM-PC/AT 兼容计算机。";
  1161. case 0x10000019: return "未执行数组";
  1162. case 0x1000001A: return "未执行读取出错";
  1163. case 0x1000001: return "b创建标记出错";
  1164. case 0x1000001C: return "访问操作结束";
  1165. case 0x1000001D: return "冗余软元件出错";
  1166. case 0x1000001E: return "检索注册失败";
  1167. case 0x1000001F: return "文件类型出错";
  1168. case 0x10000020: return "软元件存储器类型出错";
  1169. case 0x10000021: return "程序范围出错";
  1170. case 0x10000022: return "TEL 类型出错";
  1171. case 0x10000023: return "访问TEL 出错";
  1172. case 0x10000024: return "取消标记类型出错";
  1173. case 0x10000030: return "软元件重复注册出错";
  1174. case 0x10000031: return "未注册软元件出错";
  1175. case 0x10000032: return "指定软元件出错";
  1176. case 0x10000033: return "指定软元件范围出错";
  1177. case 0x10000034: return "写入文件出错";
  1178. case 0x10000040: return "启动服务器失败";
  1179. case 0x10000041: return "停止服务器出错,停止服务器失败。";
  1180. case 0x10000042: return "服务器启动两次出错";
  1181. case 0x10000043: return "未启动服务器出错";
  1182. case 0x10000044: return "源文件超时出错";
  1183. case 0x10000045: return "服务器类型出错";
  1184. case 0x10000046: return "访问服务器失败出错";
  1185. case 0x10000047: return "已访问服务器出错";
  1186. case 0x10000048: return "启动模拟器失败";
  1187. case 0x10000049: return "退出模拟器失败";
  1188. case 0x1000004A: return "未启动模拟器出错";
  1189. case 0x1000004: return "b模拟器类型出错";
  1190. case 0x1000004C: return "不支持模拟器出错";
  1191. case 0x1000004D: return "模拟器启动两次出错";
  1192. case 0x1000004E: return "未启动共享存储器出错";
  1193. case 0xF0000001: return "无许可证出错,IBM-PC/AT兼容计算机未获得许可证。";
  1194. case 0xF0000002: return "读取设置数据出错,读取逻辑站号设置数据失败。";
  1195. case 0xF0000003: return "已经打开出错,在打开状态下执行打开函数。";
  1196. case 0xF0000004: return "未打开出错,未执行打开函数。";
  1197. case 0xF0000005: return "初始化出错,MX Component内部程序初始化失败。";
  1198. case 0xF0000006: return "保护存储器出错,保护MX Component内部存储器失败。";
  1199. case 0xF0000007: return "不支持函数出错,函数不支持。";
  1200. case 0xF1000001: return "字符代码转换出错,字符代码转换(UNICODE ASCII码或ASCII码";
  1201. case 0xF1000002: return "第一个I/O编号出错,指定的第一个I/O编号值未经批准。";
  1202. case 0xF1000003: return "缓冲器地址出错,指定的缓冲器地址数值未经批准。";
  1203. case 0xF1000004: return "读取缓冲区大小出错,读取缓冲器,不能获得指定大小。";
  1204. case 0xF1000005: return "大小出错,读/写函数中指定大小异常。";
  1205. case 0xF1000006: return "操作出错,指定的远程操作为一异常值。";
  1206. case 0xF1000007: return "时钟数据出错,时钟数据异常。";
  1207. case 0xF1000008: return "M监控器的注册点数超额。,EntryDeviceStatus函数中注册的软元件点数为";
  1208. case 0xF1000009: return "注册的软元件监视数据出错";
  1209. case 0xF1000010: return "启动软元件状态监视器处理失败。,结束软元件状态监视器处理失败。";
  1210. case 0xF1000011: return "变量数据类型出错。";
  1211. case 0xF1000012: return "软元件状态监视的时间间隔值超出1 秒至1小时,范围(1至3600)。";
  1212. case 0xF1000013: return "已经连接出错,程序运行后重复执行连接。";
  1213. case 0xF1000014: return "程序运行后重复执行连接。,电话号码含有“0123456789-*#”以外的字符。";
  1214. case 0xF1000015: return "专用控制失败出错,在执行连接和断开函数时专用控制失败。";
  1215. case 0xF1000016: return "连接电话线出错,除了用于MX Comonent,电话线正连接其它应用";
  1216. case 0xF1000017: return "电话线未连接出错。,电话线未连接。";
  1217. case 0xF1000018: return "无电话号码出错。,电话号码未设定。";
  1218. case 0xF1000019: return "无关闭出错,在打开状态时执行断开。";
  1219. case 0xF100001A: return "连接目标电话线不匹配出错。,对于已经连接上电话线的端口使用不同的电话号";
  1220. case 0xF100001: return "b控制类型不匹配出错,对于控制类型不同于已经连接电话线的一个对";
  1221. case 0xF100001C: return "未断开出错。,当对连接上电话线的对象执行断开函数时,发现";
  1222. case 0xF100001D: return "未连接出错,在连接或者断开执行之前执行打开。";
  1223. case 0xF100001E: return "严重出错";
  1224. case 0xF100001F: return "设置打开时间出错,用于连接和打开的电话号码和端口号码的设定有";
  1225. case 0xF2000002: return "来自目标电话的出错响应。,可能为以下原因:";
  1226. case 0xF2000003: return "收到无效数据。,可能为以下原因:";
  1227. case 0xF2000004: return "调制解调器无反应。,可能为以下原因:";
  1228. case 0xF2000005: return "可能没有断开线路。 检查线路。";
  1229. case 0xF2000006: return "个人计算机调制解调器没有收到AT 命令。,可能为以下原因:";
  1230. case 0xF2000007: return "调制解调器对于标准出口命令没有正确响应。";
  1231. case 0xF2000009: return "调制解调器对于断开线路命令没有正确响应。 检查调制解调器。";
  1232. case 0xF200000A: return "对象没有接收信号。,* 另一端调制解调器的接收设置可能不正确。";
  1233. case 0xF200000: return "b接收回呼的等待时间超时。";
  1234. case 0xF200000C: return "无法分辨A6TEL、Q6TEL、QJ71C24单元的口令。";
  1235. case 0xF2010001: return "断开回呼线路的等待时间不在0 至180秒之间。,执行回呼的延迟时间不在0 至1800秒之间。";
  1236. case 0xF2010002: return "QJ71C24未收到指定的连接函数。,可能为以下原因:";
  1237. case 0xF2010003: return "QJ71C24不允许自动连接(在固定回呼或指定号码,时)。";
  1238. case 0xF2100005: return "可能线路没有断开。";
  1239. case 0xF2100008: return "调制解调器对于从个人计算机发送的数据无反,应。";
  1240. case 0xF2100006: return "调制解调器没有收到AT启动命令。";
  1241. case 0xF2100007: return "个人计算机调制解调器对出口命令无反应。";
  1242. //case 0xF21000**: return "调制解调器没有反应。,可能为以下原因:";
  1243. //case 0xF21001**: return "A(Q)6TEL/C24没有反应。,可能为以下原因:";
  1244. //case 0xF202****: return "有通讯失败。,下面的原因可以根据情况而定。";
  1245. default: return "Unkonw error";
  1246. }
  1247. }
  1248. #endregion
  1249. }
  1250. }