你现在位置:首页>技术论文>软件知识>正文
用结构化文本实现的MODBUSCRC计算
日期:2010-10-12 9:29:14 点击:
来源:中国工控网
作者:
点击【】放大字体.
[摘要]:本文用ST语言实现了MODBUS CRC校验的计算
[关键词]:MODBUS CRC, ST语言
这是用ST语言写的MODBUS CRC程序
(*initialize array*)
CRCHi[0]:=BYTE#16#00;    CRCLo[0]:=BYTE#16#00;
CRCHi[1]:=BYTE#16#C1;    CRCLo[1]:=BYTE#16#C0;
CRCHi[2]:=BYTE#16#81;    CRCLo[2]:=BYTE#16#C1;
CRCHi[3]:=BYTE#16#40;    CRCLo[3]:=BYTE#16#01;
CRCHi[4]:=BYTE#16#01;    CRCLo[4]:=BYTE#16#C3;
CRCHi[5]:=BYTE#16#C0;    CRCLo[5]:=BYTE#16#03;
CRCHi[6]:=BYTE#16#80;    CRCLo[6]:=BYTE#16#02;
CRCHi[7]:=BYTE#16#41;    CRCLo[7]:=BYTE#16#C2;
CRCHi[8]:=BYTE#16#01;    CRCLo[8]:=BYTE#16#C6;
CRCHi[9]:=BYTE#16#C0;    CRCLo[9]:=BYTE#16#06;
CRCHi[10]:=BYTE#16#80;   CRCLo[10]:=BYTE#16#07;
CRCHi[11]:=BYTE#16#41;   CRCLo[11]:=BYTE#16#C7;
CRCHi[12]:=BYTE#16#00;   CRCLo[12]:=BYTE#16#05;
CRCHi[13]:=BYTE#16#C1;   CRCLo[13]:=BYTE#16#C5;
CRCHi[14]:=BYTE#16#81;   CRCLo[14]:=BYTE#16#C4;
 
CRCHi[15]:=BYTE#16#40;   CRCLo[15]:=BYTE#16#04;
CRCHi[16]:=BYTE#16#01;   CRCLo[16]:=BYTE#16#CC;
CRCHi[17]:=BYTE#16#C0;   CRCLo[17]:=BYTE#16#0C;
CRCHi[18]:=BYTE#16#80;   CRCLo[18]:=BYTE#16#0D;
CRCHi[19]:=BYTE#16#41;   CRCLo[19]:=BYTE#16#CD;
CRCHi[20]:=BYTE#16#00;   CRCLo[20]:=BYTE#16#0F;
CRCHi[21]:=BYTE#16#C1;   CRCLo[21]:=BYTE#16#CF;
CRCHi[22]:=BYTE#16#81;   CRCLo[22]:=BYTE#16#CE;
CRCHi[23]:=BYTE#16#40;   CRCLo[23]:=BYTE#16#0E;
CRCHi[24]:=BYTE#16#00;   CRCLo[24]:=BYTE#16#0A;
CRCHi[25]:=BYTE#16#C1;   CRCLo[25]:=BYTE#16#CA;
CRCHi[26]:=BYTE#16#81;   CRCLo[26]:=BYTE#16#CB;
CRCHi[27]:=BYTE#16#40;   CRCLo[27]:=BYTE#16#0B;
CRCHi[28]:=BYTE#16#01;   CRCLo[28]:=BYTE#16#C9;
CRCHi[29]:=BYTE#16#C0;   CRCLo[29]:=BYTE#16#09;
 
