PlcMXComponent.cs 82 KB

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