![u8 u8]()
本文介绍了德语说明书CRC代码转换成VB6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 对不起真的很远,但我有一本德语手册令我困惑!它显示了如何为我试图在VB6中编写代码的串行设备计算CRC值。我不仅不懂德语,而且这个例子不是我所认识的语言(落入每一个障碍!)。最终我需要将显示的内容转换为VB6代码,但即使知道该示例的语言也会对我的Google搜索有所帮助。 这里来了.... 4.6 Berechnung des CRC-Zeichens FolgenderProgrammabschnitirklärtdieBerechnung des CRC-Zeichens。 Der Type U8 ist eine 8bit-Variable ohne Vorzeichen(0 bis 255) Die Funktion put_tx1_buffer(U8 c)sendet einZeichenüberdieserielle Schnittstelle。 #define POLYNOM 0xB1 // 28 + 27 + 25 + 24 + 20 + 1 #define INIT_TX_CRC {tx_crc = 0xA5;} U8 tx_crc; void build_tx_crc8(U8 a) { U8 i = 8; do { if((a& 0x01)!=(tx_crc& 0x01)) { tx_crc>> = 1; tx_crc ^ = POLYNOM; } 其他 { tx_crc>> = 1; } a>> = 1; } while( - i!= 0); } void set_lamp(U8 keyboardnumber,U8 lampnumber,U8命令) { INIT_TX_CRC; put_tx1_buffer(STX + 0x80); build_tx_crc8(STX + 0x80); put_tx1_buffer(command); build_tx_crc8(命令); put_tx1_buffer(keyboardnumber); build_tx_crc8(keyboardnumber); put_tx1_buffer(lampnumber); build_tx_crc8(lampnumber); put_tx1_buffer(ETX + 0x80); build_tx_crc8(ETX + 0x80); put_tx1_buffer(tx_crc); } 我的尝试: 谷歌翻译,C#但似乎不是那样。解决方案 您不需要翻译德语。但是你需要理解 C 和 VB6 编程语言。您还可以使用 C 源构建 DLL 并在 VB6中使用它申请。 HiSorry really long shot but I have a manual in German which is baffling me! It shows how to calculate a CRC value for a serial device I'm trying to write code in VB6 for. Not only do I not understand the German but the example isn't in a language I recognize (falling at every hurdle!). Ultimately I need to turn whatever this reveals into VB6 code but even knowing what language the example is would help in my Google searches.Here it comes....4.6 Berechnung des CRC-ZeichensFolgender Programmabschnitt erklärt die Berechnung des CRC-Zeichens. Der Type U8 ist eine 8bit-Variable ohne Vorzeichen (0 bis 255)Die Funktion put_tx1_buffer( U8 c ) sendet ein Zeichen über die serielle Schnittstelle.#define POLYNOM 0xB1 // 28+27+25+24+20+1#define INIT_TX_CRC {tx_crc=0xA5;} U8 tx_crc ;void build_tx_crc8( U8 a ){U8 i=8 ;do{if (( a & 0x01 ) != ( tx_crc & 0x01 )){tx_crc >>= 1 ;tx_crc ^= POLYNOM ;}else{tx_crc >>= 1 ;}a >>= 1 ;}while (--i!=0) ;}void set_lamp( U8 keyboardnumber, U8 lampnumber, U8 command ){INIT_TX_CRC ;put_tx1_buffer( STX+0x80 ) ; build_tx_crc8( STX+0x80 ) ; put_tx1_buffer( command ) ; build_tx_crc8( command ) ; put_tx1_buffer( keyboardnumber ) ; build_tx_crc8( keyboardnumber ) ; put_tx1_buffer( lampnumber ) ; build_tx_crc8( lampnumber ) ; put_tx1_buffer( ETX+0x80 ) ; build_tx_crc8( ETX+0x80 ) ; put_tx1_buffer( tx_crc ) ;}What I have tried:Google translate, C# but didn't seem to be that. 解决方案 这篇关于德语说明书CRC代码转换成VB6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-28 20:05