CRCHi[30]:=BYTE#16#80;   CRCLo[30]:=BYTE#16#08; 
CRCHi[31]:=BYTE#16#41;   CRCLo[31]:=BYTE#16#C8;
CRCHi[32]:=BYTE#16#01;   CRCLo[32]:=BYTE#16#D8;
CRCHi[33]:=BYTE#16#C0;   CRCLo[33]:=BYTE#16#18;
CRCHi[34]:=BYTE#16#80;   CRCLo[34]:=BYTE#16#19;
CRCHi[35]:=BYTE#16#41;   CRCLo[35]:=BYTE#16#D9;
CRCHi[36]:=BYTE#16#00;   CRCLo[36]:=BYTE#16#1B;
CRCHi[37]:=BYTE#16#C1;   CRCLo[37]:=BYTE#16#DB;
CRCHi[38]:=BYTE#16#81;   CRCLo[38]:=BYTE#16#DA;
CRCHi[39]:=BYTE#16#40;   CRCLo[39]:=BYTE#16#1A;
CRCHi[40]:=BYTE#16#00;   CRCLo[40]:=BYTE#16#1E;
CRCHi[41]:=BYTE#16#C1;   CRCLo[41]:=BYTE#16#DE;
CRCHi[42]:=BYTE#16#81;   CRCLo[42]:=BYTE#16#DF;
CRCHi[43]:=BYTE#16#40;   CRCLo[43]:=BYTE#16#1F;
CRCHi[44]:=BYTE#16#01;   CRCLo[44]:=BYTE#16#DD;
 
CRCHi[45]:=BYTE#16#C0;   CRCLo[45]:=BYTE#16#1D;
CRCHi[46]:=BYTE#16#80;   CRCLo[46]:=BYTE#16#1C;
CRCHi[47]:=BYTE#16#41;   CRCLo[47]:=BYTE#16#DC;
CRCHi[48]:=BYTE#16#00;   CRCLo[48]:=BYTE#16#14;
CRCHi[49]:=BYTE#16#C1;   CRCLo[49]:=BYTE#16#D4;
CRCHi[50]:=BYTE#16#81;   CRCLo[50]:=BYTE#16#D5;
CRCHi[51]:=BYTE#16#40;   CRCLo[51]:=BYTE#16#15;
CRCHi[52]:=BYTE#16#01;   CRCLo[52]:=BYTE#16#D7;
CRCHi[53]:=BYTE#16#C0;   CRCLo[53]:=BYTE#16#17;
CRCHi[54]:=BYTE#16#80;   CRCLo[54]:=BYTE#16#16;
CRCHi[55]:=BYTE#16#41;   CRCLo[55]:=BYTE#16#D6;
CRCHi[56]:=BYTE#16#01;   CRCLo[56]:=BYTE#16#D2;
CRCHi[57]:=BYTE#16#C0;   CRCLo[57]:=BYTE#16#12;
CRCHi[58]:=BYTE#16#80;   CRCLo[58]:=BYTE#16#13;
CRCHi[59]:=BYTE#16#41;   CRCLo[59]:=BYTE#16#D3;
 
CRCHi[60]:=BYTE#16#00;   CRCLo[60]:=BYTE#16#11; 
CRCHi[61]:=BYTE#16#C1;   CRCLo[61]:=BYTE#16#D1;
CRCHi[62]:=BYTE#16#81;   CRCLo[62]:=BYTE#16#D0;
CRCHi[63]:=BYTE#16#40;   CRCLo[63]:=BYTE#16#10;
CRCHi[64]:=BYTE#16#01;   CRCLo[64]:=BYTE#16#F0;
CRCHi[65]:=BYTE#16#C0;   CRCLo[65]:=BYTE#16#30;
CRCHi[66]:=BYTE#16#80;   CRCLo[66]:=BYTE#16#31;
CRCHi[67]:=BYTE#16#41;   CRCLo[67]:=BYTE#16#F1;
CRCHi[68]:=BYTE#16#00;   CRCLo[68]:=BYTE#16#33;
CRCHi[69]:=BYTE#16#C1;   CRCLo[69]:=BYTE#16#F3;
CRCHi[70]:=BYTE#16#81;   CRCLo[70]:=BYTE#16#F2;
CRCHi[71]:=BYTE#16#40;   CRCLo[71]:=BYTE#16#32;
CRCHi[72]:=BYTE#16#00;   CRCLo[72]:=BYTE#16#36;
CRCHi[73]:=BYTE#16#C1;   CRCLo[73]:=BYTE#16#F6;
CRCHi[74]:=BYTE#16#81;   CRCLo[74]:=BYTE#16#F7;
 
 
CRCHi[75]:=BYTE#16#40;   CRCLo[75]:=BYTE#16#37;
CRCHi[76]:=BYTE#16#01;   CRCLo[76]:=BYTE#16#F5;
CRCHi[77]:=BYTE#16#C0;   CRCLo[77]:=BYTE#16#35;
CRCHi[78]:=BYTE#16#80;   CRCLo[78]:=BYTE#16#34;
CRCHi[79]:=BYTE#16#41;   CRCLo[79]:=BYTE#16#F4;
CRCHi[80]:=BYTE#16#00;   CRCLo[80]:=BYTE#16#3C;
CRCHi[81]:=BYTE#16#C1;   CRCLo[81]:=BYTE#16#FC;
CRCHi[82]:=BYTE#16#81;   CRCLo[82]:=BYTE#16#FD;
CRCHi[83]:=BYTE#16#40;   CRCLo[83]:=BYTE#16#3D;
CRCHi[84]:=BYTE#16#01;   CRCLo[84]:=BYTE#16#FF;
CRCHi[85]:=BYTE#16#C0;   CRCLo[85]:=BYTE#16#3F;
CRCHi[86]:=BYTE#16#80;   CRCLo[86]:=BYTE#16#3E;
CRCHi[87]:=BYTE#16#41;   CRCLo[87]:=BYTE#16#FE;
CRCHi[88]:=BYTE#16#01;   CRCLo[88]:=BYTE#16#FA;
CRCHi[89]:=BYTE#16#C0;   CRCLo[89]:=BYTE#16#3A;
 
CRCHi[90]:=BYTE#16#80;   CRCLo[90]:=BYTE#16#3B;
CRCHi[91]:=BYTE#16#41;   CRCLo[91]:=BYTE#16#FB;
CRCHi[92]:=BYTE#16#00;   CRCLo[92]:=BYTE#16#39;
CRCHi[93]:=BYTE#16#C1;   CRCLo[93]:=BYTE#16#F9;
CRCHi[94]:=BYTE#16#81;   CRCLo[94]:=BYTE#16#F8;
CRCHi[95]:=BYTE#16#40;   CRCLo[95]:=BYTE#16#38;
CRCHi[96]:=BYTE#16#00;   CRCLo[96]:=BYTE#16#28;
CRCHi[97]:=BYTE#16#C1;   CRCLo[97]:=BYTE#16#E8;
CRCHi[98]:=BYTE#16#81;   CRCLo[98]:=BYTE#16#E9;
CRCHi[99]:=BYTE#16#40; CRCLo[99]:=BYTE#16#29;
CRCHi[100]:=BYTE#16#01; CRCLo[100]:=BYTE#16#EB;
CRCHi[101]:=BYTE#16#C0; CRCLo[101]:=BYTE#16#2B;
CRCHi[102]:=BYTE#16#80; CRCLo[102]:=BYTE#16#2A;
CRCHi[103]:=BYTE#16#41; CRCLo[103]:=BYTE#16#EA;
CRCHi[104]:=BYTE#16#01; CRCLo[104]:=BYTE#16#EE;
 
CRCHi[105]:=BYTE#16#C0; CRCLo[105]:=BYTE#16#2E;
CRCHi[106]:=BYTE#16#80; CRCLo[106]:=BYTE#16#2F;
CRCHi[107]:=BYTE#16#41; CRCLo[107]:=BYTE#16#EF;
CRCHi[108]:=BYTE#16#00; CRCLo[108]:=BYTE#16#2D;
CRCHi[109]:=BYTE#16#C1; CRCLo[109]:=BYTE#16#ED;
CRCHi[110]:=BYTE#16#81; CRCLo[110]:=BYTE#16#EC;
CRCHi[111]:=BYTE#16#40; CRCLo[111]:=BYTE#16#2C;
CRCHi[112]:=BYTE#16#01; CRCLo[112]:=BYTE#16#E4;
CRCHi[113]:=BYTE#16#C0; CRCLo[113]:=BYTE#16#24;
CRCHi[114]:=BYTE#16#80; CRCLo[114]:=BYTE#16#25;
CRCHi[115]:=BYTE#16#41; CRCLo[115]:=BYTE#16#E5;
CRCHi[116]:=BYTE#16#00; CRCLo[116]:=BYTE#16#27;
CRCHi[117]:=BYTE#16#C1; CRCLo[117]:=BYTE#16#E7;
CRCHi[118]:=BYTE#16#81; CRCLo[118]:=BYTE#16#E6;
CRCHi[119]:=BYTE#16#40; CRCLo[119]:=BYTE#16#26;
 
CRCHi[120]:=BYTE#16#00; CRCLo[120]:=BYTE#16#22;
CRCHi[121]:=BYTE#16#C1; CRCLo[121]:=BYTE#16#E2;
CRCHi[122]:=BYTE#16#81; CRCLo[122]:=BYTE#16#E3;
CRCHi[123]:=BYTE#16#40; CRCLo[123]:=BYTE#16#23;
CRCHi[124]:=BYTE#16#01; CRCLo[124]:=BYTE#16#E1;
CRCHi[125]:=BYTE#16#C0; CRCLo[125]:=BYTE#16#21;
CRCHi[126]:=BYTE#16#80; CRCLo[126]:=BYTE#16#20;
CRCHi[127]:=BYTE#16#41; CRCLo[127]:=BYTE#16#E0;
CRCHi[128]:=BYTE#16#01; CRCLo[128]:=BYTE#16#A0;
CRCHi[129]:=BYTE#16#C0; CRCLo[129]:=BYTE#16#60;
CRCHi[130]:=BYTE#16#80; CRCLo[130]:=BYTE#16#61;
CRCHi[131]:=BYTE#16#41; CRCLo[131]:=BYTE#16#A1;
CRCHi[132]:=BYTE#16#00; CRCLo[132]:=BYTE#16#63;
CRCHi[133]:=BYTE#16#C1; CRCLo[133]:=BYTE#16#A3;
CRCHi[134]:=BYTE#16#81; CRCLo[134]:=BYTE#16#A2;
 
CRCHi[135]:=BYTE#16#40; CRCLo[135]:=BYTE#16#62;
CRCHi[136]:=BYTE#16#00; CRCLo[136]:=BYTE#16#66;
CRCHi[137]:=BYTE#16#C1; CRCLo[137]:=BYTE#16#A6;
CRCHi[138]:=BYTE#16#81; CRCLo[138]:=BYTE#16#A7;
CRCHi[139]:=BYTE#16#40; CRCLo[139]:=BYTE#16#67;
CRCHi[140]:=BYTE#16#01; CRCLo[140]:=BYTE#16#A5;
CRCHi[141]:=BYTE#16#C0; CRCLo[141]:=BYTE#16#65;
CRCHi[142]:=BYTE#16#80; CRCLo[142]:=BYTE#16#64;
CRCHi[143]:=BYTE#16#41; CRCLo[143]:=BYTE#16#A4;
CRCHi[144]:=BYTE#16#00; CRCLo[144]:=BYTE#16#6C;
CRCHi[145]:=BYTE#16#C1; CRCLo[145]:=BYTE#16#AC;
CRCHi[146]:=BYTE#16#81; CRCLo[146]:=BYTE#16#AD;
CRCHi[147]:=BYTE#16#40; CRCLo[147]:=BYTE#16#6D;
CRCHi[148]:=BYTE#16#01; CRCLo[148]:=BYTE#16#AF;
CRCHi[149]:=BYTE#16#C0; CRCLo[149]:=BYTE#16#6F;
 
CRCHi[150]:=BYTE#16#80; CRCLo[150]:=BYTE#16#6E;
CRCHi[151]:=BYTE#16#41; CRCLo[151]:=BYTE#16#AE;
CRCHi[152]:=BYTE#16#01; CRCLo[152]:=BYTE#16#AA;
CRCHi[153]:=BYTE#16#C0; CRCLo[153]:=BYTE#16#6A;
CRCHi[154]:=BYTE#16#80; CRCLo[154]:=BYTE#16#6B;
CRCHi[155]:=BYTE#16#41; CRCLo[155]:=BYTE#16#AB;
CRCHi[156]:=BYTE#16#00; CRCLo[156]:=BYTE#16#69;
CRCHi[157]:=BYTE#16#C1; CRCLo[157]:=BYTE#16#A9;
CRCHi[158]:=BYTE#16#81; CRCLo[158]:=BYTE#16#A8;
CRCHi[159]:=BYTE#16#40; CRCLo[159]:=BYTE#16#68;
CRCHi[160]:=BYTE#16#00; CRCLo[160]:=BYTE#16#78;
CRCHi[161]:=BYTE#16#C1; CRCLo[161]:=BYTE#16#B8;
CRCHi[162]:=BYTE#16#81; CRCLo[162]:=BYTE#16#B9;
CRCHi[163]:=BYTE#16#40; CRCLo[163]:=BYTE#16#79;
CRCHi[164]:=BYTE#16#01; CRCLo[164]:=BYTE#16#BB;
 
CRCHi[165]:=BYTE#16#C0; CRCLo[165]:=BYTE#16#7B;
CRCHi[166]:=BYTE#16#80; CRCLo[166]:=BYTE#16#7A;
CRCHi[167]:=BYTE#16#41; CRCLo[167]:=BYTE#16#BA;
CRCHi[168]:=BYTE#16#01; CRCLo[168]:=BYTE#16#BE;
CRCHi[169]:=BYTE#16#C0; CRCLo[169]:=BYTE#16#7E;
CRCHi[170]:=BYTE#16#80; CRCLo[170]:=BYTE#16#7F;
CRCHi[171]:=BYTE#16#41; CRCLo[171]:=BYTE#16#BF;
CRCHi[172]:=BYTE#16#00; CRCLo[172]:=BYTE#16#7D;
CRCHi[173]:=BYTE#16#C1; CRCLo[173]:=BYTE#16#BD;
CRCHi[174]:=BYTE#16#81; CRCLo[174]:=BYTE#16#BC;
CRCHi[175]:=BYTE#16#40; CRCLo[175]:=BYTE#16#7C;
CRCHi[176]:=BYTE#16#01; CRCLo[176]:=BYTE#16#B4;
CRCHi[177]:=BYTE#16#C0; CRCLo[177]:=BYTE#16#74;
CRCHi[178]:=BYTE#16#80; CRCLo[178]:=BYTE#16#75;
CRCHi[179]:=BYTE#16#41; CRCLo[179]:=BYTE#16#B5;
 
CRCHi[180]:=BYTE#16#00; CRCLo[180]:=BYTE#16#77;
CRCHi[181]:=BYTE#16#C1; CRCLo[181]:=BYTE#16#B7;
CRCHi[182]:=BYTE#16#81; CRCLo[182]:=BYTE#16#B6;
CRCHi[183]:=BYTE#16#40; CRCLo[183]:=BYTE#16#76;
CRCHi[184]:=BYTE#16#00; CRCLo[185]:=BYTE#16#72;
CRCHi[185]:=BYTE#16#C1; CRCLo[185]:=BYTE#16#B2;
CRCHi[186]:=BYTE#16#81; CRCLo[186]:=BYTE#16#B3;
CRCHi[187]:=BYTE#16#40; CRCLo[187]:=BYTE#16#73;
CRCHi[188]:=BYTE#16#01; CRCLo[188]:=BYTE#16#B1;
CRCHi[189]:=BYTE#16#C0; CRCLo[189]:=BYTE#16#71;
CRCHi[190]:=BYTE#16#80; CRCLo[190]:=BYTE#16#70;
CRCHi[191]:=BYTE#16#41; CRCLo[191]:=BYTE#16#B0;
CRCHi[192]:=BYTE#16#00; CRCLo[192]:=BYTE#16#50;
CRCHi[193]:=BYTE#16#C1; CRCLo[193]:=BYTE#16#90;
CRCHi[194]:=BYTE#16#81; CRCLo[194]:=BYTE#16#91;
 
CRCHi[195]:=BYTE#16#40; CRCLo[195]:=BYTE#16#51;
CRCHi[196]:=BYTE#16#01; CRCLo[196]:=BYTE#16#93;
CRCHi[197]:=BYTE#16#C0; CRCLo[197]:=BYTE#16#53;
CRCHi[198]:=BYTE#16#80; CRCLo[198]:=BYTE#16#52;
CRCHi[199]:=BYTE#16#41; CRCLo[199]:=BYTE#16#92;
CRCHi[200]:=BYTE#16#01; CRCLo[200]:=BYTE#16#96;
CRCHi[201]:=BYTE#16#C0; CRCLo[201]:=BYTE#16#56;
CRCHi[202]:=BYTE#16#80; CRCLo[202]:=BYTE#16#57;
CRCHi[203]:=BYTE#16#41; CRCLo[203]:=BYTE#16#97;
CRCHi[204]:=BYTE#16#00; CRCLo[204]:=BYTE#16#55;
CRCHi[205]:=BYTE#16#C1; CRCLo[205]:=BYTE#16#95;
CRCHi[206]:=BYTE#16#81; CRCLo[206]:=BYTE#16#94;
CRCHi[207]:=BYTE#16#40; CRCLo[207]:=BYTE#16#54;
CRCHi[208]:=BYTE#16#01; CRCLo[208]:=BYTE#16#9C;
CRCHi[209]:=BYTE#16#C0; CRCLo[209]:=BYTE#16#5C;
 
CRCHi[210]:=BYTE#16#80; CRCLo[210]:=BYTE#16#5D;
CRCHi[211]:=BYTE#16#41; CRCLo[211]:=BYTE#16#9D;
CRCHi[212]:=BYTE#16#00; CRCLo[212]:=BYTE#16#5F;
CRCHi[213]:=BYTE#16#C1; CRCLo[213]:=BYTE#16#9F;
CRCHi[214]:=BYTE#16#81; CRCLo[214]:=BYTE#16#9E;
CRCHi[215]:=BYTE#16#40; CRCLo[215]:=BYTE#16#5E;
CRCHi[216]:=BYTE#16#00; CRCLo[216]:=BYTE#16#5A;
CRCHi[217]:=BYTE#16#C1; CRCLo[217]:=BYTE#16#9A;
CRCHi[218]:=BYTE#16#81; CRCLo[218]:=BYTE#16#9B;
CRCHi[219]:=BYTE#16#40; CRCLo[219]:=BYTE#16#5B;
CRCHi[220]:=BYTE#16#01; CRCLo[220]:=BYTE#16#99;
CRCHi[221]:=BYTE#16#C0; CRCLo[221]:=BYTE#16#59;
CRCHi[222]:=BYTE#16#80; CRCLo[222]:=BYTE#16#58;
CRCHi[223]:=BYTE#16#41; CRCLo[223]:=BYTE#16#98;
CRCHi[224]:=BYTE#16#01; CRCLo[224]:=BYTE#16#88;
 
CRCHi[225]:=BYTE#16#C0; CRCLo[225]:=BYTE#16#48;
CRCHi[226]:=BYTE#16#80; CRCLo[226]:=BYTE#16#49;
CRCHi[227]:=BYTE#16#41; CRCLo[227]:=BYTE#16#89;
CRCHi[228]:=BYTE#16#00; CRCLo[228]:=BYTE#16#4B;
CRCHi[229]:=BYTE#16#C1; CRCLo[229]:=BYTE#16#8B;
CRCHi[230]:=BYTE#16#81; CRCLo[230]:=BYTE#16#8A;
CRCHi[231]:=BYTE#16#40; CRCLo[231]:=BYTE#16#4A;
CRCHi[232]:=BYTE#16#00; CRCLo[232]:=BYTE#16#4E;
CRCHi[233]:=BYTE#16#C1; CRCLo[233]:=BYTE#16#8E;
CRCHi[234]:=BYTE#16#81; CRCLo[234]:=BYTE#16#8F;
CRCHi[235]:=BYTE#16#40; CRCLo[235]:=BYTE#16#4F;
CRCHi[236]:=BYTE#16#01; CRCLo[236]:=BYTE#16#8D;
CRCHi[237]:=BYTE#16#C0; CRCLo[237]:=BYTE#16#4D;
CRCHi[238]:=BYTE#16#80; CRCLo[238]:=BYTE#16#4C;
CRCHi[239]:=BYTE#16#41; CRCLo[239]:=BYTE#16#8C;
 
CRCHi[240]:=BYTE#16#00; CRCLo[240]:=BYTE#16#44;
CRCHi[241]:=BYTE#16#C1; CRCLo[241]:=BYTE#16#84;
CRCHi[242]:=BYTE#16#81; CRCLo[242]:=BYTE#16#85;
CRCHi[243]:=BYTE#16#40; CRCLo[243]:=BYTE#16#45;
CRCHi[244]:=BYTE#16#01; CRCLo[244]:=BYTE#16#87;
CRCHi[245]:=BYTE#16#C0; CRCLo[245]:=BYTE#16#47;
CRCHi[246]:=BYTE#16#80; CRCLo[246]:=BYTE#16#46;
CRCHi[247]:=BYTE#16#41; CRCLo[247]:=BYTE#16#86;
CRCHi[248]:=BYTE#16#01; CRCLo[248]:=BYTE#16#82;
CRCHi[249]:=BYTE#16#C0; CRCLo[249]:=BYTE#16#42;
CRCHi[250]:=BYTE#16#80; CRCLo[250]:=BYTE#16#43;
CRCHi[251]:=BYTE#16#41; CRCLo[251]:=BYTE#16#83;
CRCHi[252]:=BYTE#16#00; CRCLo[252]:=BYTE#16#41;
CRCHi[253]:=BYTE#16#C1; CRCLo[253]:=BYTE#16#81;
CRCHi[254]:=BYTE#16#81; CRCLo[254]:=BYTE#16#80;
 
CRCHi[255]:=BYTE#16#40; CRCLo[255]:=BYTE#16#40;
 
IF EN THEN
    CRCHigh:=BYTE#16#FF;
    CRCLow:=BYTE#16#FF;
    Data_index:=BYTE#16#01;
 
WHILE Data_index<=Data_length DO
    Chart_index:= CRCHigh XOR Data1[Data_index];
    CRCHigh:=CRCLow XOR CRCHi[Chart_index];
    CRCLow:=CRCLo[Chart_index];
    Data_index:=Data_index BYTE#16#01;
END_WHILE;
 
    Data1[Data_index]:=CRCHigh;
    Data_index:=Data_index BYTE#16#1;
    Data1[Data_index]:=CRCLow;
 
CRC:=SHL(BYTE_TO_WORD (CRCHigh),8) OR BYTE_TO_WORD (CRCLow);
END_IF;
生成的功能块如下

本新闻共2页,当前在第11 2  
P_L_C_技_术_网——可——编——程——控-制-器-技——术——门——户

评论内容
载入中...
载入中...
P
L
C



|










|


P
L
C









·最新招聘信息
·最新求职信息
·推荐产品
·推荐厂商
·栏目热门排行
·站内热门排行